@sanity/cli 6.0.0-alpha.5 → 6.0.0-alpha.7
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/README.md +2907 -109
- package/dist/actions/dataset/create.d.ts +49 -0
- package/dist/actions/dataset/create.js +48 -0
- package/dist/actions/dataset/create.js.map +1 -0
- package/dist/actions/dataset/determineDatasetAclMode.d.ts +37 -0
- package/dist/actions/dataset/determineDatasetAclMode.js +36 -0
- package/dist/actions/dataset/determineDatasetAclMode.js.map +1 -0
- package/dist/actions/debug/gatherDebugInfo.js +15 -21
- package/dist/actions/debug/gatherDebugInfo.js.map +1 -1
- package/dist/actions/debug/types.d.ts +0 -2
- package/dist/actions/debug/types.js.map +1 -1
- package/dist/actions/deploy/deployApp.js +13 -0
- package/dist/actions/deploy/deployApp.js.map +1 -1
- package/dist/actions/init/remoteTemplate.js +1 -1
- package/dist/actions/init/remoteTemplate.js.map +1 -1
- package/dist/actions/manifest/extractAppManifest.d.ts +20 -0
- package/dist/actions/manifest/extractAppManifest.js +51 -0
- package/dist/actions/manifest/extractAppManifest.js.map +1 -0
- package/dist/actions/manifest/extractManifest.js +1 -1
- package/dist/actions/manifest/extractManifest.js.map +1 -1
- package/dist/actions/manifest/types.d.ts +6 -1
- package/dist/actions/manifest/types.js.map +1 -1
- package/dist/actions/media/importAspects.js +2 -1
- package/dist/actions/media/importAspects.js.map +1 -1
- package/dist/actions/schema/utils/uniqByProjectIdDataset.d.ts +1 -1
- package/dist/actions/telemetry/resolveConsent.d.ts +1 -9
- package/dist/actions/telemetry/resolveConsent.js +2 -2
- package/dist/actions/telemetry/resolveConsent.js.map +1 -1
- package/dist/actions/telemetry/setConsent.d.ts +1 -4
- package/dist/actions/telemetry/setConsent.js +4 -8
- package/dist/actions/telemetry/setConsent.js.map +1 -1
- package/dist/commands/dataset/create.d.ts +0 -2
- package/dist/commands/dataset/create.js +8 -54
- package/dist/commands/dataset/create.js.map +1 -1
- package/dist/commands/debug.js +5 -9
- package/dist/commands/debug.js.map +1 -1
- package/dist/commands/init.d.ts +6 -1
- package/dist/commands/init.js +358 -20
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/manifest/extract.js +7 -8
- package/dist/commands/manifest/extract.js.map +1 -1
- package/dist/commands/telemetry/disable.js +0 -1
- package/dist/commands/telemetry/disable.js.map +1 -1
- package/dist/commands/telemetry/enable.js +0 -1
- package/dist/commands/telemetry/enable.js.map +1 -1
- package/dist/commands/telemetry/status.js +1 -3
- package/dist/commands/telemetry/status.js.map +1 -1
- package/dist/config/createCliConfig.d.ts +9 -0
- package/dist/hooks/prerun/flushTelemetry.worker.d.ts +2 -0
- package/dist/hooks/prerun/flushTelemetry.worker.js +22 -0
- package/dist/hooks/prerun/flushTelemetry.worker.js.map +1 -0
- package/dist/hooks/prerun/setupTelemetry.js +65 -1
- package/dist/hooks/prerun/setupTelemetry.js.map +1 -1
- package/dist/prompts/init/promptForTypescript.d.ts +2 -0
- package/dist/prompts/init/promptForTypescript.js +15 -0
- package/dist/prompts/init/promptForTypescript.js.map +1 -0
- package/dist/prompts/promptForDatasetAclMode.d.ts +9 -0
- package/dist/prompts/promptForDatasetAclMode.js +27 -0
- package/dist/prompts/promptForDatasetAclMode.js.map +1 -0
- package/dist/prompts/promptForDatasetName.d.ts +1 -1
- package/dist/prompts/promptForDatasetName.js +4 -1
- package/dist/prompts/promptForDatasetName.js.map +1 -1
- package/dist/services/organizations.d.ts +3 -1
- package/dist/services/organizations.js +2 -1
- package/dist/services/organizations.js.map +1 -1
- package/dist/services/telemetry.d.ts +2 -0
- package/dist/services/telemetry.js +20 -0
- package/dist/services/telemetry.js.map +1 -0
- package/dist/services/user.d.ts +5 -0
- package/dist/services/user.js +12 -1
- package/dist/services/user.js.map +1 -1
- package/dist/services/userApplications.d.ts +3 -1
- package/dist/services/userApplications.js +5 -1
- package/dist/services/userApplications.js.map +1 -1
- package/dist/telemetry/cli.telemetry.d.ts +20 -0
- package/dist/telemetry/cli.telemetry.js +8 -0
- package/dist/telemetry/cli.telemetry.js.map +1 -0
- package/dist/telemetry/store/cleanupOldTelemetryFiles.d.ts +5 -0
- package/dist/telemetry/store/cleanupOldTelemetryFiles.js +30 -0
- package/dist/telemetry/store/cleanupOldTelemetryFiles.js.map +1 -0
- package/dist/telemetry/store/createTelemetryStore.d.ts +39 -0
- package/dist/telemetry/store/createTelemetryStore.js +95 -0
- package/dist/telemetry/store/createTelemetryStore.js.map +1 -0
- package/dist/telemetry/store/createTraceId.d.ts +10 -0
- package/dist/telemetry/store/createTraceId.js +10 -0
- package/dist/telemetry/store/createTraceId.js.map +1 -0
- package/dist/telemetry/store/debug.d.ts +5 -0
- package/dist/telemetry/store/debug.js +7 -0
- package/dist/telemetry/store/debug.js.map +1 -0
- package/dist/telemetry/store/findTelemetryFiles.d.ts +13 -0
- package/dist/telemetry/store/findTelemetryFiles.js +34 -0
- package/dist/telemetry/store/findTelemetryFiles.js.map +1 -0
- package/dist/telemetry/store/flushTelemetryFiles.d.ts +20 -0
- package/dist/telemetry/store/flushTelemetryFiles.js +107 -0
- package/dist/telemetry/store/flushTelemetryFiles.js.map +1 -0
- package/dist/telemetry/store/generateTelemetryFilePath.d.ts +17 -0
- package/dist/telemetry/store/generateTelemetryFilePath.js +30 -0
- package/dist/telemetry/store/generateTelemetryFilePath.js.map +1 -0
- package/dist/telemetry/store/getTelemetryBaseInfo.d.ts +27 -0
- package/dist/telemetry/store/getTelemetryBaseInfo.js +34 -0
- package/dist/telemetry/store/getTelemetryBaseInfo.js.map +1 -0
- package/dist/telemetry/store/logger.d.ts +6 -0
- package/dist/telemetry/store/logger.js +54 -0
- package/dist/telemetry/store/logger.js.map +1 -0
- package/dist/telemetry/store/trace.d.ts +6 -0
- package/dist/telemetry/store/trace.js +150 -0
- package/dist/telemetry/store/trace.js.map +1 -0
- package/dist/telemetry/utils/readNDJSON.d.ts +10 -0
- package/dist/telemetry/utils/readNDJSON.js +18 -0
- package/dist/telemetry/utils/readNDJSON.js.map +1 -0
- package/dist/util/detectRuntime.d.ts +8 -0
- package/dist/util/detectRuntime.js +20 -0
- package/dist/util/detectRuntime.js.map +1 -0
- package/dist/util/isStaging.d.ts +7 -0
- package/dist/util/isStaging.js +10 -0
- package/dist/util/isStaging.js.map +1 -0
- package/dist/util/parseArguments.d.ts +35 -0
- package/dist/util/parseArguments.js +42 -0
- package/dist/util/parseArguments.js.map +1 -0
- package/oclif.manifest.json +7 -1
- package/package.json +25 -18
- package/templates/app-quickstart/src/App.css +20 -0
- package/templates/app-quickstart/src/App.tsx +25 -0
- package/templates/app-quickstart/src/ExampleComponent.css +90 -0
- package/templates/app-quickstart/src/ExampleComponent.tsx +37 -0
- package/templates/app-sanity-ui/src/App.tsx +34 -0
- package/templates/app-sanity-ui/src/ExampleComponent.tsx +34 -0
- package/templates/app-sanity-ui/src/SanityUI.tsx +23 -0
- package/templates/blog/README.md +11 -0
- package/templates/blog/schemaTypes/author.js +50 -0
- package/templates/blog/schemaTypes/blockContent.js +67 -0
- package/templates/blog/schemaTypes/category.js +19 -0
- package/templates/blog/schemaTypes/index.js +6 -0
- package/templates/blog/schemaTypes/post.js +65 -0
- package/templates/blog/static/.gitkeep +1 -0
- package/templates/clean/README.md +9 -0
- package/templates/clean/schemaTypes/index.js +1 -0
- package/templates/clean/static/.gitkeep +1 -0
- package/templates/ecommerce/README.md +11 -0
- package/templates/ecommerce/plugins/.gitkeep +1 -0
- package/templates/ecommerce/plugins/barcode-input/BarcodeInput.js +62 -0
- package/templates/ecommerce/plugins/barcode-input/index.js +9 -0
- package/templates/ecommerce/plugins/barcode-input/schemaType.js +60 -0
- package/templates/ecommerce/schemaTypes/blockContent.js +67 -0
- package/templates/ecommerce/schemaTypes/category.js +39 -0
- package/templates/ecommerce/schemaTypes/index.js +23 -0
- package/templates/ecommerce/schemaTypes/locale/localeBlockContent.js +19 -0
- package/templates/ecommerce/schemaTypes/locale/localeString.js +19 -0
- package/templates/ecommerce/schemaTypes/locale/localeText.js +19 -0
- package/templates/ecommerce/schemaTypes/locale/supportedLanguages.js +5 -0
- package/templates/ecommerce/schemaTypes/product.js +83 -0
- package/templates/ecommerce/schemaTypes/productVariant.js +52 -0
- package/templates/ecommerce/schemaTypes/vendor.js +39 -0
- package/templates/ecommerce/static/.gitkeep +1 -0
- package/templates/get-started/README.md +9 -0
- package/templates/get-started/plugins/.gitkeep +1 -0
- package/templates/get-started/plugins/sanity-plugin-tutorial/CustomDefaultLayout.tsx +16 -0
- package/templates/get-started/plugins/sanity-plugin-tutorial/GetStartedTutorial.tsx +104 -0
- package/templates/get-started/plugins/sanity-plugin-tutorial/index.ts +11 -0
- package/templates/get-started/schemaTypes/index.ts +1 -0
- package/templates/get-started/static/.gitkeep +1 -0
- package/templates/moviedb/README.md +10 -0
- package/templates/moviedb/schemaTypes/blockContent.js +67 -0
- package/templates/moviedb/schemaTypes/castMember.js +37 -0
- package/templates/moviedb/schemaTypes/crewMember.js +52 -0
- package/templates/moviedb/schemaTypes/index.js +22 -0
- package/templates/moviedb/schemaTypes/movie.js +85 -0
- package/templates/moviedb/schemaTypes/person.js +37 -0
- package/templates/moviedb/schemaTypes/plotSummaries.js +20 -0
- package/templates/moviedb/schemaTypes/plotSummary.js +24 -0
- package/templates/moviedb/schemaTypes/screening.js +81 -0
- package/templates/moviedb/static/.gitkeep +1 -0
- package/templates/quickstart/README.md +9 -0
- package/templates/quickstart/schemaTypes/index.js +1 -0
- package/templates/quickstart/static/.gitkeep +1 -0
- package/templates/shared/gitignore.txt +29 -0
- package/templates/shared/tsconfig.json +17 -0
- package/templates/shopify/README.md +85 -0
- package/templates/shopify/components/hotspots/ProductTooltip.tsx +38 -0
- package/templates/shopify/components/icons/Shopify.tsx +20 -0
- package/templates/shopify/components/inputs/CollectionHidden.tsx +23 -0
- package/templates/shopify/components/inputs/PlaceholderString.tsx +20 -0
- package/templates/shopify/components/inputs/ProductHidden.tsx +64 -0
- package/templates/shopify/components/inputs/ProductVariantHidden.tsx +24 -0
- package/templates/shopify/components/inputs/ProxyString.tsx +32 -0
- package/templates/shopify/components/media/ColorTheme.tsx +38 -0
- package/templates/shopify/components/media/ShopifyDocumentStatus.tsx +82 -0
- package/templates/shopify/components/studio/Navbar.tsx +29 -0
- package/templates/shopify/constants.ts +61 -0
- package/templates/shopify/docs/features.md +158 -0
- package/templates/shopify/plugins/customDocumentActions/index.ts +55 -0
- package/templates/shopify/plugins/customDocumentActions/shopifyDelete.tsx +144 -0
- package/templates/shopify/plugins/customDocumentActions/shopifyLink.ts +39 -0
- package/templates/shopify/plugins/customDocumentActions/types.ts +14 -0
- package/templates/shopify/schemaTypes/documents/collection.tsx +142 -0
- package/templates/shopify/schemaTypes/documents/colorTheme.tsx +44 -0
- package/templates/shopify/schemaTypes/documents/page.ts +70 -0
- package/templates/shopify/schemaTypes/documents/product.tsx +132 -0
- package/templates/shopify/schemaTypes/documents/productVariant.tsx +67 -0
- package/templates/shopify/schemaTypes/index.ts +108 -0
- package/templates/shopify/schemaTypes/objects/collection/collectionGroupType.ts +27 -0
- package/templates/shopify/schemaTypes/objects/collection/collectionLinksType.ts +16 -0
- package/templates/shopify/schemaTypes/objects/customProductOption/customProductOptionColorObjectType.tsx +48 -0
- package/templates/shopify/schemaTypes/objects/customProductOption/customProductOptionColorType.tsx +50 -0
- package/templates/shopify/schemaTypes/objects/customProductOption/customProductOptionSizeObjectType.ts +40 -0
- package/templates/shopify/schemaTypes/objects/customProductOption/customProductOptionSizeType.ts +49 -0
- package/templates/shopify/schemaTypes/objects/global/footerType.ts +22 -0
- package/templates/shopify/schemaTypes/objects/global/menuLinksType.ts +21 -0
- package/templates/shopify/schemaTypes/objects/global/menuType.ts +17 -0
- package/templates/shopify/schemaTypes/objects/global/notFoundPageType.ts +37 -0
- package/templates/shopify/schemaTypes/objects/hotspot/imageWithProductHotspotsType.ts +48 -0
- package/templates/shopify/schemaTypes/objects/hotspot/productHotspotsType.tsx +17 -0
- package/templates/shopify/schemaTypes/objects/hotspot/spotType.tsx +60 -0
- package/templates/shopify/schemaTypes/objects/link/linkEmailType.tsx +34 -0
- package/templates/shopify/schemaTypes/objects/link/linkExternalType.tsx +37 -0
- package/templates/shopify/schemaTypes/objects/link/linkInternalType.tsx +33 -0
- package/templates/shopify/schemaTypes/objects/link/linkProductType.tsx +60 -0
- package/templates/shopify/schemaTypes/objects/module/accordionGroupType.ts +33 -0
- package/templates/shopify/schemaTypes/objects/module/accordionType.ts +28 -0
- package/templates/shopify/schemaTypes/objects/module/callToActionType.tsx +85 -0
- package/templates/shopify/schemaTypes/objects/module/calloutType.ts +38 -0
- package/templates/shopify/schemaTypes/objects/module/collectionReferenceType.tsx +47 -0
- package/templates/shopify/schemaTypes/objects/module/gridItemType.ts +41 -0
- package/templates/shopify/schemaTypes/objects/module/gridType.ts +28 -0
- package/templates/shopify/schemaTypes/objects/module/heroType.tsx +40 -0
- package/templates/shopify/schemaTypes/objects/module/imageCallToActionType.tsx +19 -0
- package/templates/shopify/schemaTypes/objects/module/imageFeatureType.ts +80 -0
- package/templates/shopify/schemaTypes/objects/module/imageFeaturesType.tsx +51 -0
- package/templates/shopify/schemaTypes/objects/module/instagramType.ts +35 -0
- package/templates/shopify/schemaTypes/objects/module/productFeaturesType.tsx +50 -0
- package/templates/shopify/schemaTypes/objects/module/productReferenceType.tsx +42 -0
- package/templates/shopify/schemaTypes/objects/seoType.ts +31 -0
- package/templates/shopify/schemaTypes/objects/shopify/collectionRuleType.tsx +37 -0
- package/templates/shopify/schemaTypes/objects/shopify/inventoryType.ts +25 -0
- package/templates/shopify/schemaTypes/objects/shopify/optionType.tsx +31 -0
- package/templates/shopify/schemaTypes/objects/shopify/placeholderStringType.ts +11 -0
- package/templates/shopify/schemaTypes/objects/shopify/priceRangeType.ts +20 -0
- package/templates/shopify/schemaTypes/objects/shopify/productWithVariantType.tsx +142 -0
- package/templates/shopify/schemaTypes/objects/shopify/proxyStringType.ts +12 -0
- package/templates/shopify/schemaTypes/objects/shopify/shopType.ts +15 -0
- package/templates/shopify/schemaTypes/objects/shopify/shopifyCollectionType.ts +84 -0
- package/templates/shopify/schemaTypes/objects/shopify/shopifyProductType.ts +131 -0
- package/templates/shopify/schemaTypes/objects/shopify/shopifyProductVariantType.ts +121 -0
- package/templates/shopify/schemaTypes/portableText/portableTextSimpleType.tsx +45 -0
- package/templates/shopify/schemaTypes/portableText/portableTextType.tsx +52 -0
- package/templates/shopify/schemaTypes/singletons/homeType.ts +49 -0
- package/templates/shopify/schemaTypes/singletons/settingsType.ts +96 -0
- package/templates/shopify/static/.gitkeep +1 -0
- package/templates/shopify/structure/collectionStructure.ts +9 -0
- package/templates/shopify/structure/colorThemeStructure.ts +9 -0
- package/templates/shopify/structure/homeStructure.ts +9 -0
- package/templates/shopify/structure/index.ts +57 -0
- package/templates/shopify/structure/pageStructure.ts +11 -0
- package/templates/shopify/structure/productStructure.ts +51 -0
- package/templates/shopify/structure/settingStructure.ts +9 -0
- package/templates/shopify/utils/blocksToText.ts +20 -0
- package/templates/shopify/utils/defineStructure.ts +11 -0
- package/templates/shopify/utils/getPriceRange.ts +24 -0
- package/templates/shopify/utils/shopifyUrls.ts +22 -0
- package/templates/shopify/utils/validateSlug.ts +18 -0
- package/templates/shopify-online-storefront/README.md +54 -0
- package/templates/shopify-online-storefront/components/icons/Shopify.tsx +22 -0
- package/templates/shopify-online-storefront/components/inputs/CollectionHidden.tsx +23 -0
- package/templates/shopify-online-storefront/components/inputs/PlaceholderString.tsx +25 -0
- package/templates/shopify-online-storefront/components/inputs/ProductHidden.tsx +66 -0
- package/templates/shopify-online-storefront/components/inputs/ProductVariantHidden.tsx +25 -0
- package/templates/shopify-online-storefront/components/inputs/ProxyString.tsx +38 -0
- package/templates/shopify-online-storefront/components/media/ShopifyDocumentStatus.tsx +83 -0
- package/templates/shopify-online-storefront/constants.ts +18 -0
- package/templates/shopify-online-storefront/plugins/shopifyDocumentActions/index.ts +45 -0
- package/templates/shopify-online-storefront/plugins/shopifyDocumentActions/shopifyDelete.tsx +144 -0
- package/templates/shopify-online-storefront/plugins/shopifyDocumentActions/shopifyLink.ts +39 -0
- package/templates/shopify-online-storefront/plugins/shopifyDocumentActions/types.ts +14 -0
- package/templates/shopify-online-storefront/schemaTypes/blocks/blockContent.ts +32 -0
- package/templates/shopify-online-storefront/schemaTypes/documents/collection.tsx +83 -0
- package/templates/shopify-online-storefront/schemaTypes/documents/product.tsx +102 -0
- package/templates/shopify-online-storefront/schemaTypes/documents/productVariant.tsx +82 -0
- package/templates/shopify-online-storefront/schemaTypes/index.ts +43 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/accordion.ts +31 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/accordionGroup.ts +35 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/callout.ts +40 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/inventory.ts +30 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/option.ts +30 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/priceRange.ts +22 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/proxyString.ts +11 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/shopifyCollection.ts +109 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/shopifyCollectionRule.tsx +45 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/shopifyProduct.ts +165 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/shopifyProductVariant.ts +151 -0
- package/templates/shopify-online-storefront/structure/collectionStructure.ts +9 -0
- package/templates/shopify-online-storefront/structure/index.ts +37 -0
- package/templates/shopify-online-storefront/structure/productStructure.ts +35 -0
- package/templates/shopify-online-storefront/utils/defineStructure.ts +11 -0
- package/templates/shopify-online-storefront/utils/getPriceRange.ts +24 -0
- package/templates/shopify-online-storefront/utils/shopifyUrls.ts +22 -0
- package/dist/actions/build/__tests__/buildApp.test.js +0 -367
- package/dist/actions/build/__tests__/buildApp.test.js.map +0 -1
- package/dist/actions/build/__tests__/buildStudio.test.js +0 -561
- package/dist/actions/build/__tests__/buildStudio.test.js.map +0 -1
- package/dist/actions/build/__tests__/checkRequiredDependencies.test.js +0 -233
- package/dist/actions/build/__tests__/checkRequiredDependencies.test.js.map +0 -1
- package/dist/actions/build/__tests__/checkStudioDependencyVersions.test.js +0 -414
- package/dist/actions/build/__tests__/checkStudioDependencyVersions.test.js.map +0 -1
- package/dist/actions/build/__tests__/determineBasePath.test.js +0 -24
- package/dist/actions/build/__tests__/determineBasePath.test.js.map +0 -1
- package/dist/actions/build/__tests__/getAutoUpdatesImportMap.test.js +0 -109
- package/dist/actions/build/__tests__/getAutoUpdatesImportMap.test.js.map +0 -1
- package/dist/actions/build/__tests__/getViteConfig.test.js +0 -493
- package/dist/actions/build/__tests__/getViteConfig.test.js.map +0 -1
- package/dist/actions/build/__tests__/renderDocument.test.js +0 -278
- package/dist/actions/build/__tests__/renderDocument.test.js.map +0 -1
- package/dist/actions/build/__tests__/shouldAutoUpdate.test.js +0 -153
- package/dist/actions/build/__tests__/shouldAutoUpdate.test.js.map +0 -1
- package/dist/actions/build/renderDocumentWorker/__tests__/renderDocumentWorker.test.js +0 -657
- package/dist/actions/build/renderDocumentWorker/__tests__/renderDocumentWorker.test.js.map +0 -1
- package/dist/actions/dataset/__tests__/validateDatasetName.test.js +0 -182
- package/dist/actions/dataset/__tests__/validateDatasetName.test.js.map +0 -1
- package/dist/actions/deploy/__tests__/checkDir.test.js +0 -120
- package/dist/actions/deploy/__tests__/checkDir.test.js.map +0 -1
- package/dist/actions/docs/__tests__/normalizeDocsPath.test.js +0 -16
- package/dist/actions/docs/__tests__/normalizeDocsPath.test.js.map +0 -1
- package/dist/actions/documents/validation/reporters/prettyReporter/__tests__/formatDocumentValidation.test.js +0 -124
- package/dist/actions/documents/validation/reporters/prettyReporter/__tests__/formatDocumentValidation.test.js.map +0 -1
- package/dist/actions/graphql/__tests__/getGraphQLAPIs.test.js +0 -274
- package/dist/actions/graphql/__tests__/getGraphQLAPIs.test.js.map +0 -1
- package/dist/actions/media/__tests__/importMedia.test.js +0 -182
- package/dist/actions/media/__tests__/importMedia.test.js.map +0 -1
- package/dist/actions/schema/__tests__/formatSchemaValidation.test.js +0 -174
- package/dist/actions/schema/__tests__/formatSchemaValidation.test.js.map +0 -1
- package/dist/actions/schema/__tests__/validateAction.test.js +0 -281
- package/dist/actions/schema/__tests__/validateAction.test.js.map +0 -1
- package/dist/actions/telemetry/__tests__/fetchTelemetryConsent.test.js +0 -27
- package/dist/actions/telemetry/__tests__/fetchTelemetryConsent.test.js.map +0 -1
- package/dist/actions/users/__tests__/validateEmail.test.js +0 -16
- package/dist/actions/users/__tests__/validateEmail.test.js.map +0 -1
- package/dist/commands/__tests__/blueprints.test.js +0 -54
- package/dist/commands/__tests__/blueprints.test.js.map +0 -1
- package/dist/commands/__tests__/build.test.js +0 -132
- package/dist/commands/__tests__/build.test.js.map +0 -1
- package/dist/commands/__tests__/codemod.test.js +0 -271
- package/dist/commands/__tests__/codemod.test.js.map +0 -1
- package/dist/commands/__tests__/debug.test.js +0 -590
- package/dist/commands/__tests__/debug.test.js.map +0 -1
- package/dist/commands/__tests__/deploy.test.js +0 -1945
- package/dist/commands/__tests__/deploy.test.js.map +0 -1
- package/dist/commands/__tests__/dev.test.js +0 -453
- package/dist/commands/__tests__/dev.test.js.map +0 -1
- package/dist/commands/__tests__/exec.test.js +0 -207
- package/dist/commands/__tests__/exec.test.js.map +0 -1
- package/dist/commands/__tests__/init/init.authentication.test.js +0 -73
- package/dist/commands/__tests__/init/init.authentication.test.js.map +0 -1
- package/dist/commands/__tests__/init/init.create-new-project.test.js +0 -195
- package/dist/commands/__tests__/init/init.create-new-project.test.js.map +0 -1
- package/dist/commands/__tests__/init/init.plan.test.js +0 -279
- package/dist/commands/__tests__/init/init.plan.test.js.map +0 -1
- package/dist/commands/__tests__/init/init.setup.test.js +0 -335
- package/dist/commands/__tests__/init/init.setup.test.js.map +0 -1
- package/dist/commands/__tests__/install.test.js +0 -282
- package/dist/commands/__tests__/install.test.js.map +0 -1
- package/dist/commands/__tests__/learn.test.js +0 -29
- package/dist/commands/__tests__/learn.test.js.map +0 -1
- package/dist/commands/__tests__/logout.test.js +0 -91
- package/dist/commands/__tests__/logout.test.js.map +0 -1
- package/dist/commands/__tests__/manage.test.js +0 -110
- package/dist/commands/__tests__/manage.test.js.map +0 -1
- package/dist/commands/__tests__/migration.test.js +0 -119
- package/dist/commands/__tests__/migration.test.js.map +0 -1
- package/dist/commands/__tests__/preview.test.js +0 -261
- package/dist/commands/__tests__/preview.test.js.map +0 -1
- package/dist/commands/__tests__/start.test.js +0 -253
- package/dist/commands/__tests__/start.test.js.map +0 -1
- package/dist/commands/__tests__/undeploy.test.js +0 -382
- package/dist/commands/__tests__/undeploy.test.js.map +0 -1
- package/dist/commands/__tests__/versions.test.js +0 -142
- package/dist/commands/__tests__/versions.test.js.map +0 -1
- package/dist/commands/backup/__tests__/disable.test.js +0 -204
- package/dist/commands/backup/__tests__/disable.test.js.map +0 -1
- package/dist/commands/backup/__tests__/download.test.js +0 -768
- package/dist/commands/backup/__tests__/download.test.js.map +0 -1
- package/dist/commands/backup/__tests__/enable.test.js +0 -286
- package/dist/commands/backup/__tests__/enable.test.js.map +0 -1
- package/dist/commands/backup/__tests__/list.test.js +0 -330
- package/dist/commands/backup/__tests__/list.test.js.map +0 -1
- package/dist/commands/cors/__tests__/add.test.js +0 -376
- package/dist/commands/cors/__tests__/add.test.js.map +0 -1
- package/dist/commands/cors/__tests__/delete.test.js +0 -308
- package/dist/commands/cors/__tests__/delete.test.js.map +0 -1
- package/dist/commands/cors/__tests__/list.test.js +0 -241
- package/dist/commands/cors/__tests__/list.test.js.map +0 -1
- package/dist/commands/dataset/__tests__/copy.test.js +0 -628
- package/dist/commands/dataset/__tests__/copy.test.js.map +0 -1
- package/dist/commands/dataset/__tests__/create.test.js +0 -342
- package/dist/commands/dataset/__tests__/create.test.js.map +0 -1
- package/dist/commands/dataset/__tests__/delete.test.js +0 -231
- package/dist/commands/dataset/__tests__/delete.test.js.map +0 -1
- package/dist/commands/dataset/__tests__/export.test.js +0 -601
- package/dist/commands/dataset/__tests__/export.test.js.map +0 -1
- package/dist/commands/dataset/__tests__/import.test.js +0 -53
- package/dist/commands/dataset/__tests__/import.test.js.map +0 -1
- package/dist/commands/dataset/__tests__/list.test.js +0 -216
- package/dist/commands/dataset/__tests__/list.test.js.map +0 -1
- package/dist/commands/dataset/alias/__tests__/create.test.js +0 -339
- package/dist/commands/dataset/alias/__tests__/create.test.js.map +0 -1
- package/dist/commands/dataset/alias/__tests__/delete.test.js +0 -247
- package/dist/commands/dataset/alias/__tests__/delete.test.js.map +0 -1
- package/dist/commands/dataset/alias/__tests__/link.test.js +0 -376
- package/dist/commands/dataset/alias/__tests__/link.test.js.map +0 -1
- package/dist/commands/dataset/alias/__tests__/unlink.test.js +0 -313
- package/dist/commands/dataset/alias/__tests__/unlink.test.js.map +0 -1
- package/dist/commands/dataset/visibility/__tests__/get.test.js +0 -128
- package/dist/commands/dataset/visibility/__tests__/get.test.js.map +0 -1
- package/dist/commands/dataset/visibility/__tests__/set.test.js +0 -198
- package/dist/commands/dataset/visibility/__tests__/set.test.js.map +0 -1
- package/dist/commands/docs/__tests__/browse.test.js +0 -29
- package/dist/commands/docs/__tests__/browse.test.js.map +0 -1
- package/dist/commands/docs/__tests__/read.test.js +0 -78
- package/dist/commands/docs/__tests__/read.test.js.map +0 -1
- package/dist/commands/docs/__tests__/search.test.js +0 -255
- package/dist/commands/docs/__tests__/search.test.js.map +0 -1
- package/dist/commands/documents/__tests__/create.test.js +0 -1030
- package/dist/commands/documents/__tests__/create.test.js.map +0 -1
- package/dist/commands/documents/__tests__/delete.test.js +0 -300
- package/dist/commands/documents/__tests__/delete.test.js.map +0 -1
- package/dist/commands/documents/__tests__/get.test.js +0 -182
- package/dist/commands/documents/__tests__/get.test.js.map +0 -1
- package/dist/commands/documents/__tests__/query.test.js +0 -300
- package/dist/commands/documents/__tests__/query.test.js.map +0 -1
- package/dist/commands/documents/__tests__/validate.test.js +0 -249
- package/dist/commands/documents/__tests__/validate.test.js.map +0 -1
- package/dist/commands/graphql/__tests__/list.test.js +0 -240
- package/dist/commands/graphql/__tests__/list.test.js.map +0 -1
- package/dist/commands/graphql/__tests__/undeploy.test.js +0 -410
- package/dist/commands/graphql/__tests__/undeploy.test.js.map +0 -1
- package/dist/commands/hook/__tests__/attempt.test.js +0 -275
- package/dist/commands/hook/__tests__/attempt.test.js.map +0 -1
- package/dist/commands/hook/__tests__/create.test.js +0 -119
- package/dist/commands/hook/__tests__/create.test.js.map +0 -1
- package/dist/commands/hook/__tests__/delete.test.js +0 -233
- package/dist/commands/hook/__tests__/delete.test.js.map +0 -1
- package/dist/commands/hook/__tests__/list.test.js +0 -145
- package/dist/commands/hook/__tests__/list.test.js.map +0 -1
- package/dist/commands/hook/__tests__/logs.test.js +0 -798
- package/dist/commands/hook/__tests__/logs.test.js.map +0 -1
- package/dist/commands/manifest/__tests__/extract.test.js +0 -132
- package/dist/commands/manifest/__tests__/extract.test.js.map +0 -1
- package/dist/commands/mcp/__tests__/configure.test.js +0 -397
- package/dist/commands/mcp/__tests__/configure.test.js.map +0 -1
- package/dist/commands/media/__tests__/create-aspect.test.js +0 -173
- package/dist/commands/media/__tests__/create-aspect.test.js.map +0 -1
- package/dist/commands/media/__tests__/delete-aspect.test.js +0 -342
- package/dist/commands/media/__tests__/delete-aspect.test.js.map +0 -1
- package/dist/commands/media/__tests__/deploy-aspect.test.js +0 -619
- package/dist/commands/media/__tests__/deploy-aspect.test.js.map +0 -1
- package/dist/commands/media/__tests__/export.test.js +0 -697
- package/dist/commands/media/__tests__/export.test.js.map +0 -1
- package/dist/commands/media/__tests__/import.test.js +0 -347
- package/dist/commands/media/__tests__/import.test.js.map +0 -1
- package/dist/commands/openapi/__tests__/get.test.js +0 -149
- package/dist/commands/openapi/__tests__/get.test.js.map +0 -1
- package/dist/commands/openapi/__tests__/list.test.js +0 -113
- package/dist/commands/openapi/__tests__/list.test.js.map +0 -1
- package/dist/commands/projects/__tests__/list.test.js +0 -154
- package/dist/commands/projects/__tests__/list.test.js.map +0 -1
- package/dist/commands/schema/__tests__/delete.test.js +0 -454
- package/dist/commands/schema/__tests__/delete.test.js.map +0 -1
- package/dist/commands/schema/__tests__/deploy.test.js +0 -348
- package/dist/commands/schema/__tests__/deploy.test.js.map +0 -1
- package/dist/commands/schema/__tests__/extract.test.js +0 -121
- package/dist/commands/schema/__tests__/extract.test.js.map +0 -1
- package/dist/commands/schema/__tests__/list.test.js +0 -399
- package/dist/commands/schema/__tests__/list.test.js.map +0 -1
- package/dist/commands/schema/__tests__/validate.test.js +0 -121
- package/dist/commands/schema/__tests__/validate.test.js.map +0 -1
- package/dist/commands/telemetry/__tests__/disable.test.js +0 -147
- package/dist/commands/telemetry/__tests__/disable.test.js.map +0 -1
- package/dist/commands/telemetry/__tests__/enable.test.js +0 -133
- package/dist/commands/telemetry/__tests__/enable.test.js.map +0 -1
- package/dist/commands/telemetry/__tests__/status.test.js +0 -155
- package/dist/commands/telemetry/__tests__/status.test.js.map +0 -1
- package/dist/commands/tokens/__tests__/add.test.js +0 -435
- package/dist/commands/tokens/__tests__/add.test.js.map +0 -1
- package/dist/commands/tokens/__tests__/delete.test.js +0 -405
- package/dist/commands/tokens/__tests__/delete.test.js.map +0 -1
- package/dist/commands/tokens/__tests__/list.test.js +0 -395
- package/dist/commands/tokens/__tests__/list.test.js.map +0 -1
- package/dist/commands/users/__tests__/invite.test.js +0 -362
- package/dist/commands/users/__tests__/invite.test.js.map +0 -1
- package/dist/commands/users/__tests__/list.test.js +0 -407
- package/dist/commands/users/__tests__/list.test.js.map +0 -1
- package/dist/hooks/prerun/__tests__/setupTelemetry.test.js +0 -77
- package/dist/hooks/prerun/__tests__/setupTelemetry.test.js.map +0 -1
- package/dist/services/__tests__/datasetAliases.test.js +0 -131
- package/dist/services/__tests__/datasetAliases.test.js.map +0 -1
- package/dist/services/__tests__/datasets.test.js +0 -436
- package/dist/services/__tests__/datasets.test.js.map +0 -1
- package/dist/services/__tests__/graphql.test.js +0 -43
- package/dist/services/__tests__/graphql.test.js.map +0 -1
- package/dist/services/__tests__/mediaLibraries.test.js +0 -88
- package/dist/services/__tests__/mediaLibraries.test.js.map +0 -1
- package/dist/services/__tests__/projects.test.js +0 -41
- package/dist/services/__tests__/projects.test.js.map +0 -1
- package/dist/services/__tests__/userApplications.test.js +0 -113
- package/dist/services/__tests__/userApplications.test.js.map +0 -1
- package/dist/util/__tests__/appId.test.js +0 -31
- package/dist/util/__tests__/appId.test.js.map +0 -1
- package/dist/util/__tests__/cliClient.test.js +0 -184
- package/dist/util/__tests__/cliClient.test.js.map +0 -1
- package/dist/util/__tests__/compareDependencyVersions.test.js +0 -426
- package/dist/util/__tests__/compareDependencyVersions.test.js.map +0 -1
- package/dist/util/__tests__/extractDocumentsFromNdjsonOrTarball.test.js +0 -74
- package/dist/util/__tests__/extractDocumentsFromNdjsonOrTarball.test.js.map +0 -1
- package/dist/util/__tests__/findNdjsonEntry.test.js +0 -54
- package/dist/util/__tests__/findNdjsonEntry.test.js.map +0 -1
- package/dist/util/__tests__/getCliVersion.test.js +0 -28
- package/dist/util/__tests__/getCliVersion.test.js.map +0 -1
- package/dist/util/__tests__/getLocalPackageVersion.test.js +0 -84
- package/dist/util/__tests__/getLocalPackageVersion.test.js.map +0 -1
- package/dist/util/__tests__/getWorkspace.test.js +0 -37
- package/dist/util/__tests__/getWorkspace.test.js.map +0 -1
- package/dist/util/__tests__/readPackageJson.test.js +0 -69
- package/dist/util/__tests__/readPackageJson.test.js.map +0 -1
- package/dist/util/__tests__/warnAboutMissingAppId.test.js +0 -28
- package/dist/util/__tests__/warnAboutMissingAppId.test.js.map +0 -1
- package/dist/util/packageManager/__tests__/installPackages.test.js +0 -388
- package/dist/util/packageManager/__tests__/installPackages.test.js.map +0 -1
- package/dist/util/validation/ __tests__/validateDocuments.test.js +0 -274
- package/dist/util/validation/ __tests__/validateDocuments.test.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/actions/manifest/extractManifest.ts"],"sourcesContent":["import {createHash} from 'node:crypto'\nimport {mkdir, writeFile} from 'node:fs/promises'\nimport {join, resolve} from 'node:path'\n\nimport {getTimer, Output} from '@sanity/cli-core'\nimport {spinner} from '@sanity/cli-core/ux'\nimport {type Workspace} from 'sanity'\n\nimport {type ExtractManifestCommand} from '../../commands/manifest/extract'\nimport {importStudioConfig} from '../../util/importStudioConfig.js'\nimport {readModuleVersion} from '../../util/readModuleVersion.js'\nimport {extractWorkspaceManifest} from './extractWorkspaceManifest.js'\nimport {\n type CreateManifest,\n type CreateWorkspaceManifest,\n type ManifestWorkspaceFile,\n} from './types'\n\nexport const MANIFEST_FILENAME = 'create-manifest.json'\nconst SCHEMA_FILENAME_SUFFIX = '.create-schema.json'\nconst TOOLS_FILENAME_SUFFIX = '.create-tools.json'\n\n/** Escape-hatch env flags to change action behavior */\nconst FEATURE_ENABLED_ENV_NAME = 'SANITY_CLI_EXTRACT_MANIFEST_ENABLED'\nconst EXTRACT_MANIFEST_ENABLED = process.env[FEATURE_ENABLED_ENV_NAME] !== 'false'\nconst EXTRACT_MANIFEST_LOG_ERRORS = process.env.SANITY_CLI_EXTRACT_MANIFEST_LOG_ERRORS === 'true'\n\nconst CREATE_TIMER = 'create-manifest'\n\ninterface ExtractManifestOptions {\n flags: ExtractManifestCommand['flags']\n output: Output\n workDir: string\n}\n\n/**\n * This function will never throw.\n * @returns `undefined` if extract succeeded - caught error if it failed\n */\nexport async function extractManifestSafe(\n options: ExtractManifestOptions,\n): Promise<Error | undefined> {\n if (!EXTRACT_MANIFEST_ENABLED) {\n return undefined\n }\n\n try {\n await extractManifest(options)\n return undefined\n } catch (err) {\n if (EXTRACT_MANIFEST_LOG_ERRORS) {\n options.output.error(err)\n }\n
|
|
1
|
+
{"version":3,"sources":["../../../src/actions/manifest/extractManifest.ts"],"sourcesContent":["import {createHash} from 'node:crypto'\nimport {mkdir, writeFile} from 'node:fs/promises'\nimport {join, resolve} from 'node:path'\n\nimport {getTimer, Output} from '@sanity/cli-core'\nimport {spinner} from '@sanity/cli-core/ux'\nimport {type Workspace} from 'sanity'\n\nimport {type ExtractManifestCommand} from '../../commands/manifest/extract'\nimport {importStudioConfig} from '../../util/importStudioConfig.js'\nimport {readModuleVersion} from '../../util/readModuleVersion.js'\nimport {extractWorkspaceManifest} from './extractWorkspaceManifest.js'\nimport {\n type CreateManifest,\n type CreateWorkspaceManifest,\n type ManifestWorkspaceFile,\n} from './types'\n\nexport const MANIFEST_FILENAME = 'create-manifest.json'\nconst SCHEMA_FILENAME_SUFFIX = '.create-schema.json'\nconst TOOLS_FILENAME_SUFFIX = '.create-tools.json'\n\n/** Escape-hatch env flags to change action behavior */\nconst FEATURE_ENABLED_ENV_NAME = 'SANITY_CLI_EXTRACT_MANIFEST_ENABLED'\nconst EXTRACT_MANIFEST_ENABLED = process.env[FEATURE_ENABLED_ENV_NAME] !== 'false'\nconst EXTRACT_MANIFEST_LOG_ERRORS = process.env.SANITY_CLI_EXTRACT_MANIFEST_LOG_ERRORS === 'true'\n\nconst CREATE_TIMER = 'create-manifest'\n\ninterface ExtractManifestOptions {\n flags: ExtractManifestCommand['flags']\n output: Output\n workDir: string\n}\n\n/**\n * This function will never throw.\n * @returns `undefined` if extract succeeded - caught error if it failed\n */\nexport async function extractManifestSafe(\n options: ExtractManifestOptions,\n): Promise<Error | undefined> {\n if (!EXTRACT_MANIFEST_ENABLED) {\n return undefined\n }\n\n try {\n await extractManifest(options)\n return undefined\n } catch (err) {\n if (EXTRACT_MANIFEST_LOG_ERRORS) {\n options.output.error(err)\n }\n return err\n }\n}\n\nasync function extractManifest(options: ExtractManifestOptions): Promise<void> {\n const {flags, workDir} = options\n const staticPath = resolve(join(workDir, flags.path))\n const path = join(staticPath, MANIFEST_FILENAME)\n\n const timer = getTimer()\n timer.start(CREATE_TIMER)\n const spin = spinner('Extracting manifest').start()\n\n try {\n const workspaceManifests = await getWorkspaceManifests(workDir)\n await mkdir(staticPath, {recursive: true})\n\n const workspaceFiles = await writeWorkspaceFiles(workspaceManifests, staticPath)\n\n const manifest: CreateManifest = {\n /**\n * Version history:\n * 1: Initial release.\n * 2: Added tools file.\n * 3. Added studioVersion field.\n */\n createdAt: new Date().toISOString(),\n studioVersion: await readModuleVersion(workDir, 'sanity'),\n version: 3,\n workspaces: workspaceFiles,\n }\n\n await writeFile(path, JSON.stringify(manifest, null, 2))\n const manifestDuration = timer.end(CREATE_TIMER)\n\n spin.succeed(`Extracted manifest (${manifestDuration.toFixed(0)}ms)`)\n } catch (err) {\n spin.fail(err.message)\n throw err\n }\n}\n\nasync function getWorkspaceManifests(workDir: string): Promise<CreateWorkspaceManifest[]> {\n const workspaces = await importStudioConfig(workDir)\n return await extractWorkspaceManifest(workspaces as unknown as Workspace[])\n}\n\nfunction writeWorkspaceFiles(\n manifestWorkspaces: CreateWorkspaceManifest[],\n staticPath: string,\n): Promise<ManifestWorkspaceFile[]> {\n const output = manifestWorkspaces.map((workspace) => writeWorkspaceFile(workspace, staticPath))\n\n return Promise.all(output)\n}\n\nasync function writeWorkspaceFile(\n workspace: CreateWorkspaceManifest,\n staticPath: string,\n): Promise<ManifestWorkspaceFile> {\n const [schemaFilename, toolsFilename] = await Promise.all([\n createFile(staticPath, workspace.schema, SCHEMA_FILENAME_SUFFIX),\n createFile(staticPath, workspace.tools, TOOLS_FILENAME_SUFFIX),\n ])\n\n return {\n ...workspace,\n schema: schemaFilename,\n tools: toolsFilename,\n }\n}\n\nconst createFile = async (path: string, content: unknown, filenameSuffix: string) => {\n const stringifiedContent = JSON.stringify(content, null, 2)\n const hash = createHash('sha1').update(stringifiedContent).digest('hex')\n const filename = `${hash.slice(0, 8)}${filenameSuffix}`\n\n // workspaces with identical data will overwrite each others file. This is ok, since they are identical and can be shared\n await writeFile(join(path, filename), stringifiedContent)\n\n return filename\n}\n"],"names":["createHash","mkdir","writeFile","join","resolve","getTimer","spinner","importStudioConfig","readModuleVersion","extractWorkspaceManifest","MANIFEST_FILENAME","SCHEMA_FILENAME_SUFFIX","TOOLS_FILENAME_SUFFIX","FEATURE_ENABLED_ENV_NAME","EXTRACT_MANIFEST_ENABLED","process","env","EXTRACT_MANIFEST_LOG_ERRORS","SANITY_CLI_EXTRACT_MANIFEST_LOG_ERRORS","CREATE_TIMER","extractManifestSafe","options","undefined","extractManifest","err","output","error","flags","workDir","staticPath","path","timer","start","spin","workspaceManifests","getWorkspaceManifests","recursive","workspaceFiles","writeWorkspaceFiles","manifest","createdAt","Date","toISOString","studioVersion","version","workspaces","JSON","stringify","manifestDuration","end","succeed","toFixed","fail","message","manifestWorkspaces","map","workspace","writeWorkspaceFile","Promise","all","schemaFilename","toolsFilename","createFile","schema","tools","content","filenameSuffix","stringifiedContent","hash","update","digest","filename","slice"],"mappings":"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"}
|
|
@@ -12,6 +12,11 @@ export interface CreateManifest {
|
|
|
12
12
|
version: number;
|
|
13
13
|
workspaces: ManifestWorkspaceFile[];
|
|
14
14
|
}
|
|
15
|
+
export interface AppManifest {
|
|
16
|
+
version: '1';
|
|
17
|
+
icon?: string;
|
|
18
|
+
title?: string;
|
|
19
|
+
}
|
|
15
20
|
export interface ManifestWorkspaceFile extends Omit<CreateWorkspaceManifest, 'schema' | 'tools'> {
|
|
16
21
|
schema: string;
|
|
17
22
|
tools: string;
|
|
@@ -94,7 +99,7 @@ export interface ManifestTool {
|
|
|
94
99
|
type: string | null;
|
|
95
100
|
}
|
|
96
101
|
export type DefaultWorkspaceSchemaId = `${typeof SANITY_WORKSPACE_SCHEMA_ID_PREFIX}.${string}`;
|
|
97
|
-
|
|
102
|
+
type PrefixedWorkspaceSchemaId = `${DefaultWorkspaceSchemaId}.${string}`;
|
|
98
103
|
export type WorkspaceSchemaId = DefaultWorkspaceSchemaId | PrefixedWorkspaceSchemaId;
|
|
99
104
|
export interface StoredWorkspaceSchema extends SanityDocumentLike {
|
|
100
105
|
_id: WorkspaceSchemaId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/actions/manifest/types.ts"],"sourcesContent":["import {type SanityDocumentLike} from '@sanity/types'\nimport {type MediaLibraryConfig} from 'sanity'\n\nexport const SANITY_WORKSPACE_SCHEMA_ID_PREFIX = '_.schemas'\nexport const SANITY_WORKSPACE_SCHEMA_TYPE = 'system.schema'\nexport const CURRENT_WORKSPACE_SCHEMA_VERSION = '2025-05-01'\n\nexport type ManifestSerializable =\n | boolean\n | ManifestSerializable[]\n | number\n | string\n | {[k: string]: ManifestSerializable}\n\nexport interface CreateManifest {\n createdAt: string\n studioVersion: string | null\n version: number\n workspaces: ManifestWorkspaceFile[]\n}\n\nexport interface ManifestWorkspaceFile extends Omit<CreateWorkspaceManifest, 'schema' | 'tools'> {\n schema: string // filename\n tools: string // filename\n}\n\nexport interface CreateWorkspaceManifest {\n basePath: string\n dataset: string\n /**\n * returns null in the case of the icon not being able to be stringified\n */\n icon: string | null\n name: string\n projectId: string\n schema: ManifestSchemaType[]\n tools: ManifestTool[]\n\n mediaLibrary?: MediaLibraryConfig\n subtitle?: string\n title?: string\n}\n\nexport interface ManifestSchemaType {\n name: string\n type: string\n\n deprecated?: {\n reason: string\n }\n fields?: ManifestField[]\n fieldsets?: ManifestFieldset[]\n hidden?: 'conditional' | boolean\n lists?: ManifestTitledValue[]\n //portable text\n marks?: {\n annotations?: ManifestArrayMember[]\n decorators?: ManifestTitledValue[]\n }\n of?: ManifestArrayMember[]\n options?: Record<string, ManifestSerializable>\n preview?: {\n select: Record<string, string>\n }\n readOnly?: 'conditional' | boolean\n styles?: ManifestTitledValue[]\n title?: string\n to?: ManifestReferenceMember[]\n validation?: ManifestValidationGroup[]\n\n // userland (assignable to ManifestSerializable | undefined)\n // not included to add some typesafty to extractManifest\n // [index: string]: unknown\n}\n\nexport interface ManifestFieldset {\n [index: string]: ManifestSerializable | undefined\n name: string\n\n title?: string\n}\n\nexport interface ManifestTitledValue {\n value: string\n\n title?: string\n}\n\ntype ManifestArrayMember = Omit<ManifestSchemaType, 'name'> & {name?: string}\ntype ManifestReferenceMember = Omit<ManifestSchemaType, 'name'> & {name?: string}\nexport type ManifestField = ManifestSchemaType & {fieldset?: string}\n\nexport interface ManifestValidationGroup {\n rules: ManifestValidationRule[]\n\n level?: 'error' | 'info' | 'warning'\n message?: string\n}\n\nexport type ManifestValidationRule = {\n [index: string]: ManifestSerializable | undefined\n constraint?: ManifestSerializable\n flag: string\n}\n\nexport interface ManifestTool {\n /**\n * returns null in the case of the icon not being able to be stringified\n */\n icon: string | null\n name: string\n title: string\n type: string | null\n}\n\nexport type DefaultWorkspaceSchemaId = `${typeof SANITY_WORKSPACE_SCHEMA_ID_PREFIX}.${string}`\
|
|
1
|
+
{"version":3,"sources":["../../../src/actions/manifest/types.ts"],"sourcesContent":["import {type SanityDocumentLike} from '@sanity/types'\nimport {type MediaLibraryConfig} from 'sanity'\n\nexport const SANITY_WORKSPACE_SCHEMA_ID_PREFIX = '_.schemas'\nexport const SANITY_WORKSPACE_SCHEMA_TYPE = 'system.schema'\nexport const CURRENT_WORKSPACE_SCHEMA_VERSION = '2025-05-01'\n\nexport type ManifestSerializable =\n | boolean\n | ManifestSerializable[]\n | number\n | string\n | {[k: string]: ManifestSerializable}\n\nexport interface CreateManifest {\n createdAt: string\n studioVersion: string | null\n version: number\n workspaces: ManifestWorkspaceFile[]\n}\n\nexport interface AppManifest {\n version: '1'\n\n icon?: string\n title?: string\n}\n\nexport interface ManifestWorkspaceFile extends Omit<CreateWorkspaceManifest, 'schema' | 'tools'> {\n schema: string // filename\n tools: string // filename\n}\n\nexport interface CreateWorkspaceManifest {\n basePath: string\n dataset: string\n /**\n * returns null in the case of the icon not being able to be stringified\n */\n icon: string | null\n name: string\n projectId: string\n schema: ManifestSchemaType[]\n tools: ManifestTool[]\n\n mediaLibrary?: MediaLibraryConfig\n subtitle?: string\n title?: string\n}\n\nexport interface ManifestSchemaType {\n name: string\n type: string\n\n deprecated?: {\n reason: string\n }\n fields?: ManifestField[]\n fieldsets?: ManifestFieldset[]\n hidden?: 'conditional' | boolean\n lists?: ManifestTitledValue[]\n //portable text\n marks?: {\n annotations?: ManifestArrayMember[]\n decorators?: ManifestTitledValue[]\n }\n of?: ManifestArrayMember[]\n options?: Record<string, ManifestSerializable>\n preview?: {\n select: Record<string, string>\n }\n readOnly?: 'conditional' | boolean\n styles?: ManifestTitledValue[]\n title?: string\n to?: ManifestReferenceMember[]\n validation?: ManifestValidationGroup[]\n\n // userland (assignable to ManifestSerializable | undefined)\n // not included to add some typesafty to extractManifest\n // [index: string]: unknown\n}\n\nexport interface ManifestFieldset {\n [index: string]: ManifestSerializable | undefined\n name: string\n\n title?: string\n}\n\nexport interface ManifestTitledValue {\n value: string\n\n title?: string\n}\n\ntype ManifestArrayMember = Omit<ManifestSchemaType, 'name'> & {name?: string}\ntype ManifestReferenceMember = Omit<ManifestSchemaType, 'name'> & {name?: string}\nexport type ManifestField = ManifestSchemaType & {fieldset?: string}\n\nexport interface ManifestValidationGroup {\n rules: ManifestValidationRule[]\n\n level?: 'error' | 'info' | 'warning'\n message?: string\n}\n\nexport type ManifestValidationRule = {\n [index: string]: ManifestSerializable | undefined\n constraint?: ManifestSerializable\n flag: string\n}\n\nexport interface ManifestTool {\n /**\n * returns null in the case of the icon not being able to be stringified\n */\n icon: string | null\n name: string\n title: string\n type: string | null\n}\n\nexport type DefaultWorkspaceSchemaId = `${typeof SANITY_WORKSPACE_SCHEMA_ID_PREFIX}.${string}`\ntype PrefixedWorkspaceSchemaId = `${DefaultWorkspaceSchemaId}.${string}`\nexport type WorkspaceSchemaId = DefaultWorkspaceSchemaId | PrefixedWorkspaceSchemaId\n\nexport interface StoredWorkspaceSchema extends SanityDocumentLike {\n _id: WorkspaceSchemaId\n _type: typeof SANITY_WORKSPACE_SCHEMA_TYPE\n /**\n * The API expects JSON coming in, but will store a string to save on attribute paths.\n * Consumers must use JSON.parse on the value, put we deploy to the API using ManifestSchemaType[]\n */\n schema: ManifestSchemaType[] | string\n /* api-like version string: date at which the format had a meaningful change */\n version: typeof CURRENT_WORKSPACE_SCHEMA_VERSION | undefined\n workspace: {\n name: string\n title?: string\n }\n\n tag?: string\n}\n"],"names":["SANITY_WORKSPACE_SCHEMA_ID_PREFIX","SANITY_WORKSPACE_SCHEMA_TYPE","CURRENT_WORKSPACE_SCHEMA_VERSION"],"mappings":"AAGA,OAAO,MAAMA,oCAAoC,YAAW;AAC5D,OAAO,MAAMC,+BAA+B,gBAAe;AAC3D,OAAO,MAAMC,mCAAmC,aAAY"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { access, readdir } from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
+
import { tryGetDefaultExport } from '@sanity/cli-core';
|
|
3
4
|
import { validateMediaLibraryAssetAspect } from '@sanity/schema/_internal';
|
|
4
5
|
import { isAssetAspect } from '@sanity/types';
|
|
5
6
|
import { getTsconfig } from 'get-tsconfig';
|
|
@@ -52,7 +53,7 @@ import { tsImport } from 'tsx/esm/api';
|
|
|
52
53
|
tsconfig: tsconfig?.path
|
|
53
54
|
});
|
|
54
55
|
// Get the default export
|
|
55
|
-
const maybeAspect = aspectModule
|
|
56
|
+
const maybeAspect = tryGetDefaultExport(aspectModule);
|
|
56
57
|
// Check if user wants to filter this aspect
|
|
57
58
|
if (!filterAspects(maybeAspect)) {
|
|
58
59
|
continue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/actions/media/importAspects.ts"],"sourcesContent":["import {access, readdir} from 'node:fs/promises'\nimport path from 'node:path'\n\nimport {validateMediaLibraryAssetAspect} from '@sanity/schema/_internal'\nimport {\n isAssetAspect,\n type MediaLibraryAssetAspectDocument,\n type SchemaValidationProblem,\n} from '@sanity/types'\nimport {getTsconfig} from 'get-tsconfig'\nimport {tsImport} from 'tsx/esm/api'\n\n/**\n * File extensions that are considered valid aspect definition files\n */\nconst ASPECT_FILE_EXTENSIONS = new Set(['.js', '.jsx', '.mjs', '.mts', '.ts', '.tsx'])\n\n/**\n * Type for an aspect that has been validated\n */\ninterface ValidAspect {\n aspect: MediaLibraryAssetAspectDocument\n filename: string\n status: 'valid'\n validationErrors: never[]\n}\n\n/**\n * Type for an aspect that failed validation\n */\ninterface InvalidAspect {\n aspect: unknown\n filename: string\n status: 'invalid'\n validationErrors: SchemaValidationProblem[][]\n}\n\n/**\n * Union type for aspect containers\n */\ntype AspectContainer = InvalidAspect | ValidAspect\n\n/**\n * Options for importing aspects\n */\ninterface ImportAspectsOptions {\n /**\n * Path to the directory containing aspect definition files\n */\n aspectsPath: string\n\n /**\n * Optional filter function to determine which aspects to include\n */\n filterAspects?: (aspect: unknown) => boolean\n}\n\n/**\n * Result of importing aspects, grouped by validation status\n */\ninterface ImportAspectsResult {\n invalid: InvalidAspect[]\n valid: ValidAspect[]\n}\n\n/**\n * Import and validate aspect definition files from a directory\n *\n * This function reads all TypeScript/JavaScript files from the specified directory,\n * dynamically imports them using tsx for TypeScript support, validates them,\n * and returns them grouped by validation status.\n *\n * @param options - Options for importing aspects\n * @returns Promise resolving to valid and invalid aspects\n * @internal\n */\nexport async function importAspects(options: ImportAspectsOptions): Promise<ImportAspectsResult> {\n const {aspectsPath, filterAspects = () => true} = options\n\n // Check if directory exists\n try {\n await access(aspectsPath)\n } catch {\n throw new Error(`Aspects directory does not exist: ${aspectsPath}`)\n }\n\n // Read directory entries\n const entries = await readdir(aspectsPath, {withFileTypes: true})\n\n // Filter for valid aspect files\n const aspectFiles = entries.filter(\n (entry) => entry.isFile() && ASPECT_FILE_EXTENSIONS.has(path.extname(entry.name)),\n )\n\n // Get tsconfig for TypeScript compilation\n const tsconfig = getTsconfig(aspectsPath)\n\n // Import and validate all aspect files\n const aspects: AspectContainer[] = []\n\n for (const file of aspectFiles) {\n const filename = file.name\n const filePath = path.resolve(aspectsPath, filename)\n\n try {\n // Dynamically import the aspect file with TypeScript support\n const aspectModule = await tsImport(filePath, {\n parentURL: import.meta.url,\n tsconfig: tsconfig?.path,\n })\n\n // Get the default export\n const maybeAspect = aspectModule
|
|
1
|
+
{"version":3,"sources":["../../../src/actions/media/importAspects.ts"],"sourcesContent":["import {access, readdir} from 'node:fs/promises'\nimport path from 'node:path'\n\nimport {tryGetDefaultExport} from '@sanity/cli-core'\nimport {validateMediaLibraryAssetAspect} from '@sanity/schema/_internal'\nimport {\n isAssetAspect,\n type MediaLibraryAssetAspectDocument,\n type SchemaValidationProblem,\n} from '@sanity/types'\nimport {getTsconfig} from 'get-tsconfig'\nimport {tsImport} from 'tsx/esm/api'\n\n/**\n * File extensions that are considered valid aspect definition files\n */\nconst ASPECT_FILE_EXTENSIONS = new Set(['.js', '.jsx', '.mjs', '.mts', '.ts', '.tsx'])\n\n/**\n * Type for an aspect that has been validated\n */\ninterface ValidAspect {\n aspect: MediaLibraryAssetAspectDocument\n filename: string\n status: 'valid'\n validationErrors: never[]\n}\n\n/**\n * Type for an aspect that failed validation\n */\ninterface InvalidAspect {\n aspect: unknown\n filename: string\n status: 'invalid'\n validationErrors: SchemaValidationProblem[][]\n}\n\n/**\n * Union type for aspect containers\n */\ntype AspectContainer = InvalidAspect | ValidAspect\n\n/**\n * Options for importing aspects\n */\ninterface ImportAspectsOptions {\n /**\n * Path to the directory containing aspect definition files\n */\n aspectsPath: string\n\n /**\n * Optional filter function to determine which aspects to include\n */\n filterAspects?: (aspect: unknown) => boolean\n}\n\n/**\n * Result of importing aspects, grouped by validation status\n */\ninterface ImportAspectsResult {\n invalid: InvalidAspect[]\n valid: ValidAspect[]\n}\n\n/**\n * Import and validate aspect definition files from a directory\n *\n * This function reads all TypeScript/JavaScript files from the specified directory,\n * dynamically imports them using tsx for TypeScript support, validates them,\n * and returns them grouped by validation status.\n *\n * @param options - Options for importing aspects\n * @returns Promise resolving to valid and invalid aspects\n * @internal\n */\nexport async function importAspects(options: ImportAspectsOptions): Promise<ImportAspectsResult> {\n const {aspectsPath, filterAspects = () => true} = options\n\n // Check if directory exists\n try {\n await access(aspectsPath)\n } catch {\n throw new Error(`Aspects directory does not exist: ${aspectsPath}`)\n }\n\n // Read directory entries\n const entries = await readdir(aspectsPath, {withFileTypes: true})\n\n // Filter for valid aspect files\n const aspectFiles = entries.filter(\n (entry) => entry.isFile() && ASPECT_FILE_EXTENSIONS.has(path.extname(entry.name)),\n )\n\n // Get tsconfig for TypeScript compilation\n const tsconfig = getTsconfig(aspectsPath)\n\n // Import and validate all aspect files\n const aspects: AspectContainer[] = []\n\n for (const file of aspectFiles) {\n const filename = file.name\n const filePath = path.resolve(aspectsPath, filename)\n\n try {\n // Dynamically import the aspect file with TypeScript support\n const aspectModule = await tsImport(filePath, {\n parentURL: import.meta.url,\n tsconfig: tsconfig?.path,\n })\n\n // Get the default export\n const maybeAspect = tryGetDefaultExport(aspectModule)\n\n // Check if user wants to filter this aspect\n if (!filterAspects(maybeAspect)) {\n continue\n }\n\n // Validate that it's an asset aspect\n if (!isAssetAspect(maybeAspect)) {\n aspects.push({\n aspect: maybeAspect,\n filename,\n status: 'invalid',\n validationErrors: [],\n })\n continue\n }\n\n // Validate the aspect schema\n const [valid, errors] = validateMediaLibraryAssetAspect(maybeAspect.definition)\n\n if (!valid) {\n aspects.push({\n aspect: maybeAspect,\n filename,\n status: 'invalid',\n validationErrors: errors,\n })\n continue\n }\n\n aspects.push({\n aspect: maybeAspect,\n filename,\n status: 'valid',\n validationErrors: [],\n })\n } catch (error) {\n aspects.push({\n aspect: null,\n filename,\n status: 'invalid',\n validationErrors: [\n [\n {\n message: `Failed to import file: ${error instanceof Error ? error.message : 'Unknown error'}`,\n severity: 'error',\n },\n ],\n ],\n })\n }\n }\n\n // Group by validation status\n const result: ImportAspectsResult = {\n invalid: aspects.filter((a): a is InvalidAspect => a.status === 'invalid'),\n valid: aspects.filter((a): a is ValidAspect => a.status === 'valid'),\n }\n\n return result\n}\n"],"names":["access","readdir","path","tryGetDefaultExport","validateMediaLibraryAssetAspect","isAssetAspect","getTsconfig","tsImport","ASPECT_FILE_EXTENSIONS","Set","importAspects","options","aspectsPath","filterAspects","Error","entries","withFileTypes","aspectFiles","filter","entry","isFile","has","extname","name","tsconfig","aspects","file","filename","filePath","resolve","aspectModule","parentURL","url","maybeAspect","push","aspect","status","validationErrors","valid","errors","definition","error","message","severity","result","invalid","a"],"mappings":"AAAA,SAAQA,MAAM,EAAEC,OAAO,QAAO,mBAAkB;AAChD,OAAOC,UAAU,YAAW;AAE5B,SAAQC,mBAAmB,QAAO,mBAAkB;AACpD,SAAQC,+BAA+B,QAAO,2BAA0B;AACxE,SACEC,aAAa,QAGR,gBAAe;AACtB,SAAQC,WAAW,QAAO,eAAc;AACxC,SAAQC,QAAQ,QAAO,cAAa;AAEpC;;CAEC,GACD,MAAMC,yBAAyB,IAAIC,IAAI;IAAC;IAAO;IAAQ;IAAQ;IAAQ;IAAO;CAAO;AAkDrF;;;;;;;;;;CAUC,GACD,OAAO,eAAeC,cAAcC,OAA6B;IAC/D,MAAM,EAACC,WAAW,EAAEC,gBAAgB,IAAM,IAAI,EAAC,GAAGF;IAElD,4BAA4B;IAC5B,IAAI;QACF,MAAMX,OAAOY;IACf,EAAE,OAAM;QACN,MAAM,IAAIE,MAAM,CAAC,kCAAkC,EAAEF,aAAa;IACpE;IAEA,yBAAyB;IACzB,MAAMG,UAAU,MAAMd,QAAQW,aAAa;QAACI,eAAe;IAAI;IAE/D,gCAAgC;IAChC,MAAMC,cAAcF,QAAQG,MAAM,CAChC,CAACC,QAAUA,MAAMC,MAAM,MAAMZ,uBAAuBa,GAAG,CAACnB,KAAKoB,OAAO,CAACH,MAAMI,IAAI;IAGjF,0CAA0C;IAC1C,MAAMC,WAAWlB,YAAYM;IAE7B,uCAAuC;IACvC,MAAMa,UAA6B,EAAE;IAErC,KAAK,MAAMC,QAAQT,YAAa;QAC9B,MAAMU,WAAWD,KAAKH,IAAI;QAC1B,MAAMK,WAAW1B,KAAK2B,OAAO,CAACjB,aAAae;QAE3C,IAAI;YACF,6DAA6D;YAC7D,MAAMG,eAAe,MAAMvB,SAASqB,UAAU;gBAC5CG,WAAW,YAAYC,GAAG;gBAC1BR,UAAUA,UAAUtB;YACtB;YAEA,yBAAyB;YACzB,MAAM+B,cAAc9B,oBAAoB2B;YAExC,4CAA4C;YAC5C,IAAI,CAACjB,cAAcoB,cAAc;gBAC/B;YACF;YAEA,qCAAqC;YACrC,IAAI,CAAC5B,cAAc4B,cAAc;gBAC/BR,QAAQS,IAAI,CAAC;oBACXC,QAAQF;oBACRN;oBACAS,QAAQ;oBACRC,kBAAkB,EAAE;gBACtB;gBACA;YACF;YAEA,6BAA6B;YAC7B,MAAM,CAACC,OAAOC,OAAO,GAAGnC,gCAAgC6B,YAAYO,UAAU;YAE9E,IAAI,CAACF,OAAO;gBACVb,QAAQS,IAAI,CAAC;oBACXC,QAAQF;oBACRN;oBACAS,QAAQ;oBACRC,kBAAkBE;gBACpB;gBACA;YACF;YAEAd,QAAQS,IAAI,CAAC;gBACXC,QAAQF;gBACRN;gBACAS,QAAQ;gBACRC,kBAAkB,EAAE;YACtB;QACF,EAAE,OAAOI,OAAO;YACdhB,QAAQS,IAAI,CAAC;gBACXC,QAAQ;gBACRR;gBACAS,QAAQ;gBACRC,kBAAkB;oBAChB;wBACE;4BACEK,SAAS,CAAC,uBAAuB,EAAED,iBAAiB3B,QAAQ2B,MAAMC,OAAO,GAAG,iBAAiB;4BAC7FC,UAAU;wBACZ;qBACD;iBACF;YACH;QACF;IACF;IAEA,6BAA6B;IAC7B,MAAMC,SAA8B;QAClCC,SAASpB,QAAQP,MAAM,CAAC,CAAC4B,IAA0BA,EAAEV,MAAM,KAAK;QAChEE,OAAOb,QAAQP,MAAM,CAAC,CAAC4B,IAAwBA,EAAEV,MAAM,KAAK;IAC9D;IAEA,OAAOQ;AACT"}
|
|
@@ -8,7 +8,7 @@ export declare function uniqByProjectIdDataset(workspaces: ManifestWorkspaceFile
|
|
|
8
8
|
mediaLibrary?: import("sanity").MediaLibraryConfig | undefined;
|
|
9
9
|
dataset: string;
|
|
10
10
|
projectId: string;
|
|
11
|
-
basePath: string;
|
|
12
11
|
icon: string | null;
|
|
12
|
+
basePath: string;
|
|
13
13
|
subtitle?: string | undefined;
|
|
14
14
|
}[];
|
|
@@ -1,10 +1,2 @@
|
|
|
1
1
|
import { type ConsentInformation } from './types.js';
|
|
2
|
-
|
|
3
|
-
DO_NOT_TRACK?: string;
|
|
4
|
-
SANITY_TELEMETRY_INSPECT?: string;
|
|
5
|
-
}
|
|
6
|
-
interface Options {
|
|
7
|
-
env: Env | NodeJS.ProcessEnv;
|
|
8
|
-
}
|
|
9
|
-
export declare function resolveConsent({ env }: Options): Promise<ConsentInformation>;
|
|
10
|
-
export {};
|
|
2
|
+
export declare function resolveConsent(): Promise<ConsentInformation>;
|
|
@@ -8,7 +8,7 @@ function parseApiConsentStatus(value) {
|
|
|
8
8
|
}
|
|
9
9
|
throw new Error(`Invalid consent status. Must be one of: ${VALID_API_STATUSES.join(', ')}`);
|
|
10
10
|
}
|
|
11
|
-
export async function resolveConsent(
|
|
11
|
+
export async function resolveConsent() {
|
|
12
12
|
telemetryDebug('Resolving consent…');
|
|
13
13
|
if (isCi()) {
|
|
14
14
|
telemetryDebug('CI environment detected, treating telemetry consent as denied');
|
|
@@ -16,7 +16,7 @@ export async function resolveConsent({ env }) {
|
|
|
16
16
|
status: 'denied'
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
if (isTrueish(env.DO_NOT_TRACK)) {
|
|
19
|
+
if (isTrueish(process.env.DO_NOT_TRACK)) {
|
|
20
20
|
telemetryDebug('DO_NOT_TRACK is set, consent is denied');
|
|
21
21
|
return {
|
|
22
22
|
reason: 'localOverride',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/actions/telemetry/resolveConsent.ts"],"sourcesContent":["import {getCliToken, isCi, isTrueish} from '@sanity/cli-core'\n\nimport {fetchTelemetryConsent} from './fetchTelemetryConsent.js'\nimport {\n isValidApiConsentStatus,\n VALID_API_STATUSES,\n type ValidApiConsentStatus,\n} from './isValidApiConsentStatus.js'\nimport {telemetryDebug} from './telemetryDebug.js'\nimport {type ConsentInformation} from './types.js'\n\
|
|
1
|
+
{"version":3,"sources":["../../../src/actions/telemetry/resolveConsent.ts"],"sourcesContent":["import {getCliToken, isCi, isTrueish} from '@sanity/cli-core'\n\nimport {fetchTelemetryConsent} from './fetchTelemetryConsent.js'\nimport {\n isValidApiConsentStatus,\n VALID_API_STATUSES,\n type ValidApiConsentStatus,\n} from './isValidApiConsentStatus.js'\nimport {telemetryDebug} from './telemetryDebug.js'\nimport {type ConsentInformation} from './types.js'\n\nfunction parseApiConsentStatus(value: unknown): ValidApiConsentStatus {\n if (typeof value === 'string' && isValidApiConsentStatus(value)) {\n return value\n }\n throw new Error(`Invalid consent status. Must be one of: ${VALID_API_STATUSES.join(', ')}`)\n}\n\nexport async function resolveConsent(): Promise<ConsentInformation> {\n telemetryDebug('Resolving consent…')\n if (isCi()) {\n telemetryDebug('CI environment detected, treating telemetry consent as denied')\n return {status: 'denied'}\n }\n\n if (isTrueish(process.env.DO_NOT_TRACK)) {\n telemetryDebug('DO_NOT_TRACK is set, consent is denied')\n return {\n reason: 'localOverride',\n status: 'denied',\n }\n }\n\n const token = await getCliToken()\n if (!token) {\n telemetryDebug('User is not logged in, consent is undetermined')\n return {\n reason: 'unauthenticated',\n status: 'undetermined',\n }\n }\n\n try {\n const response = await fetchTelemetryConsent()\n\n telemetryDebug('User consent status is %s', response.status)\n return {status: parseApiConsentStatus(response.status)}\n } catch (err) {\n telemetryDebug('Failed to fetch user consent status, treating it as \"undetermined\": %s', err)\n return {\n reason: 'fetchError',\n status: 'undetermined',\n }\n }\n}\n"],"names":["getCliToken","isCi","isTrueish","fetchTelemetryConsent","isValidApiConsentStatus","VALID_API_STATUSES","telemetryDebug","parseApiConsentStatus","value","Error","join","resolveConsent","status","process","env","DO_NOT_TRACK","reason","token","response","err"],"mappings":"AAAA,SAAQA,WAAW,EAAEC,IAAI,EAAEC,SAAS,QAAO,mBAAkB;AAE7D,SAAQC,qBAAqB,QAAO,6BAA4B;AAChE,SACEC,uBAAuB,EACvBC,kBAAkB,QAEb,+BAA8B;AACrC,SAAQC,cAAc,QAAO,sBAAqB;AAGlD,SAASC,sBAAsBC,KAAc;IAC3C,IAAI,OAAOA,UAAU,YAAYJ,wBAAwBI,QAAQ;QAC/D,OAAOA;IACT;IACA,MAAM,IAAIC,MAAM,CAAC,wCAAwC,EAAEJ,mBAAmBK,IAAI,CAAC,OAAO;AAC5F;AAEA,OAAO,eAAeC;IACpBL,eAAe;IACf,IAAIL,QAAQ;QACVK,eAAe;QACf,OAAO;YAACM,QAAQ;QAAQ;IAC1B;IAEA,IAAIV,UAAUW,QAAQC,GAAG,CAACC,YAAY,GAAG;QACvCT,eAAe;QACf,OAAO;YACLU,QAAQ;YACRJ,QAAQ;QACV;IACF;IAEA,MAAMK,QAAQ,MAAMjB;IACpB,IAAI,CAACiB,OAAO;QACVX,eAAe;QACf,OAAO;YACLU,QAAQ;YACRJ,QAAQ;QACV;IACF;IAEA,IAAI;QACF,MAAMM,WAAW,MAAMf;QAEvBG,eAAe,6BAA6BY,SAASN,MAAM;QAC3D,OAAO;YAACA,QAAQL,sBAAsBW,SAASN,MAAM;QAAC;IACxD,EAAE,OAAOO,KAAK;QACZb,eAAe,0EAA0Ea;QACzF,OAAO;YACLH,QAAQ;YACRJ,QAAQ;QACV;IACF;AACF"}
|
|
@@ -2,9 +2,6 @@ import { type ValidApiConsentStatus } from './isValidApiConsentStatus.js';
|
|
|
2
2
|
import { type ConsentInformation } from './types.js';
|
|
3
3
|
type SettableConsentStatus = Extract<ValidApiConsentStatus, 'denied' | 'granted'>;
|
|
4
4
|
interface SetConsentOptions {
|
|
5
|
-
env: NodeJS.ProcessEnv | {
|
|
6
|
-
[key: string]: string | undefined;
|
|
7
|
-
};
|
|
8
5
|
status: SettableConsentStatus;
|
|
9
6
|
}
|
|
10
7
|
interface SetConsentResult {
|
|
@@ -12,5 +9,5 @@ interface SetConsentResult {
|
|
|
12
9
|
currentStatus: ConsentInformation;
|
|
13
10
|
message: string;
|
|
14
11
|
}
|
|
15
|
-
export declare function setConsent({
|
|
12
|
+
export declare function setConsent({ status }: SetConsentOptions): Promise<SetConsentResult>;
|
|
16
13
|
export {};
|
|
@@ -6,12 +6,10 @@ const TELEMETRY_CONSENT_CONFIG_KEY = 'telemetryConsent';
|
|
|
6
6
|
function isHttpError(error) {
|
|
7
7
|
return typeof error === 'object' && error !== null && 'statusCode' in error && 'message' in error;
|
|
8
8
|
}
|
|
9
|
-
export async function setConsent({
|
|
9
|
+
export async function setConsent({ status }) {
|
|
10
10
|
telemetryDebug('Setting telemetry consent to "%s"', status);
|
|
11
11
|
// Check current consent status first
|
|
12
|
-
const currentConsent = await resolveConsent(
|
|
13
|
-
env
|
|
14
|
-
});
|
|
12
|
+
const currentConsent = await resolveConsent();
|
|
15
13
|
// Handle various blocking conditions
|
|
16
14
|
if (isCi()) {
|
|
17
15
|
return {
|
|
@@ -20,7 +18,7 @@ export async function setConsent({ env, status }) {
|
|
|
20
18
|
message: 'Cannot set telemetry consent in CI environment'
|
|
21
19
|
};
|
|
22
20
|
}
|
|
23
|
-
if (isTrueish(env.DO_NOT_TRACK) && status === 'granted') {
|
|
21
|
+
if (isTrueish(process.env.DO_NOT_TRACK) && status === 'granted') {
|
|
24
22
|
return {
|
|
25
23
|
changed: false,
|
|
26
24
|
currentStatus: currentConsent,
|
|
@@ -59,9 +57,7 @@ export async function setConsent({ env, status }) {
|
|
|
59
57
|
const userConfig = getUserConfig();
|
|
60
58
|
userConfig.delete(TELEMETRY_CONSENT_CONFIG_KEY);
|
|
61
59
|
const successMessage = status === 'granted' ? "You've now enabled telemetry data collection to help us improve Sanity." : "You've opted out of telemetry data collection.\nNo data will be collected from your Sanity account.";
|
|
62
|
-
const newConsent = await resolveConsent(
|
|
63
|
-
env
|
|
64
|
-
});
|
|
60
|
+
const newConsent = await resolveConsent();
|
|
65
61
|
return {
|
|
66
62
|
changed: true,
|
|
67
63
|
currentStatus: newConsent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/actions/telemetry/setConsent.ts"],"sourcesContent":["import {getGlobalCliClient, getUserConfig, isCi, isTrueish} from '@sanity/cli-core'\n\nimport {type ValidApiConsentStatus} from './isValidApiConsentStatus.js'\nimport {resolveConsent} from './resolveConsent.js'\nimport {telemetryDebug} from './telemetryDebug.js'\nimport {type ConsentInformation} from './types.js'\n\nconst TELEMETRY_CONSENT_CONFIG_KEY = 'telemetryConsent'\n\ntype SettableConsentStatus = Extract<ValidApiConsentStatus, 'denied' | 'granted'>\n\n// Type guard for error objects with HTTP properties\nfunction isHttpError(error: unknown): error is {\n message: string\n response?: {body?: {message?: string}}\n statusCode: number\n} {\n return typeof error === 'object' && error !== null && 'statusCode' in error && 'message' in error\n}\n\ninterface SetConsentOptions {\n
|
|
1
|
+
{"version":3,"sources":["../../../src/actions/telemetry/setConsent.ts"],"sourcesContent":["import {getGlobalCliClient, getUserConfig, isCi, isTrueish} from '@sanity/cli-core'\n\nimport {type ValidApiConsentStatus} from './isValidApiConsentStatus.js'\nimport {resolveConsent} from './resolveConsent.js'\nimport {telemetryDebug} from './telemetryDebug.js'\nimport {type ConsentInformation} from './types.js'\n\nconst TELEMETRY_CONSENT_CONFIG_KEY = 'telemetryConsent'\n\ntype SettableConsentStatus = Extract<ValidApiConsentStatus, 'denied' | 'granted'>\n\n// Type guard for error objects with HTTP properties\nfunction isHttpError(error: unknown): error is {\n message: string\n response?: {body?: {message?: string}}\n statusCode: number\n} {\n return typeof error === 'object' && error !== null && 'statusCode' in error && 'message' in error\n}\n\ninterface SetConsentOptions {\n status: SettableConsentStatus\n}\n\ninterface SetConsentResult {\n changed: boolean\n currentStatus: ConsentInformation\n message: string\n}\n\nexport async function setConsent({status}: SetConsentOptions): Promise<SetConsentResult> {\n telemetryDebug('Setting telemetry consent to \"%s\"', status)\n\n // Check current consent status first\n const currentConsent = await resolveConsent()\n\n // Handle various blocking conditions\n if (isCi()) {\n return {\n changed: false,\n currentStatus: currentConsent,\n message: 'Cannot set telemetry consent in CI environment',\n }\n }\n\n if (isTrueish(process.env.DO_NOT_TRACK) && status === 'granted') {\n return {\n changed: false,\n currentStatus: currentConsent,\n message:\n 'Cannot enable telemetry while DO_NOT_TRACK environment variable is set. Unset DO_NOT_TRACK to enable telemetry.',\n }\n }\n\n // Check if already at desired status\n if (currentConsent.status === status) {\n const message =\n status === 'granted'\n ? \"You've already enabled telemetry data collection to help us improve Sanity.\"\n : currentConsent.reason === 'localOverride'\n ? \"You've already opted out of telemetry data collection.\\nNo data is collected from your machine.\\n\\nUsing DO_NOT_TRACK environment variable.\"\n : \"You've already opted out of telemetry data collection.\\nNo data is collected from your Sanity account.\"\n\n return {\n changed: false,\n currentStatus: currentConsent,\n message,\n }\n }\n\n // User must be logged in to set consent\n if (currentConsent.status === 'undetermined' && currentConsent.reason === 'unauthenticated') {\n return {\n changed: false,\n currentStatus: currentConsent,\n message: 'You need to log in first to set telemetry preferences.',\n }\n }\n\n try {\n const client = await getGlobalCliClient({\n apiVersion: '2023-12-18',\n requireUser: true,\n })\n\n const uri = `/users/me/consents/telemetry/status/${status}`\n telemetryDebug('Sending telemetry consent status to %s', uri)\n\n await client.request({\n method: 'PUT',\n uri,\n })\n\n // Clear cached telemetry consent\n const userConfig = getUserConfig()\n userConfig.delete(TELEMETRY_CONSENT_CONFIG_KEY)\n\n const successMessage =\n status === 'granted'\n ? \"You've now enabled telemetry data collection to help us improve Sanity.\"\n : \"You've opted out of telemetry data collection.\\nNo data will be collected from your Sanity account.\"\n\n const newConsent = await resolveConsent()\n\n return {\n changed: true,\n currentStatus: newConsent,\n message: successMessage,\n }\n } catch (err: unknown) {\n const errorMessage = `Failed to ${status === 'granted' ? 'enable' : 'disable'} telemetry`\n\n if (isHttpError(err) && err.statusCode === 403) {\n // Create a new error without stack trace from original error\n const message = err.response?.body?.message\n ? `${errorMessage}: ${err.response.body.message}`\n : errorMessage\n throw new Error(message)\n }\n\n if (isHttpError(err)) {\n // For other errors, preserve the original error but update the message\n err.message = err.response?.body?.message\n ? `${errorMessage}: ${err.response.body.message}`\n : errorMessage\n throw err\n }\n\n // For non-HTTP errors, wrap in a new error\n throw new Error(errorMessage)\n }\n}\n"],"names":["getGlobalCliClient","getUserConfig","isCi","isTrueish","resolveConsent","telemetryDebug","TELEMETRY_CONSENT_CONFIG_KEY","isHttpError","error","setConsent","status","currentConsent","changed","currentStatus","message","process","env","DO_NOT_TRACK","reason","client","apiVersion","requireUser","uri","request","method","userConfig","delete","successMessage","newConsent","err","errorMessage","statusCode","response","body","Error"],"mappings":"AAAA,SAAQA,kBAAkB,EAAEC,aAAa,EAAEC,IAAI,EAAEC,SAAS,QAAO,mBAAkB;AAGnF,SAAQC,cAAc,QAAO,sBAAqB;AAClD,SAAQC,cAAc,QAAO,sBAAqB;AAGlD,MAAMC,+BAA+B;AAIrC,oDAAoD;AACpD,SAASC,YAAYC,KAAc;IAKjC,OAAO,OAAOA,UAAU,YAAYA,UAAU,QAAQ,gBAAgBA,SAAS,aAAaA;AAC9F;AAYA,OAAO,eAAeC,WAAW,EAACC,MAAM,EAAoB;IAC1DL,eAAe,qCAAqCK;IAEpD,qCAAqC;IACrC,MAAMC,iBAAiB,MAAMP;IAE7B,qCAAqC;IACrC,IAAIF,QAAQ;QACV,OAAO;YACLU,SAAS;YACTC,eAAeF;YACfG,SAAS;QACX;IACF;IAEA,IAAIX,UAAUY,QAAQC,GAAG,CAACC,YAAY,KAAKP,WAAW,WAAW;QAC/D,OAAO;YACLE,SAAS;YACTC,eAAeF;YACfG,SACE;QACJ;IACF;IAEA,qCAAqC;IACrC,IAAIH,eAAeD,MAAM,KAAKA,QAAQ;QACpC,MAAMI,UACJJ,WAAW,YACP,gFACAC,eAAeO,MAAM,KAAK,kBACxB,gJACA;QAER,OAAO;YACLN,SAAS;YACTC,eAAeF;YACfG;QACF;IACF;IAEA,wCAAwC;IACxC,IAAIH,eAAeD,MAAM,KAAK,kBAAkBC,eAAeO,MAAM,KAAK,mBAAmB;QAC3F,OAAO;YACLN,SAAS;YACTC,eAAeF;YACfG,SAAS;QACX;IACF;IAEA,IAAI;QACF,MAAMK,SAAS,MAAMnB,mBAAmB;YACtCoB,YAAY;YACZC,aAAa;QACf;QAEA,MAAMC,MAAM,CAAC,oCAAoC,EAAEZ,QAAQ;QAC3DL,eAAe,0CAA0CiB;QAEzD,MAAMH,OAAOI,OAAO,CAAC;YACnBC,QAAQ;YACRF;QACF;QAEA,iCAAiC;QACjC,MAAMG,aAAaxB;QACnBwB,WAAWC,MAAM,CAACpB;QAElB,MAAMqB,iBACJjB,WAAW,YACP,4EACA;QAEN,MAAMkB,aAAa,MAAMxB;QAEzB,OAAO;YACLQ,SAAS;YACTC,eAAee;YACfd,SAASa;QACX;IACF,EAAE,OAAOE,KAAc;QACrB,MAAMC,eAAe,CAAC,UAAU,EAAEpB,WAAW,YAAY,WAAW,UAAU,UAAU,CAAC;QAEzF,IAAIH,YAAYsB,QAAQA,IAAIE,UAAU,KAAK,KAAK;YAC9C,6DAA6D;YAC7D,MAAMjB,UAAUe,IAAIG,QAAQ,EAAEC,MAAMnB,UAChC,GAAGgB,aAAa,EAAE,EAAED,IAAIG,QAAQ,CAACC,IAAI,CAACnB,OAAO,EAAE,GAC/CgB;YACJ,MAAM,IAAII,MAAMpB;QAClB;QAEA,IAAIP,YAAYsB,MAAM;YACpB,uEAAuE;YACvEA,IAAIf,OAAO,GAAGe,IAAIG,QAAQ,EAAEC,MAAMnB,UAC9B,GAAGgB,aAAa,EAAE,EAAED,IAAIG,QAAQ,CAACC,IAAI,CAACnB,OAAO,EAAE,GAC/CgB;YACJ,MAAMD;QACR;QAEA,2CAA2C;QAC3C,MAAM,IAAIK,MAAMJ;IAClB;AACF"}
|
|
@@ -12,6 +12,4 @@ export declare class CreateDatasetCommand extends SanityCommand<typeof CreateDat
|
|
|
12
12
|
visibility: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
13
|
};
|
|
14
14
|
run(): Promise<void>;
|
|
15
|
-
private determineAclMode;
|
|
16
|
-
private promptForDatasetVisibility;
|
|
17
15
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
2
|
import { SanityCommand, subdebug } from '@sanity/cli-core';
|
|
3
|
-
import {
|
|
3
|
+
import { createDataset } from '../../actions/dataset/create.js';
|
|
4
4
|
import { validateDatasetName } from '../../actions/dataset/validateDatasetName.js';
|
|
5
5
|
import { promptForDatasetName } from '../../prompts/promptForDatasetName.js';
|
|
6
|
-
import {
|
|
6
|
+
import { listDatasets } from '../../services/datasets.js';
|
|
7
7
|
import { getProjectFeatures } from '../../services/getProjectFeatures.js';
|
|
8
8
|
import { NO_PROJECT_ID } from '../../util/errorMessages.js';
|
|
9
9
|
const createDatasetDebug = subdebug('dataset:create');
|
|
@@ -86,59 +86,13 @@ export class CreateDatasetCommand extends SanityCommand {
|
|
|
86
86
|
}
|
|
87
87
|
const canCreatePrivate = projectFeatures.includes('privateDataset');
|
|
88
88
|
createDatasetDebug('%s create private datasets', canCreatePrivate ? 'Can' : 'Cannot');
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
});
|
|
96
|
-
this.log('Dataset created successfully');
|
|
97
|
-
} catch (error) {
|
|
98
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
99
|
-
createDatasetDebug(`Error creating dataset ${datasetName}`, error);
|
|
100
|
-
this.error(`Dataset creation failed: ${message}`, {
|
|
101
|
-
exit: 1
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
async determineAclMode(visibility, canCreatePrivate) {
|
|
106
|
-
if (visibility === 'custom' || visibility === 'public') {
|
|
107
|
-
return visibility;
|
|
108
|
-
}
|
|
109
|
-
// Handle private visibility request
|
|
110
|
-
if (visibility === 'private') {
|
|
111
|
-
if (canCreatePrivate) {
|
|
112
|
-
return 'private';
|
|
113
|
-
}
|
|
114
|
-
// Private requested but not available
|
|
115
|
-
this.warn('Private datasets are not available for this project. Creating as public.');
|
|
116
|
-
return 'public';
|
|
117
|
-
}
|
|
118
|
-
if (canCreatePrivate) {
|
|
119
|
-
return this.promptForDatasetVisibility();
|
|
120
|
-
}
|
|
121
|
-
// Default to public when no flag and no private capability
|
|
122
|
-
return 'public';
|
|
123
|
-
}
|
|
124
|
-
async promptForDatasetVisibility() {
|
|
125
|
-
const mode = await select({
|
|
126
|
-
choices: [
|
|
127
|
-
{
|
|
128
|
-
name: 'Public (world readable)',
|
|
129
|
-
value: 'public'
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
name: 'Private (Authenticated user or token needed)',
|
|
133
|
-
value: 'private'
|
|
134
|
-
}
|
|
135
|
-
],
|
|
136
|
-
message: 'Dataset visibility'
|
|
89
|
+
await createDataset({
|
|
90
|
+
datasetName,
|
|
91
|
+
output: this.output,
|
|
92
|
+
projectFeatures,
|
|
93
|
+
projectId,
|
|
94
|
+
visibility
|
|
137
95
|
});
|
|
138
|
-
if (mode === 'private') {
|
|
139
|
-
this.warn('Please note that while documents are private, assets (files and images) are still public');
|
|
140
|
-
}
|
|
141
|
-
return mode;
|
|
142
96
|
}
|
|
143
97
|
}
|
|
144
98
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/commands/dataset/create.ts"],"sourcesContent":["import {Args, Flags} from '@oclif/core'\nimport {SanityCommand, subdebug} from '@sanity/cli-core'\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/commands/dataset/create.ts"],"sourcesContent":["import {Args, Flags} from '@oclif/core'\nimport {SanityCommand, subdebug} from '@sanity/cli-core'\n\nimport {createDataset} from '../../actions/dataset/create.js'\nimport {validateDatasetName} from '../../actions/dataset/validateDatasetName.js'\nimport {promptForDatasetName} from '../../prompts/promptForDatasetName.js'\nimport {listDatasets} from '../../services/datasets.js'\nimport {getProjectFeatures} from '../../services/getProjectFeatures.js'\nimport {NO_PROJECT_ID} from '../../util/errorMessages.js'\n\nconst createDatasetDebug = subdebug('dataset:create')\n\nconst ALLOWED_ACL_MODES = ['custom', 'private', 'public']\n\nexport class CreateDatasetCommand extends SanityCommand<typeof CreateDatasetCommand> {\n static override args = {\n name: Args.string({\n description: 'Name of the dataset to create',\n required: false,\n }),\n }\n\n static override description = 'Create a new dataset within your project'\n\n static override examples = [\n {\n command: '<%= config.bin %> <%= command.id %>',\n description: 'Interactively create a dataset',\n },\n {\n command: '<%= config.bin %> <%= command.id %> my-dataset',\n description: 'Create a dataset named \"my-dataset\"',\n },\n {\n command: '<%= config.bin %> <%= command.id %> my-dataset --visibility private',\n description: 'Create a private dataset named \"my-dataset\"',\n },\n ]\n\n static override flags = {\n visibility: Flags.string({\n description: 'Set visibility for this dataset (custom/private/public)',\n options: ALLOWED_ACL_MODES,\n required: false,\n }),\n }\n\n public async run(): Promise<void> {\n const {args, flags} = await this.parse(CreateDatasetCommand)\n const {visibility} = flags\n\n // Ensure we have project context\n const projectId = await this.getProjectId()\n if (!projectId) {\n this.error(NO_PROJECT_ID, {exit: 1})\n }\n\n // Get dataset name from args or prompt\n let {name: datasetName} = args\n if (datasetName) {\n const nameError = validateDatasetName(datasetName)\n if (nameError) {\n this.error(nameError, {exit: 1})\n }\n } else {\n datasetName = await promptForDatasetName()\n }\n\n let datasets: string[]\n let projectFeatures: string[]\n\n try {\n const [datasetsResponse, featuresResponse] = await Promise.all([\n listDatasets(projectId),\n getProjectFeatures(projectId),\n ])\n datasets = datasetsResponse.map((ds) => ds.name)\n projectFeatures = featuresResponse\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n createDatasetDebug(`Failed to fetch project data: ${message}`, error)\n this.error(`Failed to fetch project data: ${message}`, {exit: 1})\n }\n\n if (datasets.includes(datasetName)) {\n this.error(`Dataset \"${datasetName}\" already exists`, {exit: 1})\n }\n\n const canCreatePrivate = projectFeatures.includes('privateDataset')\n createDatasetDebug('%s create private datasets', canCreatePrivate ? 'Can' : 'Cannot')\n\n await createDataset({\n datasetName,\n output: this.output,\n projectFeatures,\n projectId,\n visibility,\n })\n }\n}\n"],"names":["Args","Flags","SanityCommand","subdebug","createDataset","validateDatasetName","promptForDatasetName","listDatasets","getProjectFeatures","NO_PROJECT_ID","createDatasetDebug","ALLOWED_ACL_MODES","CreateDatasetCommand","args","name","string","description","required","examples","command","flags","visibility","options","run","parse","projectId","getProjectId","error","exit","datasetName","nameError","datasets","projectFeatures","datasetsResponse","featuresResponse","Promise","all","map","ds","message","Error","String","includes","canCreatePrivate","output"],"mappings":"AAAA,SAAQA,IAAI,EAAEC,KAAK,QAAO,cAAa;AACvC,SAAQC,aAAa,EAAEC,QAAQ,QAAO,mBAAkB;AAExD,SAAQC,aAAa,QAAO,kCAAiC;AAC7D,SAAQC,mBAAmB,QAAO,+CAA8C;AAChF,SAAQC,oBAAoB,QAAO,wCAAuC;AAC1E,SAAQC,YAAY,QAAO,6BAA4B;AACvD,SAAQC,kBAAkB,QAAO,uCAAsC;AACvE,SAAQC,aAAa,QAAO,8BAA6B;AAEzD,MAAMC,qBAAqBP,SAAS;AAEpC,MAAMQ,oBAAoB;IAAC;IAAU;IAAW;CAAS;AAEzD,OAAO,MAAMC,6BAA6BV;IACxC,OAAgBW,OAAO;QACrBC,MAAMd,KAAKe,MAAM,CAAC;YAChBC,aAAa;YACbC,UAAU;QACZ;IACF,EAAC;IAED,OAAgBD,cAAc,2CAA0C;IAExE,OAAgBE,WAAW;QACzB;YACEC,SAAS;YACTH,aAAa;QACf;QACA;YACEG,SAAS;YACTH,aAAa;QACf;QACA;YACEG,SAAS;YACTH,aAAa;QACf;KACD,CAAA;IAED,OAAgBI,QAAQ;QACtBC,YAAYpB,MAAMc,MAAM,CAAC;YACvBC,aAAa;YACbM,SAASX;YACTM,UAAU;QACZ;IACF,EAAC;IAED,MAAaM,MAAqB;QAChC,MAAM,EAACV,IAAI,EAAEO,KAAK,EAAC,GAAG,MAAM,IAAI,CAACI,KAAK,CAACZ;QACvC,MAAM,EAACS,UAAU,EAAC,GAAGD;QAErB,iCAAiC;QACjC,MAAMK,YAAY,MAAM,IAAI,CAACC,YAAY;QACzC,IAAI,CAACD,WAAW;YACd,IAAI,CAACE,KAAK,CAAClB,eAAe;gBAACmB,MAAM;YAAC;QACpC;QAEA,uCAAuC;QACvC,IAAI,EAACd,MAAMe,WAAW,EAAC,GAAGhB;QAC1B,IAAIgB,aAAa;YACf,MAAMC,YAAYzB,oBAAoBwB;YACtC,IAAIC,WAAW;gBACb,IAAI,CAACH,KAAK,CAACG,WAAW;oBAACF,MAAM;gBAAC;YAChC;QACF,OAAO;YACLC,cAAc,MAAMvB;QACtB;QAEA,IAAIyB;QACJ,IAAIC;QAEJ,IAAI;YACF,MAAM,CAACC,kBAAkBC,iBAAiB,GAAG,MAAMC,QAAQC,GAAG,CAAC;gBAC7D7B,aAAakB;gBACbjB,mBAAmBiB;aACpB;YACDM,WAAWE,iBAAiBI,GAAG,CAAC,CAACC,KAAOA,GAAGxB,IAAI;YAC/CkB,kBAAkBE;QACpB,EAAE,OAAOP,OAAO;YACd,MAAMY,UAAUZ,iBAAiBa,QAAQb,MAAMY,OAAO,GAAGE,OAAOd;YAChEjB,mBAAmB,CAAC,8BAA8B,EAAE6B,SAAS,EAAEZ;YAC/D,IAAI,CAACA,KAAK,CAAC,CAAC,8BAA8B,EAAEY,SAAS,EAAE;gBAACX,MAAM;YAAC;QACjE;QAEA,IAAIG,SAASW,QAAQ,CAACb,cAAc;YAClC,IAAI,CAACF,KAAK,CAAC,CAAC,SAAS,EAAEE,YAAY,gBAAgB,CAAC,EAAE;gBAACD,MAAM;YAAC;QAChE;QAEA,MAAMe,mBAAmBX,gBAAgBU,QAAQ,CAAC;QAClDhC,mBAAmB,8BAA8BiC,mBAAmB,QAAQ;QAE5E,MAAMvC,cAAc;YAClByB;YACAe,QAAQ,IAAI,CAACA,MAAM;YACnBZ;YACAP;YACAJ;QACF;IACF;AACF"}
|
package/dist/commands/debug.js
CHANGED
|
@@ -6,7 +6,6 @@ import { omit, padStart } from 'lodash-es';
|
|
|
6
6
|
import { gatherDebugInfo } from '../actions/debug/gatherDebugInfo.js';
|
|
7
7
|
import { getGlobalConfigLocation } from '../actions/debug/getGlobalConfigLocation.js';
|
|
8
8
|
import { getDisplayName, getFormatters } from '../actions/versions/getFormatters.js';
|
|
9
|
-
const DEBUG_API_VERSION = '2025-08-06';
|
|
10
9
|
export class Debug extends SanityCommand {
|
|
11
10
|
static description = 'Provides diagnostic info for Sanity Studio troubleshooting';
|
|
12
11
|
static examples = [
|
|
@@ -24,13 +23,8 @@ export class Debug extends SanityCommand {
|
|
|
24
23
|
try {
|
|
25
24
|
const projectRoot = await this.getProjectRoot();
|
|
26
25
|
const cliConfig = await this.getCliConfig();
|
|
27
|
-
const client = await this.getGlobalApiClient({
|
|
28
|
-
apiVersion: DEBUG_API_VERSION,
|
|
29
|
-
requireUser: true
|
|
30
|
-
});
|
|
31
26
|
const { auth, globalConfig, project, projectConfig, user, versions } = await gatherDebugInfo({
|
|
32
27
|
cliConfig,
|
|
33
|
-
client,
|
|
34
28
|
includeSecrets: flags.secrets,
|
|
35
29
|
projectRoot
|
|
36
30
|
});
|
|
@@ -39,9 +33,10 @@ export class Debug extends SanityCommand {
|
|
|
39
33
|
this.log(` ${chalk.red(user.message)}\n`);
|
|
40
34
|
} else if (user) {
|
|
41
35
|
printKeyValue({
|
|
42
|
-
Email: user.email,
|
|
43
36
|
ID: user.id,
|
|
44
37
|
Name: user.name,
|
|
38
|
+
// eslint-disable-next-line perfectionist/sort-objects
|
|
39
|
+
Email: user.email,
|
|
45
40
|
Roles: project && 'userRoles' in project ? project.userRoles : undefined
|
|
46
41
|
});
|
|
47
42
|
}
|
|
@@ -49,8 +44,9 @@ export class Debug extends SanityCommand {
|
|
|
49
44
|
if (project && 'id' in project) {
|
|
50
45
|
this.log('Project:');
|
|
51
46
|
printKeyValue({
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
ID: project.id,
|
|
48
|
+
// eslint-disable-next-line perfectionist/sort-objects
|
|
49
|
+
'Display name': project.displayName
|
|
54
50
|
});
|
|
55
51
|
}
|
|
56
52
|
// Auth info
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/debug.ts"],"sourcesContent":["import path from 'node:path'\n\nimport {Flags} from '@oclif/core'\nimport {formatObject, printKeyValue, SanityCommand} from '@sanity/cli-core'\nimport {chalk} from '@sanity/cli-core/ux'\nimport {omit, padStart} from 'lodash-es'\n\nimport {gatherDebugInfo} from '../actions/debug/gatherDebugInfo.js'\nimport {getGlobalConfigLocation} from '../actions/debug/getGlobalConfigLocation.js'\nimport {getDisplayName, getFormatters} from '../actions/versions/getFormatters.js'\n\
|
|
1
|
+
{"version":3,"sources":["../../src/commands/debug.ts"],"sourcesContent":["import path from 'node:path'\n\nimport {Flags} from '@oclif/core'\nimport {formatObject, printKeyValue, SanityCommand} from '@sanity/cli-core'\nimport {chalk} from '@sanity/cli-core/ux'\nimport {omit, padStart} from 'lodash-es'\n\nimport {gatherDebugInfo} from '../actions/debug/gatherDebugInfo.js'\nimport {getGlobalConfigLocation} from '../actions/debug/getGlobalConfigLocation.js'\nimport {getDisplayName, getFormatters} from '../actions/versions/getFormatters.js'\n\nexport class Debug extends SanityCommand<typeof Debug> {\n static override description = 'Provides diagnostic info for Sanity Studio troubleshooting'\n\n static override examples = [\n '<%= config.bin %> <%= command.id %>',\n '<%= config.bin %> <%= command.id %> --secrets',\n ]\n\n static override flags = {\n secrets: Flags.boolean({\n default: false,\n description: 'Include API keys in output',\n }),\n }\n\n public async run(): Promise<void> {\n const {flags} = this\n\n try {\n const projectRoot = await this.getProjectRoot()\n const cliConfig = await this.getCliConfig()\n\n const {auth, globalConfig, project, projectConfig, user, versions} = await gatherDebugInfo({\n cliConfig,\n includeSecrets: flags.secrets,\n projectRoot,\n })\n\n this.output.log('\\nUser:')\n if (user instanceof Error) {\n this.log(` ${chalk.red(user.message)}\\n`)\n } else if (user) {\n printKeyValue({\n ID: user.id,\n Name: user.name,\n // eslint-disable-next-line perfectionist/sort-objects\n Email: user.email,\n Roles: project && 'userRoles' in project ? project.userRoles : undefined,\n })\n }\n\n // Project info (API-based)\n if (project && 'id' in project) {\n this.log('Project:')\n printKeyValue({\n ID: project.id,\n // eslint-disable-next-line perfectionist/sort-objects\n 'Display name': project.displayName,\n })\n }\n\n // Auth info\n if (auth.hasToken) {\n this.log('Authentication:')\n printKeyValue({\n 'Auth token': flags.secrets ? auth.authToken : `<redacted>`,\n 'User type': globalConfig.authType || 'normal',\n })\n\n if (!flags.secrets) {\n this.log(' (run with --secrets to reveal token)\\n')\n }\n }\n\n // Global configuration (user home dir config file)\n this.log(`Global config (${chalk.yellow(getGlobalConfigLocation())}):`)\n const globalCfg = omit(globalConfig, ['authType', 'authToken'])\n this.log(` ${formatObject(globalCfg).replaceAll('\\n', '\\n ')}\\n`)\n\n // Project configuration (projectDir/sanity.json)\n if (projectConfig) {\n const configLocation = projectConfig\n ? ` (${chalk.yellow(path.relative(process.cwd(), projectRoot.path))})`\n : ''\n\n this.log(`Project config${configLocation}:`)\n this.log(` ${formatObject(projectConfig).replaceAll('\\n', '\\n ')}`)\n }\n\n // Print installed package versions\n if (versions) {\n this.log('\\nPackage versions:')\n\n const {formatName, versionLength} = getFormatters(versions)\n for (const mod of versions) {\n const version = padStart(mod.installed || '<missing>', versionLength)\n const latest =\n mod.installed === mod.latest\n ? chalk.green('(up to date)')\n : `(latest: ${chalk.yellow(mod.latest)})`\n\n this.log(`${formatName(getDisplayName(mod))} ${version} ${latest}`)\n }\n\n this.log('')\n }\n } catch (error) {\n this.error(\n `Failed to gather debug information: ${error instanceof Error ? error.message : 'Unknown error'}`,\n )\n }\n }\n}\n"],"names":["path","Flags","formatObject","printKeyValue","SanityCommand","chalk","omit","padStart","gatherDebugInfo","getGlobalConfigLocation","getDisplayName","getFormatters","Debug","description","examples","flags","secrets","boolean","default","run","projectRoot","getProjectRoot","cliConfig","getCliConfig","auth","globalConfig","project","projectConfig","user","versions","includeSecrets","output","log","Error","red","message","ID","id","Name","name","Email","email","Roles","userRoles","undefined","displayName","hasToken","authToken","authType","yellow","globalCfg","replaceAll","configLocation","relative","process","cwd","formatName","versionLength","mod","version","installed","latest","green","error"],"mappings":"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"}
|
package/dist/commands/init.d.ts
CHANGED
|
@@ -40,9 +40,14 @@ export declare class InitCommand extends SanityCommand<typeof InitCommand> {
|
|
|
40
40
|
};
|
|
41
41
|
run(): Promise<void>;
|
|
42
42
|
private checkFlagsInUnattendedMode;
|
|
43
|
-
private
|
|
43
|
+
private createProjectFromName;
|
|
44
44
|
private ensureAuthenticated;
|
|
45
|
+
private getOrCreateDataset;
|
|
46
|
+
private getOrCreateProject;
|
|
45
47
|
private getPlan;
|
|
48
|
+
private getProjectDetails;
|
|
49
|
+
private promptForDefaultConfig;
|
|
50
|
+
private promptForProjectCreation;
|
|
46
51
|
private promptUserForNewOrganization;
|
|
47
52
|
private promptUserForOrganization;
|
|
48
53
|
private verifyCoupon;
|