@stack-spot/portal-network 1.0.0-dev.1770928126041 → 1.0.0-dev.1771592097845

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/api/account.d.ts +430 -87
  3. package/dist/api/account.d.ts.map +1 -1
  4. package/dist/api/account.js +251 -37
  5. package/dist/api/account.js.map +1 -1
  6. package/dist/api/cloudPlatform.d.ts +57 -1
  7. package/dist/api/cloudPlatform.d.ts.map +1 -1
  8. package/dist/api/cloudPlatform.js +30 -0
  9. package/dist/api/cloudPlatform.js.map +1 -1
  10. package/dist/api-addresses.d.ts.map +1 -1
  11. package/dist/api-addresses.js +0 -1
  12. package/dist/api-addresses.js.map +1 -1
  13. package/dist/apis-itau.json +0 -8
  14. package/dist/apis.json +0 -8
  15. package/dist/client/account.d.ts +103 -1
  16. package/dist/client/account.d.ts.map +1 -1
  17. package/dist/client/account.js +96 -6
  18. package/dist/client/account.js.map +1 -1
  19. package/dist/client/cloud-platform.d.ts +44 -0
  20. package/dist/client/cloud-platform.d.ts.map +1 -1
  21. package/dist/client/cloud-platform.js +55 -1
  22. package/dist/client/cloud-platform.js.map +1 -1
  23. package/dist/index.d.ts +0 -1
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +0 -1
  26. package/dist/index.js.map +1 -1
  27. package/package.json +1 -1
  28. package/src/api/account.ts +833 -145
  29. package/src/api/cloudPlatform.ts +97 -1
  30. package/src/api-addresses.ts +0 -1
  31. package/src/apis-itau.json +0 -8
  32. package/src/apis.json +0 -8
  33. package/src/client/account.ts +57 -6
  34. package/src/client/cloud-platform.ts +30 -0
  35. package/src/index.ts +0 -1
  36. package/dist/api/cloudPlatformHorizon.d.ts +0 -1314
  37. package/dist/api/cloudPlatformHorizon.d.ts.map +0 -1
  38. package/dist/api/cloudPlatformHorizon.js +0 -494
  39. package/dist/api/cloudPlatformHorizon.js.map +0 -1
  40. package/dist/client/cloud-platform-horizon.d.ts +0 -210
  41. package/dist/client/cloud-platform-horizon.d.ts.map +0 -1
  42. package/dist/client/cloud-platform-horizon.js +0 -241
  43. package/dist/client/cloud-platform-horizon.js.map +0 -1
  44. package/src/api/cloudPlatformHorizon.ts +0 -3058
  45. package/src/client/cloud-platform-horizon.ts +0 -121
@@ -36,6 +36,7 @@ export type RoleSpec = {
36
36
  foundation: RoleSpecPermission;
37
37
  network: RoleSpecPermission;
38
38
  project: RoleSpecPermission;
39
+ serviceControlPolicy: RoleSpecPermission;
39
40
  vpn: RoleSpecPermission;
40
41
  };
41
42
  export type Role = {
@@ -66,6 +67,35 @@ export type VpnResponse = {
66
67
  updatedAt: string;
67
68
  deletedAt?: string;
68
69
  };
70
+ export type ServiceControlPolicyMetadata = {
71
+ creationTimestamp?: string;
72
+ deletionTimestamp?: string;
73
+ /** Universally Unique Lexicographically Sortable Identifier */
74
+ id?: string;
75
+ };
76
+ export type ServiceControlPolicySpecTarget = {
77
+ folderIds: string[];
78
+ projectIds: string[];
79
+ };
80
+ export type ServiceControlPolicySpec = {
81
+ /** Universally Unique Lexicographically Sortable Identifier */
82
+ foundationId: string;
83
+ name: string;
84
+ description: string;
85
+ content: string;
86
+ target: ServiceControlPolicySpecTarget;
87
+ tags: Tag[];
88
+ };
89
+ export type ServiceControlPolicyStatus = {
90
+ state: "READY" | "PENDING" | "DELETING" | "ERROR";
91
+ message?: string;
92
+ lastUpdateTimestamp?: string;
93
+ };
94
+ export type ServiceControlPolicy = {
95
+ metadata?: ServiceControlPolicyMetadata;
96
+ spec: ServiceControlPolicySpec;
97
+ status?: ServiceControlPolicyStatus;
98
+ };
69
99
  export type SecTool = {
70
100
  status: "READY" | "PENDING" | "DELETING" | "ERROR";
71
101
  };
@@ -299,6 +329,12 @@ export type CreateVpnRequest = {
299
329
  destinationCidrBlock: string;
300
330
  tags?: Tag[];
301
331
  };
332
+ export type ListServiceControlPolicy = {
333
+ /** Universally Unique Lexicographically Sortable Identifier */
334
+ foundationId?: string;
335
+ pendingResources: boolean;
336
+ content: ServiceControlPolicy[];
337
+ };
302
338
  export type ListProjectResponse = {
303
339
  stackSpotAccountId: string;
304
340
  foundationId: string;
@@ -378,8 +414,8 @@ export type ListCertificateResponse = {
378
414
  };
379
415
  export type CreateCertificateRequestBase = {
380
416
  tags?: Tag[];
381
- certificateName: string;
382
417
  forInbound: "TRUE" | "FALSE";
418
+ certificateName: string;
383
419
  "type": string;
384
420
  };
385
421
  export type CreatePublicCertificateRequest = {
@@ -477,6 +513,43 @@ export function putVpnTags({ authorization, xAccountId, foundationId, vpnId, bod
477
513
  })
478
514
  })));
479
515
  }
516
+ export function getServiceControlPolicy({ foundationId, serviceControlPolicyId }: {
517
+ foundationId: string;
518
+ serviceControlPolicyId: string;
519
+ }, opts?: Oazapfts.RequestOpts) {
520
+ return oazapfts.ok(oazapfts.fetchJson<{
521
+ status: 200;
522
+ data: ServiceControlPolicy;
523
+ }>(`/portal/foundations/${encodeURIComponent(foundationId)}/service-control-policies/${encodeURIComponent(serviceControlPolicyId)}`, {
524
+ ...opts
525
+ }));
526
+ }
527
+ export function putServiceControlPolicy({ foundationId, serviceControlPolicyId, serviceControlPolicy }: {
528
+ foundationId: string;
529
+ serviceControlPolicyId: string;
530
+ serviceControlPolicy: ServiceControlPolicy;
531
+ }, opts?: Oazapfts.RequestOpts) {
532
+ return oazapfts.ok(oazapfts.fetchJson<{
533
+ status: 202;
534
+ data: ServiceControlPolicy;
535
+ }>(`/portal/foundations/${encodeURIComponent(foundationId)}/service-control-policies/${encodeURIComponent(serviceControlPolicyId)}`, oazapfts.json({
536
+ ...opts,
537
+ method: "PUT",
538
+ body: serviceControlPolicy
539
+ })));
540
+ }
541
+ export function deleteServiceControlPolicy({ foundationId, serviceControlPolicyId }: {
542
+ foundationId: string;
543
+ serviceControlPolicyId: string;
544
+ }, opts?: Oazapfts.RequestOpts) {
545
+ return oazapfts.ok(oazapfts.fetchJson<{
546
+ status: 202;
547
+ data: ServiceControlPolicy;
548
+ }>(`/portal/foundations/${encodeURIComponent(foundationId)}/service-control-policies/${encodeURIComponent(serviceControlPolicyId)}`, {
549
+ ...opts,
550
+ method: "DELETE"
551
+ }));
552
+ }
480
553
  export function putFoundationSecProjectTags({ foundationId, body }: {
481
554
  foundationId: string;
482
555
  body: Tag[];
@@ -819,6 +892,29 @@ export function createVpn({ authorization, xAccountId, foundationId, createVpnRe
819
892
  })
820
893
  })));
821
894
  }
895
+ export function listServiceControlPolicy({ foundationId }: {
896
+ foundationId: string;
897
+ }, opts?: Oazapfts.RequestOpts) {
898
+ return oazapfts.ok(oazapfts.fetchJson<{
899
+ status: 200;
900
+ data: ListServiceControlPolicy;
901
+ }>(`/portal/foundations/${encodeURIComponent(foundationId)}/service-control-policies`, {
902
+ ...opts
903
+ }));
904
+ }
905
+ export function createServiceControlPolicy({ foundationId, serviceControlPolicy }: {
906
+ foundationId: string;
907
+ serviceControlPolicy: ServiceControlPolicy;
908
+ }, opts?: Oazapfts.RequestOpts) {
909
+ return oazapfts.ok(oazapfts.fetchJson<{
910
+ status: 202;
911
+ data: ServiceControlPolicy;
912
+ }>(`/portal/foundations/${encodeURIComponent(foundationId)}/service-control-policies`, oazapfts.json({
913
+ ...opts,
914
+ method: "POST",
915
+ body: serviceControlPolicy
916
+ })));
917
+ }
822
918
  export function listProject({ authorization, xAccountId, foundationId, parentFolderId }: {
823
919
  authorization: string;
824
920
  xAccountId?: string;
@@ -148,7 +148,6 @@ const networkApiNameToOpaApiName = {
148
148
  workspaceManager: 'workspace-manager',
149
149
  cloudServices: 'cloud-services',
150
150
  cloudAccount: 'cloud-account',
151
- cloudPlatformHorizon: 'cloud-platform-horizon',
152
151
  codeShift: 'code-shift',
153
152
  genAiInference: 'ai-inference',
154
153
  apiRuntime: 'runtime-manager',
@@ -190,14 +190,6 @@
190
190
  },
191
191
  "docs": "/v3/api-docs"
192
192
  },
193
- "cloudPlatformHorizon": {
194
- "url": {
195
- "dev": "https://cloud-platform-horizon.dev.stackspot.com",
196
- "stg": "https://cloud-platform-horizon.stg.stackspot.com",
197
- "prd": "https://cloud-platform-horizon.stackspot.com"
198
- },
199
- "docs": "/v3/api-docs"
200
- },
201
193
  "codeShift": {
202
194
  "url": {
203
195
  "dev": "https://code-shift-code-shift-api.dev.stackspot.com",
package/src/apis.json CHANGED
@@ -190,14 +190,6 @@
190
190
  },
191
191
  "docs": "/v3/api-docs"
192
192
  },
193
- "cloudPlatformHorizon": {
194
- "url": {
195
- "dev": "https://cloud-platform-horizon.dev.stackspot.com",
196
- "stg": "https://cloud-platform-horizon.stg.stackspot.com",
197
- "prd": "https://cloud-platform-horizon.stackspot.com"
198
- },
199
- "docs": "/v3/api-docs"
200
- },
201
193
  "codeShift": {
202
194
  "url": {
203
195
  "dev": "https://code-shift-code-shift-api.dev.stackspot.com",
@@ -14,6 +14,7 @@ import {
14
14
  cancelSecretDelete,
15
15
  create,
16
16
  create1,
17
+ create2,
17
18
  createAccountRole, createExtension, createExtensionLink,
18
19
  createExtensionVersion, createFidoMagicLink, createGroupMapping,
19
20
  createPartner,
@@ -51,11 +52,13 @@ import {
51
52
  getAccounts,
52
53
  getAccountSso,
53
54
  getActiveExtensionVersion,
55
+ getAll,
54
56
  getAllAccountSso,
55
57
  getAllGroupMapping,
56
58
  getAllMemberFidoCredentials,
57
59
  getAllServiceCredentialRateLimit,
58
60
  getById,
61
+ getById2,
59
62
  getEnabledFeatureFlagsForAccount,
60
63
  getExtensionVersion,
61
64
  getExternalLinksByType,
@@ -67,6 +70,7 @@ import {
67
70
  getGroupResources1,
68
71
  getGroups,
69
72
  getGroups1,
73
+ getGroups2,
70
74
  getMemberById,
71
75
  getMemberGroups,
72
76
  getMemberGroups1,
@@ -74,13 +78,15 @@ import {
74
78
  getMembers,
75
79
  getMembers1,
76
80
  getPartnerAccount, getPartnersSharingAllowed,
81
+ getPermissions,
77
82
  getPersonalAccountDetails,
78
83
  getPersonalAccountExpirationData,
79
84
  getPersonalClientCredentials,
80
85
  getResources,
81
86
  getResources2,
82
87
  getResourcesAndActionsWithStatus,
83
- getResourceTypes1,
88
+ getResourceTypes,
89
+ getResourceTypes2,
84
90
  getRoleGroups,
85
91
  getRoleGroups1,
86
92
  getRoleMembers,
@@ -109,10 +115,14 @@ import {
109
115
  listScmCredentials2, partialUpdateSso, personalAccessTokenAuthorization,
110
116
  personalContact,
111
117
  reactivateTrialAccount,
118
+ removeGroup,
119
+ removePermissions,
112
120
  removeRoleFromMember,
113
121
  removeTrialAccount,
122
+ replacePermissions,
114
123
  resetOtp,
115
124
  resetPassword,
125
+ revoke,
116
126
  revokeServiceCredential,
117
127
  revokeServiceCredential1,
118
128
  rotateServiceCredentialSecret,
@@ -167,7 +177,7 @@ class AccountClient extends ReactQueryNetworkClient {
167
177
  /**
168
178
  * Creates a Feature Flag
169
179
  */
170
- createFeatureFlag = this.mutation(create)
180
+ createFeatureFlag = this.mutation(create1)
171
181
  /**
172
182
  * Lists all Feature Flags in an Account
173
183
  */
@@ -401,7 +411,7 @@ class AccountClient extends ReactQueryNetworkClient {
401
411
  /**
402
412
  * Gets all resource types (paginated)
403
413
  */
404
- allResourceTypes = this.infiniteQuery(getResourceTypes1)
414
+ allResourceTypes = this.infiniteQuery(getResourceTypes2)
405
415
  /**
406
416
  * Sends an email for downloading the CLI
407
417
  */
@@ -643,11 +653,11 @@ class AccountClient extends ReactQueryNetworkClient {
643
653
  /**
644
654
  * Get all account groups with pagination
645
655
  */
646
- allGroupsWithPagination = this.query(getGroups1)
656
+ allGroupsWithPagination = this.query(getGroups2)
647
657
  /**
648
658
  * Get groups with infinite query
649
659
  */
650
- groups = this.infiniteQuery(getGroups1, { accumulator: 'items' })
660
+ groups = this.infiniteQuery(getGroups2, { accumulator: 'items' })
651
661
  /**
652
662
  * Get all members by group with pagination
653
663
  */
@@ -895,7 +905,7 @@ class AccountClient extends ReactQueryNetworkClient {
895
905
  /**
896
906
  * Create an enterprise account
897
907
  */
898
- createEnterpriseAccount = this.mutation(create1)
908
+ createEnterpriseAccount = this.mutation(create2)
899
909
  /**
900
910
  * Lists enterprise accounts
901
911
  */
@@ -932,6 +942,47 @@ class AccountClient extends ReactQueryNetworkClient {
932
942
  * Reactive trial account
933
943
  */
934
944
  reactivateTrialAccount = this.mutation(reactivateTrialAccount)
945
+
946
+ /**
947
+ * Get all service credentials paginated
948
+ */
949
+ gerServicesCredentials = this.infiniteQuery(getAll, { accumulator: 'items' })
950
+ /**
951
+ * Get Service Credential V3
952
+ */
953
+ getServiceCredential = this.query(getById2)
954
+ /**
955
+ * Get Resources Types with actions
956
+ */
957
+ resourcesTypesWithActions = this.infiniteQuery(getResourceTypes, { accumulator: 'items' })
958
+ /**
959
+ * Get Permissions from Service Credential
960
+ */
961
+ getPermissionsServiceCredential = this.query(getPermissions)
962
+ /**
963
+ * Get Groups from Service Credential
964
+ */
965
+ getGroupsServiceCredential = this.query(getGroups1)
966
+ /**
967
+ * Create Service Credential with Permissions
968
+ */
969
+ createServiceCredentialWithResources = this.mutation(create)
970
+ /**
971
+ * Add Permissions to Service Credential
972
+ */
973
+ updatePermissionsToServiceCredential = this.mutation(replacePermissions)
974
+ /**
975
+ * Remove permission from Service Credential
976
+ */
977
+ removePermissionFromServiceCredential = this.mutation(removePermissions)
978
+ /**
979
+ * Remove group from Service Credential
980
+ */
981
+ removeGroupFromServiceCredential = this.mutation(removeGroup)
982
+ /**
983
+ * Revoke Service Credential V3
984
+ */
985
+ revokeServiceCredentialV3 = this.mutation(revoke)
935
986
  }
936
987
 
937
988
  export const accountClient = new AccountClient()
@@ -10,6 +10,7 @@ import {
10
10
  createFoundation,
11
11
  createNetwork,
12
12
  createProject,
13
+ createServiceControlPolicy,
13
14
  createVpn,
14
15
  defaults,
15
16
  deleteBoundary,
@@ -30,6 +31,7 @@ import {
30
31
  getFoundation,
31
32
  getNetwork,
32
33
  getProject,
34
+ getServiceControlPolicy,
33
35
  getVpnConfiguration,
34
36
  listBoundary,
35
37
  listBoundarySso,
@@ -39,6 +41,8 @@ import {
39
41
  listDnsZone,
40
42
  listFoundations,
41
43
  listNetwork,
44
+ listProject,
45
+ listServiceControlPolicy,
42
46
  listVpns,
43
47
  putBoundaryDescription,
44
48
  putBoundaryPolicyDocument,
@@ -50,8 +54,10 @@ import {
50
54
  putCidrTags,
51
55
  putDnsZoneTags,
52
56
  putFolderTags,
57
+ putFoundationSecProjectTags,
53
58
  putNetworkTags,
54
59
  putProjectTags,
60
+ putServiceControlPolicy,
55
61
  putVpnTags,
56
62
  } from '../api/cloudPlatform'
57
63
  import { DefaultAPIError } from '../error/DefaultAPIError'
@@ -277,6 +283,30 @@ class CloudPlatformClient extends ReactQueryNetworkClient {
277
283
  * Edit sso boundary description
278
284
  */
279
285
  editSSOBoundaryDescription = this.mutation(removeAuthorizationParam(putBoundarySsoDescription))
286
+ /**
287
+ * Edit foundation security tags
288
+ */
289
+ editFoundationSecurityTags = this.mutation(removeAuthorizationParam(putFoundationSecProjectTags))
290
+ /**
291
+ * List service control policy
292
+ */
293
+ listServiceControlPolicy = this.query(removeAuthorizationParam(listServiceControlPolicy))
294
+ /**
295
+ * Get a service control policy details
296
+ */
297
+ getServiceControlPolicy = this.query(removeAuthorizationParam(getServiceControlPolicy))
298
+ /**
299
+ * Edit service control policy
300
+ */
301
+ editServiceControlPolicy = this.mutation(removeAuthorizationParam(putServiceControlPolicy))
302
+ /**
303
+ * Create a service control policy
304
+ */
305
+ createServiceControlPolicy = this.mutation(removeAuthorizationParam(createServiceControlPolicy))
306
+ /**
307
+ * List projects from a foundation
308
+ */
309
+ listFoundationProjects = this.query(removeAuthorizationParam(listProject))
280
310
  }
281
311
 
282
312
  export const cloudPlatformClient = new CloudPlatformClient()
package/src/index.ts CHANGED
@@ -8,7 +8,6 @@ export { aiClient } from './client/ai'
8
8
  export { apiManagementClient } from './client/api-management'
9
9
  export { cloudAccountClient } from './client/cloud-account'
10
10
  export { cloudPlatformClient } from './client/cloud-platform'
11
- export { cloudPlatformHorizonClient } from './client/cloud-platform-horizon'
12
11
  export { cloudRuntimesClient } from './client/cloud-runtimes'
13
12
  export { cloudServicesClient } from './client/cloud-services'
14
13
  export { codeShiftClient } from './client/code-shift'