@stack-spot/portal-network 0.165.2 → 0.167.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.
@@ -50,7 +50,7 @@ export type ShareableLinkResponse = {
50
50
  "type": string;
51
51
  created_by: string;
52
52
  };
53
- export type Action = "view" | "edit" | "grant_access";
53
+ export type Action = "VIEW" | "EDIT" | "GRANT_ACESS";
54
54
  export type PermissionListRequest = {
55
55
  identifier: string;
56
56
  action: Action;
@@ -84,6 +84,21 @@ export type ListWksContentsResponse = {
84
84
  [key: string]: any;
85
85
  }[] | null;
86
86
  };
87
+ export type PermissionForSharedRequest = {
88
+ userId: string;
89
+ action: Action;
90
+ userName?: string | null;
91
+ };
92
+ export type PermissionListForSharedRequest = {
93
+ users: PermissionForSharedRequest[];
94
+ };
95
+ export type ResourceMembersResponse = {
96
+ id: string;
97
+ username: string;
98
+ email: string;
99
+ name: string;
100
+ actions: string[];
101
+ };
87
102
  /**
88
103
  * Create Workspace
89
104
  */
@@ -543,6 +558,100 @@ export function useShareableLinkV1ShareShareIdPatch({ shareId, authorization, xA
543
558
  })
544
559
  }));
545
560
  }
561
+ /**
562
+ * Add Permission
563
+ */
564
+ export function addPermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierPatch({ resourceType, resourceIdentifier, authorization, xAccountId, permissionListForSharedRequest }: {
565
+ resourceType: ContentType;
566
+ resourceIdentifier: string;
567
+ authorization: string;
568
+ xAccountId?: string | null;
569
+ permissionListForSharedRequest: PermissionListForSharedRequest;
570
+ }, opts?: Oazapfts.RequestOpts) {
571
+ return oazapfts.ok(oazapfts.fetchJson<{
572
+ status: 204;
573
+ } | {
574
+ status: 404;
575
+ } | {
576
+ status: 422;
577
+ data: HttpValidationError;
578
+ }>(`/v1/resource-type/${encodeURIComponent(resourceType)}/resources/${encodeURIComponent(resourceIdentifier)}`, oazapfts.json({
579
+ ...opts,
580
+ method: "PATCH",
581
+ body: permissionListForSharedRequest,
582
+ headers: oazapfts.mergeHeaders(opts?.headers, {
583
+ authorization,
584
+ "x-account-id": xAccountId
585
+ })
586
+ })));
587
+ }
588
+ /**
589
+ * Remove Permission
590
+ */
591
+ export function removePermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierDelete({ resourceType, resourceIdentifier, authorization, xAccountId, permissionListForSharedRequest }: {
592
+ resourceType: ContentType;
593
+ resourceIdentifier: string;
594
+ authorization: string;
595
+ xAccountId?: string | null;
596
+ permissionListForSharedRequest: PermissionListForSharedRequest;
597
+ }, opts?: Oazapfts.RequestOpts) {
598
+ return oazapfts.ok(oazapfts.fetchJson<{
599
+ status: 204;
600
+ } | {
601
+ status: 404;
602
+ } | {
603
+ status: 422;
604
+ data: HttpValidationError;
605
+ }>(`/v1/resource-type/${encodeURIComponent(resourceType)}/resources/${encodeURIComponent(resourceIdentifier)}`, oazapfts.json({
606
+ ...opts,
607
+ method: "DELETE",
608
+ body: permissionListForSharedRequest,
609
+ headers: oazapfts.mergeHeaders(opts?.headers, {
610
+ authorization,
611
+ "x-account-id": xAccountId
612
+ })
613
+ })));
614
+ }
615
+ /**
616
+ * List Members
617
+ */
618
+ export function listMembersV1ResourceTypeResourceTypeResourcesResourceIdentifierMembersGet({ resourceType, resourceIdentifier, search, filterBy, filterValue, sortBy, page, size, order, authorization, xAccountId }: {
619
+ resourceType: ContentType;
620
+ resourceIdentifier: string;
621
+ search?: string | null;
622
+ filterBy?: string | null;
623
+ filterValue?: string | null;
624
+ sortBy?: SortBy | null;
625
+ page?: number;
626
+ size?: number;
627
+ order?: OrderEnum;
628
+ authorization: string;
629
+ xAccountId?: string | null;
630
+ }, opts?: Oazapfts.RequestOpts) {
631
+ return oazapfts.ok(oazapfts.fetchJson<{
632
+ status: 200;
633
+ data: ResourceMembersResponse[];
634
+ } | {
635
+ status: 404;
636
+ } | {
637
+ status: 422;
638
+ data: HttpValidationError;
639
+ }>(`/v1/resource-type/${encodeURIComponent(resourceType)}/resources/${encodeURIComponent(resourceIdentifier)}/members${QS.query(QS.explode({
640
+ search,
641
+ filter_by: filterBy,
642
+ filter_value: filterValue,
643
+ sort_by: sortBy,
644
+ page,
645
+ size,
646
+ order
647
+ }))}`, {
648
+ ...opts,
649
+ headers: oazapfts.mergeHeaders(opts?.headers, {
650
+ authorization,
651
+ "x-account-id": xAccountId
652
+ })
653
+ }));
654
+ }
546
655
  /**
547
656
  * Healthz
548
657
  */
@@ -4,7 +4,7 @@ import { DefaultAPIError } from '../error/DefaultAPIError'
4
4
  import { StackspotAPIError } from '../error/StackspotAPIError'
5
5
  import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
6
6
  import { removeAuthorizationParam } from '../utils/remove-authorization-param'
7
- import { createAddon, createDeployTemplate, createOrganization, createRuntime1, createTenant1, defaults, deploy, findApplicationDeploymentById, getApplicationDeploymentHealth, getApplicationDeploymentLogs, getOrganizationById, getOrganizations, getRuntime1, getTenant1, listAddon, listApplicationDeployments, listDeployTemplate, listRuntimes, listRuntimes1, listTenants, listTenants1 } from '../api/cloudPlatformHorizon'
7
+ import { associateWithWorkspaceEnvironment, createAddon, createDeployTemplate, createOrganization, createRuntime1, createTenant1, defaults, deploy, findApplicationDeploymentById, getApplicationDeploymentHealth, getApplicationDeploymentLogs, getAssociationWorkspaceEnvironmentByRuntimeId, getOrganizationById, getOrganizations, getRuntime1, getTenant1, listAddon, listApplicationDeployments, listAssociations, listDeployTemplate, listRuntimes, listRuntimes1, listTenants, listTenants1 } from '../api/cloudPlatformHorizon'
8
8
  import { baseDictionary } from '../error/dictionary/base'
9
9
  import { getApiAddresses } from '../api-addresses'
10
10
 
@@ -96,6 +96,18 @@ class CloudPlatformHorizonClient extends ReactQueryNetworkClient {
96
96
  * Create an deploy template
97
97
  */
98
98
  createDeployTemplate = this.mutation(removeAuthorizationParam(createDeployTemplate))
99
+ /**
100
+ * Associate an runtime with an workspace environment
101
+ */
102
+ associateRuntimeWithWorkspaceEnv = this.mutation(removeAuthorizationParam(associateWithWorkspaceEnvironment))
103
+ /**
104
+ * Retrieves associate runtime with a workspace's environment
105
+ */
106
+ getRuntimeAssociations = this.query(removeAuthorizationParam(getAssociationWorkspaceEnvironmentByRuntimeId))
107
+ /**
108
+ * List runtime associations to workspace's environment
109
+ */
110
+ listRuntimeAssociationsToEnv = this.query(removeAuthorizationParam(listAssociations))
99
111
  }
100
112
 
101
113
  export const cloudPlatformHorizonClient = new CloudPlatformHorizonClient()
@@ -5,6 +5,7 @@ import { GetAiStackResponse, KnowledgeSourceItemResponse, QuickCommandResponse }
5
5
  import {
6
6
  addContentV1WorkspacesWorkspaceIdContentTypePost,
7
7
  addFavoriteV1WorkspacesWorkspaceIdFavoritePost,
8
+ addPermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierPatch,
8
9
  addPermissionV1WorkspacesWorkspaceIdPermissionsPatch,
9
10
  createShareableLinkV1WorkspacesWorkspaceIdSharePost,
10
11
  createWorkspaceV1WorkspacesPost,
@@ -16,8 +17,10 @@ import {
16
17
  listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet,
17
18
  listAllContentsV1WorkspacesContentsContentTypeGet,
18
19
  listGroupsAndMembersPermissionInWorkspaceV1WorkspacesWorkspaceIdPermissionsGet,
20
+ listMembersV1ResourceTypeResourceTypeResourcesResourceIdentifierMembersGet,
19
21
  listWorkspacesV1WorkspacesGet,
20
22
  removeContentV1WorkspacesWorkspaceIdContentTypeContentIdDelete,
23
+ removePermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierDelete,
21
24
  removePermissionV1WorkspacesWorkspaceIdPermissionsDelete,
22
25
  updateWorkspaceV1WorkspacesWorkspaceIdPatch,
23
26
  useShareableLinkV1ShareShareIdPatch,
@@ -173,6 +176,20 @@ class WorkspaceAiClient extends ReactQueryNetworkClient {
173
176
  * Get a shareable link from a spot
174
177
  */
175
178
  shareableLink = this.mutation(removeAuthorizationParam(useShareableLinkV1ShareShareIdPatch))
179
+ /**
180
+ * Add permission to resource
181
+ */
182
+ addPermissionResource = this.mutation(removeAuthorizationParam(addPermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierPatch))
183
+ /**
184
+ * Remove permission to resource
185
+ */
186
+ removePermissionResource =
187
+ this.mutation(removeAuthorizationParam(removePermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierDelete))
188
+ /**
189
+ * List members with permission to resource
190
+ */
191
+ listMembersResource =
192
+ this.infiniteQuery(removeAuthorizationParam(listMembersV1ResourceTypeResourceTypeResourcesResourceIdentifierMembersGet))
176
193
  }
177
194
 
178
195
  export const workspaceAiClient = new WorkspaceAiClient()