@stack-spot/portal-network 0.37.0 → 0.38.1
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/CHANGELOG.md +14 -0
- package/dist/api/cloudPlatform.d.ts +117 -58
- package/dist/api/cloudPlatform.d.ts.map +1 -1
- package/dist/api/cloudPlatform.js +78 -51
- package/dist/api/cloudPlatform.js.map +1 -1
- package/dist/client/cloud-platform.d.ts +39 -28
- package/dist/client/cloud-platform.d.ts.map +1 -1
- package/dist/client/cloud-platform.js +14 -13
- package/dist/client/cloud-platform.js.map +1 -1
- package/package.json +1 -1
- package/src/api/cloudPlatform.ts +276 -84
- package/src/client/cloud-platform.ts +14 -13
package/src/api/cloudPlatform.ts
CHANGED
|
@@ -18,12 +18,11 @@ export type ReplicasConfigRequest = {
|
|
|
18
18
|
/** Minimum number of replicas */
|
|
19
19
|
min?: number;
|
|
20
20
|
/** Maximum number of replicas */
|
|
21
|
-
max
|
|
22
|
-
cpu
|
|
21
|
+
max?: number;
|
|
22
|
+
cpu?: number;
|
|
23
23
|
};
|
|
24
24
|
export type CreateDeploymentRequest = {
|
|
25
25
|
applicationId?: string;
|
|
26
|
-
deploymentId?: string;
|
|
27
26
|
action: "DEPLOY" | "STOP" | "START" | "RESTART" | "REDEPLOY";
|
|
28
27
|
containerPort?: string;
|
|
29
28
|
healthCheckPath?: string;
|
|
@@ -38,46 +37,89 @@ export type CreateDeploymentRequest = {
|
|
|
38
37
|
cpu?: number;
|
|
39
38
|
replicaNum?: ReplicasConfigRequest;
|
|
40
39
|
};
|
|
41
|
-
export type
|
|
42
|
-
deploymentId
|
|
40
|
+
export type CreateDeploymentResponse = {
|
|
41
|
+
deploymentId?: string;
|
|
43
42
|
applicationUrl?: string;
|
|
44
43
|
action: "DEPLOY" | "STOP" | "START" | "RESTART" | "REDEPLOY";
|
|
45
44
|
containerPort?: string;
|
|
46
45
|
healthCheckPath?: string;
|
|
47
46
|
envVars?: {
|
|
48
47
|
[key: string]: string;
|
|
49
|
-
}
|
|
48
|
+
};
|
|
50
49
|
imageUrl?: string;
|
|
51
50
|
versionTag?: string;
|
|
52
51
|
health?: "HEALTH" | "UNHEALTH";
|
|
53
52
|
deploymentStatus?: "UP" | "STOPPED" | "DEPLOYING";
|
|
54
53
|
runtimeId?: string;
|
|
55
|
-
runtimeName?: string;
|
|
56
|
-
runtimeTags?: string[];
|
|
57
|
-
runtimeEnv?: string;
|
|
58
54
|
mem?: number;
|
|
59
55
|
cpu?: number;
|
|
60
56
|
replicaNum?: ReplicasConfigRequest;
|
|
61
57
|
awsAccount?: string;
|
|
62
58
|
idAwsAccount?: string;
|
|
63
59
|
};
|
|
60
|
+
export type ErrorResponse = {
|
|
61
|
+
message: string;
|
|
62
|
+
exception: {
|
|
63
|
+
cause?: {
|
|
64
|
+
stackTrace?: {
|
|
65
|
+
classLoaderName?: string;
|
|
66
|
+
moduleName?: string;
|
|
67
|
+
moduleVersion?: string;
|
|
68
|
+
methodName?: string;
|
|
69
|
+
fileName?: string;
|
|
70
|
+
lineNumber?: number;
|
|
71
|
+
className?: string;
|
|
72
|
+
nativeMethod?: boolean;
|
|
73
|
+
}[];
|
|
74
|
+
message?: string;
|
|
75
|
+
localizedMessage?: string;
|
|
76
|
+
};
|
|
77
|
+
stackTrace?: {
|
|
78
|
+
classLoaderName?: string;
|
|
79
|
+
moduleName?: string;
|
|
80
|
+
moduleVersion?: string;
|
|
81
|
+
methodName?: string;
|
|
82
|
+
fileName?: string;
|
|
83
|
+
lineNumber?: number;
|
|
84
|
+
className?: string;
|
|
85
|
+
nativeMethod?: boolean;
|
|
86
|
+
}[];
|
|
87
|
+
message?: string;
|
|
88
|
+
suppressed?: {
|
|
89
|
+
stackTrace?: {
|
|
90
|
+
classLoaderName?: string;
|
|
91
|
+
moduleName?: string;
|
|
92
|
+
moduleVersion?: string;
|
|
93
|
+
methodName?: string;
|
|
94
|
+
fileName?: string;
|
|
95
|
+
lineNumber?: number;
|
|
96
|
+
className?: string;
|
|
97
|
+
nativeMethod?: boolean;
|
|
98
|
+
}[];
|
|
99
|
+
message?: string;
|
|
100
|
+
localizedMessage?: string;
|
|
101
|
+
}[];
|
|
102
|
+
localizedMessage?: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
64
105
|
export type CreateApplicationRequest = {
|
|
65
106
|
/** The name of the application in kebab-case format. */
|
|
66
107
|
name: string;
|
|
67
108
|
/** The description of the application */
|
|
68
109
|
description: "CONTAINER";
|
|
69
110
|
/** The type of the application */
|
|
70
|
-
|
|
111
|
+
"type": "CONTAINER" | "STATIC";
|
|
112
|
+
creator: string;
|
|
71
113
|
/** The creator of the application. */
|
|
72
114
|
projectId: string;
|
|
73
115
|
};
|
|
74
116
|
export type ApplicationResponse = {
|
|
75
|
-
name
|
|
76
|
-
id
|
|
77
|
-
description
|
|
117
|
+
name?: string;
|
|
118
|
+
id?: string;
|
|
119
|
+
description?: string;
|
|
78
120
|
"type": "CONTAINER" | "STATIC";
|
|
79
|
-
creator
|
|
80
|
-
projectId
|
|
121
|
+
creator?: string;
|
|
122
|
+
projectId?: string;
|
|
81
123
|
url?: string;
|
|
82
124
|
createdAt?: string;
|
|
83
125
|
updatedAt?: string;
|
|
@@ -93,7 +135,7 @@ export type RuntimeResponse = {
|
|
|
93
135
|
"type": "CONTAINER" | "STATIC";
|
|
94
136
|
projectId: string;
|
|
95
137
|
tags: string[];
|
|
96
|
-
env
|
|
138
|
+
env?: string;
|
|
97
139
|
addons: AddOn[];
|
|
98
140
|
};
|
|
99
141
|
export type ListRuntimesResponse = {
|
|
@@ -103,12 +145,13 @@ export type ListRuntimesResponse = {
|
|
|
103
145
|
offset: number;
|
|
104
146
|
};
|
|
105
147
|
export type GetRuntimeByApplicationIdResponse = {
|
|
106
|
-
id
|
|
148
|
+
id?: string;
|
|
107
149
|
name: string;
|
|
108
150
|
description: string;
|
|
109
151
|
"type": "CONTAINER" | "STATIC";
|
|
110
152
|
projectId: string;
|
|
111
153
|
tags: string[];
|
|
154
|
+
env?: string;
|
|
112
155
|
addons: AddOn[];
|
|
113
156
|
};
|
|
114
157
|
export type ListRuntimeByApplicationResponse = {
|
|
@@ -117,10 +160,6 @@ export type ListRuntimeByApplicationResponse = {
|
|
|
117
160
|
limit: number;
|
|
118
161
|
offset: number;
|
|
119
162
|
};
|
|
120
|
-
export type GetRegistryByIdResponse = {
|
|
121
|
-
registryId?: string;
|
|
122
|
-
imageUri: string;
|
|
123
|
-
};
|
|
124
163
|
export type RepositoryResponse = {
|
|
125
164
|
repositoryName: string;
|
|
126
165
|
repositoryUri: string;
|
|
@@ -132,7 +171,7 @@ export type ListRepositoryResponse = {
|
|
|
132
171
|
offset: number;
|
|
133
172
|
};
|
|
134
173
|
export type GetRepositoryImagesResponse = {
|
|
135
|
-
|
|
174
|
+
imageUri: string[];
|
|
136
175
|
};
|
|
137
176
|
export type DeploymentStatusResponse = {
|
|
138
177
|
status: "UP" | "STOPPED" | "DEPLOYING";
|
|
@@ -145,14 +184,34 @@ export type DeploymentHealthResponse = {
|
|
|
145
184
|
};
|
|
146
185
|
export type BasicDeploymentResponse = {
|
|
147
186
|
deploymentId: string;
|
|
148
|
-
runtimeName
|
|
187
|
+
runtimeName?: string;
|
|
149
188
|
deploymentStatus?: "UP" | "STOPPED" | "DEPLOYING";
|
|
150
189
|
runtimeEnv: string;
|
|
151
190
|
};
|
|
191
|
+
export type DeploymentResponse = {
|
|
192
|
+
deploymentId?: string;
|
|
193
|
+
applicationUrl?: string;
|
|
194
|
+
action: "DEPLOY" | "STOP" | "START" | "RESTART" | "REDEPLOY";
|
|
195
|
+
containerPort?: string;
|
|
196
|
+
healthCheckPath?: string;
|
|
197
|
+
envVars?: {
|
|
198
|
+
[key: string]: string;
|
|
199
|
+
};
|
|
200
|
+
imageUrl?: string;
|
|
201
|
+
versionTag?: string;
|
|
202
|
+
health?: "HEALTH" | "UNHEALTH";
|
|
203
|
+
deploymentStatus?: "UP" | "STOPPED" | "DEPLOYING";
|
|
204
|
+
runtimeId?: string;
|
|
205
|
+
mem?: number;
|
|
206
|
+
cpu?: number;
|
|
207
|
+
replicaNum?: ReplicasConfigRequest;
|
|
208
|
+
awsAccount?: string;
|
|
209
|
+
idAwsAccount?: string;
|
|
210
|
+
};
|
|
152
211
|
export type ApplicationHistoryResponse = {
|
|
153
|
-
applicationId
|
|
212
|
+
applicationId?: string;
|
|
154
213
|
runtimeName: string;
|
|
155
|
-
creator
|
|
214
|
+
creator?: string;
|
|
156
215
|
action: "CREATED" | "DEPLOYED" | "STOPPED";
|
|
157
216
|
date: string;
|
|
158
217
|
};
|
|
@@ -170,86 +229,140 @@ export type ListApplicationsResponse = {
|
|
|
170
229
|
limit: number;
|
|
171
230
|
offset: number;
|
|
172
231
|
};
|
|
173
|
-
export function createDeployment({ createDeploymentRequest }: {
|
|
232
|
+
export function createDeployment({ authorization, createDeploymentRequest }: {
|
|
233
|
+
authorization: string;
|
|
174
234
|
createDeploymentRequest: CreateDeploymentRequest;
|
|
175
235
|
}, opts?: Oazapfts.RequestOpts) {
|
|
176
236
|
return oazapfts.ok(oazapfts.fetchJson<{
|
|
177
237
|
status: 200;
|
|
178
|
-
data:
|
|
238
|
+
data: CreateDeploymentResponse;
|
|
239
|
+
} | {
|
|
240
|
+
status: 500;
|
|
241
|
+
data: ErrorResponse;
|
|
242
|
+
} | {
|
|
243
|
+
status: 503;
|
|
244
|
+
data: ErrorResponse;
|
|
179
245
|
}>("/v1/deployments", oazapfts.json({
|
|
180
246
|
...opts,
|
|
181
247
|
method: "POST",
|
|
182
|
-
body: createDeploymentRequest
|
|
248
|
+
body: createDeploymentRequest,
|
|
249
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
250
|
+
Authorization: authorization
|
|
251
|
+
})
|
|
183
252
|
})));
|
|
184
253
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
*/
|
|
188
|
-
export function createApplication({ createApplicationRequest }: {
|
|
254
|
+
export function createApplication({ authorization, createApplicationRequest }: {
|
|
255
|
+
authorization: string;
|
|
189
256
|
createApplicationRequest: CreateApplicationRequest;
|
|
190
257
|
}, opts?: Oazapfts.RequestOpts) {
|
|
191
258
|
return oazapfts.ok(oazapfts.fetchJson<{
|
|
192
259
|
status: 200;
|
|
193
260
|
data: ApplicationResponse;
|
|
261
|
+
} | {
|
|
262
|
+
status: 500;
|
|
263
|
+
data: ErrorResponse;
|
|
264
|
+
} | {
|
|
265
|
+
status: 503;
|
|
266
|
+
data: ErrorResponse;
|
|
194
267
|
}>("/v1/applications", oazapfts.json({
|
|
195
268
|
...opts,
|
|
196
269
|
method: "POST",
|
|
197
|
-
body: createApplicationRequest
|
|
270
|
+
body: createApplicationRequest,
|
|
271
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
272
|
+
Authorization: authorization
|
|
273
|
+
})
|
|
198
274
|
})));
|
|
199
275
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
*/
|
|
203
|
-
export function getApplication({ applicationId }: {
|
|
276
|
+
export function getApplication({ authorization, applicationId }: {
|
|
277
|
+
authorization: string;
|
|
204
278
|
applicationId: string;
|
|
205
279
|
}, opts?: Oazapfts.RequestOpts) {
|
|
206
280
|
return oazapfts.ok(oazapfts.fetchJson<{
|
|
207
281
|
status: 200;
|
|
208
282
|
data: ApplicationResponse;
|
|
283
|
+
} | {
|
|
284
|
+
status: 500;
|
|
285
|
+
data: ErrorResponse;
|
|
286
|
+
} | {
|
|
287
|
+
status: 503;
|
|
288
|
+
data: ErrorResponse;
|
|
209
289
|
}>(`/v1/applications/${encodeURIComponent(applicationId)}`, {
|
|
210
|
-
...opts
|
|
290
|
+
...opts,
|
|
291
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
292
|
+
Authorization: authorization
|
|
293
|
+
})
|
|
211
294
|
}));
|
|
212
295
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
export function updateApplication({ createApplicationRequest }: {
|
|
296
|
+
export function updateApplication({ authorization, applicationId, createApplicationRequest }: {
|
|
297
|
+
authorization: string;
|
|
298
|
+
applicationId: string;
|
|
217
299
|
createApplicationRequest: CreateApplicationRequest;
|
|
218
300
|
}, opts?: Oazapfts.RequestOpts) {
|
|
219
301
|
return oazapfts.ok(oazapfts.fetchJson<{
|
|
220
302
|
status: 200;
|
|
221
303
|
data: ApplicationResponse;
|
|
304
|
+
} | {
|
|
305
|
+
status: 500;
|
|
306
|
+
data: ErrorResponse;
|
|
307
|
+
} | {
|
|
308
|
+
status: 503;
|
|
309
|
+
data: ErrorResponse;
|
|
222
310
|
}>(`/v1/applications/${encodeURIComponent(applicationId)}`, oazapfts.json({
|
|
223
311
|
...opts,
|
|
224
312
|
method: "PATCH",
|
|
225
|
-
body: createApplicationRequest
|
|
313
|
+
body: createApplicationRequest,
|
|
314
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
315
|
+
Authorization: authorization
|
|
316
|
+
})
|
|
226
317
|
})));
|
|
227
318
|
}
|
|
228
|
-
export function getRuntimeById({ runtimeId }: {
|
|
319
|
+
export function getRuntimeById({ authorization, runtimeId }: {
|
|
320
|
+
authorization: string;
|
|
229
321
|
runtimeId: string;
|
|
230
322
|
}, opts?: Oazapfts.RequestOpts) {
|
|
231
323
|
return oazapfts.ok(oazapfts.fetchJson<{
|
|
232
324
|
status: 200;
|
|
233
325
|
data: RuntimeResponse;
|
|
326
|
+
} | {
|
|
327
|
+
status: 500;
|
|
328
|
+
data: ErrorResponse;
|
|
329
|
+
} | {
|
|
330
|
+
status: 503;
|
|
331
|
+
data: ErrorResponse;
|
|
234
332
|
}>(`/v1/runtimes/${encodeURIComponent(runtimeId)}`, {
|
|
235
|
-
...opts
|
|
333
|
+
...opts,
|
|
334
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
335
|
+
Authorization: authorization
|
|
336
|
+
})
|
|
236
337
|
}));
|
|
237
338
|
}
|
|
238
|
-
export function listRuntimes({ limit, offset }: {
|
|
339
|
+
export function listRuntimes({ authorization, projectId, limit, offset }: {
|
|
340
|
+
authorization: string;
|
|
341
|
+
projectId: string;
|
|
239
342
|
limit?: number;
|
|
240
343
|
offset?: number;
|
|
241
344
|
}, opts?: Oazapfts.RequestOpts) {
|
|
242
345
|
return oazapfts.ok(oazapfts.fetchJson<{
|
|
243
346
|
status: 200;
|
|
244
347
|
data: ListRuntimesResponse;
|
|
245
|
-
}
|
|
348
|
+
} | {
|
|
349
|
+
status: 500;
|
|
350
|
+
data: ErrorResponse;
|
|
351
|
+
} | {
|
|
352
|
+
status: 503;
|
|
353
|
+
data: ErrorResponse;
|
|
354
|
+
}>(`/v1/runtimes/projects/${encodeURIComponent(projectId)}${QS.query(QS.explode({
|
|
246
355
|
limit,
|
|
247
356
|
offset
|
|
248
357
|
}))}`, {
|
|
249
|
-
...opts
|
|
358
|
+
...opts,
|
|
359
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
360
|
+
Authorization: authorization
|
|
361
|
+
})
|
|
250
362
|
}));
|
|
251
363
|
}
|
|
252
|
-
export function getRuntimeByApplicationId({ applicationId, limit, offset }: {
|
|
364
|
+
export function getRuntimeByApplicationId({ authorization, applicationId, limit, offset }: {
|
|
365
|
+
authorization: string;
|
|
253
366
|
applicationId: string;
|
|
254
367
|
limit?: number;
|
|
255
368
|
offset?: number;
|
|
@@ -257,76 +370,124 @@ export function getRuntimeByApplicationId({ applicationId, limit, offset }: {
|
|
|
257
370
|
return oazapfts.ok(oazapfts.fetchJson<{
|
|
258
371
|
status: 200;
|
|
259
372
|
data: ListRuntimeByApplicationResponse;
|
|
373
|
+
} | {
|
|
374
|
+
status: 500;
|
|
375
|
+
data: ErrorResponse;
|
|
376
|
+
} | {
|
|
377
|
+
status: 503;
|
|
378
|
+
data: ErrorResponse;
|
|
260
379
|
}>(`/v1/runtimes/application/${encodeURIComponent(applicationId)}${QS.query(QS.explode({
|
|
261
380
|
limit,
|
|
262
381
|
offset
|
|
263
382
|
}))}`, {
|
|
264
|
-
...opts
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
registryId: string;
|
|
269
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
270
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
271
|
-
status: 200;
|
|
272
|
-
data: GetRegistryByIdResponse;
|
|
273
|
-
}>(`/v1/registries/${encodeURIComponent(registryId)}`, {
|
|
274
|
-
...opts
|
|
383
|
+
...opts,
|
|
384
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
385
|
+
Authorization: authorization
|
|
386
|
+
})
|
|
275
387
|
}));
|
|
276
388
|
}
|
|
277
|
-
export function listRepositories({
|
|
278
|
-
|
|
389
|
+
export function listRepositories({ authorization, limit, offset }: {
|
|
390
|
+
authorization: string;
|
|
279
391
|
limit?: number;
|
|
280
392
|
offset?: number;
|
|
281
393
|
}, opts?: Oazapfts.RequestOpts) {
|
|
282
394
|
return oazapfts.ok(oazapfts.fetchJson<{
|
|
283
395
|
status: 200;
|
|
284
396
|
data: ListRepositoryResponse;
|
|
285
|
-
}
|
|
397
|
+
} | {
|
|
398
|
+
status: 500;
|
|
399
|
+
data: ErrorResponse;
|
|
400
|
+
} | {
|
|
401
|
+
status: 503;
|
|
402
|
+
data: ErrorResponse;
|
|
403
|
+
}>(`/v1/registries/repositories${QS.query(QS.explode({
|
|
286
404
|
limit,
|
|
287
405
|
offset
|
|
288
406
|
}))}`, {
|
|
289
|
-
...opts
|
|
407
|
+
...opts,
|
|
408
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
409
|
+
Authorization: authorization
|
|
410
|
+
})
|
|
290
411
|
}));
|
|
291
412
|
}
|
|
292
|
-
export function getRepositoryImages({ repositoryId }: {
|
|
413
|
+
export function getRepositoryImages({ authorization, repositoryId }: {
|
|
414
|
+
authorization: string;
|
|
293
415
|
repositoryId: string;
|
|
294
416
|
}, opts?: Oazapfts.RequestOpts) {
|
|
295
417
|
return oazapfts.ok(oazapfts.fetchJson<{
|
|
296
418
|
status: 200;
|
|
297
419
|
data: GetRepositoryImagesResponse;
|
|
420
|
+
} | {
|
|
421
|
+
status: 500;
|
|
422
|
+
data: ErrorResponse;
|
|
423
|
+
} | {
|
|
424
|
+
status: 503;
|
|
425
|
+
data: ErrorResponse;
|
|
298
426
|
}>(`/v1/registries/repositories/${encodeURIComponent(repositoryId)}/images`, {
|
|
299
|
-
...opts
|
|
427
|
+
...opts,
|
|
428
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
429
|
+
Authorization: authorization
|
|
430
|
+
})
|
|
300
431
|
}));
|
|
301
432
|
}
|
|
302
|
-
export function getDeploymentStatus({ deploymentId }: {
|
|
433
|
+
export function getDeploymentStatus({ authorization, deploymentId }: {
|
|
434
|
+
authorization: string;
|
|
303
435
|
deploymentId: string;
|
|
304
436
|
}, opts?: Oazapfts.RequestOpts) {
|
|
305
437
|
return oazapfts.ok(oazapfts.fetchJson<{
|
|
306
438
|
status: 200;
|
|
307
439
|
data: DeploymentStatusResponse;
|
|
440
|
+
} | {
|
|
441
|
+
status: 500;
|
|
442
|
+
data: ErrorResponse;
|
|
443
|
+
} | {
|
|
444
|
+
status: 503;
|
|
445
|
+
data: ErrorResponse;
|
|
308
446
|
}>(`/v1/deployments/${encodeURIComponent(deploymentId)}/status`, {
|
|
309
|
-
...opts
|
|
447
|
+
...opts,
|
|
448
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
449
|
+
Authorization: authorization
|
|
450
|
+
})
|
|
310
451
|
}));
|
|
311
452
|
}
|
|
312
|
-
export function getDeploymentLogs({ deploymentId }: {
|
|
453
|
+
export function getDeploymentLogs({ authorization, deploymentId }: {
|
|
454
|
+
authorization: string;
|
|
313
455
|
deploymentId: string;
|
|
314
456
|
}, opts?: Oazapfts.RequestOpts) {
|
|
315
457
|
return oazapfts.ok(oazapfts.fetchJson<{
|
|
316
458
|
status: 200;
|
|
317
459
|
data: DeploymentLogResponse;
|
|
460
|
+
} | {
|
|
461
|
+
status: 500;
|
|
462
|
+
data: ErrorResponse;
|
|
463
|
+
} | {
|
|
464
|
+
status: 503;
|
|
465
|
+
data: ErrorResponse;
|
|
318
466
|
}>(`/v1/deployments/${encodeURIComponent(deploymentId)}/logs`, {
|
|
319
|
-
...opts
|
|
467
|
+
...opts,
|
|
468
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
469
|
+
Authorization: authorization
|
|
470
|
+
})
|
|
320
471
|
}));
|
|
321
472
|
}
|
|
322
|
-
export function getDeploymentHealth({ deploymentId }: {
|
|
473
|
+
export function getDeploymentHealth({ authorization, deploymentId }: {
|
|
474
|
+
authorization: string;
|
|
323
475
|
deploymentId: string;
|
|
324
476
|
}, opts?: Oazapfts.RequestOpts) {
|
|
325
477
|
return oazapfts.ok(oazapfts.fetchJson<{
|
|
326
478
|
status: 200;
|
|
327
479
|
data: DeploymentHealthResponse;
|
|
480
|
+
} | {
|
|
481
|
+
status: 500;
|
|
482
|
+
data: ErrorResponse;
|
|
483
|
+
} | {
|
|
484
|
+
status: 503;
|
|
485
|
+
data: ErrorResponse;
|
|
328
486
|
}>(`/v1/deployments/${encodeURIComponent(deploymentId)}/health`, {
|
|
329
|
-
...opts
|
|
487
|
+
...opts,
|
|
488
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
489
|
+
Authorization: authorization
|
|
490
|
+
})
|
|
330
491
|
}));
|
|
331
492
|
}
|
|
332
493
|
export function listDeployments({ applicationId }: {
|
|
@@ -335,21 +496,38 @@ export function listDeployments({ applicationId }: {
|
|
|
335
496
|
return oazapfts.ok(oazapfts.fetchJson<{
|
|
336
497
|
status: 200;
|
|
337
498
|
data: BasicDeploymentResponse[];
|
|
499
|
+
} | {
|
|
500
|
+
status: 500;
|
|
501
|
+
data: ErrorResponse;
|
|
502
|
+
} | {
|
|
503
|
+
status: 503;
|
|
504
|
+
data: ErrorResponse;
|
|
338
505
|
}>(`/v1/deployments/${encodeURIComponent(applicationId)}`, {
|
|
339
506
|
...opts
|
|
340
507
|
}));
|
|
341
508
|
}
|
|
342
|
-
export function getDeployment({ deploymentId }: {
|
|
509
|
+
export function getDeployment({ authorization, deploymentId }: {
|
|
510
|
+
authorization: string;
|
|
343
511
|
deploymentId: string;
|
|
344
512
|
}, opts?: Oazapfts.RequestOpts) {
|
|
345
513
|
return oazapfts.ok(oazapfts.fetchJson<{
|
|
346
514
|
status: 200;
|
|
347
515
|
data: DeploymentResponse;
|
|
516
|
+
} | {
|
|
517
|
+
status: 500;
|
|
518
|
+
data: ErrorResponse;
|
|
519
|
+
} | {
|
|
520
|
+
status: 503;
|
|
521
|
+
data: ErrorResponse;
|
|
348
522
|
}>(`/v1/deployments/details/${encodeURIComponent(deploymentId)}`, {
|
|
349
|
-
...opts
|
|
523
|
+
...opts,
|
|
524
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
525
|
+
Authorization: authorization
|
|
526
|
+
})
|
|
350
527
|
}));
|
|
351
528
|
}
|
|
352
|
-
export function getApplicationHistory({ applicationId, limit, offset }: {
|
|
529
|
+
export function getApplicationHistory({ authorization, applicationId, limit, offset }: {
|
|
530
|
+
authorization: string;
|
|
353
531
|
applicationId: string;
|
|
354
532
|
limit?: number;
|
|
355
533
|
offset?: number;
|
|
@@ -357,30 +535,44 @@ export function getApplicationHistory({ applicationId, limit, offset }: {
|
|
|
357
535
|
return oazapfts.ok(oazapfts.fetchJson<{
|
|
358
536
|
status: 200;
|
|
359
537
|
data: ListApplicationHistoryResponse;
|
|
538
|
+
} | {
|
|
539
|
+
status: 500;
|
|
540
|
+
data: ErrorResponse;
|
|
541
|
+
} | {
|
|
542
|
+
status: 503;
|
|
543
|
+
data: ErrorResponse;
|
|
360
544
|
}>(`/v1/applications/${encodeURIComponent(applicationId)}/history${QS.query(QS.explode({
|
|
361
545
|
limit,
|
|
362
546
|
offset
|
|
363
547
|
}))}`, {
|
|
364
|
-
...opts
|
|
548
|
+
...opts,
|
|
549
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
550
|
+
Authorization: authorization
|
|
551
|
+
})
|
|
365
552
|
}));
|
|
366
553
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
*/
|
|
370
|
-
export function listApplications({ projectId, limit, offset, name }: {
|
|
554
|
+
export function listApplications({ authorization, projectId, limit, offset }: {
|
|
555
|
+
authorization: string;
|
|
371
556
|
projectId: string;
|
|
372
557
|
limit?: number;
|
|
373
558
|
offset?: number;
|
|
374
|
-
name?: string;
|
|
375
559
|
}, opts?: Oazapfts.RequestOpts) {
|
|
376
560
|
return oazapfts.ok(oazapfts.fetchJson<{
|
|
377
561
|
status: 200;
|
|
378
562
|
data: ListApplicationsResponse;
|
|
563
|
+
} | {
|
|
564
|
+
status: 500;
|
|
565
|
+
data: ErrorResponse;
|
|
566
|
+
} | {
|
|
567
|
+
status: 503;
|
|
568
|
+
data: ErrorResponse;
|
|
379
569
|
}>(`/v1/applications/project/${encodeURIComponent(projectId)}${QS.query(QS.explode({
|
|
380
570
|
limit,
|
|
381
|
-
offset
|
|
382
|
-
name
|
|
571
|
+
offset
|
|
383
572
|
}))}`, {
|
|
384
|
-
...opts
|
|
573
|
+
...opts,
|
|
574
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
575
|
+
Authorization: authorization
|
|
576
|
+
})
|
|
385
577
|
}));
|
|
386
578
|
}
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
listRepositories,
|
|
21
21
|
listRuntimes,
|
|
22
22
|
} from '../api/cloudPlatform'
|
|
23
|
+
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
23
24
|
|
|
24
25
|
class CloudPlatformClient extends ReactQueryNetworkClient {
|
|
25
26
|
constructor() {
|
|
@@ -32,55 +33,55 @@ class CloudPlatformClient extends ReactQueryNetworkClient {
|
|
|
32
33
|
/**
|
|
33
34
|
* Get list of applications
|
|
34
35
|
*/
|
|
35
|
-
listApplications = this.query(listApplications)
|
|
36
|
+
listApplications = this.query(removeAuthorizationParam(listApplications))
|
|
36
37
|
/**
|
|
37
38
|
* Get an application by id
|
|
38
39
|
*/
|
|
39
|
-
application = this.query(getApplication)
|
|
40
|
+
application = this.query(removeAuthorizationParam(getApplication))
|
|
40
41
|
/**
|
|
41
42
|
* Get an application history
|
|
42
43
|
*/
|
|
43
|
-
applicationHistory = this.query(getApplicationHistory)
|
|
44
|
+
applicationHistory = this.query(removeAuthorizationParam(getApplicationHistory))
|
|
44
45
|
/**
|
|
45
46
|
* Get list of application deployments
|
|
46
47
|
*/
|
|
47
|
-
listApplicationDeployments = this.query(listDeployments)
|
|
48
|
+
listApplicationDeployments = this.query(removeAuthorizationParam(listDeployments))
|
|
48
49
|
/**
|
|
49
50
|
* Get an application deployment by id
|
|
50
51
|
*/
|
|
51
|
-
applicationDeployment = this.query(getDeployment)
|
|
52
|
+
applicationDeployment = this.query(removeAuthorizationParam(getDeployment))
|
|
52
53
|
/**
|
|
53
54
|
* Get an application deployment status
|
|
54
55
|
*/
|
|
55
|
-
applicationDeploymentStatus = this.query(getDeploymentStatus)
|
|
56
|
+
applicationDeploymentStatus = this.query(removeAuthorizationParam(getDeploymentStatus))
|
|
56
57
|
/**
|
|
57
58
|
* Get an application deployment health
|
|
58
59
|
*/
|
|
59
|
-
applicationDeploymentHealth = this.query(getDeploymentHealth)
|
|
60
|
+
applicationDeploymentHealth = this.query(removeAuthorizationParam(getDeploymentHealth))
|
|
60
61
|
/**
|
|
61
62
|
* Get an application deployment logs
|
|
62
63
|
*/
|
|
63
|
-
applicationDeploymentLogs = this.query(getDeploymentLogs)
|
|
64
|
+
applicationDeploymentLogs = this.query(removeAuthorizationParam(getDeploymentLogs))
|
|
64
65
|
/**
|
|
65
66
|
* Get an application runtimes
|
|
66
67
|
*/
|
|
67
|
-
listApplicationRuntimes = this.query(listRuntimes)
|
|
68
|
+
listApplicationRuntimes = this.query(removeAuthorizationParam(listRuntimes))
|
|
68
69
|
/**
|
|
69
70
|
* Get list of repositories
|
|
70
71
|
*/
|
|
71
|
-
listRepositories = this.query(listRepositories)
|
|
72
|
+
listRepositories = this.query(removeAuthorizationParam(listRepositories))
|
|
72
73
|
/**
|
|
73
74
|
* Get list of images from a repository
|
|
74
75
|
*/
|
|
75
|
-
listRepositoryImages = this.query(getRepositoryImages)
|
|
76
|
+
listRepositoryImages = this.query(removeAuthorizationParam(getRepositoryImages))
|
|
76
77
|
/**
|
|
77
78
|
* Create a deploy of the application
|
|
78
79
|
*/
|
|
79
|
-
createDeployment = this.mutation(createDeployment)
|
|
80
|
+
createDeployment = this.mutation(removeAuthorizationParam(createDeployment))
|
|
80
81
|
/**
|
|
81
82
|
* Create an application
|
|
82
83
|
*/
|
|
83
|
-
createApplication = this.mutation(createApplication)
|
|
84
|
+
createApplication = this.mutation(removeAuthorizationParam(createApplication))
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
export const cloudPlatformClient = new CloudPlatformClient()
|