@nilovonjs/hcloud-js 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.
Files changed (62) hide show
  1. package/README.md +90 -0
  2. package/package.json +70 -0
  3. package/src/apis/actions/index.ts +113 -0
  4. package/src/apis/actions/schemas.ts +59 -0
  5. package/src/apis/actions/types.ts +77 -0
  6. package/src/apis/certificates/index.ts +326 -0
  7. package/src/apis/certificates/schemas.ts +140 -0
  8. package/src/apis/certificates/types.ts +176 -0
  9. package/src/apis/common/schemas.ts +19 -0
  10. package/src/apis/dns/index.ts +961 -0
  11. package/src/apis/dns/schemas.ts +437 -0
  12. package/src/apis/dns/types.ts +397 -0
  13. package/src/apis/firewalls/index.ts +469 -0
  14. package/src/apis/firewalls/schemas.ts +274 -0
  15. package/src/apis/firewalls/types.ts +205 -0
  16. package/src/apis/floating-ips/index.ts +466 -0
  17. package/src/apis/floating-ips/schemas.ts +203 -0
  18. package/src/apis/floating-ips/types.ts +207 -0
  19. package/src/apis/images/index.ts +195 -0
  20. package/src/apis/images/schemas.ts +113 -0
  21. package/src/apis/images/types.ts +124 -0
  22. package/src/apis/isos/index.ts +91 -0
  23. package/src/apis/isos/schemas.ts +43 -0
  24. package/src/apis/isos/types.ts +60 -0
  25. package/src/apis/load-balancers/index.ts +892 -0
  26. package/src/apis/load-balancers/schemas.ts +561 -0
  27. package/src/apis/load-balancers/types.ts +361 -0
  28. package/src/apis/locations/index.ts +176 -0
  29. package/src/apis/locations/schemas.ts +83 -0
  30. package/src/apis/locations/types.ts +113 -0
  31. package/src/apis/networks/index.ts +544 -0
  32. package/src/apis/networks/schemas.ts +279 -0
  33. package/src/apis/networks/types.ts +243 -0
  34. package/src/apis/placement-groups/index.ts +212 -0
  35. package/src/apis/placement-groups/schemas.ts +90 -0
  36. package/src/apis/placement-groups/types.ts +99 -0
  37. package/src/apis/pricing/index.ts +42 -0
  38. package/src/apis/pricing/schemas.ts +93 -0
  39. package/src/apis/pricing/types.ts +71 -0
  40. package/src/apis/primary-ips/index.ts +467 -0
  41. package/src/apis/primary-ips/schemas.ts +221 -0
  42. package/src/apis/primary-ips/types.ts +221 -0
  43. package/src/apis/server-types/index.ts +93 -0
  44. package/src/apis/server-types/schemas.ts +29 -0
  45. package/src/apis/server-types/types.ts +43 -0
  46. package/src/apis/servers/index.ts +378 -0
  47. package/src/apis/servers/schemas.ts +771 -0
  48. package/src/apis/servers/types.ts +538 -0
  49. package/src/apis/ssh-keys/index.ts +204 -0
  50. package/src/apis/ssh-keys/schemas.ts +84 -0
  51. package/src/apis/ssh-keys/types.ts +106 -0
  52. package/src/apis/volumes/index.ts +452 -0
  53. package/src/apis/volumes/schemas.ts +195 -0
  54. package/src/apis/volumes/types.ts +197 -0
  55. package/src/auth/index.ts +26 -0
  56. package/src/base/index.ts +10 -0
  57. package/src/client/index.ts +388 -0
  58. package/src/config/index.ts +34 -0
  59. package/src/errors/index.ts +38 -0
  60. package/src/index.ts +799 -0
  61. package/src/types/index.ts +37 -0
  62. package/src/validation/index.ts +109 -0
@@ -0,0 +1,397 @@
1
+ /**
2
+ * Types for Hetzner Cloud DNS (Zones) API
3
+ * Types are inferred from Zod schemas
4
+ * @see https://docs.hetzner.cloud/reference/cloud#dns
5
+ */
6
+
7
+ // biome-ignore assist/source/organizeImports: we need to import the schemas first
8
+ import {
9
+ listZonesResponseSchema,
10
+ createZoneRequestSchema,
11
+ createZoneResponseSchema,
12
+ getZoneResponseSchema,
13
+ updateZoneRequestSchema,
14
+ updateZoneResponseSchema,
15
+ deleteZoneResponseSchema,
16
+ exportZoneResponseSchema,
17
+ listZoneActionsResponseSchema,
18
+ getZoneActionResponseSchema,
19
+ changeZonePrimaryNameserversRequestSchema,
20
+ changeZonePrimaryNameserversResponseSchema,
21
+ changeZoneProtectionRequestSchema,
22
+ changeZoneProtectionResponseSchema,
23
+ changeZoneDefaultTTLRequestSchema,
24
+ changeZoneDefaultTTLResponseSchema,
25
+ importZoneFileRequestSchema,
26
+ importZoneFileResponseSchema,
27
+ listRRSetsResponseSchema,
28
+ getRRSetResponseSchema,
29
+ createRRSetRequestSchema,
30
+ createRRSetResponseSchema,
31
+ updateRRSetRequestSchema,
32
+ updateRRSetResponseSchema,
33
+ deleteRRSetResponseSchema,
34
+ changeRRSetProtectionRequestSchema,
35
+ changeRRSetProtectionResponseSchema,
36
+ changeRRSetTTLRequestSchema,
37
+ changeRRSetTTLResponseSchema,
38
+ setRRSetRecordsRequestSchema,
39
+ setRRSetRecordsResponseSchema,
40
+ addRRSetRecordsRequestSchema,
41
+ addRRSetRecordsResponseSchema,
42
+ removeRRSetRecordsRequestSchema,
43
+ removeRRSetRecordsResponseSchema,
44
+ updateRRSetRecordsRequestSchema,
45
+ updateRRSetRecordsResponseSchema,
46
+ zoneSchema,
47
+ zoneStatusSchema,
48
+ zoneProtectionSchema,
49
+ rrsetSchema,
50
+ rrsetRecordSchema,
51
+ rrsetProtectionSchema,
52
+ } from "../../apis/dns/schemas";
53
+ import type { z } from "zod";
54
+
55
+ /**
56
+ * Zone status
57
+ */
58
+ export type ZoneStatus = z.infer<typeof zoneStatusSchema>;
59
+
60
+ /**
61
+ * Zone protection
62
+ */
63
+ export type ZoneProtection = z.infer<typeof zoneProtectionSchema>;
64
+
65
+ /**
66
+ * Zone
67
+ */
68
+ export type Zone = z.infer<typeof zoneSchema>;
69
+
70
+ /**
71
+ * RRSet record
72
+ */
73
+ export type RRSetRecord = z.infer<typeof rrsetRecordSchema>;
74
+
75
+ /**
76
+ * RRSet protection
77
+ */
78
+ export type RRSetProtection = z.infer<typeof rrsetProtectionSchema>;
79
+
80
+ /**
81
+ * RRSet
82
+ */
83
+ export type RRSet = z.infer<typeof rrsetSchema>;
84
+
85
+ /**
86
+ * List Zones query parameters
87
+ * @see https://docs.hetzner.cloud/reference/cloud#zones-list-zones
88
+ */
89
+ export interface ListZonesParams {
90
+ /**
91
+ * Can be used to filter resources by their name. The response will only contain the resources matching the specified name.
92
+ */
93
+ name?: string;
94
+ /**
95
+ * Can be used multiple times. Choices: id, id:asc, id:desc, name, name:asc, name:desc, created, created:asc, created:desc
96
+ * @see https://docs.hetzner.cloud/reference/cloud#sorting
97
+ */
98
+ sort?: string | string[];
99
+ /**
100
+ * Can be used to filter resources by labels. The response will only contain resources matching the label selector.
101
+ */
102
+ label_selector?: string;
103
+ /**
104
+ * Page number to return. For more information, see [Pagination](https://docs.hetzner.cloud/reference/cloud#pagination).
105
+ */
106
+ page?: number;
107
+ /**
108
+ * Maximum number of entries returned per page. For more information, see [Pagination](https://docs.hetzner.cloud/reference/cloud#pagination).
109
+ */
110
+ per_page?: number;
111
+ }
112
+
113
+ /**
114
+ * List Zones response
115
+ * @see https://docs.hetzner.cloud/reference/cloud#zones-list-zones
116
+ */
117
+ export type ListZonesResponse = z.infer<typeof listZonesResponseSchema>;
118
+
119
+ /**
120
+ * Create Zone parameters
121
+ * @see https://docs.hetzner.cloud/reference/cloud#zones-create-a-zone
122
+ */
123
+ export type CreateZoneParams = z.infer<typeof createZoneRequestSchema>;
124
+
125
+ /**
126
+ * Create Zone response
127
+ * @see https://docs.hetzner.cloud/reference/cloud#zones-create-a-zone
128
+ */
129
+ export type CreateZoneResponse = z.infer<typeof createZoneResponseSchema>;
130
+
131
+ /**
132
+ * Get Zone response
133
+ * @see https://docs.hetzner.cloud/reference/cloud#zones-get-a-zone
134
+ */
135
+ export type GetZoneResponse = z.infer<typeof getZoneResponseSchema>;
136
+
137
+ /**
138
+ * Update Zone parameters
139
+ * @see https://docs.hetzner.cloud/reference/cloud#zones-update-a-zone
140
+ */
141
+ export type UpdateZoneParams = z.infer<typeof updateZoneRequestSchema>;
142
+
143
+ /**
144
+ * Update Zone response
145
+ * @see https://docs.hetzner.cloud/reference/cloud#zones-update-a-zone
146
+ */
147
+ export type UpdateZoneResponse = z.infer<typeof updateZoneResponseSchema>;
148
+
149
+ /**
150
+ * Delete Zone response
151
+ * @see https://docs.hetzner.cloud/reference/cloud#zones-delete-a-zone
152
+ */
153
+ export type DeleteZoneResponse = z.infer<typeof deleteZoneResponseSchema>;
154
+
155
+ /**
156
+ * Export Zone response
157
+ * @see https://docs.hetzner.cloud/reference/cloud#zones-export-a-zone-file
158
+ */
159
+ export type ExportZoneResponse = z.infer<typeof exportZoneResponseSchema>;
160
+
161
+ /**
162
+ * List Zone Actions query parameters
163
+ * @see https://docs.hetzner.cloud/reference/cloud#zones-list-actions-for-a-zone
164
+ */
165
+ export interface ListZoneActionsParams {
166
+ /**
167
+ * Can be used multiple times. Choices: id, id:asc, id:desc, command, command:asc, command:desc, status, status:asc, status:desc, progress, progress:asc, progress:desc, started, started:asc, started:desc, finished, finished:asc, finished:desc
168
+ * @see https://docs.hetzner.cloud/reference/cloud#sorting
169
+ */
170
+ sort?: string | string[];
171
+ /**
172
+ * Can be used to filter Actions by status. The response will only contain Actions matching the status.
173
+ */
174
+ status?: string | string[];
175
+ /**
176
+ * Page number to return. For more information, see [Pagination](https://docs.hetzner.cloud/reference/cloud#pagination).
177
+ */
178
+ page?: number;
179
+ /**
180
+ * Maximum number of entries returned per page. For more information, see [Pagination](https://docs.hetzner.cloud/reference/cloud#pagination).
181
+ */
182
+ per_page?: number;
183
+ }
184
+
185
+ /**
186
+ * List Zone Actions response
187
+ * @see https://docs.hetzner.cloud/reference/cloud#zones-list-actions-for-a-zone
188
+ */
189
+ export type ListZoneActionsResponse = z.infer<typeof listZoneActionsResponseSchema>;
190
+
191
+ /**
192
+ * Get Zone Action response
193
+ * @see https://docs.hetzner.cloud/reference/cloud#zones-get-an-action-for-a-zone
194
+ */
195
+ export type GetZoneActionResponse = z.infer<typeof getZoneActionResponseSchema>;
196
+
197
+ /**
198
+ * Change Zone Primary Nameservers parameters
199
+ * @see https://docs.hetzner.cloud/reference/cloud#zones-change-a-zones-primary-nameservers
200
+ */
201
+ export type ChangeZonePrimaryNameserversParams = z.infer<
202
+ typeof changeZonePrimaryNameserversRequestSchema
203
+ >;
204
+
205
+ /**
206
+ * Change Zone Primary Nameservers response
207
+ * @see https://docs.hetzner.cloud/reference/cloud#zones-change-a-zones-primary-nameservers
208
+ */
209
+ export type ChangeZonePrimaryNameserversResponse = z.infer<
210
+ typeof changeZonePrimaryNameserversResponseSchema
211
+ >;
212
+
213
+ /**
214
+ * Change Zone Protection parameters
215
+ * @see https://docs.hetzner.cloud/reference/cloud#zones-change-a-zones-protection
216
+ */
217
+ export type ChangeZoneProtectionParams = z.infer<typeof changeZoneProtectionRequestSchema>;
218
+
219
+ /**
220
+ * Change Zone Protection response
221
+ * @see https://docs.hetzner.cloud/reference/cloud#zones-change-a-zones-protection
222
+ */
223
+ export type ChangeZoneProtectionResponse = z.infer<typeof changeZoneProtectionResponseSchema>;
224
+
225
+ /**
226
+ * Change Zone Default TTL parameters
227
+ * @see https://docs.hetzner.cloud/reference/cloud#zones-change-a-zones-default-ttl
228
+ */
229
+ export type ChangeZoneDefaultTTLParams = z.infer<typeof changeZoneDefaultTTLRequestSchema>;
230
+
231
+ /**
232
+ * Change Zone Default TTL response
233
+ * @see https://docs.hetzner.cloud/reference/cloud#zones-change-a-zones-default-ttl
234
+ */
235
+ export type ChangeZoneDefaultTTLResponse = z.infer<typeof changeZoneDefaultTTLResponseSchema>;
236
+
237
+ /**
238
+ * Import Zone file parameters
239
+ * @see https://docs.hetzner.cloud/reference/cloud#zones-import-a-zone-file
240
+ */
241
+ export type ImportZoneFileParams = z.infer<typeof importZoneFileRequestSchema>;
242
+
243
+ /**
244
+ * Import Zone file response
245
+ * @see https://docs.hetzner.cloud/reference/cloud#zones-import-a-zone-file
246
+ */
247
+ export type ImportZoneFileResponse = z.infer<typeof importZoneFileResponseSchema>;
248
+
249
+ /**
250
+ * List RRSets query parameters
251
+ * @see https://docs.hetzner.cloud/reference/cloud#rrsets-list-rrsets
252
+ */
253
+ export interface ListRRSetsParams {
254
+ /**
255
+ * Can be used to filter resources by their name. The response will only contain the resources matching the specified name.
256
+ */
257
+ name?: string;
258
+ /**
259
+ * Can be used to filter resources by their type. The response will only contain the resources matching the specified type.
260
+ */
261
+ type?: string;
262
+ /**
263
+ * Can be used multiple times. Choices: id, id:asc, id:desc, name, name:asc, name:desc, type, type:asc, type:desc, created, created:asc, created:desc
264
+ * @see https://docs.hetzner.cloud/reference/cloud#sorting
265
+ */
266
+ sort?: string | string[];
267
+ /**
268
+ * Can be used to filter resources by labels. The response will only contain resources matching the label selector.
269
+ */
270
+ label_selector?: string;
271
+ /**
272
+ * Page number to return. For more information, see [Pagination](https://docs.hetzner.cloud/reference/cloud#pagination).
273
+ */
274
+ page?: number;
275
+ /**
276
+ * Maximum number of entries returned per page. For more information, see [Pagination](https://docs.hetzner.cloud/reference/cloud#pagination).
277
+ */
278
+ per_page?: number;
279
+ }
280
+
281
+ /**
282
+ * List RRSets response
283
+ * @see https://docs.hetzner.cloud/reference/cloud#rrsets-list-rrsets
284
+ */
285
+ export type ListRRSetsResponse = z.infer<typeof listRRSetsResponseSchema>;
286
+
287
+ /**
288
+ * Get RRSet response
289
+ * @see https://docs.hetzner.cloud/reference/cloud#rrsets-get-an-rrset
290
+ */
291
+ export type GetRRSetResponse = z.infer<typeof getRRSetResponseSchema>;
292
+
293
+ /**
294
+ * Create RRSet parameters
295
+ * @see https://docs.hetzner.cloud/reference/cloud#rrsets-create-an-rrset
296
+ */
297
+ export type CreateRRSetParams = z.infer<typeof createRRSetRequestSchema>;
298
+
299
+ /**
300
+ * Create RRSet response
301
+ * @see https://docs.hetzner.cloud/reference/cloud#rrsets-create-an-rrset
302
+ */
303
+ export type CreateRRSetResponse = z.infer<typeof createRRSetResponseSchema>;
304
+
305
+ /**
306
+ * Update RRSet parameters
307
+ * @see https://docs.hetzner.cloud/reference/cloud#rrsets-update-an-rrset
308
+ */
309
+ export type UpdateRRSetParams = z.infer<typeof updateRRSetRequestSchema>;
310
+
311
+ /**
312
+ * Update RRSet response
313
+ * @see https://docs.hetzner.cloud/reference/cloud#rrsets-update-an-rrset
314
+ */
315
+ export type UpdateRRSetResponse = z.infer<typeof updateRRSetResponseSchema>;
316
+
317
+ /**
318
+ * Delete RRSet response
319
+ * @see https://docs.hetzner.cloud/reference/cloud#rrsets-delete-an-rrset
320
+ */
321
+ export type DeleteRRSetResponse = z.infer<typeof deleteRRSetResponseSchema>;
322
+
323
+ /**
324
+ * Change RRSet Protection parameters
325
+ * @see https://docs.hetzner.cloud/reference/cloud#rrsets-change-an-rrsets-protection
326
+ */
327
+ export type ChangeRRSetProtectionParams = z.infer<
328
+ typeof changeRRSetProtectionRequestSchema
329
+ >;
330
+
331
+ /**
332
+ * Change RRSet Protection response
333
+ * @see https://docs.hetzner.cloud/reference/cloud#rrsets-change-an-rrsets-protection
334
+ */
335
+ export type ChangeRRSetProtectionResponse = z.infer<
336
+ typeof changeRRSetProtectionResponseSchema
337
+ >;
338
+
339
+ /**
340
+ * Change RRSet TTL parameters
341
+ * @see https://docs.hetzner.cloud/reference/cloud#rrsets-change-an-rrsets-ttl
342
+ */
343
+ export type ChangeRRSetTTLParams = z.infer<typeof changeRRSetTTLRequestSchema>;
344
+
345
+ /**
346
+ * Change RRSet TTL response
347
+ * @see https://docs.hetzner.cloud/reference/cloud#rrsets-change-an-rrsets-ttl
348
+ */
349
+ export type ChangeRRSetTTLResponse = z.infer<typeof changeRRSetTTLResponseSchema>;
350
+
351
+ /**
352
+ * Set RRSet Records parameters
353
+ * @see https://docs.hetzner.cloud/reference/cloud#rrsets-set-records-of-an-rrset
354
+ */
355
+ export type SetRRSetRecordsParams = z.infer<typeof setRRSetRecordsRequestSchema>;
356
+
357
+ /**
358
+ * Set RRSet Records response
359
+ * @see https://docs.hetzner.cloud/reference/cloud#rrsets-set-records-of-an-rrset
360
+ */
361
+ export type SetRRSetRecordsResponse = z.infer<typeof setRRSetRecordsResponseSchema>;
362
+
363
+ /**
364
+ * Add RRSet Records parameters
365
+ * @see https://docs.hetzner.cloud/reference/cloud#rrsets-add-records-to-an-rrset
366
+ */
367
+ export type AddRRSetRecordsParams = z.infer<typeof addRRSetRecordsRequestSchema>;
368
+
369
+ /**
370
+ * Add RRSet Records response
371
+ * @see https://docs.hetzner.cloud/reference/cloud#rrsets-add-records-to-an-rrset
372
+ */
373
+ export type AddRRSetRecordsResponse = z.infer<typeof addRRSetRecordsResponseSchema>;
374
+
375
+ /**
376
+ * Remove RRSet Records parameters
377
+ * @see https://docs.hetzner.cloud/reference/cloud#rrsets-remove-records-from-an-rrset
378
+ */
379
+ export type RemoveRRSetRecordsParams = z.infer<typeof removeRRSetRecordsRequestSchema>;
380
+
381
+ /**
382
+ * Remove RRSet Records response
383
+ * @see https://docs.hetzner.cloud/reference/cloud#rrsets-remove-records-from-an-rrset
384
+ */
385
+ export type RemoveRRSetRecordsResponse = z.infer<typeof removeRRSetRecordsResponseSchema>;
386
+
387
+ /**
388
+ * Update RRSet Records parameters
389
+ * @see https://docs.hetzner.cloud/reference/cloud#rrsets-update-records-of-an-rrset
390
+ */
391
+ export type UpdateRRSetRecordsParams = z.infer<typeof updateRRSetRecordsRequestSchema>;
392
+
393
+ /**
394
+ * Update RRSet Records response
395
+ * @see https://docs.hetzner.cloud/reference/cloud#rrsets-update-records-of-an-rrset
396
+ */
397
+ export type UpdateRRSetRecordsResponse = z.infer<typeof updateRRSetRecordsResponseSchema>;