@stack-spot/portal-network 0.189.0 → 0.190.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.
- package/CHANGELOG.md +7 -0
- package/dist/api/account.d.ts +197 -202
- package/dist/api/account.d.ts.map +1 -1
- package/dist/api/account.js +154 -140
- package/dist/api/account.js.map +1 -1
- package/dist/client/account.d.ts +29 -29
- package/dist/client/account.d.ts.map +1 -1
- package/dist/client/account.js +26 -17
- package/dist/client/account.js.map +1 -1
- package/package.json +1 -1
- package/src/api/account.ts +298 -392
- package/src/client/account.ts +25 -28
package/src/client/account.ts
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
bindRoles,
|
|
12
12
|
bindToGroups,
|
|
13
13
|
bindToRoles,
|
|
14
|
+
cancelSecretDelete,
|
|
14
15
|
create,
|
|
15
16
|
create1,
|
|
16
17
|
createAccountRole, createExtension, createExtensionLink,
|
|
@@ -41,7 +42,7 @@ import {
|
|
|
41
42
|
enableSecret,
|
|
42
43
|
enterpriseContact,
|
|
43
44
|
findAssociations,
|
|
44
|
-
|
|
45
|
+
findSecrets,
|
|
45
46
|
getAccess,
|
|
46
47
|
getAccount1,
|
|
47
48
|
getAccountMembers,
|
|
@@ -63,31 +64,23 @@ import {
|
|
|
63
64
|
getFeatures3,
|
|
64
65
|
getGroupById,
|
|
65
66
|
getGroupResources,
|
|
66
|
-
getGroupResources1,
|
|
67
67
|
getGroups,
|
|
68
|
-
getGroups1,
|
|
69
68
|
getMemberById,
|
|
70
69
|
getMemberGroups,
|
|
71
|
-
getMemberGroups1,
|
|
72
70
|
getMemberPreferences,
|
|
73
71
|
getMembers,
|
|
74
|
-
getMembers1,
|
|
75
72
|
getPartnerAccount, getPartnersSharingAllowed,
|
|
76
73
|
getPersonalAccountDetails,
|
|
77
74
|
getPersonalClientCredentials,
|
|
78
|
-
|
|
75
|
+
getResources,
|
|
79
76
|
getResources2,
|
|
80
|
-
|
|
77
|
+
getResourcesAndActionsWithStatus,
|
|
81
78
|
getResourceTypes1,
|
|
82
79
|
getRoleGroups,
|
|
83
|
-
getRoleGroups1,
|
|
84
80
|
getRoleMembers,
|
|
85
|
-
getRoleMembers1,
|
|
86
81
|
getRoles,
|
|
87
82
|
getRoles1,
|
|
88
83
|
getRoles2,
|
|
89
|
-
getRoles3,
|
|
90
|
-
getRoles4, getRoles5,
|
|
91
84
|
getScmProvider,
|
|
92
85
|
getServiceCredential,
|
|
93
86
|
getServiceCredentialByIdRateLimit,
|
|
@@ -226,11 +219,11 @@ class AccountClient extends ReactQueryNetworkClient {
|
|
|
226
219
|
/**
|
|
227
220
|
* Gets member Groups (paginated).
|
|
228
221
|
*/
|
|
229
|
-
memberGroups = this.infiniteQuery(
|
|
222
|
+
memberGroups = this.infiniteQuery(getMemberGroups)
|
|
230
223
|
/**
|
|
231
224
|
* Gets member roles (paginated).
|
|
232
225
|
*/
|
|
233
|
-
memberRoles = this.infiniteQuery(
|
|
226
|
+
memberRoles = this.infiniteQuery(getRoles1)
|
|
234
227
|
/**
|
|
235
228
|
* Gets member resources.
|
|
236
229
|
*/
|
|
@@ -282,7 +275,7 @@ class AccountClient extends ReactQueryNetworkClient {
|
|
|
282
275
|
/**
|
|
283
276
|
* Get all groups (paginated).
|
|
284
277
|
*/
|
|
285
|
-
allGroups = this.infiniteQuery(
|
|
278
|
+
allGroups = this.infiniteQuery(getGroups)
|
|
286
279
|
/**
|
|
287
280
|
* Creates a group.
|
|
288
281
|
*/
|
|
@@ -298,7 +291,7 @@ class AccountClient extends ReactQueryNetworkClient {
|
|
|
298
291
|
/**
|
|
299
292
|
* Gets all members in a group (paginated).
|
|
300
293
|
*/
|
|
301
|
-
groupMembers = this.infiniteQuery(
|
|
294
|
+
groupMembers = this.infiniteQuery(getMembers)
|
|
302
295
|
/**
|
|
303
296
|
* Adds several members to a group
|
|
304
297
|
*/
|
|
@@ -310,7 +303,7 @@ class AccountClient extends ReactQueryNetworkClient {
|
|
|
310
303
|
/**
|
|
311
304
|
* Gets all roles of a group.
|
|
312
305
|
*/
|
|
313
|
-
groupRoles = this.infiniteQuery(
|
|
306
|
+
groupRoles = this.infiniteQuery(getRoles2)
|
|
314
307
|
/**
|
|
315
308
|
* Adds several roles to a group.
|
|
316
309
|
*/
|
|
@@ -322,7 +315,7 @@ class AccountClient extends ReactQueryNetworkClient {
|
|
|
322
315
|
/**
|
|
323
316
|
* Gets all resources of a group (paginated).
|
|
324
317
|
*/
|
|
325
|
-
groupResources = this.infiniteQuery(
|
|
318
|
+
groupResources = this.infiniteQuery(getGroupResources)
|
|
326
319
|
/**
|
|
327
320
|
* Adds several resources to a group.
|
|
328
321
|
*/
|
|
@@ -334,14 +327,14 @@ class AccountClient extends ReactQueryNetworkClient {
|
|
|
334
327
|
/**
|
|
335
328
|
* Gets all roles in the account (paginated)
|
|
336
329
|
*/
|
|
337
|
-
allRoles = this.infiniteQuery(
|
|
330
|
+
allRoles = this.infiniteQuery(getRoles)
|
|
338
331
|
/**
|
|
339
332
|
* Get a role by id
|
|
340
333
|
*/
|
|
341
334
|
role = this.query({
|
|
342
335
|
name: 'account.role',
|
|
343
336
|
request: async (signal, { id }: { id: string }) => {
|
|
344
|
-
const roles = await
|
|
337
|
+
const roles = await getRoles({ filterBy: 'id', filterValue: id }, { signal })
|
|
345
338
|
if (!roles.length) throw new StackspotAPIError({ status: 404 })
|
|
346
339
|
return roles[0]
|
|
347
340
|
},
|
|
@@ -349,7 +342,7 @@ class AccountClient extends ReactQueryNetworkClient {
|
|
|
349
342
|
/**
|
|
350
343
|
* Gets all members with the provided role (paginated)
|
|
351
344
|
*/
|
|
352
|
-
roleMembers = this.infiniteQuery(
|
|
345
|
+
roleMembers = this.infiniteQuery(getRoleMembers)
|
|
353
346
|
/**
|
|
354
347
|
* Creates a role
|
|
355
348
|
*/
|
|
@@ -369,7 +362,7 @@ class AccountClient extends ReactQueryNetworkClient {
|
|
|
369
362
|
/**
|
|
370
363
|
* Gets all groups with the provided role (paginated)
|
|
371
364
|
*/
|
|
372
|
-
roleGroups = this.infiniteQuery(
|
|
365
|
+
roleGroups = this.infiniteQuery(getRoleGroups)
|
|
373
366
|
/**
|
|
374
367
|
* Adds a role to several groups
|
|
375
368
|
*/
|
|
@@ -377,7 +370,7 @@ class AccountClient extends ReactQueryNetworkClient {
|
|
|
377
370
|
/**
|
|
378
371
|
* Get the actions a role is allowed to perform
|
|
379
372
|
*/
|
|
380
|
-
rolePermissions = this.infiniteQuery(
|
|
373
|
+
rolePermissions = this.infiniteQuery(getResourcesAndActionsWithStatus)
|
|
381
374
|
/**
|
|
382
375
|
* Updates a role with new list of permissions
|
|
383
376
|
*/
|
|
@@ -389,7 +382,7 @@ class AccountClient extends ReactQueryNetworkClient {
|
|
|
389
382
|
/**
|
|
390
383
|
* Gets all resources (paginated)
|
|
391
384
|
*/
|
|
392
|
-
allResources = this.infiniteQuery(
|
|
385
|
+
allResources = this.infiniteQuery(getResources)
|
|
393
386
|
/**
|
|
394
387
|
* Gets all resource types (paginated)
|
|
395
388
|
*/
|
|
@@ -738,15 +731,15 @@ class AccountClient extends ReactQueryNetworkClient {
|
|
|
738
731
|
/**
|
|
739
732
|
* Get secrets
|
|
740
733
|
*/
|
|
741
|
-
getSecrets = this.query(
|
|
734
|
+
getSecrets = this.query(findSecrets)
|
|
742
735
|
/**
|
|
743
736
|
* Get workspace and spot secrets
|
|
744
737
|
*/
|
|
745
738
|
getWorkspaceAndSpotSecrets = this.query({
|
|
746
739
|
name: 'account.getWorkspaceAndSpotSecrets',
|
|
747
740
|
request: async (signal) => {
|
|
748
|
-
const workspaceSecrets = await
|
|
749
|
-
const spotSecrets = await
|
|
741
|
+
const workspaceSecrets = await findSecrets({ filterByScope: 'SCOPED', filterByScopedBy: 'WORKSPACE', size: 1500 }, { signal })
|
|
742
|
+
const spotSecrets = await findSecrets({ filterByScope: 'SCOPED', filterByScopedBy: 'SPOT', size: 1500 }, { signal })
|
|
750
743
|
return { workspaces: workspaceSecrets?.items, spots: spotSecrets?.items }
|
|
751
744
|
},
|
|
752
745
|
})
|
|
@@ -759,10 +752,10 @@ class AccountClient extends ReactQueryNetworkClient {
|
|
|
759
752
|
*/
|
|
760
753
|
getSecretsByIds = this.query({
|
|
761
754
|
name: 'getSecretsByIds',
|
|
762
|
-
request: (signal, variables: { ids: string[]
|
|
755
|
+
request: (signal, variables: { ids: string[] }) => {
|
|
763
756
|
const requests = variables?.ids?.map((secretId) => getById({ secretId }, { signal }))
|
|
764
757
|
return Promise.all(requests)
|
|
765
|
-
}
|
|
758
|
+
},
|
|
766
759
|
})
|
|
767
760
|
|
|
768
761
|
/**
|
|
@@ -785,6 +778,10 @@ class AccountClient extends ReactQueryNetworkClient {
|
|
|
785
778
|
* Disable secret
|
|
786
779
|
*/
|
|
787
780
|
disableSecret = this.mutation(disableSecret)
|
|
781
|
+
/**
|
|
782
|
+
* Cancel Secret delete
|
|
783
|
+
*/
|
|
784
|
+
cancelSecretDelete = this.mutation(cancelSecretDelete)
|
|
788
785
|
|
|
789
786
|
// TRIAL
|
|
790
787
|
/**
|