@leaflow/sdk 0.170.0 → 0.172.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.
- package/dist/compute/v2/generated/functions.d.ts +1 -1
- package/dist/compute/v2/generated/functions.js +1 -1
- package/dist/compute/v2/generated/models.d.ts +3 -5
- package/dist/compute/v2/generated/schemas.zod.d.ts +1 -1
- package/dist/compute/v2/generated/schemas.zod.js +1 -1
- package/dist/compute/v2/generated/validators/createElasticIPRequestBody.zod.js +1 -1
- package/dist/compute/v2/generated/validators/elasticIPLine.zod.d.ts +0 -1
- package/dist/compute/v2/generated/validators/elasticIPLine.zod.js +0 -3
- package/dist/compute/v2/generated/validators/elasticIPLineListResponseBody.zod.d.ts +0 -1
- package/dist/compute/v2/generated/validators/newElasticIP.zod.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/routes.d.ts +80 -0
- package/dist/routes.js +90 -0
- package/dist/swas/v1/generated/functions.d.ts +418 -0
- package/dist/swas/v1/generated/functions.js +250 -0
- package/dist/swas/v1/generated/models.d.ts +384 -0
- package/dist/swas/v1/generated/models.js +87 -0
- package/dist/swas/v1/generated/schemas.zod.d.ts +117 -0
- package/dist/swas/v1/generated/schemas.zod.js +120 -0
- package/dist/swas/v1/generated/validators/catalog.zod.d.ts +32 -0
- package/dist/swas/v1/generated/validators/catalog.zod.js +16 -0
- package/dist/swas/v1/generated/validators/createPurchaseHeaders.zod.d.ts +14 -0
- package/dist/swas/v1/generated/validators/createPurchaseHeaders.zod.js +12 -0
- package/dist/swas/v1/generated/validators/cursorPagination.zod.d.ts +14 -0
- package/dist/swas/v1/generated/validators/cursorPagination.zod.js +14 -0
- package/dist/swas/v1/generated/validators/customerRefundProgress.zod.d.ts +16 -0
- package/dist/swas/v1/generated/validators/customerRefundProgress.zod.js +14 -0
- package/dist/swas/v1/generated/validators/decimalAmount.zod.d.ts +12 -0
- package/dist/swas/v1/generated/validators/decimalAmount.zod.js +11 -0
- package/dist/swas/v1/generated/validators/error.zod.d.ts +16 -0
- package/dist/swas/v1/generated/validators/error.zod.js +17 -0
- package/dist/swas/v1/generated/validators/expectedQuote.zod.d.ts +14 -0
- package/dist/swas/v1/generated/validators/expectedQuote.zod.js +13 -0
- package/dist/swas/v1/generated/validators/instance.zod.d.ts +58 -0
- package/dist/swas/v1/generated/validators/instance.zod.js +47 -0
- package/dist/swas/v1/generated/validators/instanceCapabilities.zod.d.ts +16 -0
- package/dist/swas/v1/generated/validators/instanceCapabilities.zod.js +14 -0
- package/dist/swas/v1/generated/validators/instanceList.zod.d.ts +62 -0
- package/dist/swas/v1/generated/validators/instanceList.zod.js +15 -0
- package/dist/swas/v1/generated/validators/instancePagination.zod.d.ts +15 -0
- package/dist/swas/v1/generated/validators/instancePagination.zod.js +10 -0
- package/dist/swas/v1/generated/validators/instancePrice.zod.d.ts +15 -0
- package/dist/swas/v1/generated/validators/instancePrice.zod.js +21 -0
- package/dist/swas/v1/generated/validators/listInstancesParams.zod.d.ts +20 -0
- package/dist/swas/v1/generated/validators/listInstancesParams.zod.js +22 -0
- package/dist/swas/v1/generated/validators/listPlansParams.zod.d.ts +14 -0
- package/dist/swas/v1/generated/validators/listPlansParams.zod.js +12 -0
- package/dist/swas/v1/generated/validators/managementOperation.zod.d.ts +36 -0
- package/dist/swas/v1/generated/validators/managementOperation.zod.js +21 -0
- package/dist/swas/v1/generated/validators/money.zod.d.ts +11 -0
- package/dist/swas/v1/generated/validators/money.zod.js +11 -0
- package/dist/swas/v1/generated/validators/offsetPagination.zod.d.ts +16 -0
- package/dist/swas/v1/generated/validators/offsetPagination.zod.js +16 -0
- package/dist/swas/v1/generated/validators/plan.zod.d.ts +29 -0
- package/dist/swas/v1/generated/validators/plan.zod.js +22 -0
- package/dist/swas/v1/generated/validators/price.zod.d.ts +19 -0
- package/dist/swas/v1/generated/validators/price.zod.js +28 -0
- package/dist/swas/v1/generated/validators/purchase.zod.d.ts +34 -0
- package/dist/swas/v1/generated/validators/purchase.zod.js +34 -0
- package/dist/swas/v1/generated/validators/purchaseCreate.zod.d.ts +27 -0
- package/dist/swas/v1/generated/validators/purchaseCreate.zod.js +23 -0
- package/dist/swas/v1/generated/validators/rebootCycle.zod.d.ts +14 -0
- package/dist/swas/v1/generated/validators/rebootCycle.zod.js +17 -0
- package/dist/swas/v1/generated/validators/rebootInstance.zod.d.ts +11 -0
- package/dist/swas/v1/generated/validators/rebootInstance.zod.js +9 -0
- package/dist/swas/v1/generated/validators/rebootInstanceHeaders.zod.d.ts +14 -0
- package/dist/swas/v1/generated/validators/rebootInstanceHeaders.zod.js +12 -0
- package/dist/swas/v1/generated/validators/refundProgress.zod.d.ts +33 -0
- package/dist/swas/v1/generated/validators/refundProgress.zod.js +27 -0
- package/dist/swas/v1/generated/validators/startInstance.zod.d.ts +11 -0
- package/dist/swas/v1/generated/validators/startInstance.zod.js +9 -0
- package/dist/swas/v1/generated/validators/startInstanceHeaders.zod.d.ts +14 -0
- package/dist/swas/v1/generated/validators/startInstanceHeaders.zod.js +12 -0
- package/dist/swas/v1/generated/validators/stopInstance.zod.d.ts +11 -0
- package/dist/swas/v1/generated/validators/stopInstance.zod.js +9 -0
- package/dist/swas/v1/generated/validators/stopInstanceHeaders.zod.d.ts +14 -0
- package/dist/swas/v1/generated/validators/stopInstanceHeaders.zod.js +12 -0
- package/dist/swas/v1/generated/validators/supplierRefundProgress.zod.d.ts +14 -0
- package/dist/swas/v1/generated/validators/supplierRefundProgress.zod.js +12 -0
- package/dist/swas/v1/index.d.ts +4 -0
- package/dist/swas/v1/index.js +4 -0
- package/dist/swas/v1/response-schemas.d.ts +18 -0
- package/dist/swas/v1/response-schemas.js +19 -0
- package/package.json +1 -1
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow SWAS API
|
|
5
|
+
* Manage SWAS purchases and instances in the current project. Use an IAM scoped token for every request. Amounts are decimal strings in the stated currency; timestamps are UTC RFC 3339. Accepted requests may still be in progress. Read purchase, operation and refund progress separately.
|
|
6
|
+
* OpenAPI spec version: 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
import type { Catalog, CreatePurchaseHeaders, Error, Instance, InstanceList, ListInstancesParams, ListPlansParams, ManagementOperation, Purchase, PurchaseCreate, RebootInstance, RebootInstanceHeaders, RefundProgress, StartInstance, StartInstanceHeaders, StopInstance, StopInstanceHeaders } from "./models.js";
|
|
9
|
+
export type listPlansResponse200 = {
|
|
10
|
+
data: Catalog;
|
|
11
|
+
status: 200;
|
|
12
|
+
};
|
|
13
|
+
export type listPlansResponse400 = {
|
|
14
|
+
data: Error;
|
|
15
|
+
status: 400;
|
|
16
|
+
};
|
|
17
|
+
export type listPlansResponse401 = {
|
|
18
|
+
data: Error;
|
|
19
|
+
status: 401;
|
|
20
|
+
};
|
|
21
|
+
export type listPlansResponse403 = {
|
|
22
|
+
data: Error;
|
|
23
|
+
status: 403;
|
|
24
|
+
};
|
|
25
|
+
export type listPlansResponse404 = {
|
|
26
|
+
data: Error;
|
|
27
|
+
status: 404;
|
|
28
|
+
};
|
|
29
|
+
export type listPlansResponse409 = {
|
|
30
|
+
data: Error;
|
|
31
|
+
status: 409;
|
|
32
|
+
};
|
|
33
|
+
export type listPlansResponse503 = {
|
|
34
|
+
data: Error;
|
|
35
|
+
status: 503;
|
|
36
|
+
};
|
|
37
|
+
export type listPlansResponseSuccess = listPlansResponse200 & {
|
|
38
|
+
headers: Headers;
|
|
39
|
+
};
|
|
40
|
+
export type listPlansResponseError = (listPlansResponse400 | listPlansResponse401 | listPlansResponse403 | listPlansResponse404 | listPlansResponse409 | listPlansResponse503) & {
|
|
41
|
+
headers: Headers;
|
|
42
|
+
};
|
|
43
|
+
export type listPlansResponse = listPlansResponseSuccess | listPlansResponseError;
|
|
44
|
+
export declare const getListPlansUrl: (params: ListPlansParams) => string;
|
|
45
|
+
/**
|
|
46
|
+
* Lists available plans and prices for the requested region. A plan without a price is not available to buy.
|
|
47
|
+
* @summary List plans
|
|
48
|
+
*/
|
|
49
|
+
export declare const listPlans: (params: ListPlansParams, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<listPlansResponse>;
|
|
50
|
+
export type createPurchaseResponse202 = {
|
|
51
|
+
data: Purchase;
|
|
52
|
+
status: 202;
|
|
53
|
+
};
|
|
54
|
+
export type createPurchaseResponse400 = {
|
|
55
|
+
data: Error;
|
|
56
|
+
status: 400;
|
|
57
|
+
};
|
|
58
|
+
export type createPurchaseResponse401 = {
|
|
59
|
+
data: Error;
|
|
60
|
+
status: 401;
|
|
61
|
+
};
|
|
62
|
+
export type createPurchaseResponse403 = {
|
|
63
|
+
data: Error;
|
|
64
|
+
status: 403;
|
|
65
|
+
};
|
|
66
|
+
export type createPurchaseResponse404 = {
|
|
67
|
+
data: Error;
|
|
68
|
+
status: 404;
|
|
69
|
+
};
|
|
70
|
+
export type createPurchaseResponse409 = {
|
|
71
|
+
data: Error;
|
|
72
|
+
status: 409;
|
|
73
|
+
};
|
|
74
|
+
export type createPurchaseResponse503 = {
|
|
75
|
+
data: Error;
|
|
76
|
+
status: 503;
|
|
77
|
+
};
|
|
78
|
+
export type createPurchaseResponseSuccess = createPurchaseResponse202 & {
|
|
79
|
+
headers: Headers;
|
|
80
|
+
};
|
|
81
|
+
export type createPurchaseResponseError = (createPurchaseResponse400 | createPurchaseResponse401 | createPurchaseResponse403 | createPurchaseResponse404 | createPurchaseResponse409 | createPurchaseResponse503) & {
|
|
82
|
+
headers: Headers;
|
|
83
|
+
};
|
|
84
|
+
export type createPurchaseResponse = createPurchaseResponseSuccess | createPurchaseResponseError;
|
|
85
|
+
export declare const getCreatePurchaseUrl: () => string;
|
|
86
|
+
/**
|
|
87
|
+
* Creates a purchase using the current catalog revision and expected price. Reuse the same Idempotency-Key after a timeout. Acceptance is not confirmation of payment or instance delivery.
|
|
88
|
+
* @summary Create purchase
|
|
89
|
+
*/
|
|
90
|
+
export declare const createPurchase: (purchaseCreate: PurchaseCreate, headers: CreatePurchaseHeaders, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<createPurchaseResponse>;
|
|
91
|
+
export type getPurchaseResponse200 = {
|
|
92
|
+
data: Purchase;
|
|
93
|
+
status: 200;
|
|
94
|
+
};
|
|
95
|
+
export type getPurchaseResponse400 = {
|
|
96
|
+
data: Error;
|
|
97
|
+
status: 400;
|
|
98
|
+
};
|
|
99
|
+
export type getPurchaseResponse401 = {
|
|
100
|
+
data: Error;
|
|
101
|
+
status: 401;
|
|
102
|
+
};
|
|
103
|
+
export type getPurchaseResponse403 = {
|
|
104
|
+
data: Error;
|
|
105
|
+
status: 403;
|
|
106
|
+
};
|
|
107
|
+
export type getPurchaseResponse404 = {
|
|
108
|
+
data: Error;
|
|
109
|
+
status: 404;
|
|
110
|
+
};
|
|
111
|
+
export type getPurchaseResponse409 = {
|
|
112
|
+
data: Error;
|
|
113
|
+
status: 409;
|
|
114
|
+
};
|
|
115
|
+
export type getPurchaseResponse503 = {
|
|
116
|
+
data: Error;
|
|
117
|
+
status: 503;
|
|
118
|
+
};
|
|
119
|
+
export type getPurchaseResponseSuccess = getPurchaseResponse200 & {
|
|
120
|
+
headers: Headers;
|
|
121
|
+
};
|
|
122
|
+
export type getPurchaseResponseError = (getPurchaseResponse400 | getPurchaseResponse401 | getPurchaseResponse403 | getPurchaseResponse404 | getPurchaseResponse409 | getPurchaseResponse503) & {
|
|
123
|
+
headers: Headers;
|
|
124
|
+
};
|
|
125
|
+
export type getPurchaseResponse = getPurchaseResponseSuccess | getPurchaseResponseError;
|
|
126
|
+
export declare const getGetPurchaseUrl: (purchaseId: string) => string;
|
|
127
|
+
/**
|
|
128
|
+
* Returns purchase, delivery and Billing progress. Payment and instance delivery may finish at different times.
|
|
129
|
+
* @summary Get purchase
|
|
130
|
+
*/
|
|
131
|
+
export declare const getPurchase: (purchaseId: string, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<getPurchaseResponse>;
|
|
132
|
+
export type listInstancesResponse200 = {
|
|
133
|
+
data: InstanceList;
|
|
134
|
+
status: 200;
|
|
135
|
+
};
|
|
136
|
+
export type listInstancesResponse400 = {
|
|
137
|
+
data: Error;
|
|
138
|
+
status: 400;
|
|
139
|
+
};
|
|
140
|
+
export type listInstancesResponse401 = {
|
|
141
|
+
data: Error;
|
|
142
|
+
status: 401;
|
|
143
|
+
};
|
|
144
|
+
export type listInstancesResponse403 = {
|
|
145
|
+
data: Error;
|
|
146
|
+
status: 403;
|
|
147
|
+
};
|
|
148
|
+
export type listInstancesResponse404 = {
|
|
149
|
+
data: Error;
|
|
150
|
+
status: 404;
|
|
151
|
+
};
|
|
152
|
+
export type listInstancesResponse409 = {
|
|
153
|
+
data: Error;
|
|
154
|
+
status: 409;
|
|
155
|
+
};
|
|
156
|
+
export type listInstancesResponse503 = {
|
|
157
|
+
data: Error;
|
|
158
|
+
status: 503;
|
|
159
|
+
};
|
|
160
|
+
export type listInstancesResponseSuccess = listInstancesResponse200 & {
|
|
161
|
+
headers: Headers;
|
|
162
|
+
};
|
|
163
|
+
export type listInstancesResponseError = (listInstancesResponse400 | listInstancesResponse401 | listInstancesResponse403 | listInstancesResponse404 | listInstancesResponse409 | listInstancesResponse503) & {
|
|
164
|
+
headers: Headers;
|
|
165
|
+
};
|
|
166
|
+
export type listInstancesResponse = listInstancesResponseSuccess | listInstancesResponseError;
|
|
167
|
+
export declare const getListInstancesUrl: (params: ListInstancesParams) => string;
|
|
168
|
+
/**
|
|
169
|
+
* Lists the current project's instances in the requested region. Pagination uses page and page_size; total_count is returned when known.
|
|
170
|
+
* @summary List instances
|
|
171
|
+
*/
|
|
172
|
+
export declare const listInstances: (params: ListInstancesParams, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<listInstancesResponse>;
|
|
173
|
+
export type getInstanceResponse200 = {
|
|
174
|
+
data: Instance;
|
|
175
|
+
status: 200;
|
|
176
|
+
};
|
|
177
|
+
export type getInstanceResponse400 = {
|
|
178
|
+
data: Error;
|
|
179
|
+
status: 400;
|
|
180
|
+
};
|
|
181
|
+
export type getInstanceResponse401 = {
|
|
182
|
+
data: Error;
|
|
183
|
+
status: 401;
|
|
184
|
+
};
|
|
185
|
+
export type getInstanceResponse403 = {
|
|
186
|
+
data: Error;
|
|
187
|
+
status: 403;
|
|
188
|
+
};
|
|
189
|
+
export type getInstanceResponse404 = {
|
|
190
|
+
data: Error;
|
|
191
|
+
status: 404;
|
|
192
|
+
};
|
|
193
|
+
export type getInstanceResponse409 = {
|
|
194
|
+
data: Error;
|
|
195
|
+
status: 409;
|
|
196
|
+
};
|
|
197
|
+
export type getInstanceResponse503 = {
|
|
198
|
+
data: Error;
|
|
199
|
+
status: 503;
|
|
200
|
+
};
|
|
201
|
+
export type getInstanceResponseSuccess = getInstanceResponse200 & {
|
|
202
|
+
headers: Headers;
|
|
203
|
+
};
|
|
204
|
+
export type getInstanceResponseError = (getInstanceResponse400 | getInstanceResponse401 | getInstanceResponse403 | getInstanceResponse404 | getInstanceResponse409 | getInstanceResponse503) & {
|
|
205
|
+
headers: Headers;
|
|
206
|
+
};
|
|
207
|
+
export type getInstanceResponse = getInstanceResponseSuccess | getInstanceResponseError;
|
|
208
|
+
export declare const getGetInstanceUrl: (instanceId: string) => string;
|
|
209
|
+
/**
|
|
210
|
+
* Returns an instance and its most recently observed status.
|
|
211
|
+
* @summary Get instance
|
|
212
|
+
*/
|
|
213
|
+
export declare const getInstance: (instanceId: string, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<getInstanceResponse>;
|
|
214
|
+
export type startInstanceResponse202 = {
|
|
215
|
+
data: ManagementOperation;
|
|
216
|
+
status: 202;
|
|
217
|
+
};
|
|
218
|
+
export type startInstanceResponse400 = {
|
|
219
|
+
data: Error;
|
|
220
|
+
status: 400;
|
|
221
|
+
};
|
|
222
|
+
export type startInstanceResponse401 = {
|
|
223
|
+
data: Error;
|
|
224
|
+
status: 401;
|
|
225
|
+
};
|
|
226
|
+
export type startInstanceResponse403 = {
|
|
227
|
+
data: Error;
|
|
228
|
+
status: 403;
|
|
229
|
+
};
|
|
230
|
+
export type startInstanceResponse404 = {
|
|
231
|
+
data: Error;
|
|
232
|
+
status: 404;
|
|
233
|
+
};
|
|
234
|
+
export type startInstanceResponse409 = {
|
|
235
|
+
data: Error;
|
|
236
|
+
status: 409;
|
|
237
|
+
};
|
|
238
|
+
export type startInstanceResponse503 = {
|
|
239
|
+
data: Error;
|
|
240
|
+
status: 503;
|
|
241
|
+
};
|
|
242
|
+
export type startInstanceResponseSuccess = startInstanceResponse202 & {
|
|
243
|
+
headers: Headers;
|
|
244
|
+
};
|
|
245
|
+
export type startInstanceResponseError = (startInstanceResponse400 | startInstanceResponse401 | startInstanceResponse403 | startInstanceResponse404 | startInstanceResponse409 | startInstanceResponse503) & {
|
|
246
|
+
headers: Headers;
|
|
247
|
+
};
|
|
248
|
+
export type startInstanceResponse = startInstanceResponseSuccess | startInstanceResponseError;
|
|
249
|
+
export declare const getStartInstanceUrl: (instanceId: string) => string;
|
|
250
|
+
/**
|
|
251
|
+
* Starts an existing instance. Returns an operation to poll; acceptance is not completion.
|
|
252
|
+
* @summary Start instance
|
|
253
|
+
*/
|
|
254
|
+
export declare const startInstance: (instanceId: string, startInstanceBody: StartInstance, headers: StartInstanceHeaders, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<startInstanceResponse>;
|
|
255
|
+
export type getInstanceOperationResponse200 = {
|
|
256
|
+
data: ManagementOperation;
|
|
257
|
+
status: 200;
|
|
258
|
+
};
|
|
259
|
+
export type getInstanceOperationResponse400 = {
|
|
260
|
+
data: Error;
|
|
261
|
+
status: 400;
|
|
262
|
+
};
|
|
263
|
+
export type getInstanceOperationResponse401 = {
|
|
264
|
+
data: Error;
|
|
265
|
+
status: 401;
|
|
266
|
+
};
|
|
267
|
+
export type getInstanceOperationResponse403 = {
|
|
268
|
+
data: Error;
|
|
269
|
+
status: 403;
|
|
270
|
+
};
|
|
271
|
+
export type getInstanceOperationResponse404 = {
|
|
272
|
+
data: Error;
|
|
273
|
+
status: 404;
|
|
274
|
+
};
|
|
275
|
+
export type getInstanceOperationResponse409 = {
|
|
276
|
+
data: Error;
|
|
277
|
+
status: 409;
|
|
278
|
+
};
|
|
279
|
+
export type getInstanceOperationResponse503 = {
|
|
280
|
+
data: Error;
|
|
281
|
+
status: 503;
|
|
282
|
+
};
|
|
283
|
+
export type getInstanceOperationResponseSuccess = getInstanceOperationResponse200 & {
|
|
284
|
+
headers: Headers;
|
|
285
|
+
};
|
|
286
|
+
export type getInstanceOperationResponseError = (getInstanceOperationResponse400 | getInstanceOperationResponse401 | getInstanceOperationResponse403 | getInstanceOperationResponse404 | getInstanceOperationResponse409 | getInstanceOperationResponse503) & {
|
|
287
|
+
headers: Headers;
|
|
288
|
+
};
|
|
289
|
+
export type getInstanceOperationResponse = getInstanceOperationResponseSuccess | getInstanceOperationResponseError;
|
|
290
|
+
export declare const getGetInstanceOperationUrl: (instanceId: string, operationId: string) => string;
|
|
291
|
+
/**
|
|
292
|
+
* Returns management progress for the specified instance. Unknown progress is not confirmation of success; do not repeat an operation solely because its outcome is unknown.
|
|
293
|
+
* @summary Get instance operation
|
|
294
|
+
*/
|
|
295
|
+
export declare const getInstanceOperation: (instanceId: string, operationId: string, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<getInstanceOperationResponse>;
|
|
296
|
+
export type stopInstanceResponse202 = {
|
|
297
|
+
data: ManagementOperation;
|
|
298
|
+
status: 202;
|
|
299
|
+
};
|
|
300
|
+
export type stopInstanceResponse400 = {
|
|
301
|
+
data: Error;
|
|
302
|
+
status: 400;
|
|
303
|
+
};
|
|
304
|
+
export type stopInstanceResponse401 = {
|
|
305
|
+
data: Error;
|
|
306
|
+
status: 401;
|
|
307
|
+
};
|
|
308
|
+
export type stopInstanceResponse403 = {
|
|
309
|
+
data: Error;
|
|
310
|
+
status: 403;
|
|
311
|
+
};
|
|
312
|
+
export type stopInstanceResponse404 = {
|
|
313
|
+
data: Error;
|
|
314
|
+
status: 404;
|
|
315
|
+
};
|
|
316
|
+
export type stopInstanceResponse409 = {
|
|
317
|
+
data: Error;
|
|
318
|
+
status: 409;
|
|
319
|
+
};
|
|
320
|
+
export type stopInstanceResponse503 = {
|
|
321
|
+
data: Error;
|
|
322
|
+
status: 503;
|
|
323
|
+
};
|
|
324
|
+
export type stopInstanceResponseSuccess = stopInstanceResponse202 & {
|
|
325
|
+
headers: Headers;
|
|
326
|
+
};
|
|
327
|
+
export type stopInstanceResponseError = (stopInstanceResponse400 | stopInstanceResponse401 | stopInstanceResponse403 | stopInstanceResponse404 | stopInstanceResponse409 | stopInstanceResponse503) & {
|
|
328
|
+
headers: Headers;
|
|
329
|
+
};
|
|
330
|
+
export type stopInstanceResponse = stopInstanceResponseSuccess | stopInstanceResponseError;
|
|
331
|
+
export declare const getStopInstanceUrl: (instanceId: string) => string;
|
|
332
|
+
/**
|
|
333
|
+
* Stops an existing instance. Returns an operation to poll; acceptance is not completion.
|
|
334
|
+
* @summary Stop instance
|
|
335
|
+
*/
|
|
336
|
+
export declare const stopInstance: (instanceId: string, stopInstanceBody: StopInstance, headers: StopInstanceHeaders, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<stopInstanceResponse>;
|
|
337
|
+
export type getCancellationRefundProgressResponse200 = {
|
|
338
|
+
data: RefundProgress;
|
|
339
|
+
status: 200;
|
|
340
|
+
};
|
|
341
|
+
export type getCancellationRefundProgressResponse400 = {
|
|
342
|
+
data: Error;
|
|
343
|
+
status: 400;
|
|
344
|
+
};
|
|
345
|
+
export type getCancellationRefundProgressResponse401 = {
|
|
346
|
+
data: Error;
|
|
347
|
+
status: 401;
|
|
348
|
+
};
|
|
349
|
+
export type getCancellationRefundProgressResponse403 = {
|
|
350
|
+
data: Error;
|
|
351
|
+
status: 403;
|
|
352
|
+
};
|
|
353
|
+
export type getCancellationRefundProgressResponse404 = {
|
|
354
|
+
data: Error;
|
|
355
|
+
status: 404;
|
|
356
|
+
};
|
|
357
|
+
export type getCancellationRefundProgressResponse409 = {
|
|
358
|
+
data: Error;
|
|
359
|
+
status: 409;
|
|
360
|
+
};
|
|
361
|
+
export type getCancellationRefundProgressResponse503 = {
|
|
362
|
+
data: Error;
|
|
363
|
+
status: 503;
|
|
364
|
+
};
|
|
365
|
+
export type getCancellationRefundProgressResponseSuccess = getCancellationRefundProgressResponse200 & {
|
|
366
|
+
headers: Headers;
|
|
367
|
+
};
|
|
368
|
+
export type getCancellationRefundProgressResponseError = (getCancellationRefundProgressResponse400 | getCancellationRefundProgressResponse401 | getCancellationRefundProgressResponse403 | getCancellationRefundProgressResponse404 | getCancellationRefundProgressResponse409 | getCancellationRefundProgressResponse503) & {
|
|
369
|
+
headers: Headers;
|
|
370
|
+
};
|
|
371
|
+
export type getCancellationRefundProgressResponse = getCancellationRefundProgressResponseSuccess | getCancellationRefundProgressResponseError;
|
|
372
|
+
export declare const getGetCancellationRefundProgressUrl: (instanceId: string, cancellationId: string) => string;
|
|
373
|
+
/**
|
|
374
|
+
* Returns cancellation and refund progress for the specified instance. Unknown refund amounts and currencies are null. A completed cancellation does not confirm that money has been returned.
|
|
375
|
+
* @summary Get cancellation refund progress
|
|
376
|
+
*/
|
|
377
|
+
export declare const getCancellationRefundProgress: (instanceId: string, cancellationId: string, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<getCancellationRefundProgressResponse>;
|
|
378
|
+
export type rebootInstanceResponse202 = {
|
|
379
|
+
data: ManagementOperation;
|
|
380
|
+
status: 202;
|
|
381
|
+
};
|
|
382
|
+
export type rebootInstanceResponse400 = {
|
|
383
|
+
data: Error;
|
|
384
|
+
status: 400;
|
|
385
|
+
};
|
|
386
|
+
export type rebootInstanceResponse401 = {
|
|
387
|
+
data: Error;
|
|
388
|
+
status: 401;
|
|
389
|
+
};
|
|
390
|
+
export type rebootInstanceResponse403 = {
|
|
391
|
+
data: Error;
|
|
392
|
+
status: 403;
|
|
393
|
+
};
|
|
394
|
+
export type rebootInstanceResponse404 = {
|
|
395
|
+
data: Error;
|
|
396
|
+
status: 404;
|
|
397
|
+
};
|
|
398
|
+
export type rebootInstanceResponse409 = {
|
|
399
|
+
data: Error;
|
|
400
|
+
status: 409;
|
|
401
|
+
};
|
|
402
|
+
export type rebootInstanceResponse503 = {
|
|
403
|
+
data: Error;
|
|
404
|
+
status: 503;
|
|
405
|
+
};
|
|
406
|
+
export type rebootInstanceResponseSuccess = rebootInstanceResponse202 & {
|
|
407
|
+
headers: Headers;
|
|
408
|
+
};
|
|
409
|
+
export type rebootInstanceResponseError = (rebootInstanceResponse400 | rebootInstanceResponse401 | rebootInstanceResponse403 | rebootInstanceResponse404 | rebootInstanceResponse409 | rebootInstanceResponse503) & {
|
|
410
|
+
headers: Headers;
|
|
411
|
+
};
|
|
412
|
+
export type rebootInstanceResponse = rebootInstanceResponseSuccess | rebootInstanceResponseError;
|
|
413
|
+
export declare const getRebootInstanceUrl: (instanceId: string) => string;
|
|
414
|
+
/**
|
|
415
|
+
* Reboots an existing instance. Returns an operation to poll; an unchanged Running status does not confirm completion.
|
|
416
|
+
* @summary Reboot instance
|
|
417
|
+
*/
|
|
418
|
+
export declare const rebootInstance: (instanceId: string, rebootInstanceBody: RebootInstance, headers: RebootInstanceHeaders, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<rebootInstanceResponse>;
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
export const getListPlansUrl = (params) => {
|
|
2
|
+
const normalizedParams = new URLSearchParams();
|
|
3
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
4
|
+
if (value !== undefined) {
|
|
5
|
+
normalizedParams.append(key, value === null ? "null" : String(value));
|
|
6
|
+
}
|
|
7
|
+
});
|
|
8
|
+
const stringifiedParams = normalizedParams.toString();
|
|
9
|
+
return stringifiedParams.length > 0
|
|
10
|
+
? `https://swas.leaflow.cloud/api/v1/catalog/plans?${stringifiedParams}`
|
|
11
|
+
: `https://swas.leaflow.cloud/api/v1/catalog/plans`;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Lists available plans and prices for the requested region. A plan without a price is not available to buy.
|
|
15
|
+
* @summary List plans
|
|
16
|
+
*/
|
|
17
|
+
export const listPlans = async (params, options, fetchFn) => {
|
|
18
|
+
const res = await (fetchFn ?? fetch)(getListPlansUrl(params), {
|
|
19
|
+
...options,
|
|
20
|
+
method: "GET",
|
|
21
|
+
});
|
|
22
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
23
|
+
const data = body ? JSON.parse(body) : {};
|
|
24
|
+
return { data, status: res.status, headers: res.headers };
|
|
25
|
+
};
|
|
26
|
+
export const getCreatePurchaseUrl = () => {
|
|
27
|
+
return `https://swas.leaflow.cloud/api/v1/purchases`;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Creates a purchase using the current catalog revision and expected price. Reuse the same Idempotency-Key after a timeout. Acceptance is not confirmation of payment or instance delivery.
|
|
31
|
+
* @summary Create purchase
|
|
32
|
+
*/
|
|
33
|
+
export const createPurchase = async (purchaseCreate, headers, options, fetchFn) => {
|
|
34
|
+
const getHeaders = (h) => {
|
|
35
|
+
if (!h)
|
|
36
|
+
return {};
|
|
37
|
+
if (h instanceof Headers)
|
|
38
|
+
return Object.fromEntries(h.entries());
|
|
39
|
+
if (Symbol.iterator in h) {
|
|
40
|
+
return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
41
|
+
}
|
|
42
|
+
const headers = {};
|
|
43
|
+
for (const [name, value] of Object.entries(h)) {
|
|
44
|
+
if (value !== undefined)
|
|
45
|
+
headers[name] = value;
|
|
46
|
+
}
|
|
47
|
+
return headers;
|
|
48
|
+
};
|
|
49
|
+
const res = await (fetchFn ?? fetch)(getCreatePurchaseUrl(), {
|
|
50
|
+
...options,
|
|
51
|
+
method: "POST",
|
|
52
|
+
headers: { "Content-Type": "application/json", ...headers, ...getHeaders(options?.headers) },
|
|
53
|
+
body: JSON.stringify(purchaseCreate),
|
|
54
|
+
});
|
|
55
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
56
|
+
const data = body ? JSON.parse(body) : {};
|
|
57
|
+
return { data, status: res.status, headers: res.headers };
|
|
58
|
+
};
|
|
59
|
+
export const getGetPurchaseUrl = (purchaseId) => {
|
|
60
|
+
return `https://swas.leaflow.cloud/api/v1/purchases/${encodeURIComponent(String(purchaseId))}`;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Returns purchase, delivery and Billing progress. Payment and instance delivery may finish at different times.
|
|
64
|
+
* @summary Get purchase
|
|
65
|
+
*/
|
|
66
|
+
export const getPurchase = async (purchaseId, options, fetchFn) => {
|
|
67
|
+
const res = await (fetchFn ?? fetch)(getGetPurchaseUrl(purchaseId), {
|
|
68
|
+
...options,
|
|
69
|
+
method: "GET",
|
|
70
|
+
});
|
|
71
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
72
|
+
const data = body ? JSON.parse(body) : {};
|
|
73
|
+
return { data, status: res.status, headers: res.headers };
|
|
74
|
+
};
|
|
75
|
+
export const getListInstancesUrl = (params) => {
|
|
76
|
+
const normalizedParams = new URLSearchParams();
|
|
77
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
78
|
+
if (value !== undefined) {
|
|
79
|
+
normalizedParams.append(key, value === null ? "null" : String(value));
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
const stringifiedParams = normalizedParams.toString();
|
|
83
|
+
return stringifiedParams.length > 0
|
|
84
|
+
? `https://swas.leaflow.cloud/api/v1/instances?${stringifiedParams}`
|
|
85
|
+
: `https://swas.leaflow.cloud/api/v1/instances`;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Lists the current project's instances in the requested region. Pagination uses page and page_size; total_count is returned when known.
|
|
89
|
+
* @summary List instances
|
|
90
|
+
*/
|
|
91
|
+
export const listInstances = async (params, options, fetchFn) => {
|
|
92
|
+
const res = await (fetchFn ?? fetch)(getListInstancesUrl(params), {
|
|
93
|
+
...options,
|
|
94
|
+
method: "GET",
|
|
95
|
+
});
|
|
96
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
97
|
+
const data = body ? JSON.parse(body) : {};
|
|
98
|
+
return { data, status: res.status, headers: res.headers };
|
|
99
|
+
};
|
|
100
|
+
export const getGetInstanceUrl = (instanceId) => {
|
|
101
|
+
return `https://swas.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}`;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Returns an instance and its most recently observed status.
|
|
105
|
+
* @summary Get instance
|
|
106
|
+
*/
|
|
107
|
+
export const getInstance = async (instanceId, options, fetchFn) => {
|
|
108
|
+
const res = await (fetchFn ?? fetch)(getGetInstanceUrl(instanceId), {
|
|
109
|
+
...options,
|
|
110
|
+
method: "GET",
|
|
111
|
+
});
|
|
112
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
113
|
+
const data = body ? JSON.parse(body) : {};
|
|
114
|
+
return { data, status: res.status, headers: res.headers };
|
|
115
|
+
};
|
|
116
|
+
export const getStartInstanceUrl = (instanceId) => {
|
|
117
|
+
return `https://swas.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}:start`;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Starts an existing instance. Returns an operation to poll; acceptance is not completion.
|
|
121
|
+
* @summary Start instance
|
|
122
|
+
*/
|
|
123
|
+
export const startInstance = async (instanceId, startInstanceBody, headers, options, fetchFn) => {
|
|
124
|
+
const getHeaders = (h) => {
|
|
125
|
+
if (!h)
|
|
126
|
+
return {};
|
|
127
|
+
if (h instanceof Headers)
|
|
128
|
+
return Object.fromEntries(h.entries());
|
|
129
|
+
if (Symbol.iterator in h) {
|
|
130
|
+
return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
131
|
+
}
|
|
132
|
+
const headers = {};
|
|
133
|
+
for (const [name, value] of Object.entries(h)) {
|
|
134
|
+
if (value !== undefined)
|
|
135
|
+
headers[name] = value;
|
|
136
|
+
}
|
|
137
|
+
return headers;
|
|
138
|
+
};
|
|
139
|
+
const res = await (fetchFn ?? fetch)(getStartInstanceUrl(instanceId), {
|
|
140
|
+
...options,
|
|
141
|
+
method: "POST",
|
|
142
|
+
headers: { "Content-Type": "application/json", ...headers, ...getHeaders(options?.headers) },
|
|
143
|
+
body: JSON.stringify(startInstanceBody),
|
|
144
|
+
});
|
|
145
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
146
|
+
const data = body ? JSON.parse(body) : {};
|
|
147
|
+
return { data, status: res.status, headers: res.headers };
|
|
148
|
+
};
|
|
149
|
+
export const getGetInstanceOperationUrl = (instanceId, operationId) => {
|
|
150
|
+
return `https://swas.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/operations/${encodeURIComponent(String(operationId))}`;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Returns management progress for the specified instance. Unknown progress is not confirmation of success; do not repeat an operation solely because its outcome is unknown.
|
|
154
|
+
* @summary Get instance operation
|
|
155
|
+
*/
|
|
156
|
+
export const getInstanceOperation = async (instanceId, operationId, options, fetchFn) => {
|
|
157
|
+
const res = await (fetchFn ?? fetch)(getGetInstanceOperationUrl(instanceId, operationId), {
|
|
158
|
+
...options,
|
|
159
|
+
method: "GET",
|
|
160
|
+
});
|
|
161
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
162
|
+
const data = body ? JSON.parse(body) : {};
|
|
163
|
+
return { data, status: res.status, headers: res.headers };
|
|
164
|
+
};
|
|
165
|
+
export const getStopInstanceUrl = (instanceId) => {
|
|
166
|
+
return `https://swas.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}:stop`;
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Stops an existing instance. Returns an operation to poll; acceptance is not completion.
|
|
170
|
+
* @summary Stop instance
|
|
171
|
+
*/
|
|
172
|
+
export const stopInstance = async (instanceId, stopInstanceBody, headers, options, fetchFn) => {
|
|
173
|
+
const getHeaders = (h) => {
|
|
174
|
+
if (!h)
|
|
175
|
+
return {};
|
|
176
|
+
if (h instanceof Headers)
|
|
177
|
+
return Object.fromEntries(h.entries());
|
|
178
|
+
if (Symbol.iterator in h) {
|
|
179
|
+
return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
180
|
+
}
|
|
181
|
+
const headers = {};
|
|
182
|
+
for (const [name, value] of Object.entries(h)) {
|
|
183
|
+
if (value !== undefined)
|
|
184
|
+
headers[name] = value;
|
|
185
|
+
}
|
|
186
|
+
return headers;
|
|
187
|
+
};
|
|
188
|
+
const res = await (fetchFn ?? fetch)(getStopInstanceUrl(instanceId), {
|
|
189
|
+
...options,
|
|
190
|
+
method: "POST",
|
|
191
|
+
headers: { "Content-Type": "application/json", ...headers, ...getHeaders(options?.headers) },
|
|
192
|
+
body: JSON.stringify(stopInstanceBody),
|
|
193
|
+
});
|
|
194
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
195
|
+
const data = body ? JSON.parse(body) : {};
|
|
196
|
+
return { data, status: res.status, headers: res.headers };
|
|
197
|
+
};
|
|
198
|
+
export const getGetCancellationRefundProgressUrl = (instanceId, cancellationId) => {
|
|
199
|
+
return `https://swas.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/cancellations/${encodeURIComponent(String(cancellationId))}/refund-progress`;
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* Returns cancellation and refund progress for the specified instance. Unknown refund amounts and currencies are null. A completed cancellation does not confirm that money has been returned.
|
|
203
|
+
* @summary Get cancellation refund progress
|
|
204
|
+
*/
|
|
205
|
+
export const getCancellationRefundProgress = async (instanceId, cancellationId, options, fetchFn) => {
|
|
206
|
+
const res = await (fetchFn ?? fetch)(getGetCancellationRefundProgressUrl(instanceId, cancellationId), {
|
|
207
|
+
...options,
|
|
208
|
+
method: "GET",
|
|
209
|
+
});
|
|
210
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
211
|
+
const data = body ? JSON.parse(body) : {};
|
|
212
|
+
return {
|
|
213
|
+
data,
|
|
214
|
+
status: res.status,
|
|
215
|
+
headers: res.headers,
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
export const getRebootInstanceUrl = (instanceId) => {
|
|
219
|
+
return `https://swas.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}:reboot`;
|
|
220
|
+
};
|
|
221
|
+
/**
|
|
222
|
+
* Reboots an existing instance. Returns an operation to poll; an unchanged Running status does not confirm completion.
|
|
223
|
+
* @summary Reboot instance
|
|
224
|
+
*/
|
|
225
|
+
export const rebootInstance = async (instanceId, rebootInstanceBody, headers, options, fetchFn) => {
|
|
226
|
+
const getHeaders = (h) => {
|
|
227
|
+
if (!h)
|
|
228
|
+
return {};
|
|
229
|
+
if (h instanceof Headers)
|
|
230
|
+
return Object.fromEntries(h.entries());
|
|
231
|
+
if (Symbol.iterator in h) {
|
|
232
|
+
return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
233
|
+
}
|
|
234
|
+
const headers = {};
|
|
235
|
+
for (const [name, value] of Object.entries(h)) {
|
|
236
|
+
if (value !== undefined)
|
|
237
|
+
headers[name] = value;
|
|
238
|
+
}
|
|
239
|
+
return headers;
|
|
240
|
+
};
|
|
241
|
+
const res = await (fetchFn ?? fetch)(getRebootInstanceUrl(instanceId), {
|
|
242
|
+
...options,
|
|
243
|
+
method: "POST",
|
|
244
|
+
headers: { "Content-Type": "application/json", ...headers, ...getHeaders(options?.headers) },
|
|
245
|
+
body: JSON.stringify(rebootInstanceBody),
|
|
246
|
+
});
|
|
247
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
248
|
+
const data = body ? JSON.parse(body) : {};
|
|
249
|
+
return { data, status: res.status, headers: res.headers };
|
|
250
|
+
};
|