securewithtrace 0.14.0 → 0.15.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/dist/index.js +43 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22671,6 +22671,15 @@ var organizationContract = c9.router({
|
|
|
22671
22671
|
500: ErrorResponseSchema
|
|
22672
22672
|
}
|
|
22673
22673
|
},
|
|
22674
|
+
listMyOrganizations: {
|
|
22675
|
+
method: "GET",
|
|
22676
|
+
path: "/users/me/organizations",
|
|
22677
|
+
responses: {
|
|
22678
|
+
200: ListOrganizationsResponseSchema,
|
|
22679
|
+
401: ErrorResponseSchema,
|
|
22680
|
+
500: ErrorResponseSchema
|
|
22681
|
+
}
|
|
22682
|
+
},
|
|
22674
22683
|
getOrganization: {
|
|
22675
22684
|
method: "GET",
|
|
22676
22685
|
path: "/organizations/:organizationId",
|
|
@@ -23945,6 +23954,21 @@ var UpdateVulnerabilityRequestSchema = external_exports.object({
|
|
|
23945
23954
|
statusReason: external_exports.string().optional(),
|
|
23946
23955
|
dismissReason: DismissReason.optional()
|
|
23947
23956
|
});
|
|
23957
|
+
var BulkUpdateVulnerabilitiesRequestSchema = external_exports.object({
|
|
23958
|
+
vulnerabilityIds: external_exports.array(external_exports.uuid()).min(1).max(500),
|
|
23959
|
+
status: VulnerabilityStatus,
|
|
23960
|
+
statusReason: external_exports.string().optional(),
|
|
23961
|
+
dismissReason: DismissReason.optional()
|
|
23962
|
+
});
|
|
23963
|
+
var BulkUpdateVulnerabilitiesResponseSchema = external_exports.object({
|
|
23964
|
+
succeeded: external_exports.array(external_exports.uuid()),
|
|
23965
|
+
failed: external_exports.array(
|
|
23966
|
+
external_exports.object({
|
|
23967
|
+
vulnerabilityId: external_exports.uuid(),
|
|
23968
|
+
error: external_exports.string()
|
|
23969
|
+
})
|
|
23970
|
+
)
|
|
23971
|
+
});
|
|
23948
23972
|
|
|
23949
23973
|
// ../../packages/api-contracts/src/contracts/v1/vulnerability.ts
|
|
23950
23974
|
var c16 = initContract();
|
|
@@ -24013,6 +24037,20 @@ var vulnerabilityContract = c16.router({
|
|
|
24013
24037
|
500: ErrorResponseSchema
|
|
24014
24038
|
}
|
|
24015
24039
|
},
|
|
24040
|
+
bulkUpdateVulnerabilities: {
|
|
24041
|
+
method: "PATCH",
|
|
24042
|
+
path: "/organizations/:organizationId/vulnerabilities/bulk",
|
|
24043
|
+
pathParams: OrgIdParamsSchema,
|
|
24044
|
+
body: BulkUpdateVulnerabilitiesRequestSchema,
|
|
24045
|
+
responses: {
|
|
24046
|
+
200: BulkUpdateVulnerabilitiesResponseSchema,
|
|
24047
|
+
400: ErrorResponseSchema,
|
|
24048
|
+
401: ErrorResponseSchema,
|
|
24049
|
+
403: ErrorResponseSchema,
|
|
24050
|
+
404: ErrorResponseSchema,
|
|
24051
|
+
500: ErrorResponseSchema
|
|
24052
|
+
}
|
|
24053
|
+
},
|
|
24016
24054
|
deleteVulnerability: {
|
|
24017
24055
|
method: "DELETE",
|
|
24018
24056
|
path: "/organizations/:organizationId/vulnerabilities/:vulnerabilityId",
|
|
@@ -24924,8 +24962,8 @@ function determineActiveOrganization(organizations, selectedOrganizationId) {
|
|
|
24924
24962
|
};
|
|
24925
24963
|
}
|
|
24926
24964
|
async function resolveOrganizationId(client) {
|
|
24927
|
-
const result = client ? await client.organization.
|
|
24928
|
-
(authenticatedClient) => authenticatedClient.organization.
|
|
24965
|
+
const result = client ? await client.organization.listMyOrganizations() : await authenticatedRequest(
|
|
24966
|
+
(authenticatedClient) => authenticatedClient.organization.listMyOrganizations()
|
|
24929
24967
|
);
|
|
24930
24968
|
if (result.status !== 200) {
|
|
24931
24969
|
console.error(`Failed to resolve organization (status ${result.status}).`);
|
|
@@ -24958,8 +24996,8 @@ async function resolveOrganizationId(client) {
|
|
|
24958
24996
|
}
|
|
24959
24997
|
async function resolveOrganizationIdSafe(client) {
|
|
24960
24998
|
try {
|
|
24961
|
-
const result = client ? await client.organization.
|
|
24962
|
-
(authenticatedClient) => authenticatedClient.organization.
|
|
24999
|
+
const result = client ? await client.organization.listMyOrganizations() : await authenticatedRequestSafe(
|
|
25000
|
+
(authenticatedClient) => authenticatedClient.organization.listMyOrganizations()
|
|
24963
25001
|
);
|
|
24964
25002
|
if (!result) {
|
|
24965
25003
|
return null;
|
|
@@ -25054,7 +25092,7 @@ function isSafeOrganizationId(organizationId) {
|
|
|
25054
25092
|
return SAFE_ORGANIZATION_ID_PATTERN.test(organizationId);
|
|
25055
25093
|
}
|
|
25056
25094
|
async function fetchOrganizationContext() {
|
|
25057
|
-
const result = await authenticatedRequest((client) => client.organization.
|
|
25095
|
+
const result = await authenticatedRequest((client) => client.organization.listMyOrganizations());
|
|
25058
25096
|
if (result.status !== 200) {
|
|
25059
25097
|
console.error(`Failed to list organizations (status ${result.status}).`);
|
|
25060
25098
|
process.exit(1);
|