@sanity/cli 3.87.0 → 3.87.1-canary.4
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/lib/_chunks-cjs/cli.js
CHANGED
@@ -53662,7 +53662,7 @@ ${chalk2.green("Success!")} Now, use this command to continue:
|
|
53662
53662
|
`
|
53663
53663
|
)) : (print(`
|
53664
53664
|
${chalk2.green("Success!")} Now, use these commands to continue:
|
53665
|
-
`), print(`First: ${chalk2.cyan(`cd ${outputPath}`)} - to enter project
|
53665
|
+
`), print(`First: ${chalk2.cyan(`cd ${outputPath}`)} - to enter project's directory`), print(
|
53666
53666
|
`Then: ${chalk2.cyan(devCommand)} -to run ${isAppTemplate ? "your Sanity application" : "Sanity Studio"}
|
53667
53667
|
`
|
53668
53668
|
)), print("Other helpful commands"), print("npx sanity docs - to open the documentation in a browser"), print("npx sanity manage - to open the project settings in a browser"), print("npx sanity help - to explore the CLI manual");
|
@@ -54076,18 +54076,25 @@ The default dataset configuration has a public dataset named "production".`;
|
|
54076
54076
|
return chosenOrg === "-new-" ? createOrganization().then((org) => org.id) : chosenOrg || void 0;
|
54077
54077
|
}
|
54078
54078
|
async function hasProjectAttachGrant(orgId) {
|
54079
|
-
const requiredGrantGroup = "sanity.organization.projects", requiredGrant = "attach";
|
54080
|
-
|
54081
|
-
(
|
54082
|
-
|
54079
|
+
const requiredGrantGroup = "sanity.organization.projects", requiredGrant = "attach", client2 = apiClient({ requireProject: !1, requireUser: !0 }).clone().config({ apiVersion: "v2021-06-07" });
|
54080
|
+
try {
|
54081
|
+
return ((await client2.request({ uri: `organizations/${orgId}/grants` }))[requiredGrantGroup] || []).some(
|
54082
|
+
(resource) => resource.grants && resource.grants.some((grant) => grant.name === requiredGrant)
|
54083
|
+
);
|
54084
|
+
} catch (err) {
|
54085
|
+
return err.statusCode === 401 ? (loadEnv.debug("No access to organization %s (401)", orgId), !1) : (loadEnv.debug("Error checking grants for organization %s: %s", orgId, err.message), !1);
|
54086
|
+
}
|
54083
54087
|
}
|
54084
54088
|
function getOrganizationsWithAttachGrantInfo(organizations) {
|
54085
54089
|
return pMap(
|
54086
54090
|
organizations,
|
54087
|
-
async (organization) =>
|
54088
|
-
|
54089
|
-
|
54090
|
-
|
54091
|
+
async (organization) => {
|
54092
|
+
try {
|
54093
|
+
return { hasAttachGrant: await hasProjectAttachGrant(organization.id), organization };
|
54094
|
+
} catch (err) {
|
54095
|
+
return loadEnv.debug("Error checking grants for organization %s: %s", organization.id, err.message), { hasAttachGrant: !1, organization };
|
54096
|
+
}
|
54097
|
+
},
|
54091
54098
|
{ concurrency: 3 }
|
54092
54099
|
);
|
54093
54100
|
}
|