@stack-spot/portal-network 0.16.1 → 0.18.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.
@@ -8,11 +8,11 @@ import * as Oazapfts from "@oazapfts/runtime";
8
8
  import * as QS from "@oazapfts/runtime/query";
9
9
  export const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders> = {
10
10
  headers: {},
11
- baseUrl: "https://workspace.v1.stackspot.com",
11
+ baseUrl: "https://workspace-workspace-api.dev.stackspot.com",
12
12
  };
13
13
  const oazapfts = Oazapfts.runtime(defaults);
14
14
  export const servers = {
15
- generatedServerUrl: "https://workspace.v1.stackspot.com"
15
+ generatedServerUrl: "https://workspace-workspace-api.dev.stackspot.com"
16
16
  };
17
17
  export type ContextAttributeDto = {
18
18
  key: string;
@@ -58,11 +58,11 @@ export type WorkspaceWorkflowCreateRequest = {
58
58
  };
59
59
  export type WorkspaceVariableReadResponse = {
60
60
  /** Workspace variable name. */
61
- name?: string;
61
+ name: string;
62
62
  /** Workspace variable value. */
63
- value?: string;
63
+ value: string;
64
64
  /** Workspace variable description. */
65
- description?: string;
65
+ description: string;
66
66
  };
67
67
  export type UpdateWorkspaceVariableRequest = {
68
68
  /** Workspace variable value. */
@@ -80,7 +80,7 @@ export type AttributesByEnv = {
80
80
  attributes: PluginAttribute[];
81
81
  };
82
82
  export type AddTypedContextRequest = {
83
- attributesByEnv?: AttributesByEnv;
83
+ attributesByEnv: AttributesByEnv;
84
84
  };
85
85
  export type WorkflowActionResponse = {
86
86
  actionVersionId: string;
@@ -97,17 +97,17 @@ export type WorkflowReadResponse = {
97
97
  };
98
98
  export type WorkflowActionsRequest = {
99
99
  /** Workflow action version id. */
100
- actionVersionId?: string;
100
+ actionVersionId: string;
101
101
  /** Workspace order step. */
102
- orderStep?: number;
102
+ orderStep: number;
103
103
  /** This action will create repository. */
104
- createRepo?: boolean;
104
+ createRepo: boolean;
105
105
  };
106
106
  export type WorkflowConditionRequest = {
107
107
  /** Workflow condition. */
108
- condition?: "BEFORE" | "AFTER";
108
+ condition: "BEFORE" | "AFTER";
109
109
  /** Workflow actions. */
110
- actions?: WorkflowActionsRequest[];
110
+ actions: WorkflowActionsRequest[];
111
111
  };
112
112
  export type AddWorkspaceWorkflowStepRequest = {
113
113
  /** Workflow identifier. */
@@ -116,19 +116,19 @@ export type AddWorkspaceWorkflowStepRequest = {
116
116
  };
117
117
  export type ImportContextRequest = {
118
118
  /** Context type (PLUGIN, ACTION). */
119
- "type"?: "PLUGIN" | "ACTION";
119
+ "type": "PLUGIN" | "ACTION";
120
120
  /** PluginId. */
121
- externalId?: string;
121
+ externalId: string;
122
122
  /** Input attributes by environments. */
123
- attributesByEnv?: AttributesByEnv[];
123
+ attributesByEnv: AttributesByEnv[];
124
124
  };
125
125
  export type UpdateSharedInfraStatusRequest = {
126
126
  /** Shared Infrastructure Status. */
127
- status?: "CREATED" | "CREATE_FAILED" | "DRAFT" | "DELETING" | "DELETE_FAILED";
127
+ status: "CREATED" | "CREATE_FAILED" | "DRAFT" | "DELETING" | "DELETE_FAILED";
128
128
  };
129
129
  export type IdResponse = {
130
130
  /** Id response. */
131
- id?: string;
131
+ id: string;
132
132
  };
133
133
  export type SharedInfraVisibleLinksResponse = {
134
134
  id: string;
@@ -180,23 +180,23 @@ export type PluginsStatusInCloud = {
180
180
  };
181
181
  export type UpdateRunRequest = {
182
182
  /** Activity status to update. */
183
- status?: "RUNNING" | "SUCCEEDED" | "USER_ERROR" | "RUNTIME_ERROR" | "EXTERNAL_ERROR" | "ABORTED" | "ABORTING";
183
+ status: "RUNNING" | "SUCCEEDED" | "USER_ERROR" | "RUNTIME_ERROR" | "EXTERNAL_ERROR" | "ABORTED" | "ABORTING";
184
184
  /** Message. */
185
185
  message?: string;
186
186
  /** List of plugins that contain in deploy, rollback or destroy. */
187
- plugins?: Plugins[];
187
+ plugins: Plugins[];
188
188
  /** List of plugins in cloud. */
189
- pluginsStatusInCloud?: PluginsStatusInCloud[];
189
+ pluginsStatusInCloud: PluginsStatusInCloud[];
190
190
  };
191
191
  export type RunTaskRequest = {
192
192
  /** Plugin Id. */
193
- runTaskId?: string;
193
+ runTaskId: string;
194
194
  /** Plugin type. */
195
- "type"?: "IAC" | "DEPLOY" | "DESTROY" | "IAC_SELF_HOSTED" | "DEPLOY_SELF_HOSTED" | "DESTROY_SELF_HOSTED";
195
+ "type": "IAC" | "DEPLOY" | "DESTROY" | "IAC_SELF_HOSTED" | "DEPLOY_SELF_HOSTED" | "DESTROY_SELF_HOSTED";
196
196
  /** Plugin status to update. */
197
- status?: "EXTERNAL_ERROR" | "INTERNAL_ERROR" | "ABORTED" | "FAILED" | "SUCCEEDED" | "RUNNING" | "PENDING" | "READY_TO_RUN";
197
+ status: "EXTERNAL_ERROR" | "INTERNAL_ERROR" | "ABORTED" | "FAILED" | "SUCCEEDED" | "RUNNING" | "PENDING" | "READY_TO_RUN";
198
198
  /** Plugin Alias. */
199
- pluginAlias?: string;
199
+ pluginAlias: string;
200
200
  /** Add message when plugin deployment gives error. */
201
201
  message?: string;
202
202
  };
@@ -206,27 +206,27 @@ export type DeploymentTagRequest = {
206
206
  /** Shared Infra id. */
207
207
  sharedInfrastructureId?: string;
208
208
  /** Related tag. */
209
- relatedTag?: string;
209
+ relatedTag: string;
210
210
  };
211
211
  export type ConnectionInterfaceAttribute = {
212
212
  /** Attribute key. */
213
- key?: string;
213
+ key: string;
214
214
  /** Attribute value. */
215
- value?: object;
215
+ value: object;
216
216
  /** Indicates if this attribute value is sensitive or not. */
217
- sensitive?: boolean;
217
+ sensitive: boolean;
218
218
  };
219
219
  export type UpdateConnectionInterfaceAttributesRequest = {
220
220
  /** Environment id. */
221
- environmentId?: string;
221
+ environmentId: string;
222
222
  /** List of attributes */
223
- attributes?: ConnectionInterfaceAttribute[];
223
+ attributes: ConnectionInterfaceAttribute[];
224
224
  };
225
225
  export type ConnectionInterfaceAttributesByEnv = {
226
226
  /** Environment id. */
227
- environmentId?: string;
227
+ environmentId: string;
228
228
  /** List of attributes */
229
- attributes?: ConnectionInterfaceAttribute[];
229
+ attributes: ConnectionInterfaceAttribute[];
230
230
  };
231
231
  export type UpsertConnectionInterfaceRequest = {
232
232
  applicationId?: string;
@@ -238,7 +238,7 @@ export type UpsertConnectionInterfaceRequest = {
238
238
  };
239
239
  export type UpdateApplicationStatusRequest = {
240
240
  /** Application Status. */
241
- status?: "CREATED" | "CREATE_FAILED" | "DRAFT" | "DELETING" | "DELETE_FAILED" | "ARCHIVING" | "ARCHIVED" | "ARCHIVE_FAILED";
241
+ status: "CREATED" | "CREATE_FAILED" | "DRAFT" | "DELETING" | "DELETE_FAILED" | "ARCHIVING" | "ARCHIVED" | "ARCHIVE_FAILED";
242
242
  };
243
243
  export type ApplicationVisibleLinksResponse = {
244
244
  id: string;
@@ -301,29 +301,61 @@ export type StackWorkflowCreateRequest = {
301
301
  actionsBefore: WorkflowActionContextRequest[];
302
302
  actionsAfter: WorkflowActionContextRequest[];
303
303
  };
304
+ export type EnvironmentSimpleResponse = {
305
+ /** Environment id. */
306
+ id: string;
307
+ /** Environment name. */
308
+ name: string;
309
+ };
310
+ export type TargetByPluginUsageResponse = {
311
+ /** Plugin Version ID. */
312
+ pluginVersionId: string;
313
+ environment: EnvironmentSimpleResponse;
314
+ };
315
+ export type WorkspaceResponse = {
316
+ /** Workspace id. */
317
+ id: string;
318
+ /** Workspace name */
319
+ name: string;
320
+ /** Workspace description */
321
+ description?: string;
322
+ /** Workspace image */
323
+ imageUrl?: string;
324
+ };
325
+ export type PluginUsageByTargetResponse = {
326
+ /** Application id. */
327
+ id: string;
328
+ /** Application name. */
329
+ name: string;
330
+ /** Application description. */
331
+ description?: string;
332
+ /** Amount of linked versions. */
333
+ totalLinkedVersions: number;
334
+ workspace: WorkspaceResponse;
335
+ };
304
336
  export type WorkspaceReadResponse = {
305
337
  /** Workspace id. */
306
- id?: string;
338
+ id: string;
307
339
  /** Workspace name. */
308
- name?: string;
340
+ name: string;
309
341
  /** Workspace description. */
310
342
  description?: string;
311
343
  /** Workspace image URL. */
312
344
  imageUrl?: string;
313
345
  /** Workspace manage runtime. */
314
- manageRuntime?: boolean;
346
+ manageRuntime: boolean;
315
347
  /** Workspace accountId. */
316
- accountId?: string;
348
+ accountId: string;
317
349
  /** Workspace teams. - deprecated field */
318
350
  teams?: string[];
319
351
  /** Workspace creator. */
320
- createdBy?: string;
352
+ createdBy: string;
321
353
  /** Workspace creation date. */
322
- createdAt?: string;
354
+ createdAt: string;
323
355
  /** Workspace updater. */
324
- updatedBy?: string;
356
+ updatedBy: string;
325
357
  /** Workspace update date. */
326
- updatedAt?: string;
358
+ updatedAt: string;
327
359
  };
328
360
  export type NewWorkspaceRequest = {
329
361
  /** Workspace name. */
@@ -333,7 +365,7 @@ export type NewWorkspaceRequest = {
333
365
  /** Workspace image base64. */
334
366
  image?: string;
335
367
  /** Workspace manage runtime. */
336
- manageRuntime?: boolean;
368
+ manageRuntime: boolean;
337
369
  };
338
370
  export type NewWorkspaceVariableRequest = {
339
371
  /** Workspace variable name. */
@@ -345,11 +377,11 @@ export type NewWorkspaceVariableRequest = {
345
377
  };
346
378
  export type StackInWorkspaceReadResponse = {
347
379
  /** Stack version id. */
348
- stackVersionId?: string;
380
+ stackVersionId: string;
349
381
  /** Workspace id. */
350
- workspaceId?: string;
382
+ workspaceId: string;
351
383
  /** Account id. */
352
- accountId?: string;
384
+ accountId: string;
353
385
  };
354
386
  export type AddStackInWorkspaceRequest = {
355
387
  /** Stack version id. */
@@ -361,37 +393,37 @@ export type StackVersionResponse = {
361
393
  };
362
394
  export type StackWithWorkspaceContextResponse = {
363
395
  /** List of stack version with pluginVersionId list that has workspace context. */
364
- stackVersions?: StackVersionResponse[];
396
+ stackVersions: StackVersionResponse[];
365
397
  /** Workspace id. */
366
- workspaceId?: string;
398
+ workspaceId: string;
367
399
  /** Account id. */
368
- accountId?: string;
400
+ accountId: string;
369
401
  };
370
402
  export type SharedInfraDetailsResponse = {
371
403
  /** Shared infrastructure id. */
372
- id?: string;
404
+ id: string;
373
405
  /** Shared infrastructure name. */
374
- name?: string;
406
+ name: string;
375
407
  /** Shared infrastructure description. */
376
408
  description?: string;
377
409
  /** Shared infrastructure repository url. */
378
410
  repoUrl?: string;
379
411
  /** Shared infrastructure repository base branch. */
380
- repoBaseBranch?: string;
412
+ repoBaseBranch: string;
381
413
  /** Stack used to generate this shared infrastructure. */
382
- stackVersionId?: string;
414
+ stackVersionId: string;
383
415
  /** Starter used to generate this shared infrastructure. */
384
416
  starterId?: string;
385
417
  /** Shared Infrastructure status. */
386
- status?: string;
418
+ status: string;
387
419
  /** Shared Infrastructure creator. */
388
- createdBy?: string;
420
+ createdBy: string;
389
421
  /** Shared Infrastructure creation date. */
390
- createdAt?: string;
422
+ createdAt: string;
391
423
  /** Shared Infrastructure updater. */
392
- updatedBy?: string;
424
+ updatedBy: string;
393
425
  /** Shared Infrastructure update date. */
394
- updatedAt?: string;
426
+ updatedAt: string;
395
427
  };
396
428
  export type CreateSharedInfraRequest = {
397
429
  /** Shared infrastructure name. */
@@ -403,7 +435,7 @@ export type CreateSharedInfraRequest = {
403
435
  /** Shared infrastructure repository base branch. */
404
436
  repoBaseBranch: string;
405
437
  /** Stack used to generate this shared infrastructure. */
406
- stackVersionId?: string;
438
+ stackVersionId: string;
407
439
  /** Starter used to generate this shared infrastructure. */
408
440
  starterId?: string;
409
441
  };
@@ -417,7 +449,7 @@ export type RecreateSharedInfraRequest = {
417
449
  /** Shared infrastructure repository base branch. */
418
450
  repoBaseBranch: string;
419
451
  /** Stack used to generate this shared infrastructure. */
420
- stackVersionId?: string;
452
+ stackVersionId: string;
421
453
  /** Starter used to generate this shared infrastructure. */
422
454
  starterId?: string;
423
455
  };
@@ -433,11 +465,11 @@ export type UpdateSharedInfraRequest = {
433
465
  };
434
466
  export type SharedInfraLinkReadResponse = {
435
467
  /** Shared infra link id. */
436
- id?: string;
468
+ id: string;
437
469
  /** Shared infra link name. */
438
- name?: string;
470
+ name: string;
439
471
  /** Shared infra link url. */
440
- url?: string;
472
+ url: string;
441
473
  /** Shared infra link image URL. */
442
474
  imageUrl?: string;
443
475
  };
@@ -445,7 +477,7 @@ export type CreateSharedInfraLinkRequest = {
445
477
  /** Shared infra link name. */
446
478
  name: string;
447
479
  /** Shared infra URL. */
448
- url?: string;
480
+ url: string;
449
481
  /** Shared infra image base64. */
450
482
  image?: string;
451
483
  };
@@ -466,41 +498,41 @@ export type PluginElementSnapshot = {
466
498
  };
467
499
  export type SharedInfraDeploySnapshotRequest = {
468
500
  /** Deployment Id. */
469
- deploymentId?: string;
501
+ deploymentId: string;
470
502
  /** Deployment Id. */
471
- environmentId?: string;
503
+ environmentId: string;
472
504
  /** Input attributes for applied app plugin. */
473
- plugins?: PluginElementSnapshot[];
505
+ plugins: PluginElementSnapshot[];
474
506
  };
475
507
  export type StartRunRequest = {
476
508
  /** Requestor's email. */
477
- requestedBy?: string;
509
+ requestedBy: string;
478
510
  /** Action to perform. */
479
- action?: "CREATE" | "UPDATE" | "DELETE" | "RUN";
511
+ action: "CREATE" | "UPDATE" | "DELETE" | "RUN";
480
512
  /** Run ID. */
481
- runId?: string;
513
+ runId: string;
482
514
  /** Environment id. */
483
- environmentId?: string;
515
+ environmentId: string;
484
516
  /** Application id. */
485
517
  applicationId?: string;
486
518
  /** Shared Infra id. */
487
519
  sharedInfrastructureId?: string;
488
520
  /** Deploy type. */
489
- "type"?: "DEPLOY" | "ROLLBACK" | "DESTROY" | "DEPLOY_SELF_HOSTED" | "DESTROY_SELF_HOSTED" | "ROLLBACK_SELF_HOSTED";
521
+ "type": "DEPLOY" | "ROLLBACK" | "DESTROY" | "DEPLOY_SELF_HOSTED" | "DESTROY_SELF_HOSTED" | "ROLLBACK_SELF_HOSTED";
490
522
  /** Pipeline URL for self hosted deployment. */
491
523
  pipelineLink?: string;
492
524
  /** Application Manifest. */
493
525
  appManifesto?: string;
494
526
  /** List of plugins that contain in deploy, rollback or destroy. */
495
- plugins?: Plugins[];
527
+ plugins: Plugins[];
496
528
  };
497
529
  export type WorkspaceLinkReadResponse = {
498
530
  /** Shared infra link id. */
499
- id?: string;
531
+ id: string;
500
532
  /** Workspace link name. */
501
- name?: string;
533
+ name: string;
502
534
  /** Workspace link url. */
503
- url?: string;
535
+ url: string;
504
536
  /** Workspace link image URL. */
505
537
  imageUrl?: string;
506
538
  };
@@ -508,17 +540,17 @@ export type CreateWorkspaceLinkRequest = {
508
540
  /** Workspace link name. */
509
541
  name: string;
510
542
  /** Workspace link URL. */
511
- url?: string;
543
+ url: string;
512
544
  /** Workspace link image base64. */
513
545
  image?: string;
514
546
  };
515
547
  export type WorkspaceEmbeddedLinkReadResponse = {
516
548
  /** Workspace embedded link id. */
517
- id?: string;
549
+ id: string;
518
550
  /** Workspace embedded link name. */
519
- name?: string;
551
+ name: string;
520
552
  /** Workspace embedded link url. */
521
- url?: string;
553
+ url: string;
522
554
  /** Workspace embedded link image URL. */
523
555
  imageUrl?: string;
524
556
  /** Workspace embedded link layout. */
@@ -528,31 +560,31 @@ export type CreateWorkspaceEmbeddedLinkRequest = {
528
560
  /** Workspace embedded link name. */
529
561
  name: string;
530
562
  /** Workspace embedded link URL. */
531
- url?: string;
563
+ url: string;
532
564
  /** Workspace embedded link image base64. */
533
565
  image?: string;
534
566
  };
535
567
  export type ConnectionInterfaceSummaryResponse = {
536
568
  /** Connection interface id. */
537
- id?: string;
569
+ id: string;
538
570
  /** Connection interface id type generate by client. */
539
- typeId?: string;
571
+ typeId: string;
540
572
  /** Shared infra that was used to generated this Connection interface. */
541
573
  sharedInfraId?: string;
542
574
  /** Application that was used to generated this Connection interface. */
543
575
  applicationId?: string;
544
576
  /** Connection interface id generated by client. */
545
- connectionInterfaceId?: string;
577
+ connectionInterfaceId: string;
546
578
  /** Indicates if this connection interface was generated by a plugin or manually. */
547
- automaticallyGenerated?: boolean;
579
+ automaticallyGenerated: boolean;
548
580
  /** The version ID of the plugin that generated this. */
549
581
  sourcePluginVersionId?: string;
550
582
  };
551
583
  export type CreateConnectionInterfaceRequest = {
552
584
  /** Connection interface type id. */
553
- typeId?: string;
585
+ typeId: string;
554
586
  /** Connection interface id generated by client. */
555
- connectionInterfaceId?: string;
587
+ connectionInterfaceId: string;
556
588
  /** Connection interface owner applications. */
557
589
  applicationId?: string;
558
590
  /** Connection interface owner shared infra. */
@@ -560,42 +592,39 @@ export type CreateConnectionInterfaceRequest = {
560
592
  /** Version id from plugin that generated this connection interface. */
561
593
  sourcePluginVersionId?: string;
562
594
  /** Indicates if this connection interface was generated by a plugin or manually. */
563
- automaticallyGenerated?: boolean;
595
+ automaticallyGenerated: boolean;
564
596
  /** Connection interface attributes. */
565
- attributesByEnv?: ConnectionInterfaceAttributesByEnv[];
597
+ attributesByEnv: ConnectionInterfaceAttributesByEnv[];
566
598
  };
567
- //This type was manually corrected. Please be aware that removing this might cause type issues
568
599
  export type UpdateConnectionInterfaceVisibilityRequest = {
569
- /** Ids */
570
- ids?: string[];
571
- /** Type */
572
- type?: "ACCOUNT" | "APPLICATION" | "WORKSPACE";
600
+ ids: string[];
601
+ "type": "ACCOUNT" | "APPLICATION" | "WORKSPACE";
573
602
  };
574
603
  export type ApplicationReadResponse = {
575
604
  /** Application id. */
576
- id?: string;
605
+ id: string;
577
606
  /** Application name. */
578
- name?: string;
607
+ name: string;
579
608
  /** Application description. */
580
609
  description?: string;
581
610
  /** Application repository url. */
582
611
  repoUrl?: string;
583
612
  /** Application repository base branch. */
584
- repoBaseBranch?: string;
613
+ repoBaseBranch: string;
585
614
  /** Stack used to generate this application. */
586
615
  stackVersionId?: string;
587
616
  /** Starter used to generate this application. */
588
617
  starterId?: string;
589
618
  /** Application status. */
590
- status?: string;
619
+ status: string;
591
620
  /** Application creator. */
592
- createdBy?: string;
621
+ createdBy: string;
593
622
  /** Application creation date. */
594
- createdAt?: string;
623
+ createdAt: string;
595
624
  /** Application updater. */
596
- updatedBy?: string;
625
+ updatedBy: string;
597
626
  /** Application update date. */
598
- updatedAt?: string;
627
+ updatedAt: string;
599
628
  };
600
629
  export type CreateApplicationRequest = {
601
630
  /** Application name. */
@@ -607,9 +636,9 @@ export type CreateApplicationRequest = {
607
636
  /** Application repository base branch. */
608
637
  repoBaseBranch: string;
609
638
  /** Stack used to generate this application. */
610
- stackVersionId: string;
639
+ stackVersionId?: string;
611
640
  /** Starter used to generate this application. */
612
- starterId: string;
641
+ starterId?: string;
613
642
  };
614
643
  export type RecreateApplicationRequest = {
615
644
  /** Application name. */
@@ -637,11 +666,11 @@ export type UpdateApplicationRequest = {
637
666
  };
638
667
  export type ApplicationLinkReadResponse = {
639
668
  /** Shared infra link id. */
640
- id?: string;
669
+ id: string;
641
670
  /** Application link name. */
642
- name?: string;
671
+ name: string;
643
672
  /** Application link url. */
644
- url?: string;
673
+ url: string;
645
674
  /** Application link image URL. */
646
675
  imageUrl?: string;
647
676
  };
@@ -649,13 +678,13 @@ export type CreateApplicationLinkRequest = {
649
678
  /** Application link name. */
650
679
  name: string;
651
680
  /** Application link URL. */
652
- url?: string;
681
+ url: string;
653
682
  /** Application link image base64. */
654
683
  image?: string;
655
684
  };
656
685
  export type ApplicationDestroyRequest = {
657
686
  /** Destroy status. */
658
- status?: "SUCCESS" | "FAILED";
687
+ status: "SUCCESS" | "FAILED";
659
688
  };
660
689
  export type MetaDataRequest = {
661
690
  name: string;
@@ -699,10 +728,10 @@ export type AppliedPluginsRequest = {
699
728
  /** Stack version id */
700
729
  stackVersionId: string;
701
730
  /** Plugin inputs */
702
- inputs?: {
731
+ inputs: {
703
732
  [key: string]: object;
704
733
  };
705
- connections?: ConnectionsRequest;
734
+ connections: ConnectionsRequest;
706
735
  links?: PluginLinkRequest;
707
736
  };
708
737
  export type SpecRequest = {
@@ -711,30 +740,30 @@ export type SpecRequest = {
711
740
  /** Deploy specification repository */
712
741
  repository: string;
713
742
  /** Plugins applied in deploy */
714
- appliedPlugins?: AppliedPluginsRequest[];
743
+ appliedPlugins: AppliedPluginsRequest[];
715
744
  };
716
745
  export type AppManifestoRequest = {
717
746
  /** Deployment schema version */
718
747
  schemaVersion: string;
719
748
  /** Deployment kind */
720
749
  kind: string;
721
- metadata?: MetaDataRequest;
722
- spec?: SpecRequest;
750
+ metadata: MetaDataRequest;
751
+ spec: SpecRequest;
723
752
  };
724
753
  export type ApplicationDeployRequest = {
725
754
  /** Deploy status. */
726
- status?: "SUCCESS" | "FAILED";
755
+ status: "SUCCESS" | "FAILED";
727
756
  /** Deploy version. */
728
757
  version: string;
729
- appManifesto?: AppManifestoRequest;
758
+ appManifesto: AppManifestoRequest;
730
759
  };
731
760
  export type ApplicationEmbeddedLinkReadResponse = {
732
761
  /** Application embedded link id. */
733
- id?: string;
762
+ id: string;
734
763
  /** Application embedded link name. */
735
- name?: string;
764
+ name: string;
736
765
  /** Application embedded link url. */
737
- url?: string;
766
+ url: string;
738
767
  /** Application embedded link image URL. */
739
768
  imageUrl?: string;
740
769
  /** Application embedded link layout. */
@@ -744,27 +773,61 @@ export type CreateApplicationEmbeddedLinkRequest = {
744
773
  /** Application embedded link name. */
745
774
  name: string;
746
775
  /** Application embedded link URL. */
747
- url?: string;
776
+ url: string;
748
777
  /** Application embedded link image base64. */
749
778
  image?: string;
750
779
  };
751
780
  export type ApplicationDeploySnapshotRequest = {
752
781
  /** Deployment Id. */
753
- deploymentId?: string;
782
+ deploymentId: string;
754
783
  /** Deployment Id. */
755
- environmentId?: string;
784
+ environmentId: string;
756
785
  /** Input attributes for applied app plugin. */
757
- plugins?: PluginElementSnapshot[];
786
+ plugins: PluginElementSnapshot[];
787
+ };
788
+ export type EnvironmentLinkedPluginResponse = {
789
+ id: string;
790
+ name: string;
791
+ totalLinkedApps: number;
792
+ totalLinkedInfra: number;
793
+ };
794
+ export type EnvironmentStackResponse = {
795
+ stackVersionId: string;
796
+ environments: EnvironmentLinkedPluginResponse[];
797
+ };
798
+ export type StackUsageByWorkspaceResponse = {
799
+ /** Workspace id. */
800
+ id: string;
801
+ /** Workspace name */
802
+ name: string;
803
+ /** Workspace description */
804
+ description?: string;
805
+ /** Workspace image */
806
+ imageUrl?: string;
807
+ /** Amount of linked versions. */
808
+ totalLinkedVersions: number;
809
+ /** Stack Versions linked. */
810
+ stackVersions: EnvironmentStackResponse[];
811
+ };
812
+ export type PluginUsageAmountResponse = {
813
+ pluginVersionId: string;
814
+ totalUsedInInfras: number;
815
+ totalUsedInApps: number;
816
+ };
817
+ export type PluginUsageAmountConsolidatedResponse = {
818
+ totalUsedInInfras: number;
819
+ totalUsedInApps: number;
820
+ details: PluginUsageAmountResponse[];
758
821
  };
759
822
  export type EnvironmentReadResponse = {
760
823
  /** Environment id. */
761
- id?: string;
824
+ id: string;
762
825
  /** Environment name. */
763
- name?: string;
826
+ name: string;
764
827
  /** Environment description. */
765
- description?: string;
828
+ description: string;
766
829
  /** Environment accountId. */
767
- accountId?: string;
830
+ accountId: string;
768
831
  };
769
832
  export type EnvironmentSaveRequest = {
770
833
  /** Environment name. */
@@ -774,9 +837,9 @@ export type EnvironmentSaveRequest = {
774
837
  };
775
838
  export type EnvironmentReadBatchResponse = {
776
839
  /** Environment id. */
777
- id?: string;
840
+ id: string;
778
841
  /** Environment name. */
779
- name?: string;
842
+ name: string;
780
843
  };
781
844
  export type WorkflowResponse = {
782
845
  id: string;
@@ -803,9 +866,9 @@ export type AccountWorkflowCreateRequest = {
803
866
  };
804
867
  export type AccountStackContextResponse = {
805
868
  /** List of stack version ids with pluginVersionId list with account context. */
806
- stackVersions?: StackVersionResponse[];
869
+ stackVersions: StackVersionResponse[];
807
870
  /** Account id. */
808
- accountId?: string;
871
+ accountId: string;
809
872
  };
810
873
  export type UpdateWorkspaceRequest = {
811
874
  /** Workspace name. */
@@ -841,9 +904,9 @@ export type UpdateWorkspaceEmbeddedLinkRequest = {
841
904
  };
842
905
  export type UpsertWorkspaceEmbeddedLinkRequest = {
843
906
  /** Workspace embedded link id. */
844
- id?: string;
907
+ id: string;
845
908
  /** Workspace embedded link layout. */
846
- layout?: object;
909
+ layout: object;
847
910
  };
848
911
  export type UpdateApplicationLinkRequest = {
849
912
  /** Shared infra link URL. */
@@ -862,9 +925,9 @@ export type UpdateApplicationEmbeddedLinkRequest = {
862
925
  };
863
926
  export type UpsertApplicationEmbeddedLinkRequest = {
864
927
  /** Application embedded link id. */
865
- id?: string;
928
+ id: string;
866
929
  /** Application embedded link layout. */
867
- layout?: object;
930
+ layout: object;
868
931
  };
869
932
  export type EnvironmentUpdateRequest = {
870
933
  /** Environment name. */
@@ -904,34 +967,34 @@ export type AppliedPluginV2Response = {
904
967
  };
905
968
  export type ConnectionInterfaceSummaryV2Response = {
906
969
  /** Connection interface api id. */
907
- apiId?: string;
970
+ apiId: string;
908
971
  /** Connection interface id type generate by client. */
909
- typeId?: string;
972
+ typeId: string;
910
973
  /** Connection interface id generated by client. */
911
- slug?: string;
974
+ slug: string;
912
975
  /** Indicates if this connection interface was generated by a plugin or manually. */
913
- automaticallyGenerated?: boolean;
976
+ automaticallyGenerated: boolean;
914
977
  /** The version ID of the plugin that generated this. */
915
978
  sourcePluginVersionId?: string;
916
979
  };
917
980
  export type Visibility = {
918
981
  /** Connection visibility type. */
919
- "type"?: "ACCOUNT" | "APPLICATION" | "WORKSPACE";
982
+ "type": "ACCOUNT" | "APPLICATION" | "WORKSPACE";
920
983
  /** IDs (based on type) for which connection interface is visible. */
921
- ids?: string[];
984
+ ids: string[];
922
985
  };
923
986
  export type ConnectionInterfaceDetailsV2Response = {
924
987
  /** Connection interface type. */
925
- typeId?: string;
988
+ typeId: string;
926
989
  /** Connection interface id generated by client. */
927
- slug?: string;
928
- visibility?: Visibility;
990
+ slug: string;
991
+ visibility: Visibility;
929
992
  /** Version id from plugin that generated this connection interface. */
930
993
  sourcePluginVersionId?: string;
931
994
  /** Indicates if this connection interface was generated by a plugin or manually. */
932
- automaticallyGenerated?: boolean;
995
+ automaticallyGenerated: boolean;
933
996
  /** Connection interface attributes. */
934
- attributesByEnv?: ConnectionInterfaceAttributesByEnv[];
997
+ attributesByEnv: ConnectionInterfaceAttributesByEnv[];
935
998
  };
936
999
  export type PluginInUseResponse = {
937
1000
  name: string;
@@ -1019,18 +1082,18 @@ export type AppAndInfraDependencyResponse = {
1019
1082
  };
1020
1083
  export type ConnectionInterfaceDetailsResponse = {
1021
1084
  /** Connection interface id. */
1022
- id?: string;
1085
+ id: string;
1023
1086
  /** Connection interface type id. */
1024
- typeId?: string;
1087
+ typeId: string;
1025
1088
  /** Connection interface id generated by client. */
1026
- connectionInterfaceId?: string;
1027
- visibility?: Visibility;
1089
+ connectionInterfaceId: string;
1090
+ visibility: Visibility;
1028
1091
  /** Version id from plugin that generated this connection interface. */
1029
1092
  sourcePluginVersionId?: string;
1030
1093
  /** Indicates if this connection interface was generated by a plugin or manually. */
1031
- automaticallyGenerated?: boolean;
1094
+ automaticallyGenerated: boolean;
1032
1095
  /** Connection interface attributes. */
1033
- attributesByEnv?: ConnectionInterfaceAttributesByEnv[];
1096
+ attributesByEnv: ConnectionInterfaceAttributesByEnv[];
1034
1097
  };
1035
1098
  export type DeploymentTargetsResponse = {
1036
1099
  targetId: string;
@@ -1112,24 +1175,24 @@ export type ApplicationCanBeDeletedResponse = {
1112
1175
  };
1113
1176
  export type WorkspaceInfo = {
1114
1177
  /** Workspace id. */
1115
- id?: string;
1178
+ id: string;
1116
1179
  /** Workspace name */
1117
- name?: string;
1180
+ name: string;
1118
1181
  };
1119
1182
  export type GetSharedInfraResponse = {
1120
1183
  /** Shared infrastructure id. */
1121
- id?: string;
1184
+ id: string;
1122
1185
  /** Shared infrastructure name. */
1123
- name?: string;
1186
+ name: string;
1124
1187
  /** Shared infrastructure description. */
1125
1188
  description?: string;
1126
1189
  /** Shared infrastructure repository url. */
1127
1190
  repoUrl?: string;
1128
1191
  /** Shared infrastructure repository base branch. */
1129
- repoBaseBranch?: string;
1192
+ repoBaseBranch: string;
1130
1193
  /** Stack used to generate this shared infrastructure. */
1131
- stackVersionId?: string;
1132
- workspace?: WorkspaceInfo;
1194
+ stackVersionId: string;
1195
+ workspace: WorkspaceInfo;
1133
1196
  };
1134
1197
  export type PluginInUseDetailsResponse = {
1135
1198
  workspaceId: string;
@@ -1137,41 +1200,35 @@ export type PluginInUseDetailsResponse = {
1137
1200
  };
1138
1201
  export type CheckConnectionSlugAvailabilityResponse = {
1139
1202
  /** Whether connection slug is available or not. */
1140
- available?: boolean;
1141
- };
1142
- export type WorkspaceResponse = {
1143
- /** Workspace id. */
1144
- id?: string;
1145
- /** Workspace name. */
1146
- name?: string;
1203
+ available: boolean;
1147
1204
  };
1148
1205
  export type ApplicationRepoUrlReadResponse = {
1149
1206
  /** Application id. */
1150
- id?: string;
1207
+ id: string;
1151
1208
  /** Application name. */
1152
- name?: string;
1209
+ name: string;
1153
1210
  /** Application status. */
1154
- status?: "CREATED" | "CREATE_FAILED" | "DRAFT" | "DELETING" | "DELETE_FAILED" | "ARCHIVING" | "ARCHIVED" | "ARCHIVE_FAILED";
1211
+ status: "CREATED" | "CREATE_FAILED" | "DRAFT" | "DELETING" | "DELETE_FAILED" | "ARCHIVING" | "ARCHIVED" | "ARCHIVE_FAILED";
1155
1212
  /** Application description. */
1156
1213
  description?: string;
1157
1214
  workspace?: WorkspaceResponse;
1158
1215
  };
1159
1216
  export type GetApplicationResponse = {
1160
1217
  /** Application id. */
1161
- id?: string;
1218
+ id: string;
1162
1219
  /** Application name. */
1163
- name?: string;
1220
+ name: string;
1164
1221
  /** Application description. */
1165
1222
  description?: string;
1166
1223
  /** Application repository url. */
1167
1224
  repoUrl?: string;
1168
1225
  /** Application repository base branch. */
1169
- repoBaseBranch?: string;
1226
+ repoBaseBranch: string;
1170
1227
  /** Stack used to generate this application. */
1171
- stackVersionId?: string;
1228
+ stackVersionId: string;
1172
1229
  /** Starter used to generate this application. */
1173
- starterId?: string;
1174
- workspace?: WorkspaceInfo;
1230
+ starterId: string;
1231
+ workspace: WorkspaceInfo;
1175
1232
  };
1176
1233
  export type WorkflowActionUsageResponse = {
1177
1234
  versionRanges: string[];
@@ -2062,12 +2119,59 @@ export function saveStackWorkflowContext({ stackId, workflowId, stackWorkflowCre
2062
2119
  body: stackWorkflowCreateRequest
2063
2120
  })));
2064
2121
  }
2122
+ /**
2123
+ * List specific shared infra or application usage by plugin list.
2124
+ */
2125
+ export function listPluginUsageByTargetId({ accountId, targetType, targetId, body }: {
2126
+ accountId: string;
2127
+ targetType: "applications" | "shared_infra";
2128
+ targetId: string;
2129
+ body: string[];
2130
+ }, opts?: Oazapfts.RequestOpts) {
2131
+ return oazapfts.ok(oazapfts.fetchJson<{
2132
+ status: 200;
2133
+ data: TargetByPluginUsageResponse[];
2134
+ } | {
2135
+ status: 403;
2136
+ data: ErrorResponse;
2137
+ }>(`/v1/${encodeURIComponent(targetType)}/${encodeURIComponent(targetId)}/plugins/usage`, oazapfts.json({
2138
+ ...opts,
2139
+ method: "POST",
2140
+ body,
2141
+ headers: oazapfts.mergeHeaders(opts?.headers, {
2142
+ accountId
2143
+ })
2144
+ })));
2145
+ }
2146
+ /**
2147
+ * List all shared infras or applications usage by plugin list.
2148
+ */
2149
+ export function listAllPluginUsage({ accountId, targetType, body }: {
2150
+ accountId: string;
2151
+ targetType: "applications" | "shared_infra";
2152
+ body: string[];
2153
+ }, opts?: Oazapfts.RequestOpts) {
2154
+ return oazapfts.ok(oazapfts.fetchJson<{
2155
+ status: 200;
2156
+ data: PluginUsageByTargetResponse[];
2157
+ } | {
2158
+ status: 403;
2159
+ data: ErrorResponse;
2160
+ }>(`/v1/${encodeURIComponent(targetType)}/plugins/usage`, oazapfts.json({
2161
+ ...opts,
2162
+ method: "POST",
2163
+ body,
2164
+ headers: oazapfts.mergeHeaders(opts?.headers, {
2165
+ accountId
2166
+ })
2167
+ })));
2168
+ }
2065
2169
  /**
2066
2170
  * Get all workspaces
2067
2171
  */
2068
2172
  export function getWorkspaces({ name, aclOnly, accountId }: {
2069
2173
  name?: string;
2070
- aclOnly: boolean;
2174
+ aclOnly?: boolean;
2071
2175
  accountId?: string;
2072
2176
  }, opts?: Oazapfts.RequestOpts) {
2073
2177
  return oazapfts.ok(oazapfts.fetchJson<{
@@ -3195,6 +3299,56 @@ export function processDeploySnapshot1({ workspaceId, applicationId, application
3195
3299
  body: applicationDeploySnapshotRequest
3196
3300
  })));
3197
3301
  }
3302
+ /**
3303
+ * List all workspaces usage by stack version list.
3304
+ */
3305
+ export function listAllStackUsage({ accountId, body }: {
3306
+ accountId: string;
3307
+ body: string[];
3308
+ }, opts?: Oazapfts.RequestOpts) {
3309
+ return oazapfts.ok(oazapfts.fetchJson<{
3310
+ status: 200;
3311
+ data: StackUsageByWorkspaceResponse[];
3312
+ } | {
3313
+ status: 403;
3314
+ data: ErrorResponse;
3315
+ }>("/v1/workspaces/stacks/usage", oazapfts.json({
3316
+ ...opts,
3317
+ method: "POST",
3318
+ body,
3319
+ headers: oazapfts.mergeHeaders(opts?.headers, {
3320
+ accountId
3321
+ })
3322
+ })));
3323
+ }
3324
+ /**
3325
+ * Retrieve the amount of apps and shared infras that use the given plugin version id list
3326
+ */
3327
+ export function findPluginUsageAmount({ accountId, body }: {
3328
+ accountId: string;
3329
+ body: string[];
3330
+ }, opts?: Oazapfts.RequestOpts) {
3331
+ return oazapfts.ok(oazapfts.fetchJson<{
3332
+ status: 200;
3333
+ data: PluginUsageAmountConsolidatedResponse;
3334
+ } | {
3335
+ status: 400;
3336
+ data: ErrorResponse;
3337
+ } | {
3338
+ status: 403;
3339
+ data: ErrorResponse;
3340
+ } | {
3341
+ status: 500;
3342
+ data: ErrorResponse;
3343
+ }>("/v1/plugin-usage", oazapfts.json({
3344
+ ...opts,
3345
+ method: "POST",
3346
+ body,
3347
+ headers: oazapfts.mergeHeaders(opts?.headers, {
3348
+ accountId
3349
+ })
3350
+ })));
3351
+ }
3198
3352
  /**
3199
3353
  * Get environments
3200
3354
  */