securewithtrace 0.14.1 → 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 +14 -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",
|
|
@@ -24953,8 +24962,8 @@ function determineActiveOrganization(organizations, selectedOrganizationId) {
|
|
|
24953
24962
|
};
|
|
24954
24963
|
}
|
|
24955
24964
|
async function resolveOrganizationId(client) {
|
|
24956
|
-
const result = client ? await client.organization.
|
|
24957
|
-
(authenticatedClient) => authenticatedClient.organization.
|
|
24965
|
+
const result = client ? await client.organization.listMyOrganizations() : await authenticatedRequest(
|
|
24966
|
+
(authenticatedClient) => authenticatedClient.organization.listMyOrganizations()
|
|
24958
24967
|
);
|
|
24959
24968
|
if (result.status !== 200) {
|
|
24960
24969
|
console.error(`Failed to resolve organization (status ${result.status}).`);
|
|
@@ -24987,8 +24996,8 @@ async function resolveOrganizationId(client) {
|
|
|
24987
24996
|
}
|
|
24988
24997
|
async function resolveOrganizationIdSafe(client) {
|
|
24989
24998
|
try {
|
|
24990
|
-
const result = client ? await client.organization.
|
|
24991
|
-
(authenticatedClient) => authenticatedClient.organization.
|
|
24999
|
+
const result = client ? await client.organization.listMyOrganizations() : await authenticatedRequestSafe(
|
|
25000
|
+
(authenticatedClient) => authenticatedClient.organization.listMyOrganizations()
|
|
24992
25001
|
);
|
|
24993
25002
|
if (!result) {
|
|
24994
25003
|
return null;
|
|
@@ -25083,7 +25092,7 @@ function isSafeOrganizationId(organizationId) {
|
|
|
25083
25092
|
return SAFE_ORGANIZATION_ID_PATTERN.test(organizationId);
|
|
25084
25093
|
}
|
|
25085
25094
|
async function fetchOrganizationContext() {
|
|
25086
|
-
const result = await authenticatedRequest((client) => client.organization.
|
|
25095
|
+
const result = await authenticatedRequest((client) => client.organization.listMyOrganizations());
|
|
25087
25096
|
if (result.status !== 200) {
|
|
25088
25097
|
console.error(`Failed to list organizations (status ${result.status}).`);
|
|
25089
25098
|
process.exit(1);
|