@stack-spot/portal-network 0.187.1-beta.1 → 0.188.0-beta.1
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 +15 -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/api/codeShift.d.ts +21 -0
- package/dist/api/codeShift.d.ts.map +1 -1
- package/dist/api/codeShift.js +13 -0
- package/dist/api/codeShift.js.map +1 -1
- package/dist/client/account.d.ts +30 -32
- 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/dist/client/code-shift.d.ts +9 -0
- package/dist/client/code-shift.d.ts.map +1 -1
- package/dist/client/code-shift.js +11 -1
- package/dist/client/code-shift.js.map +1 -1
- package/package.json +1 -1
- package/src/api/account.ts +298 -392
- package/src/api/codeShift.ts +36 -0
- package/src/client/account.ts +25 -28
- package/src/client/code-shift.ts +8 -0
package/src/api/codeShift.ts
CHANGED
|
@@ -153,6 +153,8 @@ export type PutModuleRequest = {
|
|
|
153
153
|
/** Inputs of module */
|
|
154
154
|
inputs?: InputRequest[] | null;
|
|
155
155
|
/** Module studio */
|
|
156
|
+
studio?: string | null;
|
|
157
|
+
/** Module Constants */
|
|
156
158
|
constants?: {
|
|
157
159
|
[key: string]: any;
|
|
158
160
|
} | null;
|
|
@@ -344,6 +346,13 @@ export type CustomerRatingResponse = {
|
|
|
344
346
|
created_by: UserResponse;
|
|
345
347
|
created_at: string;
|
|
346
348
|
};
|
|
349
|
+
export type LanguageResponse = {
|
|
350
|
+
name: string;
|
|
351
|
+
extensions: string[];
|
|
352
|
+
bytes: number;
|
|
353
|
+
relativePercentage: number;
|
|
354
|
+
absolutePercentage: number;
|
|
355
|
+
};
|
|
347
356
|
export type GetReportResponse = {
|
|
348
357
|
id: string;
|
|
349
358
|
"module": ModuleResponse2 | null;
|
|
@@ -379,6 +388,7 @@ export type GetReportResponse = {
|
|
|
379
388
|
[key: string]: any;
|
|
380
389
|
} | null;
|
|
381
390
|
customer_rating?: CustomerRatingResponse | null;
|
|
391
|
+
languages?: LanguageResponse[] | null;
|
|
382
392
|
};
|
|
383
393
|
export type GetReportResponseRead = {
|
|
384
394
|
id: string;
|
|
@@ -415,6 +425,7 @@ export type GetReportResponseRead = {
|
|
|
415
425
|
[key: string]: any;
|
|
416
426
|
} | null;
|
|
417
427
|
customer_rating?: CustomerRatingResponse | null;
|
|
428
|
+
languages?: LanguageResponse[] | null;
|
|
418
429
|
};
|
|
419
430
|
export type GetPullRequest = {
|
|
420
431
|
content: string;
|
|
@@ -550,6 +561,7 @@ export type RepositoryResponse = {
|
|
|
550
561
|
tags: string[];
|
|
551
562
|
url: string;
|
|
552
563
|
defaultBranch: string;
|
|
564
|
+
languages?: LanguageResponse[] | null;
|
|
553
565
|
};
|
|
554
566
|
export type RepositoryResponseRead = {
|
|
555
567
|
/** Repository ID */
|
|
@@ -562,6 +574,7 @@ export type RepositoryResponseRead = {
|
|
|
562
574
|
tags: string[];
|
|
563
575
|
url: string;
|
|
564
576
|
defaultBranch: string;
|
|
577
|
+
languages?: LanguageResponse[] | null;
|
|
565
578
|
};
|
|
566
579
|
export type ListRepositoryResponse = {
|
|
567
580
|
/** List of applications */
|
|
@@ -3580,3 +3593,26 @@ export function searchReposScmV2V2ReposSearchScmSearchIdGet({ searchId, authoriz
|
|
|
3580
3593
|
})
|
|
3581
3594
|
}));
|
|
3582
3595
|
}
|
|
3596
|
+
/**
|
|
3597
|
+
* Download Search Repos Scm V2
|
|
3598
|
+
*/
|
|
3599
|
+
export function downloadSearchReposScmV2V2ReposSearchScmSearchIdDownloadGet({ searchId, extension, authorization }: {
|
|
3600
|
+
searchId: string;
|
|
3601
|
+
extension?: "csv" | "xlsx";
|
|
3602
|
+
authorization: string;
|
|
3603
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
3604
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
3605
|
+
status: 200;
|
|
3606
|
+
data: ResponseSearchRepoByIdResponseRead;
|
|
3607
|
+
} | {
|
|
3608
|
+
status: 422;
|
|
3609
|
+
data: HttpValidationError;
|
|
3610
|
+
}>(`/v2/repos/search-scm/${encodeURIComponent(searchId)}/download${QS.query(QS.explode({
|
|
3611
|
+
extension
|
|
3612
|
+
}))}`, {
|
|
3613
|
+
...opts,
|
|
3614
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
3615
|
+
authorization
|
|
3616
|
+
})
|
|
3617
|
+
}));
|
|
3618
|
+
}
|
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(getRoles)
|
|
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(getRoles)
|
|
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
|
/**
|
package/src/client/code-shift.ts
CHANGED
|
@@ -65,6 +65,7 @@ import {
|
|
|
65
65
|
analyticsRepositoryTargetDetailsV1AnalyticsRepositoriesTargetDetailsGet,
|
|
66
66
|
analyticsRepositoryTargetDetailsDownloadV1AnalyticsRepositoriesTargetDetailsDownloadGet,
|
|
67
67
|
updateModuleServiceV1ModulesModuleIdPut,
|
|
68
|
+
downloadSearchReposScmV2V2ReposSearchScmSearchIdDownloadGet,
|
|
68
69
|
} from '../api/codeShift'
|
|
69
70
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
70
71
|
import { codeShiftDictionary } from '../error/dictionary/code-shift'
|
|
@@ -173,6 +174,7 @@ class CodeShift extends ReactQueryNetworkClient {
|
|
|
173
174
|
*/
|
|
174
175
|
searchRepositoryStatus = this.query(removeAuthorizationParam(getStatusSearchReposScmServiceV1ReposSearchScmSearchRepoIdStatusGet))
|
|
175
176
|
/**
|
|
177
|
+
* @deprecated
|
|
176
178
|
* Downloads file with found repositories
|
|
177
179
|
*/
|
|
178
180
|
downloadSearchRepository = this.mutation(removeAuthorizationParam(downloadSearchReposScmServiceV1ReposSearchScmSearchRepoIdDownloadGet))
|
|
@@ -188,6 +190,12 @@ class CodeShift extends ReactQueryNetworkClient {
|
|
|
188
190
|
* Gets repositories search by id (v2)
|
|
189
191
|
*/
|
|
190
192
|
getRepositoriesBySearchId = this.query(removeAuthorizationParam(searchReposScmV2V2ReposSearchScmSearchIdGet))
|
|
193
|
+
/**
|
|
194
|
+
* Downloads file with found repositories (v2)
|
|
195
|
+
*/
|
|
196
|
+
downloadSearchRepositoryV2 = this.mutation(
|
|
197
|
+
removeAuthorizationParam(downloadSearchReposScmV2V2ReposSearchScmSearchIdDownloadGet),
|
|
198
|
+
)
|
|
191
199
|
/**
|
|
192
200
|
* Validate if the user has permission.
|
|
193
201
|
* We do not use opa in this api, so this is the fn needed to check permissions.
|