@sanity/cli 6.0.0-alpha.4 → 6.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/dev/startStudioDevServer.js +3 -8
- package/dist/actions/dev/startStudioDevServer.js.map +1 -1
- package/dist/actions/dev/types.d.ts +1 -3
- package/dist/actions/dev/types.js.map +1 -1
- package/dist/actions/documents/validate.d.ts +0 -2
- package/dist/actions/documents/validate.js +21 -1
- package/dist/actions/documents/validate.js.map +1 -1
- package/dist/actions/exec/execScript.js +1 -1
- package/dist/actions/exec/execScript.js.map +1 -1
- package/dist/actions/graphql/getGraphQLAPIs.js +1 -1
- package/dist/actions/graphql/getGraphQLAPIs.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 +2 -5
- 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/deleteSchemaAction.d.ts +13 -5
- package/dist/actions/schema/deleteSchemaAction.js +12 -17
- package/dist/actions/schema/deleteSchemaAction.js.map +1 -1
- package/dist/actions/schema/deploySchemas.d.ts +15 -0
- package/dist/actions/schema/deploySchemas.js +98 -0
- package/dist/actions/schema/deploySchemas.js.map +1 -0
- package/dist/actions/schema/listSchemas.d.ts +12 -0
- package/dist/actions/schema/listSchemas.js +119 -0
- package/dist/actions/schema/listSchemas.js.map +1 -0
- package/dist/actions/schema/schemaStoreTypes.d.ts +0 -11
- package/dist/actions/schema/schemaStoreTypes.js.map +1 -1
- package/dist/actions/schema/utils/debug.d.ts +2 -0
- package/dist/actions/schema/utils/debug.js +5 -0
- package/dist/actions/schema/utils/debug.js.map +1 -0
- package/dist/actions/schema/utils/manifestExtractor.d.ts +3 -8
- package/dist/actions/schema/utils/manifestExtractor.js +12 -17
- package/dist/actions/schema/utils/manifestExtractor.js.map +1 -1
- package/dist/actions/schema/utils/manifestReader.d.ts +2 -9
- package/dist/actions/schema/utils/manifestReader.js +6 -12
- package/dist/actions/schema/utils/manifestReader.js.map +1 -1
- package/dist/actions/schema/utils/schemaStoreOutStrings.d.ts +0 -1
- package/dist/actions/schema/utils/schemaStoreOutStrings.js +1 -1
- package/dist/actions/schema/utils/schemaStoreOutStrings.js.map +1 -1
- package/dist/actions/schema/utils/schemaStoreValidation.d.ts +10 -62
- package/dist/actions/schema/utils/schemaStoreValidation.js +38 -125
- package/dist/actions/schema/utils/schemaStoreValidation.js.map +1 -1
- package/dist/actions/schema/utils/uniqByProjectIdDataset.d.ts +14 -0
- package/dist/actions/schema/utils/uniqByProjectIdDataset.js +9 -0
- package/dist/actions/schema/utils/uniqByProjectIdDataset.js.map +1 -0
- package/dist/actions/users/getMembersForProject.d.ts +1 -3
- package/dist/actions/users/getMembersForProject.js +6 -17
- package/dist/actions/users/getMembersForProject.js.map +1 -1
- package/dist/actions/users/types.d.ts +0 -11
- package/dist/actions/users/types.js.map +1 -1
- package/dist/commands/backup/disable.js +5 -11
- package/dist/commands/backup/disable.js.map +1 -1
- package/dist/commands/backup/enable.js +5 -11
- package/dist/commands/backup/enable.js.map +1 -1
- package/dist/commands/backup/list.js +7 -8
- package/dist/commands/backup/list.js.map +1 -1
- package/dist/commands/cors/add.js +5 -13
- package/dist/commands/cors/add.js.map +1 -1
- package/dist/commands/cors/delete.js +7 -15
- package/dist/commands/cors/delete.js.map +1 -1
- package/dist/commands/cors/list.js +2 -10
- package/dist/commands/cors/list.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/dataset/export.js +4 -4
- package/dist/commands/dataset/export.js.map +1 -1
- package/dist/commands/debug.js +5 -9
- package/dist/commands/debug.js.map +1 -1
- package/dist/commands/dev.js +0 -1
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/documents/create.d.ts +1 -0
- package/dist/commands/documents/create.js +10 -9
- package/dist/commands/documents/create.js.map +1 -1
- package/dist/commands/documents/delete.js +2 -3
- package/dist/commands/documents/delete.js.map +1 -1
- package/dist/commands/documents/get.js +2 -3
- package/dist/commands/documents/get.js.map +1 -1
- package/dist/commands/documents/query.js +2 -3
- package/dist/commands/documents/query.js.map +1 -1
- package/dist/commands/documents/validate.js +0 -20
- package/dist/commands/documents/validate.js.map +1 -1
- package/dist/commands/graphql/list.js +2 -2
- package/dist/commands/graphql/list.js.map +1 -1
- package/dist/commands/graphql/undeploy.js +4 -9
- package/dist/commands/graphql/undeploy.js.map +1 -1
- package/dist/commands/hook/create.js +2 -6
- package/dist/commands/hook/create.js.map +1 -1
- package/dist/commands/hook/delete.js +5 -17
- package/dist/commands/hook/delete.js.map +1 -1
- package/dist/commands/hook/list.js +2 -8
- package/dist/commands/hook/list.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/media/export.js +2 -2
- package/dist/commands/media/export.js.map +1 -1
- package/dist/commands/media/import.js +2 -2
- package/dist/commands/media/import.js.map +1 -1
- package/dist/commands/projects/list.js +2 -6
- package/dist/commands/projects/list.js.map +1 -1
- package/dist/commands/schema/delete.d.ts +1 -1
- package/dist/commands/schema/delete.js +20 -23
- package/dist/commands/schema/delete.js.map +1 -1
- package/dist/commands/schema/deploy.d.ts +16 -0
- package/dist/commands/schema/deploy.js +98 -0
- package/dist/commands/schema/deploy.js.map +1 -0
- package/dist/commands/schema/list.d.ts +15 -0
- package/dist/commands/schema/list.js +104 -0
- package/dist/commands/schema/list.js.map +1 -0
- package/dist/commands/tokens/add.js +3 -5
- package/dist/commands/tokens/add.js.map +1 -1
- package/dist/commands/users/invite.js +6 -17
- package/dist/commands/users/invite.js.map +1 -1
- package/dist/commands/users/list.js +4 -7
- package/dist/commands/users/list.js.map +1 -1
- package/dist/config/createCliConfig.d.ts +13 -4
- 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/backup.d.ts +8 -0
- package/dist/services/backup.js +19 -0
- package/dist/services/backup.js.map +1 -1
- package/dist/services/cors.d.ts +23 -0
- package/dist/services/cors.js +38 -0
- package/dist/services/cors.js.map +1 -0
- package/dist/services/graphql.d.ts +7 -0
- package/dist/services/graphql.js +11 -0
- package/dist/services/graphql.js.map +1 -1
- package/dist/services/hooks.d.ts +2 -0
- package/dist/services/hooks.js +19 -0
- package/dist/services/hooks.js.map +1 -1
- package/dist/services/organizations.d.ts +4 -2
- package/dist/services/organizations.js +3 -2
- package/dist/services/organizations.js.map +1 -1
- package/dist/services/projects.d.ts +11 -0
- package/dist/services/projects.js +41 -0
- package/dist/services/projects.js.map +1 -1
- package/dist/services/schemas.d.ts +4 -0
- package/dist/services/schemas.js +40 -0
- package/dist/services/schemas.js.map +1 -0
- package/dist/services/user.d.ts +13 -0
- package/dist/services/user.js +27 -3
- 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/util/errorMessages.d.ts +1 -0
- package/dist/util/errorMessages.js +1 -0
- package/dist/util/errorMessages.js.map +1 -1
- package/dist/util/getCliVersion.js +1 -1
- package/dist/util/getCliVersion.js.map +1 -1
- package/dist/util/readPackageJson.d.ts +1 -15
- package/dist/util/readPackageJson.js +1 -1
- package/dist/util/readPackageJson.js.map +1 -1
- package/dist/util/uniqBy.d.ts +1 -0
- package/dist/util/uniqBy.js +14 -0
- package/dist/util/uniqBy.js.map +1 -0
- package/oclif.manifest.json +284 -139
- package/package.json +36 -33
- 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/cors/constants.d.ts +0 -1
- package/dist/actions/cors/constants.js +0 -3
- package/dist/actions/cors/constants.js.map +0 -1
- package/dist/actions/cors/types.d.ts +0 -9
- package/dist/actions/cors/types.js +0 -3
- package/dist/actions/cors/types.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__/deleteSchemaAction.test.js +0 -294
- package/dist/actions/schema/__tests__/deleteSchemaAction.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/schema/schemaStoreConstants.d.ts +0 -1
- package/dist/actions/schema/schemaStoreConstants.js +0 -4
- package/dist/actions/schema/schemaStoreConstants.js.map +0 -1
- package/dist/actions/schema/utils/schemaActionHelpers.d.ts +0 -1
- package/dist/actions/schema/utils/schemaActionHelpers.js +0 -5
- package/dist/actions/schema/utils/schemaActionHelpers.js.map +0 -1
- package/dist/actions/schema/utils/schemaApiClient.d.ts +0 -6
- package/dist/actions/schema/utils/schemaApiClient.js +0 -17
- package/dist/actions/schema/utils/schemaApiClient.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/actions/users/apiVersion.d.ts +0 -6
- package/dist/actions/users/apiVersion.js +0 -7
- package/dist/actions/users/apiVersion.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 -697
- package/dist/commands/__tests__/debug.test.js.map +0 -1
- package/dist/commands/__tests__/deploy.test.js +0 -1913
- package/dist/commands/__tests__/deploy.test.js.map +0 -1
- package/dist/commands/__tests__/dev.test.js +0 -410
- 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 -60
- package/dist/commands/__tests__/init/init.authentication.test.js.map +0 -1
- package/dist/commands/__tests__/init/init.create-new-project.test.js +0 -196
- package/dist/commands/__tests__/init/init.create-new-project.test.js.map +0 -1
- package/dist/commands/__tests__/init/init.plan.test.js +0 -220
- package/dist/commands/__tests__/init/init.plan.test.js.map +0 -1
- package/dist/commands/__tests__/init/init.setup.test.js +0 -279
- package/dist/commands/__tests__/init/init.setup.test.js.map +0 -1
- package/dist/commands/__tests__/install.test.js +0 -258
- 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 -88
- package/dist/commands/__tests__/logout.test.js.map +0 -1
- package/dist/commands/__tests__/manage.test.js +0 -105
- 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 -134
- package/dist/commands/__tests__/versions.test.js.map +0 -1
- package/dist/commands/backup/__tests__/disable.test.js +0 -207
- package/dist/commands/backup/__tests__/disable.test.js.map +0 -1
- package/dist/commands/backup/__tests__/download.test.js +0 -679
- package/dist/commands/backup/__tests__/download.test.js.map +0 -1
- package/dist/commands/backup/__tests__/enable.test.js +0 -317
- package/dist/commands/backup/__tests__/enable.test.js.map +0 -1
- package/dist/commands/backup/__tests__/list.test.js +0 -321
- package/dist/commands/backup/__tests__/list.test.js.map +0 -1
- package/dist/commands/cors/__tests__/add.test.js +0 -346
- package/dist/commands/cors/__tests__/add.test.js.map +0 -1
- package/dist/commands/cors/__tests__/delete.test.js +0 -293
- package/dist/commands/cors/__tests__/delete.test.js.map +0 -1
- package/dist/commands/cors/__tests__/list.test.js +0 -218
- package/dist/commands/cors/__tests__/list.test.js.map +0 -1
- package/dist/commands/dataset/__tests__/copy.test.js +0 -520
- package/dist/commands/dataset/__tests__/copy.test.js.map +0 -1
- package/dist/commands/dataset/__tests__/create.test.js +0 -312
- package/dist/commands/dataset/__tests__/create.test.js.map +0 -1
- package/dist/commands/dataset/__tests__/delete.test.js +0 -224
- package/dist/commands/dataset/__tests__/delete.test.js.map +0 -1
- package/dist/commands/dataset/__tests__/export.test.js +0 -561
- 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 -174
- package/dist/commands/dataset/__tests__/list.test.js.map +0 -1
- package/dist/commands/dataset/alias/__tests__/create.test.js +0 -299
- package/dist/commands/dataset/alias/__tests__/create.test.js.map +0 -1
- package/dist/commands/dataset/alias/__tests__/delete.test.js +0 -236
- package/dist/commands/dataset/alias/__tests__/delete.test.js.map +0 -1
- package/dist/commands/dataset/alias/__tests__/link.test.js +0 -336
- package/dist/commands/dataset/alias/__tests__/link.test.js.map +0 -1
- package/dist/commands/dataset/alias/__tests__/unlink.test.js +0 -298
- package/dist/commands/dataset/alias/__tests__/unlink.test.js.map +0 -1
- package/dist/commands/dataset/visibility/__tests__/get.test.js +0 -147
- package/dist/commands/dataset/visibility/__tests__/get.test.js.map +0 -1
- package/dist/commands/dataset/visibility/__tests__/set.test.js +0 -245
- 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 -254
- package/dist/commands/docs/__tests__/search.test.js.map +0 -1
- package/dist/commands/documents/__tests__/create.test.js +0 -967
- package/dist/commands/documents/__tests__/create.test.js.map +0 -1
- package/dist/commands/documents/__tests__/delete.test.js +0 -268
- package/dist/commands/documents/__tests__/delete.test.js.map +0 -1
- package/dist/commands/documents/__tests__/get.test.js +0 -209
- package/dist/commands/documents/__tests__/get.test.js.map +0 -1
- package/dist/commands/documents/__tests__/query.test.js +0 -405
- package/dist/commands/documents/__tests__/query.test.js.map +0 -1
- package/dist/commands/documents/__tests__/validate.test.js +0 -226
- package/dist/commands/documents/__tests__/validate.test.js.map +0 -1
- package/dist/commands/graphql/__tests__/list.test.js +0 -228
- package/dist/commands/graphql/__tests__/list.test.js.map +0 -1
- package/dist/commands/graphql/__tests__/undeploy.test.js +0 -384
- package/dist/commands/graphql/__tests__/undeploy.test.js.map +0 -1
- package/dist/commands/hook/__tests__/attempt.test.js +0 -260
- package/dist/commands/hook/__tests__/attempt.test.js.map +0 -1
- package/dist/commands/hook/__tests__/create.test.js +0 -121
- package/dist/commands/hook/__tests__/create.test.js.map +0 -1
- package/dist/commands/hook/__tests__/delete.test.js +0 -220
- package/dist/commands/hook/__tests__/delete.test.js.map +0 -1
- package/dist/commands/hook/__tests__/list.test.js +0 -138
- package/dist/commands/hook/__tests__/list.test.js.map +0 -1
- package/dist/commands/hook/__tests__/logs.test.js +0 -770
- package/dist/commands/hook/__tests__/logs.test.js.map +0 -1
- package/dist/commands/manifest/__tests__/extract.test.js +0 -123
- 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 -160
- package/dist/commands/media/__tests__/create-aspect.test.js.map +0 -1
- package/dist/commands/media/__tests__/delete-aspect.test.js +0 -333
- package/dist/commands/media/__tests__/delete-aspect.test.js.map +0 -1
- package/dist/commands/media/__tests__/deploy-aspect.test.js +0 -632
- package/dist/commands/media/__tests__/deploy-aspect.test.js.map +0 -1
- package/dist/commands/media/__tests__/export.test.js +0 -398
- package/dist/commands/media/__tests__/export.test.js.map +0 -1
- package/dist/commands/media/__tests__/import.test.js +0 -281
- 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 -153
- package/dist/commands/projects/__tests__/list.test.js.map +0 -1
- package/dist/commands/schema/__tests__/delete.test.js +0 -209
- package/dist/commands/schema/__tests__/delete.test.js.map +0 -1
- package/dist/commands/schema/__tests__/extract.test.js +0 -113
- package/dist/commands/schema/__tests__/extract.test.js.map +0 -1
- package/dist/commands/schema/__tests__/validate.test.js +0 -104
- package/dist/commands/schema/__tests__/validate.test.js.map +0 -1
- package/dist/commands/telemetry/__tests__/disable.test.js +0 -145
- package/dist/commands/telemetry/__tests__/disable.test.js.map +0 -1
- package/dist/commands/telemetry/__tests__/enable.test.js +0 -131
- package/dist/commands/telemetry/__tests__/enable.test.js.map +0 -1
- package/dist/commands/telemetry/__tests__/status.test.js +0 -153
- package/dist/commands/telemetry/__tests__/status.test.js.map +0 -1
- package/dist/commands/tokens/__tests__/add.test.js +0 -420
- package/dist/commands/tokens/__tests__/add.test.js.map +0 -1
- package/dist/commands/tokens/__tests__/delete.test.js +0 -375
- package/dist/commands/tokens/__tests__/delete.test.js.map +0 -1
- package/dist/commands/tokens/__tests__/list.test.js +0 -368
- package/dist/commands/tokens/__tests__/list.test.js.map +0 -1
- package/dist/commands/users/__tests__/invite.test.js +0 -341
- package/dist/commands/users/__tests__/invite.test.js.map +0 -1
- package/dist/commands/users/__tests__/list.test.js +0 -401
- 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,226 +0,0 @@
|
|
|
1
|
-
import { runCommand } from '@oclif/test';
|
|
2
|
-
import { testCommand } from '@sanity/cli-test';
|
|
3
|
-
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
|
|
4
|
-
import { ValidateDocumentsCommand } from '../validate.js';
|
|
5
|
-
const mocks = vi.hoisted(()=>({
|
|
6
|
-
confirm: vi.fn(),
|
|
7
|
-
isFile: vi.fn(),
|
|
8
|
-
validate: vi.fn()
|
|
9
|
-
}));
|
|
10
|
-
vi.mock('node:fs', ()=>({
|
|
11
|
-
default: {
|
|
12
|
-
promises: {
|
|
13
|
-
stat: vi.fn().mockResolvedValue({
|
|
14
|
-
isFile: mocks.isFile
|
|
15
|
-
})
|
|
16
|
-
},
|
|
17
|
-
resolve: vi.fn((dir, file)=>`/resolved/${file}`)
|
|
18
|
-
}
|
|
19
|
-
}));
|
|
20
|
-
vi.mock('@sanity/cli-core/ux', async ()=>{
|
|
21
|
-
const actual = await vi.importActual('@sanity/cli-core/ux');
|
|
22
|
-
return {
|
|
23
|
-
...actual,
|
|
24
|
-
confirm: mocks.confirm
|
|
25
|
-
};
|
|
26
|
-
});
|
|
27
|
-
vi.mock('../../../../../cli-core/src/config/findProjectRoot.js', ()=>({
|
|
28
|
-
findProjectRoot: vi.fn().mockResolvedValue({
|
|
29
|
-
directory: '/test/path',
|
|
30
|
-
root: '/test/path',
|
|
31
|
-
type: 'studio'
|
|
32
|
-
})
|
|
33
|
-
}));
|
|
34
|
-
vi.mock('../../../../../cli-core/src/config/cli/getCliConfig.js', ()=>({
|
|
35
|
-
getCliConfig: vi.fn()
|
|
36
|
-
}));
|
|
37
|
-
vi.mock('../../../../../cli-core/src/services/apiClient.js', ()=>({
|
|
38
|
-
getGlobalCliClient: vi.fn().mockResolvedValue({
|
|
39
|
-
config: vi.fn(()=>({
|
|
40
|
-
dataset: 'test-dataset',
|
|
41
|
-
projectId: 'test-project'
|
|
42
|
-
}))
|
|
43
|
-
})
|
|
44
|
-
}));
|
|
45
|
-
vi.mock('../../../actions/documents/validate.js', ()=>({
|
|
46
|
-
validateDocuments: mocks.validate
|
|
47
|
-
}));
|
|
48
|
-
const mockConfirm = mocks.confirm;
|
|
49
|
-
const mockIsFile = mocks.isFile;
|
|
50
|
-
const mockValidate = mocks.validate;
|
|
51
|
-
describe('#documents:validate', ()=>{
|
|
52
|
-
afterEach(()=>{
|
|
53
|
-
vi.clearAllMocks();
|
|
54
|
-
});
|
|
55
|
-
beforeEach(()=>{
|
|
56
|
-
mockConfirm.mockResolvedValue(true);
|
|
57
|
-
mockIsFile.mockReturnValue(true);
|
|
58
|
-
});
|
|
59
|
-
test('--help works', async ()=>{
|
|
60
|
-
const { stdout } = await runCommand([
|
|
61
|
-
'documents validate',
|
|
62
|
-
'--help'
|
|
63
|
-
]);
|
|
64
|
-
expect(stdout).toMatchInlineSnapshot(`
|
|
65
|
-
"Validate documents in a dataset against the studio schema
|
|
66
|
-
|
|
67
|
-
USAGE
|
|
68
|
-
$ sanity documents validate [-d <value>] [--file <value>] [--format <value>]
|
|
69
|
-
[--level error|warning|info] [--max-custom-validation-concurrency <value>]
|
|
70
|
-
[--max-fetch-concurrency <value>] [--workspace <value>] [-y]
|
|
71
|
-
|
|
72
|
-
FLAGS
|
|
73
|
-
-d, --dataset=<value> Override the dataset used. By
|
|
74
|
-
default, this is derived from
|
|
75
|
-
the given workspace
|
|
76
|
-
-y, --yes Skips the first confirmation
|
|
77
|
-
prompt
|
|
78
|
-
--file=<value> Provide a path to either an
|
|
79
|
-
.ndjson file or a tarball
|
|
80
|
-
containing an .ndjson file
|
|
81
|
-
--format=<value> The output format used to
|
|
82
|
-
print the found validation
|
|
83
|
-
markers and report progress
|
|
84
|
-
--level=<option> [default: warning] The
|
|
85
|
-
minimum level reported out.
|
|
86
|
-
Defaults to warning
|
|
87
|
-
<options: error|warning|info>
|
|
88
|
-
--max-custom-validation-concurrency=<value> [default: 5] Specify how many
|
|
89
|
-
custom validators can run
|
|
90
|
-
concurrently
|
|
91
|
-
--max-fetch-concurrency=<value> [default: 25] Specify how
|
|
92
|
-
many \`client.fetch\` requests
|
|
93
|
-
are allow concurrency at once
|
|
94
|
-
--workspace=<value> The name of the workspace to
|
|
95
|
-
use when downloading and
|
|
96
|
-
validating all documents
|
|
97
|
-
|
|
98
|
-
DESCRIPTION
|
|
99
|
-
Validate documents in a dataset against the studio schema
|
|
100
|
-
|
|
101
|
-
EXAMPLES
|
|
102
|
-
Validates all documents in a Sanity project with more than one workspace
|
|
103
|
-
|
|
104
|
-
$ sanity documents validate --workspace default
|
|
105
|
-
|
|
106
|
-
Override the dataset specified in the workspace
|
|
107
|
-
|
|
108
|
-
$ sanity documents validate --workspace default --dataset staging
|
|
109
|
-
|
|
110
|
-
Save the results of the report into a file
|
|
111
|
-
|
|
112
|
-
$ sanity documents validate --yes > report.txt
|
|
113
|
-
|
|
114
|
-
Report out info level validation markers too
|
|
115
|
-
|
|
116
|
-
$ sanity documents validate --level info
|
|
117
|
-
|
|
118
|
-
"
|
|
119
|
-
`);
|
|
120
|
-
});
|
|
121
|
-
test('throws error if user enters unsupported level flag', async ()=>{
|
|
122
|
-
const { error } = await testCommand(ValidateDocumentsCommand, [
|
|
123
|
-
'--level',
|
|
124
|
-
'critical'
|
|
125
|
-
]);
|
|
126
|
-
expect(error?.message).toContain('Expected --level=critical to be one of: error, warning, info');
|
|
127
|
-
});
|
|
128
|
-
test('throws error if user enters non integer max-custom-validation-concurrency flag', async ()=>{
|
|
129
|
-
const { error } = await testCommand(ValidateDocumentsCommand, [
|
|
130
|
-
'--max-custom-validation-concurrency',
|
|
131
|
-
'abc'
|
|
132
|
-
]);
|
|
133
|
-
expect(error?.message).toContain('Expected an integer but received: abc');
|
|
134
|
-
});
|
|
135
|
-
test('throws error if user enters non integer max-fetch-concurrency flag', async ()=>{
|
|
136
|
-
const { error } = await testCommand(ValidateDocumentsCommand, [
|
|
137
|
-
'--max-fetch-concurrency',
|
|
138
|
-
'xyz'
|
|
139
|
-
]);
|
|
140
|
-
expect(error?.message).toContain('Expected an integer but received: xyz');
|
|
141
|
-
});
|
|
142
|
-
test('prompts user to confirm by default and exits if they do not want to continue', async ()=>{
|
|
143
|
-
mockConfirm.mockResolvedValue(false);
|
|
144
|
-
const { stdout } = await testCommand(ValidateDocumentsCommand, []);
|
|
145
|
-
expect(stdout).toMatchInlineSnapshot(`
|
|
146
|
-
"⚠ Warning: This command downloads all documents from your dataset and processes them through your local schema within a simulated browser environment.
|
|
147
|
-
|
|
148
|
-
Potential pitfalls:
|
|
149
|
-
|
|
150
|
-
- Processes all documents locally (excluding assets). Large datasets may require more resources.
|
|
151
|
-
- Executes all custom validation functions. Some functions may need to be refactored for compatibility.
|
|
152
|
-
- Not all standard browser features are available and may cause issues while loading your Studio.
|
|
153
|
-
- Adheres to document permissions. Ensure this account can see all desired documents.
|
|
154
|
-
User aborted
|
|
155
|
-
"
|
|
156
|
-
`);
|
|
157
|
-
expect(mockConfirm).toHaveBeenCalledWith({
|
|
158
|
-
default: true,
|
|
159
|
-
message: expect.stringContaining('Are you sure you want to continue?')
|
|
160
|
-
});
|
|
161
|
-
expect(mockConfirm).toHaveBeenCalled();
|
|
162
|
-
});
|
|
163
|
-
test('skips confirm if user uses yes flag', async ()=>{
|
|
164
|
-
await testCommand(ValidateDocumentsCommand, [
|
|
165
|
-
'--y'
|
|
166
|
-
]);
|
|
167
|
-
expect(mockConfirm).not.toHaveBeenCalled();
|
|
168
|
-
});
|
|
169
|
-
test('exits if format is incorrect value', async ()=>{
|
|
170
|
-
const { error } = await testCommand(ValidateDocumentsCommand, [
|
|
171
|
-
'--format',
|
|
172
|
-
'xml'
|
|
173
|
-
]);
|
|
174
|
-
expect(error?.message).toContain("Did not recognize format 'xml'. Available formats are 'json', 'ndjson', and 'pretty'");
|
|
175
|
-
});
|
|
176
|
-
test('exits if user inputs invalid file path in flag', async ()=>{
|
|
177
|
-
mockIsFile.mockReturnValue(false);
|
|
178
|
-
const { error } = await testCommand(ValidateDocumentsCommand, [
|
|
179
|
-
'--file',
|
|
180
|
-
'/non/existent/file.ndjson'
|
|
181
|
-
]);
|
|
182
|
-
expect(error?.message).toContain("'--file' must point to a valid ndjson file or tarball");
|
|
183
|
-
});
|
|
184
|
-
test('validateDocuments is called with the correct params', async ()=>{
|
|
185
|
-
mockValidate.mockResolvedValue('warning');
|
|
186
|
-
await testCommand(ValidateDocumentsCommand, [
|
|
187
|
-
'--yes',
|
|
188
|
-
'--dataset',
|
|
189
|
-
'my-dataset',
|
|
190
|
-
'--workspace',
|
|
191
|
-
'my-workspace',
|
|
192
|
-
'--level',
|
|
193
|
-
'info',
|
|
194
|
-
'--max-custom-validation-concurrency',
|
|
195
|
-
'10',
|
|
196
|
-
'--max-fetch-concurrency',
|
|
197
|
-
'50',
|
|
198
|
-
'--file',
|
|
199
|
-
'/path/to/file.ndjson'
|
|
200
|
-
]);
|
|
201
|
-
expect(mockValidate).toHaveBeenCalledWith({
|
|
202
|
-
clientConfig: expect.any(Object),
|
|
203
|
-
dataset: 'my-dataset',
|
|
204
|
-
level: 'info',
|
|
205
|
-
maxCustomValidationConcurrency: 10,
|
|
206
|
-
maxFetchConcurrency: 50,
|
|
207
|
-
ndjsonFilePath: expect.stringContaining('file.ndjson'),
|
|
208
|
-
reporter: expect.any(Function),
|
|
209
|
-
studioHost: undefined,
|
|
210
|
-
workDir: '/test/path',
|
|
211
|
-
workspace: 'my-workspace'
|
|
212
|
-
});
|
|
213
|
-
});
|
|
214
|
-
test('exits with code 1 if validateDocuments returns overall level as error', async ()=>{
|
|
215
|
-
mockValidate.mockResolvedValue('error');
|
|
216
|
-
const { error } = await testCommand(ValidateDocumentsCommand, []);
|
|
217
|
-
expect(error?.oclif?.exit).toBe(1);
|
|
218
|
-
});
|
|
219
|
-
test('exits with code 0 if validateDocuments does not return overall level as error', async ()=>{
|
|
220
|
-
mockValidate.mockResolvedValue('warning');
|
|
221
|
-
const { error } = await testCommand(ValidateDocumentsCommand, []);
|
|
222
|
-
expect(error).toBe(undefined);
|
|
223
|
-
});
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
//# sourceMappingURL=validate.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/commands/documents/__tests__/validate.test.ts"],"sourcesContent":["import {runCommand} from '@oclif/test'\nimport {testCommand} from '@sanity/cli-test'\nimport {afterEach, beforeEach, describe, expect, test, vi} from 'vitest'\n\nimport {ValidateDocumentsCommand} from '../validate.js'\n\nconst mocks = vi.hoisted(() => ({\n confirm: vi.fn(),\n isFile: vi.fn(),\n validate: vi.fn(),\n}))\n\nvi.mock('node:fs', () => ({\n default: {\n promises: {\n stat: vi.fn().mockResolvedValue({\n isFile: mocks.isFile,\n }),\n },\n resolve: vi.fn((dir, file) => `/resolved/${file}`),\n },\n}))\n\nvi.mock('@sanity/cli-core/ux', async () => {\n const actual = await vi.importActual<typeof import('@sanity/cli-core/ux')>('@sanity/cli-core/ux')\n return {\n ...actual,\n confirm: mocks.confirm,\n }\n})\n\nvi.mock('../../../../../cli-core/src/config/findProjectRoot.js', () => ({\n findProjectRoot: vi.fn().mockResolvedValue({\n directory: '/test/path',\n root: '/test/path',\n type: 'studio',\n }),\n}))\n\nvi.mock('../../../../../cli-core/src/config/cli/getCliConfig.js', () => ({\n getCliConfig: vi.fn(),\n}))\n\nvi.mock('../../../../../cli-core/src/services/apiClient.js', () => ({\n getGlobalCliClient: vi.fn().mockResolvedValue({\n config: vi.fn(() => ({\n dataset: 'test-dataset',\n projectId: 'test-project',\n })),\n }),\n}))\n\nvi.mock('../../../actions/documents/validate.js', () => ({\n validateDocuments: mocks.validate,\n}))\n\nconst mockConfirm = mocks.confirm\nconst mockIsFile = mocks.isFile\nconst mockValidate = mocks.validate\n\ndescribe('#documents:validate', () => {\n afterEach(() => {\n vi.clearAllMocks()\n })\n beforeEach(() => {\n mockConfirm.mockResolvedValue(true)\n mockIsFile.mockReturnValue(true)\n })\n\n test('--help works', async () => {\n const {stdout} = await runCommand(['documents validate', '--help'])\n\n expect(stdout).toMatchInlineSnapshot(`\n \"Validate documents in a dataset against the studio schema\n\n USAGE\n $ sanity documents validate [-d <value>] [--file <value>] [--format <value>]\n [--level error|warning|info] [--max-custom-validation-concurrency <value>]\n [--max-fetch-concurrency <value>] [--workspace <value>] [-y]\n\n FLAGS\n -d, --dataset=<value> Override the dataset used. By\n default, this is derived from\n the given workspace\n -y, --yes Skips the first confirmation\n prompt\n --file=<value> Provide a path to either an\n .ndjson file or a tarball\n containing an .ndjson file\n --format=<value> The output format used to\n print the found validation\n markers and report progress\n --level=<option> [default: warning] The\n minimum level reported out.\n Defaults to warning\n <options: error|warning|info>\n --max-custom-validation-concurrency=<value> [default: 5] Specify how many\n custom validators can run\n concurrently\n --max-fetch-concurrency=<value> [default: 25] Specify how\n many \\`client.fetch\\` requests\n are allow concurrency at once\n --workspace=<value> The name of the workspace to\n use when downloading and\n validating all documents\n\n DESCRIPTION\n Validate documents in a dataset against the studio schema\n\n EXAMPLES\n Validates all documents in a Sanity project with more than one workspace\n\n $ sanity documents validate --workspace default\n\n Override the dataset specified in the workspace\n\n $ sanity documents validate --workspace default --dataset staging\n\n Save the results of the report into a file\n\n $ sanity documents validate --yes > report.txt\n\n Report out info level validation markers too\n\n $ sanity documents validate --level info\n\n \"\n `)\n })\n\n test('throws error if user enters unsupported level flag', async () => {\n const {error} = await testCommand(ValidateDocumentsCommand, ['--level', 'critical'])\n\n expect(error?.message).toContain('Expected --level=critical to be one of: error, warning, info')\n })\n\n test('throws error if user enters non integer max-custom-validation-concurrency flag', async () => {\n const {error} = await testCommand(ValidateDocumentsCommand, [\n '--max-custom-validation-concurrency',\n 'abc',\n ])\n\n expect(error?.message).toContain('Expected an integer but received: abc')\n })\n\n test('throws error if user enters non integer max-fetch-concurrency flag', async () => {\n const {error} = await testCommand(ValidateDocumentsCommand, ['--max-fetch-concurrency', 'xyz'])\n\n expect(error?.message).toContain('Expected an integer but received: xyz')\n })\n\n test('prompts user to confirm by default and exits if they do not want to continue', async () => {\n mockConfirm.mockResolvedValue(false)\n\n const {stdout} = await testCommand(ValidateDocumentsCommand, [])\n\n expect(stdout).toMatchInlineSnapshot(`\n \"⚠ Warning: This command downloads all documents from your dataset and processes them through your local schema within a simulated browser environment.\n\n Potential pitfalls:\n\n - Processes all documents locally (excluding assets). Large datasets may require more resources.\n - Executes all custom validation functions. Some functions may need to be refactored for compatibility.\n - Not all standard browser features are available and may cause issues while loading your Studio.\n - Adheres to document permissions. Ensure this account can see all desired documents.\n User aborted\n \"\n `)\n expect(mockConfirm).toHaveBeenCalledWith({\n default: true,\n message: expect.stringContaining('Are you sure you want to continue?'),\n })\n expect(mockConfirm).toHaveBeenCalled()\n })\n\n test('skips confirm if user uses yes flag', async () => {\n await testCommand(ValidateDocumentsCommand, ['--y'])\n\n expect(mockConfirm).not.toHaveBeenCalled()\n })\n\n test('exits if format is incorrect value', async () => {\n const {error} = await testCommand(ValidateDocumentsCommand, ['--format', 'xml'])\n\n expect(error?.message).toContain(\n \"Did not recognize format 'xml'. Available formats are 'json', 'ndjson', and 'pretty'\",\n )\n })\n\n test('exits if user inputs invalid file path in flag', async () => {\n mockIsFile.mockReturnValue(false)\n\n const {error} = await testCommand(ValidateDocumentsCommand, [\n '--file',\n '/non/existent/file.ndjson',\n ])\n\n expect(error?.message).toContain(\"'--file' must point to a valid ndjson file or tarball\")\n })\n\n test('validateDocuments is called with the correct params', async () => {\n mockValidate.mockResolvedValue('warning')\n\n await testCommand(ValidateDocumentsCommand, [\n '--yes',\n '--dataset',\n 'my-dataset',\n '--workspace',\n 'my-workspace',\n '--level',\n 'info',\n '--max-custom-validation-concurrency',\n '10',\n '--max-fetch-concurrency',\n '50',\n '--file',\n '/path/to/file.ndjson',\n ])\n\n expect(mockValidate).toHaveBeenCalledWith({\n clientConfig: expect.any(Object),\n dataset: 'my-dataset',\n level: 'info',\n maxCustomValidationConcurrency: 10,\n maxFetchConcurrency: 50,\n ndjsonFilePath: expect.stringContaining('file.ndjson'),\n reporter: expect.any(Function),\n studioHost: undefined,\n workDir: '/test/path',\n workspace: 'my-workspace',\n })\n })\n\n test('exits with code 1 if validateDocuments returns overall level as error', async () => {\n mockValidate.mockResolvedValue('error')\n\n const {error} = await testCommand(ValidateDocumentsCommand, [])\n\n expect(error?.oclif?.exit).toBe(1)\n })\n\n test('exits with code 0 if validateDocuments does not return overall level as error', async () => {\n mockValidate.mockResolvedValue('warning')\n\n const {error} = await testCommand(ValidateDocumentsCommand, [])\n\n expect(error).toBe(undefined)\n })\n})\n"],"names":["runCommand","testCommand","afterEach","beforeEach","describe","expect","test","vi","ValidateDocumentsCommand","mocks","hoisted","confirm","fn","isFile","validate","mock","default","promises","stat","mockResolvedValue","resolve","dir","file","actual","importActual","findProjectRoot","directory","root","type","getCliConfig","getGlobalCliClient","config","dataset","projectId","validateDocuments","mockConfirm","mockIsFile","mockValidate","clearAllMocks","mockReturnValue","stdout","toMatchInlineSnapshot","error","message","toContain","toHaveBeenCalledWith","stringContaining","toHaveBeenCalled","not","clientConfig","any","Object","level","maxCustomValidationConcurrency","maxFetchConcurrency","ndjsonFilePath","reporter","Function","studioHost","undefined","workDir","workspace","oclif","exit","toBe"],"mappings":"AAAA,SAAQA,UAAU,QAAO,cAAa;AACtC,SAAQC,WAAW,QAAO,mBAAkB;AAC5C,SAAQC,SAAS,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,IAAI,EAAEC,EAAE,QAAO,SAAQ;AAExE,SAAQC,wBAAwB,QAAO,iBAAgB;AAEvD,MAAMC,QAAQF,GAAGG,OAAO,CAAC,IAAO,CAAA;QAC9BC,SAASJ,GAAGK,EAAE;QACdC,QAAQN,GAAGK,EAAE;QACbE,UAAUP,GAAGK,EAAE;IACjB,CAAA;AAEAL,GAAGQ,IAAI,CAAC,WAAW,IAAO,CAAA;QACxBC,SAAS;YACPC,UAAU;gBACRC,MAAMX,GAAGK,EAAE,GAAGO,iBAAiB,CAAC;oBAC9BN,QAAQJ,MAAMI,MAAM;gBACtB;YACF;YACAO,SAASb,GAAGK,EAAE,CAAC,CAACS,KAAKC,OAAS,CAAC,UAAU,EAAEA,MAAM;QACnD;IACF,CAAA;AAEAf,GAAGQ,IAAI,CAAC,uBAAuB;IAC7B,MAAMQ,SAAS,MAAMhB,GAAGiB,YAAY,CAAuC;IAC3E,OAAO;QACL,GAAGD,MAAM;QACTZ,SAASF,MAAME,OAAO;IACxB;AACF;AAEAJ,GAAGQ,IAAI,C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AO;YACPC,gCAAgC;YAChCC,qBAAqB;YACrBC,gBAAgBlD,OAAOyC,gBAAgB,CAAC;YACxCU,UAAUnD,OAAO6C,GAAG,CAACO;YACrBC,YAAYC;YACZC,SAAS;YACTC,WAAW;QACb;IACF;IAEAvD,KAAK,yEAAyE;QAC5E+B,aAAalB,iBAAiB,CAAC;QAE/B,MAAM,EAACuB,KAAK,EAAC,GAAG,MAAMzC,YAAYO,0BAA0B,EAAE;QAE9DH,OAAOqC,OAAOoB,OAAOC,MAAMC,IAAI,CAAC;IAClC;IAEA1D,KAAK,iFAAiF;QACpF+B,aAAalB,iBAAiB,CAAC;QAE/B,MAAM,EAACuB,KAAK,EAAC,GAAG,MAAMzC,YAAYO,0BAA0B,EAAE;QAE9DH,OAAOqC,OAAOsB,IAAI,CAACL;IACrB;AACF"}
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import { runCommand } from '@oclif/test';
|
|
2
|
-
import { getCliConfig } from '@sanity/cli-core';
|
|
3
|
-
import { mockApi, testCommand } from '@sanity/cli-test';
|
|
4
|
-
import nock from 'nock';
|
|
5
|
-
import { afterEach, describe, expect, test, vi } from 'vitest';
|
|
6
|
-
import { GRAPHQL_API_VERSION } from '../../../services/graphql.js';
|
|
7
|
-
import { NO_PROJECT_ID } from '../../../util/errorMessages.js';
|
|
8
|
-
import { List } from '../list.js';
|
|
9
|
-
// Mock the config functions with relative paths
|
|
10
|
-
vi.mock('../../../../../cli-core/src/config/findProjectRoot.js', ()=>({
|
|
11
|
-
findProjectRoot: vi.fn().mockResolvedValue({
|
|
12
|
-
directory: '/test/path',
|
|
13
|
-
root: '/test/path',
|
|
14
|
-
type: 'studio'
|
|
15
|
-
})
|
|
16
|
-
}));
|
|
17
|
-
vi.mock('../../../../../cli-core/src/config/cli/getCliConfig.js', ()=>({
|
|
18
|
-
getCliConfig: vi.fn().mockResolvedValue({
|
|
19
|
-
api: {
|
|
20
|
-
projectId: 'test-project'
|
|
21
|
-
}
|
|
22
|
-
})
|
|
23
|
-
}));
|
|
24
|
-
vi.mock('../../../../../cli-core/src/services/getCliToken.js', ()=>({
|
|
25
|
-
getCliToken: vi.fn().mockResolvedValue('test-token')
|
|
26
|
-
}));
|
|
27
|
-
const mockGetCliConfig = vi.mocked(getCliConfig);
|
|
28
|
-
describe('#list', ()=>{
|
|
29
|
-
afterEach(()=>{
|
|
30
|
-
vi.clearAllMocks();
|
|
31
|
-
const pending = nock.pendingMocks();
|
|
32
|
-
nock.cleanAll();
|
|
33
|
-
expect(pending, 'pending mocks').toEqual([]);
|
|
34
|
-
});
|
|
35
|
-
test('--help works', async ()=>{
|
|
36
|
-
const { stdout } = await runCommand([
|
|
37
|
-
'graphql list',
|
|
38
|
-
'--help'
|
|
39
|
-
]);
|
|
40
|
-
expect(stdout).toMatchInlineSnapshot(`
|
|
41
|
-
"List all GraphQL endpoints deployed for this project
|
|
42
|
-
|
|
43
|
-
USAGE
|
|
44
|
-
$ sanity graphql list
|
|
45
|
-
|
|
46
|
-
DESCRIPTION
|
|
47
|
-
List all GraphQL endpoints deployed for this project
|
|
48
|
-
|
|
49
|
-
EXAMPLES
|
|
50
|
-
List GraphQL endpoints for the current project
|
|
51
|
-
|
|
52
|
-
$ sanity graphql list
|
|
53
|
-
|
|
54
|
-
"
|
|
55
|
-
`);
|
|
56
|
-
});
|
|
57
|
-
test('displays GraphQL endpoints correctly with multiple endpoints', async ()=>{
|
|
58
|
-
mockApi({
|
|
59
|
-
apiHost: 'https://test-project.api.sanity.io',
|
|
60
|
-
apiVersion: GRAPHQL_API_VERSION,
|
|
61
|
-
uri: '/apis/graphql'
|
|
62
|
-
}).reply(200, [
|
|
63
|
-
{
|
|
64
|
-
dataset: 'production',
|
|
65
|
-
generation: 'gen2',
|
|
66
|
-
playgroundEnabled: true,
|
|
67
|
-
projectId: 'test-project',
|
|
68
|
-
tag: 'default'
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
dataset: 'staging',
|
|
72
|
-
generation: 'gen3',
|
|
73
|
-
playgroundEnabled: false,
|
|
74
|
-
projectId: 'test-project',
|
|
75
|
-
tag: 'latest'
|
|
76
|
-
}
|
|
77
|
-
]);
|
|
78
|
-
const { stdout } = await testCommand(List);
|
|
79
|
-
expect(stdout).toMatchInlineSnapshot(`
|
|
80
|
-
"Here are the GraphQL endpoints deployed for this project:
|
|
81
|
-
1. Dataset: production
|
|
82
|
-
Tag: default
|
|
83
|
-
Generation: gen2
|
|
84
|
-
Playground: true
|
|
85
|
-
URL: https://test-project.api.sanity.io/v2025-09-19/graphql/production/default
|
|
86
|
-
|
|
87
|
-
2. Dataset: staging
|
|
88
|
-
Tag: latest
|
|
89
|
-
Generation: gen3
|
|
90
|
-
Playground: false
|
|
91
|
-
URL: https://test-project.api.sanity.io/v2025-09-19/graphql/staging/latest
|
|
92
|
-
|
|
93
|
-
"
|
|
94
|
-
`);
|
|
95
|
-
});
|
|
96
|
-
test('displays single GraphQL endpoint correctly', async ()=>{
|
|
97
|
-
mockApi({
|
|
98
|
-
apiHost: 'https://test-project.api.sanity.io',
|
|
99
|
-
apiVersion: GRAPHQL_API_VERSION,
|
|
100
|
-
uri: '/apis/graphql'
|
|
101
|
-
}).reply(200, [
|
|
102
|
-
{
|
|
103
|
-
dataset: 'production',
|
|
104
|
-
generation: 'gen2',
|
|
105
|
-
playgroundEnabled: true,
|
|
106
|
-
projectId: 'test-project',
|
|
107
|
-
tag: 'default'
|
|
108
|
-
}
|
|
109
|
-
]);
|
|
110
|
-
const { stdout } = await testCommand(List);
|
|
111
|
-
expect(stdout).toMatchInlineSnapshot(`
|
|
112
|
-
"Here are the GraphQL endpoints deployed for this project:
|
|
113
|
-
1. Dataset: production
|
|
114
|
-
Tag: default
|
|
115
|
-
Generation: gen2
|
|
116
|
-
Playground: true
|
|
117
|
-
URL: https://test-project.api.sanity.io/v2025-09-19/graphql/production/default
|
|
118
|
-
|
|
119
|
-
"
|
|
120
|
-
`);
|
|
121
|
-
});
|
|
122
|
-
test('handles empty GraphQL endpoints list', async ()=>{
|
|
123
|
-
mockApi({
|
|
124
|
-
apiHost: 'https://test-project.api.sanity.io',
|
|
125
|
-
apiVersion: GRAPHQL_API_VERSION,
|
|
126
|
-
uri: '/apis/graphql'
|
|
127
|
-
}).reply(200, []);
|
|
128
|
-
const { stdout } = await testCommand(List);
|
|
129
|
-
expect(stdout).toBe("This project doesn't have any GraphQL endpoints deployed.\n");
|
|
130
|
-
});
|
|
131
|
-
test('handles null/undefined GraphQL endpoints response', async ()=>{
|
|
132
|
-
mockApi({
|
|
133
|
-
apiHost: 'https://test-project.api.sanity.io',
|
|
134
|
-
apiVersion: GRAPHQL_API_VERSION,
|
|
135
|
-
uri: '/apis/graphql'
|
|
136
|
-
}).reply(200, undefined);
|
|
137
|
-
const { stdout } = await testCommand(List);
|
|
138
|
-
expect(stdout).toBe("This project doesn't have any GraphQL endpoints deployed.\n");
|
|
139
|
-
});
|
|
140
|
-
test.each([
|
|
141
|
-
[
|
|
142
|
-
404,
|
|
143
|
-
'Project not found'
|
|
144
|
-
],
|
|
145
|
-
[
|
|
146
|
-
500,
|
|
147
|
-
'Internal Server Error'
|
|
148
|
-
]
|
|
149
|
-
])('displays error when API request fails with %i status and message "%s"', async (status, message)=>{
|
|
150
|
-
mockApi({
|
|
151
|
-
apiHost: 'https://test-project.api.sanity.io',
|
|
152
|
-
apiVersion: GRAPHQL_API_VERSION,
|
|
153
|
-
uri: '/apis/graphql'
|
|
154
|
-
}).reply(status, {
|
|
155
|
-
message
|
|
156
|
-
});
|
|
157
|
-
const { error } = await testCommand(List);
|
|
158
|
-
expect(error).toBeInstanceOf(Error);
|
|
159
|
-
expect(error?.message).toContain('GraphQL endpoints list retrieval failed');
|
|
160
|
-
expect(error?.message).toContain(message);
|
|
161
|
-
expect(error?.oclif?.exit).toBe(1);
|
|
162
|
-
});
|
|
163
|
-
test('throws error when project ID is not defined', async ()=>{
|
|
164
|
-
mockGetCliConfig.mockResolvedValueOnce({
|
|
165
|
-
api: {
|
|
166
|
-
projectId: undefined
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
const { error } = await testCommand(List);
|
|
170
|
-
expect(error).toBeInstanceOf(Error);
|
|
171
|
-
expect(error?.message).toEqual(NO_PROJECT_ID);
|
|
172
|
-
expect(error?.oclif?.exit).toBe(1);
|
|
173
|
-
});
|
|
174
|
-
test('displays endpoints correctly when dataset names contain special characters', async ()=>{
|
|
175
|
-
mockApi({
|
|
176
|
-
apiHost: 'https://test-project.api.sanity.io',
|
|
177
|
-
apiVersion: GRAPHQL_API_VERSION,
|
|
178
|
-
uri: '/apis/graphql'
|
|
179
|
-
}).reply(200, [
|
|
180
|
-
{
|
|
181
|
-
dataset: 'my-dataset-123',
|
|
182
|
-
generation: 'gen2',
|
|
183
|
-
playgroundEnabled: true,
|
|
184
|
-
projectId: 'test-project',
|
|
185
|
-
tag: 'v1.0.0'
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
dataset: 'test_dataset',
|
|
189
|
-
generation: 'gen3',
|
|
190
|
-
playgroundEnabled: false,
|
|
191
|
-
projectId: 'test-project',
|
|
192
|
-
tag: 'beta-2'
|
|
193
|
-
}
|
|
194
|
-
]);
|
|
195
|
-
const { stdout } = await testCommand(List);
|
|
196
|
-
expect(stdout).toContain('Dataset: my-dataset-123');
|
|
197
|
-
expect(stdout).toContain('Tag: v1.0.0');
|
|
198
|
-
expect(stdout).toContain('Dataset: test_dataset');
|
|
199
|
-
expect(stdout).toContain('Tag: beta-2');
|
|
200
|
-
});
|
|
201
|
-
test('displays endpoints with various generation values correctly', async ()=>{
|
|
202
|
-
mockApi({
|
|
203
|
-
apiHost: 'https://test-project.api.sanity.io',
|
|
204
|
-
apiVersion: GRAPHQL_API_VERSION,
|
|
205
|
-
uri: '/apis/graphql'
|
|
206
|
-
}).reply(200, [
|
|
207
|
-
{
|
|
208
|
-
dataset: 'production',
|
|
209
|
-
generation: 'gen1',
|
|
210
|
-
playgroundEnabled: true,
|
|
211
|
-
projectId: 'test-project',
|
|
212
|
-
tag: 'default'
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
dataset: 'staging',
|
|
216
|
-
generation: 'gen3',
|
|
217
|
-
playgroundEnabled: false,
|
|
218
|
-
projectId: 'test-project',
|
|
219
|
-
tag: 'default'
|
|
220
|
-
}
|
|
221
|
-
]);
|
|
222
|
-
const { stdout } = await testCommand(List);
|
|
223
|
-
expect(stdout).toContain('Generation: gen1');
|
|
224
|
-
expect(stdout).toContain('Generation: gen3');
|
|
225
|
-
});
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
//# sourceMappingURL=list.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/commands/graphql/__tests__/list.test.ts"],"sourcesContent":["import {runCommand} from '@oclif/test'\nimport {getCliConfig} from '@sanity/cli-core'\nimport {mockApi, testCommand} from '@sanity/cli-test'\nimport nock from 'nock'\nimport {afterEach, describe, expect, test, vi} from 'vitest'\n\nimport {GRAPHQL_API_VERSION} from '../../../services/graphql.js'\nimport {NO_PROJECT_ID} from '../../../util/errorMessages.js'\nimport {List} from '../list.js'\n\n// Mock the config functions with relative paths\nvi.mock('../../../../../cli-core/src/config/findProjectRoot.js', () => ({\n findProjectRoot: vi.fn().mockResolvedValue({\n directory: '/test/path',\n root: '/test/path',\n type: 'studio',\n }),\n}))\n\nvi.mock('../../../../../cli-core/src/config/cli/getCliConfig.js', () => ({\n getCliConfig: vi.fn().mockResolvedValue({\n api: {\n projectId: 'test-project',\n },\n }),\n}))\n\nvi.mock('../../../../../cli-core/src/services/getCliToken.js', () => ({\n getCliToken: vi.fn().mockResolvedValue('test-token'),\n}))\n\nconst mockGetCliConfig = vi.mocked(getCliConfig)\n\ndescribe('#list', () => {\n afterEach(() => {\n vi.clearAllMocks()\n const pending = nock.pendingMocks()\n nock.cleanAll()\n expect(pending, 'pending mocks').toEqual([])\n })\n\n test('--help works', async () => {\n const {stdout} = await runCommand(['graphql list', '--help'])\n\n expect(stdout).toMatchInlineSnapshot(`\n \"List all GraphQL endpoints deployed for this project\n\n USAGE\n $ sanity graphql list\n\n DESCRIPTION\n List all GraphQL endpoints deployed for this project\n\n EXAMPLES\n List GraphQL endpoints for the current project\n\n $ sanity graphql list\n\n \"\n `)\n })\n\n test('displays GraphQL endpoints correctly with multiple endpoints', async () => {\n mockApi({\n apiHost: 'https://test-project.api.sanity.io',\n apiVersion: GRAPHQL_API_VERSION,\n uri: '/apis/graphql',\n }).reply(200, [\n {\n dataset: 'production',\n generation: 'gen2',\n playgroundEnabled: true,\n projectId: 'test-project',\n tag: 'default',\n },\n {\n dataset: 'staging',\n generation: 'gen3',\n playgroundEnabled: false,\n projectId: 'test-project',\n tag: 'latest',\n },\n ])\n\n const {stdout} = await testCommand(List)\n\n expect(stdout).toMatchInlineSnapshot(`\n \"Here are the GraphQL endpoints deployed for this project:\n 1. Dataset: production\n Tag: default\n Generation: gen2\n Playground: true\n URL: https://test-project.api.sanity.io/v2025-09-19/graphql/production/default\n\n 2. Dataset: staging\n Tag: latest\n Generation: gen3\n Playground: false\n URL: https://test-project.api.sanity.io/v2025-09-19/graphql/staging/latest\n\n \"\n `)\n })\n\n test('displays single GraphQL endpoint correctly', async () => {\n mockApi({\n apiHost: 'https://test-project.api.sanity.io',\n apiVersion: GRAPHQL_API_VERSION,\n uri: '/apis/graphql',\n }).reply(200, [\n {\n dataset: 'production',\n generation: 'gen2',\n playgroundEnabled: true,\n projectId: 'test-project',\n tag: 'default',\n },\n ])\n\n const {stdout} = await testCommand(List)\n\n expect(stdout).toMatchInlineSnapshot(`\n \"Here are the GraphQL endpoints deployed for this project:\n 1. Dataset: production\n Tag: default\n Generation: gen2\n Playground: true\n URL: https://test-project.api.sanity.io/v2025-09-19/graphql/production/default\n\n \"\n `)\n })\n\n test('handles empty GraphQL endpoints list', async () => {\n mockApi({\n apiHost: 'https://test-project.api.sanity.io',\n apiVersion: GRAPHQL_API_VERSION,\n uri: '/apis/graphql',\n }).reply(200, [])\n\n const {stdout} = await testCommand(List)\n\n expect(stdout).toBe(\"This project doesn't have any GraphQL endpoints deployed.\\n\")\n })\n\n test('handles null/undefined GraphQL endpoints response', async () => {\n mockApi({\n apiHost: 'https://test-project.api.sanity.io',\n apiVersion: GRAPHQL_API_VERSION,\n uri: '/apis/graphql',\n }).reply(200, undefined)\n\n const {stdout} = await testCommand(List)\n\n expect(stdout).toBe(\"This project doesn't have any GraphQL endpoints deployed.\\n\")\n })\n\n test.each([\n [404, 'Project not found'],\n [500, 'Internal Server Error'],\n ])(\n 'displays error when API request fails with %i status and message \"%s\"',\n async (status, message) => {\n mockApi({\n apiHost: 'https://test-project.api.sanity.io',\n apiVersion: GRAPHQL_API_VERSION,\n uri: '/apis/graphql',\n }).reply(status, {message})\n\n const {error} = await testCommand(List)\n\n expect(error).toBeInstanceOf(Error)\n expect(error?.message).toContain('GraphQL endpoints list retrieval failed')\n expect(error?.message).toContain(message)\n expect(error?.oclif?.exit).toBe(1)\n },\n )\n\n test('throws error when project ID is not defined', async () => {\n mockGetCliConfig.mockResolvedValueOnce({\n api: {\n projectId: undefined,\n },\n })\n\n const {error} = await testCommand(List)\n\n expect(error).toBeInstanceOf(Error)\n expect(error?.message).toEqual(NO_PROJECT_ID)\n expect(error?.oclif?.exit).toBe(1)\n })\n\n test('displays endpoints correctly when dataset names contain special characters', async () => {\n mockApi({\n apiHost: 'https://test-project.api.sanity.io',\n apiVersion: GRAPHQL_API_VERSION,\n uri: '/apis/graphql',\n }).reply(200, [\n {\n dataset: 'my-dataset-123',\n generation: 'gen2',\n playgroundEnabled: true,\n projectId: 'test-project',\n tag: 'v1.0.0',\n },\n {\n dataset: 'test_dataset',\n generation: 'gen3',\n playgroundEnabled: false,\n projectId: 'test-project',\n tag: 'beta-2',\n },\n ])\n\n const {stdout} = await testCommand(List)\n\n expect(stdout).toContain('Dataset: my-dataset-123')\n expect(stdout).toContain('Tag: v1.0.0')\n expect(stdout).toContain('Dataset: test_dataset')\n expect(stdout).toContain('Tag: beta-2')\n })\n\n test('displays endpoints with various generation values correctly', async () => {\n mockApi({\n apiHost: 'https://test-project.api.sanity.io',\n apiVersion: GRAPHQL_API_VERSION,\n uri: '/apis/graphql',\n }).reply(200, [\n {\n dataset: 'production',\n generation: 'gen1',\n playgroundEnabled: true,\n projectId: 'test-project',\n tag: 'default',\n },\n {\n dataset: 'staging',\n generation: 'gen3',\n playgroundEnabled: false,\n projectId: 'test-project',\n tag: 'default',\n },\n ])\n\n const {stdout} = await testCommand(List)\n\n expect(stdout).toContain('Generation: gen1')\n expect(stdout).toContain('Generation: gen3')\n })\n})\n"],"names":["runCommand","getCliConfig","mockApi","testCommand","nock","afterEach","describe","expect","test","vi","GRAPHQL_API_VERSION","NO_PROJECT_ID","List","mock","findProjectRoot","fn","mockResolvedValue","directory","root","type","api","projectId","getCliToken","mockGetCliConfig","mocked","clearAllMocks","pending","pendingMocks","cleanAll","toEqual","stdout","toMatchInlineSnapshot","apiHost","apiVersion","uri","reply","dataset","generation","playgroundEnabled","tag","toBe","undefined","each","status","message","error","toBeInstanceOf","Error","toContain","oclif","exit","mockResolvedValueOnce"],"mappings":"AAAA,SAAQA,UAAU,QAAO,cAAa;AACtC,SAAQC,YAAY,QAAO,mBAAkB;AAC7C,SAAQC,OAAO,EAAEC,WAAW,QAAO,mBAAkB;AACrD,OAAOC,UAAU,OAAM;AACvB,SAAQC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,IAAI,EAAEC,EAAE,QAAO,SAAQ;AAE5D,SAAQC,mBAAmB,QAAO,+BAA8B;AAChE,SAAQC,aAAa,QAAO,iCAAgC;AAC5D,SAAQC,IAAI,QAAO,aAAY;AAE/B,gDAAgD;AAChDH,GAAGI,IAAI,CAAC,yDAAyD,IAAO,CAAA;QACtEC,iBAAiBL,GAAGM,EAAE,GAAGC,iBAAiB,CAAC;YACzCC,WAAW;YACXC,MAAM;YACNC,MAAM;QACR;IACF,CAAA;AAEAV,GAAGI,IAAI,CAAC,0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