@cloudfleet/sdk 0.0.1-028b8fa → 0.0.1-03062e4

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. If you want to keep using the Fleet until the end of the billing period, set the status to `cancelling`. 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,24 +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.
408
- *
409
- * This endpoint allows you to update fleet details.
388
+ * List tags for a repository
410
389
  *
411
- * Setting status to `deleted` 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. If you want to keep using the Fleet until the end of the billing period, set the status to `cancelling`.
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.
412
391
  *
413
- * 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
414
407
  *
415
- * 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.
416
409
  *
417
410
  */
418
- export const updateFleetMutation = (options) => {
411
+ export const deleteTagMutation = (options) => {
419
412
  const mutationOptions = {
420
413
  mutationFn: async (fnOptions) => {
421
- const { data } = await ClustersService.updateFleet({
414
+ const { data } = await RegistryService.deleteTag({
422
415
  ...options,
423
416
  ...fnOptions,
424
417
  throwOnError: true
@@ -428,15 +421,16 @@ export const updateFleetMutation = (options) => {
428
421
  };
429
422
  return mutationOptions;
430
423
  };
431
- export const queryClusterQueryKey = (options) => createQueryKey('queryCluster', options);
424
+ export const getTagQueryKey = (options) => createQueryKey('getTag', options);
432
425
  /**
433
- * 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.
434
429
  *
435
- * 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.
436
430
  */
437
- export const queryClusterOptions = (options) => queryOptions({
431
+ export const getTagOptions = (options) => queryOptions({
438
432
  queryFn: async ({ queryKey, signal }) => {
439
- const { data } = await ClustersService.queryCluster({
433
+ const { data } = await RegistryService.getTag({
440
434
  ...options,
441
435
  ...queryKey[0],
442
436
  signal,
@@ -444,20 +438,20 @@ export const queryClusterOptions = (options) => queryOptions({
444
438
  });
445
439
  return data;
446
440
  },
447
- queryKey: queryClusterQueryKey(options)
441
+ queryKey: getTagQueryKey(options)
448
442
  });
449
- export const listClustersQueryKey = (options) => createQueryKey('listClusters', options);
443
+ export const getOrganizationQueryKey = (options) => createQueryKey('getOrganization', options);
450
444
  /**
451
- * List clusters.
445
+ * Get organization information.
452
446
  *
453
- * Returns a list of clusters under the current organization, including quota. Quota is a set of filters defined by the admin of the organization that will be applied to all resources created in the cluster. Quota information returned here does not take into account quota set on organization or platform level. For calculated quota applied to this account, use /clusters/{cluster_id}/quota endpoint. For more information about quotas, see [Quotas and limits](https://cloudfleet.ai/docs/organization/quotas/) section of documentaiton.
447
+ * Returns organization details including quota. For more information about quotas, see [Quotas and limits](https://cloudfleet.ai/docs/organization/quotas/) section of documentaiton.
454
448
  *
455
449
  * This endpoint is available to all users in the organization.
456
450
  *
457
451
  */
458
- export const listClustersOptions = (options) => queryOptions({
452
+ export const getOrganizationOptions = (options) => queryOptions({
459
453
  queryFn: async ({ queryKey, signal }) => {
460
- const { data } = await ClustersService.listClusters({
454
+ const { data } = await OrganizationService.getOrganization({
461
455
  ...options,
462
456
  ...queryKey[0],
463
457
  signal,
@@ -465,20 +459,18 @@ export const listClustersOptions = (options) => queryOptions({
465
459
  });
466
460
  return data;
467
461
  },
468
- queryKey: listClustersQueryKey(options)
462
+ queryKey: getOrganizationQueryKey(options)
469
463
  });
470
464
  /**
471
- * Create a new cluster.
472
- *
473
- * 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.
474
466
  *
475
- * 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.
476
468
  *
477
469
  */
478
- export const createClusterMutation = (options) => {
470
+ export const createOrganizationMutation = (options) => {
479
471
  const mutationOptions = {
480
472
  mutationFn: async (fnOptions) => {
481
- const { data } = await ClustersService.createCluster({
473
+ const { data } = await OrganizationService.createOrganization({
482
474
  ...options,
483
475
  ...fnOptions,
484
476
  throwOnError: true
@@ -489,17 +481,14 @@ export const createClusterMutation = (options) => {
489
481
  return mutationOptions;
490
482
  };
491
483
  /**
492
- * Permanently delete cluster.
493
- *
494
- * This endpoint will permanently delete the cluster. This operation cannot be undone.
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 including quota. Quota is a set of filters defined by the admin of the organization that will be applied to all resources created in the cluster. Quota information returned here does not take into account quota set on organization or platform level. For calculated quota applied to this account, use /clusters/{cluster_id}/quota endpoint. For more information about quotas, see [Quotas and limits](https://cloudfleet.ai/docs/organization/quotas/) section of documentaiton.
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,53 +517,36 @@ 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, including quota and cluster status. For more information about clusters, see [Clusters](https://cloudfleet.ai/docs/cluster-management/cluster-types/) section of documentaiton.
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.
576
548
  *
577
- * Returns a list of invites under the current organization. This endpoint is available to all users in the organization.
549
+ * Returns a list of pending (non-expired) invites under the current organization. This endpoint is available to administrators of the organization only.
578
550
  *
579
551
  */
580
552
  export const listInvitesOptions = (options) => queryOptions({
@@ -612,7 +584,7 @@ export const getInviteQueryKey = (options) => createQueryKey('getInvite', option
612
584
  /**
613
585
  * Get invite information.
614
586
  *
615
- * Returns invite details.
587
+ * Validates an invitation code and returns the email address it was issued to (to pre-fill the signup form) and the organization it grants access to. This endpoint is unauthenticated, so no other invite details (such as the invited role) are disclosed.
616
588
  *
617
589
  */
618
590
  export const getInviteOptions = (options) => queryOptions({
@@ -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,22 @@ 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
+ * 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.
695
668
  *
696
- * MCP endpoint for handling Model Context Protocol JSON-RPC 2.0 messages.
697
669
  */
698
- export const postMcpMutation = (options) => {
670
+ export const createFleetMutation = (options) => {
699
671
  const mutationOptions = {
700
672
  mutationFn: async (fnOptions) => {
701
- const { data } = await McpService.postMcp({
673
+ const { data } = await ClustersService.createFleet({
702
674
  ...options,
703
675
  ...fnOptions,
704
676
  throwOnError: true
@@ -708,37 +680,20 @@ export const postMcpMutation = (options) => {
708
680
  };
709
681
  return mutationOptions;
710
682
  };
711
- export const getOrganizationQueryKey = (options) => createQueryKey('getOrganization', options);
712
683
  /**
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.
684
+ * Permanently delete fleet.
716
685
  *
717
- * 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.
718
687
  *
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.
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.
734
689
  *
735
- * 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.
736
691
  *
737
692
  */
738
- export const createOrganizationMutation = (options) => {
693
+ export const deleteFleetMutation = (options) => {
739
694
  const mutationOptions = {
740
695
  mutationFn: async (fnOptions) => {
741
- const { data } = await OrganizationService.createOrganization({
696
+ const { data } = await ClustersService.deleteFleet({
742
697
  ...options,
743
698
  ...fnOptions,
744
699
  throwOnError: true
@@ -748,16 +703,18 @@ export const createOrganizationMutation = (options) => {
748
703
  };
749
704
  return mutationOptions;
750
705
  };
751
- export const listRepositoriesQueryKey = (options) => createQueryKey('listRepositories', options);
706
+ export const getFleetQueryKey = (options) => createQueryKey('getFleet', options);
752
707
  /**
753
- * List repositories
708
+ * Get fleet information.
754
709
  *
755
- * 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.
756
713
  *
757
714
  */
758
- export const listRepositoriesOptions = (options) => queryOptions({
715
+ export const getFleetOptions = (options) => queryOptions({
759
716
  queryFn: async ({ queryKey, signal }) => {
760
- const { data } = await RegistryService.listRepositories({
717
+ const { data } = await ClustersService.getFleet({
761
718
  ...options,
762
719
  ...queryKey[0],
763
720
  signal,
@@ -765,37 +722,24 @@ export const listRepositoriesOptions = (options) => queryOptions({
765
722
  });
766
723
  return data;
767
724
  },
768
- queryKey: listRepositoriesQueryKey(options)
725
+ queryKey: getFleetQueryKey(options)
769
726
  });
770
- export const listTagsQueryKey = (options) => createQueryKey('listTags', options);
771
727
  /**
772
- * List tags for a repository
728
+ * Update fleet information.
773
729
  *
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.
730
+ * This endpoint allows you to update fleet details.
775
731
  *
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
732
+ * For more information, see [Fleets](https://cloudfleet.ai/docs/cloud-infrastructure/fleets/) section of documentaiton.
791
733
  *
792
- * 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.
793
737
  *
794
738
  */
795
- export const deleteTagMutation = (options) => {
739
+ export const updateFleetMutation = (options) => {
796
740
  const mutationOptions = {
797
741
  mutationFn: async (fnOptions) => {
798
- const { data } = await RegistryService.deleteTag({
742
+ const { data } = await ClustersService.updateFleet({
799
743
  ...options,
800
744
  ...fnOptions,
801
745
  throwOnError: true
@@ -805,35 +749,18 @@ export const deleteTagMutation = (options) => {
805
749
  };
806
750
  return mutationOptions;
807
751
  };
808
- export const getTagQueryKey = (options) => createQueryKey('getTag', options);
752
+ export const listChartsQueryKey = (options) => createQueryKey('listCharts', options);
809
753
  /**
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.
754
+ * List charts.
813
755
  *
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.
756
+ * Returns a list of charts in the cluster.
830
757
  *
831
- * Returns all tickets belonging to the caller's organization, newest first.
758
+ * This endpoint is available to all users in the organization.
832
759
  *
833
760
  */
834
- export const listTicketsOptions = (options) => queryOptions({
761
+ export const listChartsOptions = (options) => queryOptions({
835
762
  queryFn: async ({ queryKey, signal }) => {
836
- const { data } = await TicketsService.listTickets({
763
+ const { data } = await ClustersService.listCharts({
837
764
  ...options,
838
765
  ...queryKey[0],
839
766
  signal,
@@ -841,18 +768,20 @@ export const listTicketsOptions = (options) => queryOptions({
841
768
  });
842
769
  return data;
843
770
  },
844
- queryKey: listTicketsQueryKey(options)
771
+ queryKey: listChartsQueryKey(options)
845
772
  });
846
773
  /**
847
- * Create a new support ticket.
774
+ * Create a new chart.
775
+ *
776
+ * Create a new chart deployment.
848
777
  *
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).
778
+ * This endpoint is available to administrators of the organization only.
850
779
  *
851
780
  */
852
- export const createTicketMutation = (options) => {
781
+ export const createChartMutation = (options) => {
853
782
  const mutationOptions = {
854
783
  mutationFn: async (fnOptions) => {
855
- const { data } = await TicketsService.createTicket({
784
+ const { data } = await ClustersService.createChart({
856
785
  ...options,
857
786
  ...fnOptions,
858
787
  throwOnError: true
@@ -863,15 +792,17 @@ export const createTicketMutation = (options) => {
863
792
  return mutationOptions;
864
793
  };
865
794
  /**
866
- * Close a ticket (soft close).
795
+ * Permanently delete the chart deployment from the cluster.
867
796
  *
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.
797
+ * This endpoint will permanently delete chart. This operation cannot be undone.
798
+ *
799
+ * This endpoint is available to administrators of the organization only.
869
800
  *
870
801
  */
871
- export const closeTicketMutation = (options) => {
802
+ export const deleteChartMutation = (options) => {
872
803
  const mutationOptions = {
873
804
  mutationFn: async (fnOptions) => {
874
- const { data } = await TicketsService.closeTicket({
805
+ const { data } = await ClustersService.deleteChart({
875
806
  ...options,
876
807
  ...fnOptions,
877
808
  throwOnError: true
@@ -881,13 +812,18 @@ export const closeTicketMutation = (options) => {
881
812
  };
882
813
  return mutationOptions;
883
814
  };
884
- export const getTicketQueryKey = (options) => createQueryKey('getTicket', options);
815
+ export const getChartQueryKey = (options) => createQueryKey('getChart', options);
885
816
  /**
886
- * 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
+ *
887
823
  */
888
- export const getTicketOptions = (options) => queryOptions({
824
+ export const getChartOptions = (options) => queryOptions({
889
825
  queryFn: async ({ queryKey, signal }) => {
890
- const { data } = await TicketsService.getTicket({
826
+ const { data } = await ClustersService.getChart({
891
827
  ...options,
892
828
  ...queryKey[0],
893
829
  signal,
@@ -895,18 +831,20 @@ export const getTicketOptions = (options) => queryOptions({
895
831
  });
896
832
  return data;
897
833
  },
898
- queryKey: getTicketQueryKey(options)
834
+ queryKey: getChartQueryKey(options)
899
835
  });
900
836
  /**
901
- * Append a customer reply to a ticket.
837
+ * Update chart information.
902
838
  *
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.
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.
904
842
  *
905
843
  */
906
- export const replyTicketMutation = (options) => {
844
+ export const updateChartMutation = (options) => {
907
845
  const mutationOptions = {
908
846
  mutationFn: async (fnOptions) => {
909
- const { data } = await TicketsService.replyTicket({
847
+ const { data } = await ClustersService.updateChart({
910
848
  ...options,
911
849
  ...fnOptions,
912
850
  throwOnError: true
@@ -916,32 +854,18 @@ export const replyTicketMutation = (options) => {
916
854
  };
917
855
  return mutationOptions;
918
856
  };
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);
857
+ export const listClustersQueryKey = (options) => createQueryKey('listClusters', options);
936
858
  /**
937
- * List access tokens in organization.
859
+ * List clusters.
938
860
  *
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.
861
+ * Returns a list of clusters under the current organization.
862
+ *
863
+ * This endpoint is available to all users in the organization.
940
864
  *
941
865
  */
942
- export const listTokensOptions = (options) => queryOptions({
866
+ export const listClustersOptions = (options) => queryOptions({
943
867
  queryFn: async ({ queryKey, signal }) => {
944
- const { data } = await TokensService.listTokens({
868
+ const { data } = await ClustersService.listClusters({
945
869
  ...options,
946
870
  ...queryKey[0],
947
871
  signal,
@@ -949,20 +873,20 @@ export const listTokensOptions = (options) => queryOptions({
949
873
  });
950
874
  return data;
951
875
  },
952
- queryKey: listTokensQueryKey(options)
876
+ queryKey: listClustersQueryKey(options)
953
877
  });
954
878
  /**
955
- * Create a new access token.
879
+ * Create a new cluster.
956
880
  *
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.
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.
958
882
  *
959
883
  * This endpoint is available to administrators of the organization only.
960
884
  *
961
885
  */
962
- export const createTokenMutation = (options) => {
886
+ export const createClusterMutation = (options) => {
963
887
  const mutationOptions = {
964
888
  mutationFn: async (fnOptions) => {
965
- const { data } = await TokensService.createToken({
889
+ const { data } = await ClustersService.createCluster({
966
890
  ...options,
967
891
  ...fnOptions,
968
892
  throwOnError: true
@@ -973,15 +897,19 @@ export const createTokenMutation = (options) => {
973
897
  return mutationOptions;
974
898
  };
975
899
  /**
976
- * Permanently delete access token.
900
+ * Permanently delete cluster.
977
901
  *
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.
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.
979
907
  *
980
908
  */
981
- export const deleteTokenMutation = (options) => {
909
+ export const deleteClusterMutation = (options) => {
982
910
  const mutationOptions = {
983
911
  mutationFn: async (fnOptions) => {
984
- const { data } = await TokensService.deleteToken({
912
+ const { data } = await ClustersService.deleteCluster({
985
913
  ...options,
986
914
  ...fnOptions,
987
915
  throwOnError: true
@@ -991,16 +919,18 @@ export const deleteTokenMutation = (options) => {
991
919
  };
992
920
  return mutationOptions;
993
921
  };
994
- export const getTokenQueryKey = (options) => createQueryKey('getToken', options);
922
+ export const getClusterQueryKey = (options) => createQueryKey('getCluster', options);
995
923
  /**
996
- * Get access token information.
924
+ * Get cluster information.
997
925
  *
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.
926
+ * Returns cluster details.
927
+ *
928
+ * This endpoint is available to all users in the organization.
999
929
  *
1000
930
  */
1001
- export const getTokenOptions = (options) => queryOptions({
931
+ export const getClusterOptions = (options) => queryOptions({
1002
932
  queryFn: async ({ queryKey, signal }) => {
1003
- const { data } = await TokensService.getToken({
933
+ const { data } = await ClustersService.getCluster({
1004
934
  ...options,
1005
935
  ...queryKey[0],
1006
936
  signal,
@@ -1008,20 +938,22 @@ export const getTokenOptions = (options) => queryOptions({
1008
938
  });
1009
939
  return data;
1010
940
  },
1011
- queryKey: getTokenQueryKey(options)
941
+ queryKey: getClusterQueryKey(options)
1012
942
  });
1013
943
  /**
1014
- * Update access token information.
944
+ * Update cluster information.
1015
945
  *
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.
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.
1017
949
  *
1018
950
  * This endpoint is available to administrators of the organization only.
1019
951
  *
1020
952
  */
1021
- export const updateTokenMutation = (options) => {
953
+ export const updateClusterMutation = (options) => {
1022
954
  const mutationOptions = {
1023
955
  mutationFn: async (fnOptions) => {
1024
- const { data } = await TokensService.updateToken({
956
+ const { data } = await ClustersService.updateCluster({
1025
957
  ...options,
1026
958
  ...fnOptions,
1027
959
  throwOnError: true
@@ -1032,14 +964,15 @@ export const updateTokenMutation = (options) => {
1032
964
  return mutationOptions;
1033
965
  };
1034
966
  /**
1035
- * 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.
1036
970
  *
1037
- * Generates a new access token secret. Old secret will not be valid anymore.
1038
971
  */
1039
- export const regenerateTokenMutation = (options) => {
972
+ export const getJoinInformationMutation = (options) => {
1040
973
  const mutationOptions = {
1041
974
  mutationFn: async (fnOptions) => {
1042
- const { data } = await TokensService.regenerateToken({
975
+ const { data } = await ClustersService.getJoinInformation({
1043
976
  ...options,
1044
977
  ...fnOptions,
1045
978
  throwOnError: true
@@ -1049,13 +982,16 @@ export const regenerateTokenMutation = (options) => {
1049
982
  };
1050
983
  return mutationOptions;
1051
984
  };
1052
- export const listUserOrganizationsQueryKey = (options) => createQueryKey('listUserOrganizations', options);
985
+ export const getUsageQueryKey = (options) => createQueryKey('getUsage', options);
1053
986
  /**
1054
- * 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
+ *
1055
991
  */
1056
- export const listUserOrganizationsOptions = (options) => queryOptions({
992
+ export const getUsageOptions = (options) => queryOptions({
1057
993
  queryFn: async ({ queryKey, signal }) => {
1058
- const { data } = await UsersService.listUserOrganizations({
994
+ const { data } = await BillingService.getUsage({
1059
995
  ...options,
1060
996
  ...queryKey[0],
1061
997
  signal,
@@ -1063,20 +999,37 @@ export const listUserOrganizationsOptions = (options) => queryOptions({
1063
999
  });
1064
1000
  return data;
1065
1001
  },
1066
- queryKey: listUserOrganizationsQueryKey(options)
1002
+ queryKey: getUsageQueryKey(options)
1067
1003
  });
1068
- export const listUsersQueryKey = (options) => createQueryKey('listUsers', options);
1069
1004
  /**
1070
- * List users in organization.
1005
+ * Get Stripe client secret.
1071
1006
  *
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.
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.
1073
1008
  *
1074
- * 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.
1075
1028
  *
1076
1029
  */
1077
- export const listUsersOptions = (options) => queryOptions({
1030
+ export const listPaymentMethodsOptions = (options) => queryOptions({
1078
1031
  queryFn: async ({ queryKey, signal }) => {
1079
- const { data } = await UsersService.listUsers({
1032
+ const { data } = await BillingService.listPaymentMethods({
1080
1033
  ...options,
1081
1034
  ...queryKey[0],
1082
1035
  signal,
@@ -1084,18 +1037,18 @@ export const listUsersOptions = (options) => queryOptions({
1084
1037
  });
1085
1038
  return data;
1086
1039
  },
1087
- queryKey: listUsersQueryKey(options)
1040
+ queryKey: listPaymentMethodsQueryKey(options)
1088
1041
  });
1089
1042
  /**
1090
- * Create a new user.
1043
+ * Set the default payment method.
1091
1044
  *
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.
1045
+ * Sets the given payment method as the default used for invoices and active subscriptions. Requires the Administrator role.
1093
1046
  *
1094
1047
  */
1095
- export const createUserMutation = (options) => {
1048
+ export const setDefaultPaymentMethodMutation = (options) => {
1096
1049
  const mutationOptions = {
1097
1050
  mutationFn: async (fnOptions) => {
1098
- const { data } = await UsersService.createUser({
1051
+ const { data } = await BillingService.setDefaultPaymentMethod({
1099
1052
  ...options,
1100
1053
  ...fnOptions,
1101
1054
  throwOnError: true
@@ -1106,15 +1059,15 @@ export const createUserMutation = (options) => {
1106
1059
  return mutationOptions;
1107
1060
  };
1108
1061
  /**
1109
- * Delete user by id.
1062
+ * Delete a payment method.
1110
1063
  *
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.
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.
1112
1065
  *
1113
1066
  */
1114
- export const deleteUserMutation = (options) => {
1067
+ export const deletePaymentMethodMutation = (options) => {
1115
1068
  const mutationOptions = {
1116
1069
  mutationFn: async (fnOptions) => {
1117
- const { data } = await UsersService.deleteUser({
1070
+ const { data } = await BillingService.deletePaymentMethod({
1118
1071
  ...options,
1119
1072
  ...fnOptions,
1120
1073
  throwOnError: true
@@ -1124,18 +1077,35 @@ export const deleteUserMutation = (options) => {
1124
1077
  };
1125
1078
  return mutationOptions;
1126
1079
  };
1127
- export const getUserQueryKey = (options) => createQueryKey('getUser', options);
1080
+ export const listInvoicesQueryKey = (options) => createQueryKey('listInvoices', options);
1128
1081
  /**
1129
- * Get user profile information by id.
1082
+ * List issued invoices.
1130
1083
  *
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.
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.
1132
1085
  *
1133
- * 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.
1134
1104
  *
1135
1105
  */
1136
- export const getUserOptions = (options) => queryOptions({
1106
+ export const getContactOptions = (options) => queryOptions({
1137
1107
  queryFn: async ({ queryKey, signal }) => {
1138
- const { data } = await UsersService.getUser({
1108
+ const { data } = await BillingService.getContact({
1139
1109
  ...options,
1140
1110
  ...queryKey[0],
1141
1111
  signal,
@@ -1143,18 +1113,56 @@ export const getUserOptions = (options) => queryOptions({
1143
1113
  });
1144
1114
  return data;
1145
1115
  },
1146
- queryKey: getUserQueryKey(options)
1116
+ queryKey: getContactQueryKey(options)
1147
1117
  });
1148
1118
  /**
1149
- * Update user profile information.
1119
+ * Update organization contact information and billing address.
1150
1120
  *
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.
1121
+ * This endpoint allows you to update organization details with its contact information. This endpoint is available to administrators of the organization only.
1152
1122
  *
1153
1123
  */
1154
- export const updateUserMutation = (options) => {
1124
+ export const updateContactMutation = (options) => {
1155
1125
  const mutationOptions = {
1156
1126
  mutationFn: async (fnOptions) => {
1157
- 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({
1158
1166
  ...options,
1159
1167
  ...fnOptions,
1160
1168
  throwOnError: true