@stack-spot/portal-network 0.59.0 → 0.61.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.
@@ -18,6 +18,10 @@ export type EnvVar = {
18
18
  key: string;
19
19
  value: string;
20
20
  };
21
+ export type SecretVar = {
22
+ key: string;
23
+ value: string;
24
+ };
21
25
  export type ReplicaNum = {
22
26
  min?: number;
23
27
  max?: number;
@@ -33,6 +37,7 @@ export type CreateDeploymentRequestV2 = {
33
37
  tag: string;
34
38
  mem?: number;
35
39
  envVars?: EnvVar[];
40
+ secretVars?: SecretVar[];
36
41
  cpu?: number;
37
42
  replicaNum?: ReplicaNum;
38
43
  awsAccount?: string;
@@ -60,6 +65,7 @@ export type CreateDeploymentResponseV2 = {
60
65
  tag: string;
61
66
  mem?: number;
62
67
  envVars?: EnvVar[];
68
+ secretVars?: SecretVar[];
63
69
  cpu?: number;
64
70
  replicaNum?: ReplicaNum;
65
71
  awsAccount: string;
@@ -220,6 +226,21 @@ export type GetApplicationByUlidResponseV2 = {
220
226
  createdAt?: string;
221
227
  updatedAt?: string;
222
228
  };
229
+ export type GetInstanceResponse = {
230
+ used: number;
231
+ available: number;
232
+ };
233
+ export type ApplicationHistoryResponse = {
234
+ applicationId?: string;
235
+ runtimeName?: string;
236
+ creator?: string;
237
+ action: string;
238
+ date: string;
239
+ };
240
+ export type ListApplicationHistoryResponse = {
241
+ applicationId: string;
242
+ applicationHistory: ApplicationHistoryResponse[];
243
+ };
223
244
  export type BasicDeploymentResponse = {
224
245
  deploymentId: string;
225
246
  runtimeName: string;
@@ -312,7 +333,8 @@ export type GetApplicationByUlidResponse = {
312
333
  createdAt?: string;
313
334
  updatedAt?: string;
314
335
  };
315
- export function createDeployment({ createDeploymentRequestV2 }: {
336
+ export function createDeployment({ authorization, createDeploymentRequestV2 }: {
337
+ authorization: string;
316
338
  createDeploymentRequestV2: CreateDeploymentRequestV2;
317
339
  }, opts?: Oazapfts.RequestOpts) {
318
340
  return oazapfts.ok(oazapfts.fetchJson<{
@@ -345,10 +367,14 @@ export function createDeployment({ createDeploymentRequestV2 }: {
345
367
  }>("/v2/deployments", oazapfts.json({
346
368
  ...opts,
347
369
  method: "POST",
348
- body: createDeploymentRequestV2
370
+ body: createDeploymentRequestV2,
371
+ headers: oazapfts.mergeHeaders(opts?.headers, {
372
+ Authorization: authorization
373
+ })
349
374
  })));
350
375
  }
351
- export function setAutoscallihng({ setAutoscalingRequest }: {
376
+ export function setAutoscalihng({ authorization, setAutoscalingRequest }: {
377
+ authorization: string;
352
378
  setAutoscalingRequest: SetAutoscalingRequest;
353
379
  }, opts?: Oazapfts.RequestOpts) {
354
380
  return oazapfts.ok(oazapfts.fetchJson<{
@@ -378,13 +404,91 @@ export function setAutoscallihng({ setAutoscalingRequest }: {
378
404
  status?: StatusType;
379
405
  detail?: string;
380
406
  };
381
- }>("/v2/deployments/autoscalling", oazapfts.json({
407
+ }>("/v2/deployments/autoscaling", oazapfts.json({
382
408
  ...opts,
383
409
  method: "POST",
384
- body: setAutoscalingRequest
410
+ body: setAutoscalingRequest,
411
+ headers: oazapfts.mergeHeaders(opts?.headers, {
412
+ Authorization: authorization
413
+ })
385
414
  })));
386
415
  }
387
- export function createApplication({ applicationDtov2 }: {
416
+ export function cleanDeployments({ authorization }: {
417
+ authorization: string;
418
+ }, opts?: Oazapfts.RequestOpts) {
419
+ return oazapfts.ok(oazapfts.fetchJson<{
420
+ status: 200;
421
+ } | {
422
+ status: 422;
423
+ data: {
424
+ instance?: string;
425
+ "type"?: string;
426
+ parameters?: {
427
+ [key: string]: object;
428
+ };
429
+ title?: string;
430
+ status?: StatusType;
431
+ detail?: string;
432
+ };
433
+ } | {
434
+ status: 500;
435
+ data: {
436
+ instance?: string;
437
+ "type"?: string;
438
+ parameters?: {
439
+ [key: string]: object;
440
+ };
441
+ title?: string;
442
+ status?: StatusType;
443
+ detail?: string;
444
+ };
445
+ }>("/v2/clean/deployments", {
446
+ ...opts,
447
+ method: "POST",
448
+ headers: oazapfts.mergeHeaders(opts?.headers, {
449
+ Authorization: authorization
450
+ })
451
+ }));
452
+ }
453
+ export function cleanApplications({ authorization }: {
454
+ authorization: string;
455
+ }, opts?: Oazapfts.RequestOpts) {
456
+ return oazapfts.ok(oazapfts.fetchJson<{
457
+ status: 200;
458
+ } | {
459
+ status: 422;
460
+ data: {
461
+ instance?: string;
462
+ "type"?: string;
463
+ parameters?: {
464
+ [key: string]: object;
465
+ };
466
+ title?: string;
467
+ status?: StatusType;
468
+ detail?: string;
469
+ };
470
+ } | {
471
+ status: 500;
472
+ data: {
473
+ instance?: string;
474
+ "type"?: string;
475
+ parameters?: {
476
+ [key: string]: object;
477
+ };
478
+ title?: string;
479
+ status?: StatusType;
480
+ detail?: string;
481
+ };
482
+ }>("/v2/clean/applications", {
483
+ ...opts,
484
+ method: "POST",
485
+ headers: oazapfts.mergeHeaders(opts?.headers, {
486
+ Authorization: authorization
487
+ })
488
+ }));
489
+ }
490
+ export function createApplication({ authorization, applicationDtov2 }: {
491
+ authorization: string;
388
492
  applicationDtov2: ApplicationDtov2;
389
493
  }, opts?: Oazapfts.RequestOpts) {
390
494
  return oazapfts.ok(oazapfts.fetchJson<{
@@ -417,10 +521,14 @@ export function createApplication({ applicationDtov2 }: {
417
521
  }>("/v2/applications", oazapfts.json({
418
522
  ...opts,
419
523
  method: "POST",
420
- body: applicationDtov2
524
+ body: applicationDtov2,
525
+ headers: oazapfts.mergeHeaders(opts?.headers, {
526
+ Authorization: authorization
527
+ })
421
528
  })));
422
529
  }
423
- export function stopApplication({ applicationId, runtimeId }: {
530
+ export function stopApplication({ authorization, applicationId, runtimeId }: {
531
+ authorization: string;
424
532
  applicationId: string;
425
533
  runtimeId: string;
426
534
  }, opts?: Oazapfts.RequestOpts) {
@@ -456,10 +564,14 @@ export function stopApplication({ applicationId, runtimeId }: {
456
564
  runtimeId
457
565
  }))}`, {
458
566
  ...opts,
459
- method: "POST"
567
+ method: "POST",
568
+ headers: oazapfts.mergeHeaders(opts?.headers, {
569
+ Authorization: authorization
570
+ })
460
571
  }));
461
572
  }
462
- export function startApplication({ applicationId, runtimeId }: {
573
+ export function startApplication({ authorization, applicationId, runtimeId }: {
574
+ authorization: string;
463
575
  applicationId: string;
464
576
  runtimeId: string;
465
577
  }, opts?: Oazapfts.RequestOpts) {
@@ -495,7 +607,53 @@ export function startApplication({ applicationId, runtimeId }: {
495
607
  runtimeId
496
608
  }))}`, {
497
609
  ...opts,
498
- method: "POST"
610
+ method: "POST",
611
+ headers: oazapfts.mergeHeaders(opts?.headers, {
612
+ Authorization: authorization
613
+ })
614
+ }));
615
+ }
616
+ export function restartApplication({ authorization, applicationId, runtimeId }: {
617
+ authorization: string;
618
+ applicationId: string;
619
+ runtimeId: string;
620
+ }, opts?: Oazapfts.RequestOpts) {
621
+ return oazapfts.ok(oazapfts.fetchJson<{
622
+ status: 200;
623
+ data: object;
624
+ } | {
625
+ status: 422;
626
+ data: {
627
+ instance?: string;
628
+ "type"?: string;
629
+ parameters?: {
630
+ [key: string]: object;
631
+ };
632
+ title?: string;
633
+ status?: StatusType;
634
+ detail?: string;
635
+ };
636
+ } | {
637
+ status: 500;
638
+ data: {
639
+ instance?: string;
640
+ "type"?: string;
641
+ parameters?: {
642
+ [key: string]: object;
643
+ };
644
+ title?: string;
645
+ status?: StatusType;
646
+ detail?: string;
647
+ };
648
+ }>(`/v2/applications/restart${QS.query(QS.explode({
649
+ applicationId,
650
+ runtimeId
651
+ }))}`, {
652
+ ...opts,
653
+ method: "POST",
654
+ headers: oazapfts.mergeHeaders(opts?.headers, {
655
+ Authorization: authorization
656
+ })
499
657
  }));
500
658
  }
501
659
  export function createRuntimeTag({ tagId, runtimeId }: {
@@ -986,13 +1144,12 @@ export function getDeploymentHealth({ deploymentId }: {
986
1144
  ...opts
987
1145
  }));
988
1146
  }
989
- export function getApplicationHistory({ projectId, limit, offset }: {
990
- projectId: string;
991
- limit?: number;
992
- offset?: number;
1147
+ export function getApplication({ applicationId }: {
1148
+ applicationId: string;
993
1149
  }, opts?: Oazapfts.RequestOpts) {
994
1150
  return oazapfts.ok(oazapfts.fetchJson<{
995
1151
  status: 200;
1152
+ data: GetApplicationByUlidResponseV2;
996
1153
  } | {
997
1154
  status: 422;
998
1155
  data: {
@@ -1017,19 +1174,17 @@ export function getApplicationHistory({ projectId, limit, offset }: {
1017
1174
  status?: StatusType;
1018
1175
  detail?: string;
1019
1176
  };
1020
- }>(`/v2/applications/${encodeURIComponent(projectId)}/history${QS.query(QS.explode({
1021
- limit,
1022
- offset
1023
- }))}`, {
1177
+ }>(`/v2/applications/${encodeURIComponent(applicationId)}`, {
1024
1178
  ...opts
1025
1179
  }));
1026
1180
  }
1027
- export function getApplication({ applicationId }: {
1181
+ export function getSecrets({ applicationId, runtimeId }: {
1028
1182
  applicationId: string;
1183
+ runtimeId: string;
1029
1184
  }, opts?: Oazapfts.RequestOpts) {
1030
1185
  return oazapfts.ok(oazapfts.fetchJson<{
1031
1186
  status: 200;
1032
- data: GetApplicationByUlidResponseV2;
1187
+ data: SecretVar[];
1033
1188
  } | {
1034
1189
  status: 422;
1035
1190
  data: {
@@ -1054,7 +1209,76 @@ export function getApplication({ applicationId }: {
1054
1209
  status?: StatusType;
1055
1210
  detail?: string;
1056
1211
  };
1057
- }>(`/v2/applications/${encodeURIComponent(applicationId)}`, {
1212
+ }>(`/v2/applications/${encodeURIComponent(applicationId)}/${encodeURIComponent(runtimeId)}/secrets`, {
1213
+ ...opts
1214
+ }));
1215
+ }
1216
+ export function getInstances({ applicationId, runtimeId }: {
1217
+ applicationId: string;
1218
+ runtimeId: string;
1219
+ }, opts?: Oazapfts.RequestOpts) {
1220
+ return oazapfts.ok(oazapfts.fetchJson<{
1221
+ status: 200;
1222
+ data: GetInstanceResponse;
1223
+ } | {
1224
+ status: 422;
1225
+ data: {
1226
+ instance?: string;
1227
+ "type"?: string;
1228
+ parameters?: {
1229
+ [key: string]: object;
1230
+ };
1231
+ title?: string;
1232
+ status?: StatusType;
1233
+ detail?: string;
1234
+ };
1235
+ } | {
1236
+ status: 500;
1237
+ data: {
1238
+ instance?: string;
1239
+ "type"?: string;
1240
+ parameters?: {
1241
+ [key: string]: object;
1242
+ };
1243
+ title?: string;
1244
+ status?: StatusType;
1245
+ detail?: string;
1246
+ };
1247
+ }>(`/v2/applications/${encodeURIComponent(applicationId)}/${encodeURIComponent(runtimeId)}/instances`, {
1248
+ ...opts
1249
+ }));
1250
+ }
1251
+ export function getApplicationHistory({ applicationId }: {
1252
+ applicationId: string;
1253
+ }, opts?: Oazapfts.RequestOpts) {
1254
+ return oazapfts.ok(oazapfts.fetchJson<{
1255
+ status: 200;
1256
+ data: ListApplicationHistoryResponse;
1257
+ } | {
1258
+ status: 422;
1259
+ data: {
1260
+ instance?: string;
1261
+ "type"?: string;
1262
+ parameters?: {
1263
+ [key: string]: object;
1264
+ };
1265
+ title?: string;
1266
+ status?: StatusType;
1267
+ detail?: string;
1268
+ };
1269
+ } | {
1270
+ status: 500;
1271
+ data: {
1272
+ instance?: string;
1273
+ "type"?: string;
1274
+ parameters?: {
1275
+ [key: string]: object;
1276
+ };
1277
+ title?: string;
1278
+ status?: StatusType;
1279
+ detail?: string;
1280
+ };
1281
+ }>(`/v2/applications/${encodeURIComponent(applicationId)}/history`, {
1058
1282
  ...opts
1059
1283
  }));
1060
1284
  }
@@ -1126,6 +1350,47 @@ export function getLastDeploymentByRuntime({ applicationId }: {
1126
1350
  ...opts
1127
1351
  }));
1128
1352
  }
1353
+ export function schedule({ applicationId, runtimeId, day, month, minute }: {
1354
+ applicationId: string;
1355
+ runtimeId: string;
1356
+ day: number;
1357
+ month: number;
1358
+ minute: number;
1359
+ }, opts?: Oazapfts.RequestOpts) {
1360
+ return oazapfts.ok(oazapfts.fetchJson<{
1361
+ status: 200;
1362
+ } | {
1363
+ status: 422;
1364
+ data: {
1365
+ instance?: string;
1366
+ "type"?: string;
1367
+ parameters?: {
1368
+ [key: string]: object;
1369
+ };
1370
+ title?: string;
1371
+ status?: StatusType;
1372
+ detail?: string;
1373
+ };
1374
+ } | {
1375
+ status: 500;
1376
+ data: {
1377
+ instance?: string;
1378
+ "type"?: string;
1379
+ parameters?: {
1380
+ [key: string]: object;
1381
+ };
1382
+ title?: string;
1383
+ status?: StatusType;
1384
+ detail?: string;
1385
+ };
1386
+ }>(`/v2/applications/schedule/${encodeURIComponent(applicationId)}/${encodeURIComponent(runtimeId)}${QS.query(QS.explode({
1387
+ day,
1388
+ month,
1389
+ minute
1390
+ }))}`, {
1391
+ ...opts
1392
+ }));
1393
+ }
1129
1394
  export function listApplications1({ projectId, limit, offset }: {
1130
1395
  projectId: string;
1131
1396
  limit?: number;
@@ -4,8 +4,8 @@
4
4
  * DO NOT MODIFY - This file has been generated using oazapfts.
5
5
  * See https://www.npmjs.com/package/oazapfts
6
6
  */
7
- import * as Oazapfts from "@oazapfts/runtime";
8
- import * as QS from "@oazapfts/runtime/query";
7
+ import * as Oazapfts from "@oazapfts/runtime"
8
+ import * as QS from "@oazapfts/runtime/query"
9
9
  export const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders> = {
10
10
  headers: {},
11
11
  baseUrl: "https://workspace-workspace-manager.dev.stackspot.com",
@@ -174,6 +174,7 @@ export type SimpleStackResponse = {
174
174
  stackId: string;
175
175
  name: string;
176
176
  slug: string;
177
+ imageUrl?: string;
177
178
  studio: StudioResponse;
178
179
  };
179
180
  export type WorkflowAccountSettingsResponse = {
@@ -690,13 +691,6 @@ export type WorkspacePageResponse = {
690
691
  totalPages: number;
691
692
  items: WorkspaceResponse[];
692
693
  };
693
- export type SimpleStackWithImageResponse = {
694
- stackId: string;
695
- name: string;
696
- slug: string;
697
- imageUrl?: string;
698
- studio: StudioResponse;
699
- };
700
694
  export type WorkflowCompleteResponse = {
701
695
  workflowId: string;
702
696
  name: string;
@@ -1570,7 +1564,7 @@ export function workflowWorkspaceControllerlistStacks({ workspaceId, workflowId
1570
1564
  }, opts?: Oazapfts.RequestOpts) {
1571
1565
  return oazapfts.ok(oazapfts.fetchJson<{
1572
1566
  status: 200;
1573
- data: SimpleStackWithImageResponse[];
1567
+ data: SimpleStackResponse[];
1574
1568
  }>(`/v1/workspaces/${encodeURIComponent(workspaceId)}/workflows/${encodeURIComponent(workflowId)}/stacks`, {
1575
1569
  ...opts
1576
1570
  }));
@@ -1810,6 +1804,14 @@ export function accountSharedInfraControllergetAccountSharedInfraPage({ page, si
1810
1804
  ...opts
1811
1805
  }));
1812
1806
  }
1807
+ export function accountSharedInfraControllergetAccountApplicationsFilters(opts?: Oazapfts.RequestOpts) {
1808
+ return oazapfts.ok(oazapfts.fetchJson<{
1809
+ status: 200;
1810
+ data: StackFilterResponse;
1811
+ }>("/v1/shared-infra/filters", {
1812
+ ...opts
1813
+ }));
1814
+ }
1813
1815
  export function contextControllergetStackActionInputsInWorkspaceContext({ workspaceId, stackVersionId, actionsVersionId, envName }: {
1814
1816
  workspaceId: string;
1815
1817
  stackVersionId: string;
@@ -1865,6 +1867,14 @@ export function accountApplicationControllergetAccountApplicationPage({ page, si
1865
1867
  ...opts
1866
1868
  }));
1867
1869
  }
1870
+ export function accountApplicationControllergetAccountApplicationsFilters(opts?: Oazapfts.RequestOpts) {
1871
+ return oazapfts.ok(oazapfts.fetchJson<{
1872
+ status: 200;
1873
+ data: StackFilterResponse;
1874
+ }>("/v1/applications/filters", {
1875
+ ...opts
1876
+ }));
1877
+ }
1868
1878
  export function accountStackControllerlistStacksByAccountWithWorkflow({ workspaceId }: {
1869
1879
  workspaceId?: string;
1870
1880
  }, opts?: Oazapfts.RequestOpts) {
@@ -10,12 +10,15 @@ import
10
10
  getDeploymentHealth,
11
11
  getDeploymentLogs,
12
12
  getDeploymentStatus,
13
+ getInstances,
13
14
  getLastDeploymentByRuntime,
14
15
  getRepositoryImages,
16
+ getSecrets,
15
17
  listApplications,
16
18
  listDeployments,
17
19
  listRepositories,
18
20
  listRuntimes,
21
+ setAutoscalihng,
19
22
  startApplication,
20
23
  stopApplication,
21
24
  } from '../api/cloudRuntimes'
@@ -98,6 +101,18 @@ class CloudRuntimesClient extends ReactQueryNetworkClient {
98
101
  * Stop an application
99
102
  */
100
103
  stopApplication = this.mutation(removeAuthorizationParam(stopApplication))
104
+ /**
105
+ * Get secret keys of an application by runtime
106
+ */
107
+ applicationSecretKeys = this.query(removeAuthorizationParam(getSecrets))
108
+ /**
109
+ * Get application instances in use
110
+ */
111
+ applicationInstancesNow = this.query(removeAuthorizationParam(getInstances))
112
+ /**
113
+ * Edit application instances
114
+ */
115
+ editApplicationInstances = this.mutation(removeAuthorizationParam(setAutoscalihng))
101
116
  }
102
117
 
103
118
 
@@ -34,6 +34,8 @@ import {
34
34
  workspaceStackControllerdeleteStacksInWorkspace,
35
35
  workspaceStackControllerlistStacks,
36
36
  workspaceStackControllerrefreshStacksInWorkspace,
37
+ accountApplicationControllergetAccountApplicationsFilters,
38
+ accountSharedInfraControllergetAccountApplicationsFilters,
37
39
  } from '../api/workspaceManager'
38
40
  import apis from '../apis.json'
39
41
  import { DefaultAPIError } from '../error/DefaultAPIError'
@@ -307,6 +309,12 @@ class WorkspaceManagerClient extends ReactQueryNetworkClient {
307
309
  * Get all shared infrastructures associated with an account.
308
310
  */
309
311
  getAccountSharedInfra = this.query(accountSharedInfraControllergetAccountSharedInfraPage)
312
+
313
+ /** * Gets filters for applications associated with an account. */
314
+ getAccountApplicationsFilters = this.query(accountApplicationControllergetAccountApplicationsFilters)
315
+
316
+ /** * Gets filters for shared infrastructures associated with an account. */
317
+ getAccountSharedInfraFilters = this.query(accountSharedInfraControllergetAccountApplicationsFilters)
310
318
  }
311
319
 
312
320
  export const workspaceManagerClient = new WorkspaceManagerClient()