@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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/services/userApplications.ts"],"sourcesContent":["import {PassThrough} from 'node:stream'\nimport {type Gzip} from 'node:zlib'\n\nimport {debug, getGlobalCliClient} from '@sanity/cli-core'\nimport FormData from 'form-data'\n\nexport const USER_APPLICATIONS_API_VERSION = 'v2024-08-01'\n\ninterface ActiveDeployment {\n createdAt: string\n deployedAt: string\n deployedBy: string\n isActiveDeployment: boolean\n isAutoUpdating: boolean | null\n size: string | null\n updatedAt: string\n version: string\n}\n\nexport interface UserApplication {\n appHost: string\n createdAt: string\n id: string\n organizationId: string | null\n projectId: string | null\n title: string | null\n type: 'coreApp' | 'studio'\n updatedAt: string\n urlType: 'external' | 'internal'\n\n activeDeployment?: ActiveDeployment | null\n}\n\ntype GetUserApplicationOptions =\n | {appHost?: never; appId: string; isSdkApp: true; projectId?: never}\n | {appHost?: string; appId?: string; isSdkApp: false; projectId: string}\n\nexport async function getUserApplication({\n appHost,\n appId,\n isSdkApp,\n projectId,\n}: GetUserApplicationOptions): Promise<UserApplication | null> {\n let query: Record<string, string | string[]> | undefined\n let uri: string\n\n // set the uri\n if (isSdkApp) {\n uri = appId ? `/user-applications/${appId}` : '/user-applications'\n } else {\n uri = appId\n ? `/projects/${projectId}/user-applications/${appId}`\n : `/projects/${projectId}/user-applications`\n }\n\n // set the query\n if (isSdkApp) {\n query = {appType: 'coreApp'}\n } else if (!appId) {\n // In practice, this function isn't called if we don't have at least one of appHost or appId,\n // so the default case won't be called. But leaving this ternary in for now (from old CLI code) just in case.\n query = appHost ? {appHost, appType: 'studio'} : {default: 'true'}\n }\n\n const client = await getGlobalCliClient({\n apiVersion: USER_APPLICATIONS_API_VERSION,\n requireUser: true,\n })\n\n try {\n const options = query ? {query, uri} : {uri}\n return await client.request(options)\n } catch (err) {\n if (err?.statusCode === 404) {\n return null\n }\n\n debug('Error getting user application', err)\n throw err\n }\n}\n\ninterface DeleteUserApplicationOptions {\n applicationId: string\n appType: 'coreApp' | 'studio'\n}\n\nexport async function deleteUserApplication({\n applicationId,\n appType,\n}: DeleteUserApplicationOptions): Promise<void> {\n const client = await getGlobalCliClient({\n apiVersion: USER_APPLICATIONS_API_VERSION,\n requireUser: true,\n })\n\n await client.request({\n method: 'DELETE',\n query: {appType},\n uri: `/user-applications/${applicationId}`,\n })\n}\n\nexport async function getUserApplications(options: {\n appType: 'studio'\n projectId: string\n}): Promise<UserApplication[]>\nexport async function getUserApplications(options: {\n appType: 'coreApp'\n organizationId: string\n}): Promise<UserApplication[]>\nexport async function getUserApplications(\n options:\n | {\n appType: 'coreApp'\n organizationId?: string\n }\n | {\n appType: 'studio'\n projectId?: string\n },\n): Promise<UserApplication[] | null> {\n const {appType} = options\n const client = await getGlobalCliClient({\n apiVersion: USER_APPLICATIONS_API_VERSION,\n requireUser: true,\n })\n\n if (appType === 'studio') {\n const {projectId} = options as {appType: 'studio'; projectId?: string}\n return await client.request({\n query: {appType: 'studio'},\n uri: `/projects/${projectId}/user-applications`,\n })\n }\n\n const {organizationId} = options as {appType: 'coreApp'; organizationId?: string}\n\n try {\n return await client.request({\n query: {appType: 'coreApp', organizationId: organizationId!},\n uri: `/user-applications`,\n })\n } catch (error) {\n // User doesn't have permission to view applications for the org,\n // or the organization ID doesn’t exist\n if (error?.statusCode === 403) {\n throw error\n }\n\n debug('Error finding user applications', error)\n return null\n }\n}\n\nexport async function createUserApplication(options: {\n appType: 'coreApp'\n body: Pick<UserApplication, 'appHost' | 'type' | 'urlType'> & {\n title?: string\n }\n organizationId?: string\n}): Promise<UserApplication>\nexport async function createUserApplication(options: {\n appType: 'studio'\n body: Pick<UserApplication, 'appHost' | 'type' | 'urlType'> & {\n title?: string\n }\n projectId: string\n}): Promise<UserApplication>\nexport async function createUserApplication(options: {\n appType: 'coreApp' | 'studio'\n body: Pick<UserApplication, 'appHost' | 'type' | 'urlType'> & {\n title?: string\n }\n organizationId?: string\n projectId?: string\n}): Promise<UserApplication> {\n const {appType, body} = options\n\n const client = await getGlobalCliClient({\n apiVersion: USER_APPLICATIONS_API_VERSION,\n requireUser: true,\n })\n\n let uri\n let query\n\n // If we have an organizationId, we're creating a core app\n if (appType === 'coreApp') {\n const {organizationId} = options as {appType: 'coreApp'; organizationId?: string}\n uri = '/user-applications'\n query = {appType: 'coreApp', organizationId: organizationId!}\n } else {\n const {projectId} = options as {appType: 'studio'; projectId?: string}\n uri = `/projects/${projectId}/user-applications`\n query = {appType: 'studio'}\n }\n\n return client.request({body, method: 'POST', query, uri})\n}\n\ninterface CreateDeploymentOptions {\n applicationId: string\n isAutoUpdating: boolean\n tarball: Gzip\n version: string\n\n isApp?: boolean\n\n projectId?: string\n}\n\nexport async function createDeployment({\n applicationId,\n isApp,\n isAutoUpdating,\n projectId,\n tarball,\n version,\n}: CreateDeploymentOptions): Promise<{location: string}> {\n const client = await getGlobalCliClient({\n apiVersion: USER_APPLICATIONS_API_VERSION,\n requireUser: true,\n })\n\n const formData = new FormData()\n formData.append('isAutoUpdating', isAutoUpdating.toString())\n formData.append('version', version)\n formData.append('tarball', tarball, {contentType: 'application/gzip', filename: 'app.tar.gz'})\n\n let uri\n let query\n\n if (isApp) {\n uri = `/user-applications/${applicationId}/deployments`\n query = {appType: 'coreApp'}\n } else {\n uri = `/projects/${projectId}/user-applications/${applicationId}/deployments`\n query = {appType: 'studio'}\n }\n\n return client.request({\n body: formData.pipe(new PassThrough()),\n headers: formData.getHeaders(),\n method: 'POST',\n query,\n uri,\n })\n}\n"],"names":["PassThrough","debug","getGlobalCliClient","FormData","USER_APPLICATIONS_API_VERSION","getUserApplication","appHost","appId","isSdkApp","projectId","query","uri","appType","default","client","apiVersion","requireUser","options","request","err","statusCode","deleteUserApplication","applicationId","method","getUserApplications","organizationId","error","createUserApplication","body","createDeployment","isApp","isAutoUpdating","tarball","version","formData","append","toString","contentType","filename","pipe","headers","getHeaders"],"mappings":"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"}
|
|
1
|
+
{"version":3,"sources":["../../src/services/userApplications.ts"],"sourcesContent":["import {PassThrough} from 'node:stream'\nimport {type Gzip} from 'node:zlib'\n\nimport {debug, getGlobalCliClient} from '@sanity/cli-core'\nimport FormData from 'form-data'\n\nimport {appManifestHasData} from '../actions/manifest/extractAppManifest.js'\nimport {type AppManifest} from '../actions/manifest/types.js'\n\nexport const USER_APPLICATIONS_API_VERSION = 'v2024-08-01'\n\ninterface ActiveDeployment {\n createdAt: string\n deployedAt: string\n deployedBy: string\n isActiveDeployment: boolean\n isAutoUpdating: boolean | null\n size: string | null\n updatedAt: string\n version: string\n}\n\nexport interface UserApplication {\n appHost: string\n createdAt: string\n id: string\n organizationId: string | null\n projectId: string | null\n title: string | null\n type: 'coreApp' | 'studio'\n updatedAt: string\n urlType: 'external' | 'internal'\n\n activeDeployment?: ActiveDeployment | null\n}\n\ntype GetUserApplicationOptions =\n | {appHost?: never; appId: string; isSdkApp: true; projectId?: never}\n | {appHost?: string; appId?: string; isSdkApp: false; projectId: string}\n\nexport async function getUserApplication({\n appHost,\n appId,\n isSdkApp,\n projectId,\n}: GetUserApplicationOptions): Promise<UserApplication | null> {\n let query: Record<string, string | string[]> | undefined\n let uri: string\n\n // set the uri\n if (isSdkApp) {\n uri = appId ? `/user-applications/${appId}` : '/user-applications'\n } else {\n uri = appId\n ? `/projects/${projectId}/user-applications/${appId}`\n : `/projects/${projectId}/user-applications`\n }\n\n // set the query\n if (isSdkApp) {\n query = {appType: 'coreApp'}\n } else if (!appId) {\n // In practice, this function isn't called if we don't have at least one of appHost or appId,\n // so the default case won't be called. But leaving this ternary in for now (from old CLI code) just in case.\n query = appHost ? {appHost, appType: 'studio'} : {default: 'true'}\n }\n\n const client = await getGlobalCliClient({\n apiVersion: USER_APPLICATIONS_API_VERSION,\n requireUser: true,\n })\n\n try {\n const options = query ? {query, uri} : {uri}\n return await client.request(options)\n } catch (err) {\n if (err?.statusCode === 404) {\n return null\n }\n\n debug('Error getting user application', err)\n throw err\n }\n}\n\ninterface DeleteUserApplicationOptions {\n applicationId: string\n appType: 'coreApp' | 'studio'\n}\n\nexport async function deleteUserApplication({\n applicationId,\n appType,\n}: DeleteUserApplicationOptions): Promise<void> {\n const client = await getGlobalCliClient({\n apiVersion: USER_APPLICATIONS_API_VERSION,\n requireUser: true,\n })\n\n await client.request({\n method: 'DELETE',\n query: {appType},\n uri: `/user-applications/${applicationId}`,\n })\n}\n\nexport async function getUserApplications(options: {\n appType: 'studio'\n projectId: string\n}): Promise<UserApplication[]>\nexport async function getUserApplications(options: {\n appType: 'coreApp'\n organizationId: string\n}): Promise<UserApplication[]>\nexport async function getUserApplications(\n options:\n | {\n appType: 'coreApp'\n organizationId?: string\n }\n | {\n appType: 'studio'\n projectId?: string\n },\n): Promise<UserApplication[] | null> {\n const {appType} = options\n const client = await getGlobalCliClient({\n apiVersion: USER_APPLICATIONS_API_VERSION,\n requireUser: true,\n })\n\n if (appType === 'studio') {\n const {projectId} = options as {appType: 'studio'; projectId?: string}\n return await client.request({\n query: {appType: 'studio'},\n uri: `/projects/${projectId}/user-applications`,\n })\n }\n\n const {organizationId} = options as {appType: 'coreApp'; organizationId?: string}\n\n try {\n return await client.request({\n query: {appType: 'coreApp', organizationId: organizationId!},\n uri: `/user-applications`,\n })\n } catch (error) {\n // User doesn't have permission to view applications for the org,\n // or the organization ID doesn’t exist\n if (error?.statusCode === 403) {\n throw error\n }\n\n debug('Error finding user applications', error)\n return null\n }\n}\n\nexport async function createUserApplication(options: {\n appType: 'coreApp'\n body: Pick<UserApplication, 'appHost' | 'type' | 'urlType'> & {\n title?: string\n }\n organizationId?: string\n}): Promise<UserApplication>\nexport async function createUserApplication(options: {\n appType: 'studio'\n body: Pick<UserApplication, 'appHost' | 'type' | 'urlType'> & {\n title?: string\n }\n projectId: string\n}): Promise<UserApplication>\nexport async function createUserApplication(options: {\n appType: 'coreApp' | 'studio'\n body: Pick<UserApplication, 'appHost' | 'type' | 'urlType'> & {\n title?: string\n }\n organizationId?: string\n projectId?: string\n}): Promise<UserApplication> {\n const {appType, body} = options\n\n const client = await getGlobalCliClient({\n apiVersion: USER_APPLICATIONS_API_VERSION,\n requireUser: true,\n })\n\n let uri\n let query\n\n // If we have an organizationId, we're creating a core app\n if (appType === 'coreApp') {\n const {organizationId} = options as {appType: 'coreApp'; organizationId?: string}\n uri = '/user-applications'\n query = {appType: 'coreApp', organizationId: organizationId!}\n } else {\n const {projectId} = options as {appType: 'studio'; projectId?: string}\n uri = `/projects/${projectId}/user-applications`\n query = {appType: 'studio'}\n }\n\n return client.request({body, method: 'POST', query, uri})\n}\n\ninterface CreateDeploymentOptions {\n applicationId: string\n isAutoUpdating: boolean\n tarball: Gzip\n version: string\n\n isApp?: boolean\n\n manifest?: AppManifest\n\n projectId?: string\n}\n\nexport async function createDeployment({\n applicationId,\n isApp,\n isAutoUpdating,\n manifest,\n projectId,\n tarball,\n version,\n}: CreateDeploymentOptions): Promise<{location: string}> {\n const client = await getGlobalCliClient({\n apiVersion: USER_APPLICATIONS_API_VERSION,\n requireUser: true,\n })\n\n const formData = new FormData()\n formData.append('isAutoUpdating', isAutoUpdating.toString())\n formData.append('version', version)\n if (isApp && appManifestHasData(manifest)) {\n formData.append('manifest', JSON.stringify(manifest))\n }\n\n formData.append('tarball', tarball, {contentType: 'application/gzip', filename: 'app.tar.gz'})\n\n let uri\n let query\n\n if (isApp) {\n uri = `/user-applications/${applicationId}/deployments`\n query = {appType: 'coreApp'}\n } else {\n uri = `/projects/${projectId}/user-applications/${applicationId}/deployments`\n query = {appType: 'studio'}\n }\n\n return client.request({\n body: formData.pipe(new PassThrough()),\n headers: formData.getHeaders(),\n method: 'POST',\n query,\n uri,\n })\n}\n"],"names":["PassThrough","debug","getGlobalCliClient","FormData","appManifestHasData","USER_APPLICATIONS_API_VERSION","getUserApplication","appHost","appId","isSdkApp","projectId","query","uri","appType","default","client","apiVersion","requireUser","options","request","err","statusCode","deleteUserApplication","applicationId","method","getUserApplications","organizationId","error","createUserApplication","body","createDeployment","isApp","isAutoUpdating","manifest","tarball","version","formData","append","toString","JSON","stringify","contentType","filename","pipe","headers","getHeaders"],"mappings":"AAAA,SAAQA,WAAW,QAAO,cAAa;AAGvC,SAAQC,KAAK,EAAEC,kBAAkB,QAAO,mBAAkB;AAC1D,OAAOC,cAAc,YAAW;AAEhC,SAAQC,kBAAkB,QAAO,4CAA2C;AAG5E,OAAO,MAAMC,gCAAgC,cAAa;AA+B1D,OAAO,eAAeC,mBAAmB,EACvCC,OAAO,EACPC,KAAK,EACLC,QAAQ,EACRC,SAAS,EACiB;IAC1B,IAAIC;IACJ,IAAIC;IAEJ,cAAc;IACd,IAAIH,UAAU;QACZG,MAAMJ,QAAQ,CAAC,mBAAmB,EAAEA,OAAO,GAAG;IAChD,OAAO;QACLI,MAAMJ,QACF,CAAC,UAAU,EAAEE,UAAU,mBAAmB,EAAEF,OAAO,GACnD,CAAC,UAAU,EAAEE,UAAU,kBAAkB,CAAC;IAChD;IAEA,gBAAgB;IAChB,IAAID,UAAU;QACZE,QAAQ;YAACE,SAAS;QAAS;IAC7B,OAAO,IAAI,CAACL,OAAO;QACjB,6FAA6F;QAC7F,6GAA6G;QAC7GG,QAAQJ,UAAU;YAACA;YAASM,SAAS;QAAQ,IAAI;YAACC,SAAS;QAAM;IACnE;IAEA,MAAMC,SAAS,MAAMb,mBAAmB;QACtCc,YAAYX;QACZY,aAAa;IACf;IAEA,IAAI;QACF,MAAMC,UAAUP,QAAQ;YAACA;YAAOC;QAAG,IAAI;YAACA;QAAG;QAC3C,OAAO,MAAMG,OAAOI,OAAO,CAACD;IAC9B,EAAE,OAAOE,KAAK;QACZ,IAAIA,KAAKC,eAAe,KAAK;YAC3B,OAAO;QACT;QAEApB,MAAM,kCAAkCmB;QACxC,MAAMA;IACR;AACF;AAOA,OAAO,eAAeE,sBAAsB,EAC1CC,aAAa,EACbV,OAAO,EACsB;IAC7B,MAAME,SAAS,MAAMb,mBAAmB;QACtCc,YAAYX;QACZY,aAAa;IACf;IAEA,MAAMF,OAAOI,OAAO,CAAC;QACnBK,QAAQ;QACRb,OAAO;YAACE;QAAO;QACfD,KAAK,CAAC,mBAAmB,EAAEW,eAAe;IAC5C;AACF;AAUA,OAAO,eAAeE,oBACpBP,OAQK;IAEL,MAAM,EAACL,OAAO,EAAC,GAAGK;IAClB,MAAMH,SAAS,MAAMb,mBAAmB;QACtCc,YAAYX;QACZY,aAAa;IACf;IAEA,IAAIJ,YAAY,UAAU;QACxB,MAAM,EAACH,SAAS,EAAC,GAAGQ;QACpB,OAAO,MAAMH,OAAOI,OAAO,CAAC;YAC1BR,OAAO;gBAACE,SAAS;YAAQ;YACzBD,KAAK,CAAC,UAAU,EAAEF,UAAU,kBAAkB,CAAC;QACjD;IACF;IAEA,MAAM,EAACgB,cAAc,EAAC,GAAGR;IAEzB,IAAI;QACF,OAAO,MAAMH,OAAOI,OAAO,CAAC;YAC1BR,OAAO;gBAACE,SAAS;gBAAWa,gBAAgBA;YAAe;YAC3Dd,KAAK,CAAC,kBAAkB,CAAC;QAC3B;IACF,EAAE,OAAOe,OAAO;QACd,iEAAiE;QACjE,uCAAuC;QACvC,IAAIA,OAAON,eAAe,KAAK;YAC7B,MAAMM;QACR;QAEA1B,MAAM,mCAAmC0B;QACzC,OAAO;IACT;AACF;AAgBA,OAAO,eAAeC,sBAAsBV,OAO3C;IACC,MAAM,EAACL,OAAO,EAAEgB,IAAI,EAAC,GAAGX;IAExB,MAAMH,SAAS,MAAMb,mBAAmB;QACtCc,YAAYX;QACZY,aAAa;IACf;IAEA,IAAIL;IACJ,IAAID;IAEJ,0DAA0D;IAC1D,IAAIE,YAAY,WAAW;QACzB,MAAM,EAACa,cAAc,EAAC,GAAGR;QACzBN,MAAM;QACND,QAAQ;YAACE,SAAS;YAAWa,gBAAgBA;QAAe;IAC9D,OAAO;QACL,MAAM,EAAChB,SAAS,EAAC,GAAGQ;QACpBN,MAAM,CAAC,UAAU,EAAEF,UAAU,kBAAkB,CAAC;QAChDC,QAAQ;YAACE,SAAS;QAAQ;IAC5B;IAEA,OAAOE,OAAOI,OAAO,CAAC;QAACU;QAAML,QAAQ;QAAQb;QAAOC;IAAG;AACzD;AAeA,OAAO,eAAekB,iBAAiB,EACrCP,aAAa,EACbQ,KAAK,EACLC,cAAc,EACdC,QAAQ,EACRvB,SAAS,EACTwB,OAAO,EACPC,OAAO,EACiB;IACxB,MAAMpB,SAAS,MAAMb,mBAAmB;QACtCc,YAAYX;QACZY,aAAa;IACf;IAEA,MAAMmB,WAAW,IAAIjC;IACrBiC,SAASC,MAAM,CAAC,kBAAkBL,eAAeM,QAAQ;IACzDF,SAASC,MAAM,CAAC,WAAWF;IAC3B,IAAIJ,SAAS3B,mBAAmB6B,WAAW;QACzCG,SAASC,MAAM,CAAC,YAAYE,KAAKC,SAAS,CAACP;IAC7C;IAEAG,SAASC,MAAM,CAAC,WAAWH,SAAS;QAACO,aAAa;QAAoBC,UAAU;IAAY;IAE5F,IAAI9B;IACJ,IAAID;IAEJ,IAAIoB,OAAO;QACTnB,MAAM,CAAC,mBAAmB,EAAEW,cAAc,YAAY,CAAC;QACvDZ,QAAQ;YAACE,SAAS;QAAS;IAC7B,OAAO;QACLD,MAAM,CAAC,UAAU,EAAEF,UAAU,mBAAmB,EAAEa,cAAc,YAAY,CAAC;QAC7EZ,QAAQ;YAACE,SAAS;QAAQ;IAC5B;IAEA,OAAOE,OAAOI,OAAO,CAAC;QACpBU,MAAMO,SAASO,IAAI,CAAC,IAAI3C;QACxB4C,SAASR,SAASS,UAAU;QAC5BrB,QAAQ;QACRb;QACAC;IACF;AACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const NO_PROJECT_ID = "sanity.cli.ts does not contain a project identifier (\"api.projectId\"), which is required for the Sanity CLI to communicate with the Sanity API";
|
|
2
|
+
export declare const NO_DATASET_ID = "sanity.cli.ts does not contain a dataset identifier (\"api.dataset\"), which is required for the Sanity CLI to communicate with the Sanity API";
|
|
2
3
|
export declare const NO_ORGANIZATION_ID = "sanity.cli.ts does not contain an organization identifier (\"app.organizationId\"), which is required for the Sanity CLI to communicate with the Sanity API";
|
|
3
4
|
export declare const NO_MEDIA_LIBRARY_ASPECTS_PATH = "sanity.cli.ts does not contain a media library aspects path (\"mediaLibrary.aspectsPath\"), which is required for the Sanity CLI to manage aspects.";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export const NO_PROJECT_ID = `sanity.cli.ts does not contain a project identifier ("api.projectId"), which is required for the Sanity CLI to communicate with the Sanity API`;
|
|
2
|
+
export const NO_DATASET_ID = `sanity.cli.ts does not contain a dataset identifier ("api.dataset"), which is required for the Sanity CLI to communicate with the Sanity API`;
|
|
2
3
|
export const NO_ORGANIZATION_ID = `sanity.cli.ts does not contain an organization identifier ("app.organizationId"), which is required for the Sanity CLI to communicate with the Sanity API`;
|
|
3
4
|
export const NO_MEDIA_LIBRARY_ASPECTS_PATH = `sanity.cli.ts does not contain a media library aspects path ("mediaLibrary.aspectsPath"), which is required for the Sanity CLI to manage aspects.`;
|
|
4
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/util/errorMessages.ts"],"sourcesContent":["export const NO_PROJECT_ID = `sanity.cli.ts does not contain a project identifier (\"api.projectId\"), which is required for the Sanity CLI to communicate with the Sanity API`\nexport const NO_ORGANIZATION_ID = `sanity.cli.ts does not contain an organization identifier (\"app.organizationId\"), which is required for the Sanity CLI to communicate with the Sanity API`\nexport const NO_MEDIA_LIBRARY_ASPECTS_PATH = `sanity.cli.ts does not contain a media library aspects path (\"mediaLibrary.aspectsPath\"), which is required for the Sanity CLI to manage aspects.`\n"],"names":["NO_PROJECT_ID","NO_ORGANIZATION_ID","NO_MEDIA_LIBRARY_ASPECTS_PATH"],"mappings":"AAAA,OAAO,MAAMA,gBAAgB,CAAC,8IAA8I,CAAC,CAAA;AAC7K,OAAO,MAAMC,qBAAqB,CAAC,yJAAyJ,CAAC,CAAA;AAC7L,OAAO,MAAMC,gCAAgC,CAAC,iJAAiJ,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"sources":["../../src/util/errorMessages.ts"],"sourcesContent":["export const NO_PROJECT_ID = `sanity.cli.ts does not contain a project identifier (\"api.projectId\"), which is required for the Sanity CLI to communicate with the Sanity API`\nexport const NO_DATASET_ID = `sanity.cli.ts does not contain a dataset identifier (\"api.dataset\"), which is required for the Sanity CLI to communicate with the Sanity API`\nexport const NO_ORGANIZATION_ID = `sanity.cli.ts does not contain an organization identifier (\"app.organizationId\"), which is required for the Sanity CLI to communicate with the Sanity API`\nexport const NO_MEDIA_LIBRARY_ASPECTS_PATH = `sanity.cli.ts does not contain a media library aspects path (\"mediaLibrary.aspectsPath\"), which is required for the Sanity CLI to manage aspects.`\n"],"names":["NO_PROJECT_ID","NO_DATASET_ID","NO_ORGANIZATION_ID","NO_MEDIA_LIBRARY_ASPECTS_PATH"],"mappings":"AAAA,OAAO,MAAMA,gBAAgB,CAAC,8IAA8I,CAAC,CAAA;AAC7K,OAAO,MAAMC,gBAAgB,CAAC,4IAA4I,CAAC,CAAA;AAC3K,OAAO,MAAMC,qBAAqB,CAAC,yJAAyJ,CAAC,CAAA;AAC7L,OAAO,MAAMC,gCAAgC,CAAC,iJAAiJ,CAAC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
|
-
import { packageDirectory } from '
|
|
3
|
+
import { packageDirectory } from 'package-directory';
|
|
4
4
|
import { readPackageJson } from './readPackageJson.js';
|
|
5
5
|
/**
|
|
6
6
|
* Get the version of the `@sanity/cli` package.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/util/getCliVersion.ts"],"sourcesContent":["import path from 'node:path'\nimport {fileURLToPath} from 'node:url'\n\nimport {packageDirectory} from '
|
|
1
|
+
{"version":3,"sources":["../../src/util/getCliVersion.ts"],"sourcesContent":["import path from 'node:path'\nimport {fileURLToPath} from 'node:url'\n\nimport {packageDirectory} from 'package-directory'\n\nimport {type PackageJson, readPackageJson} from './readPackageJson.js'\n\n/**\n * Get the version of the `@sanity/cli` package.\n *\n * @internal\n * @returns The version of the `@sanity/cli` package.\n */\nexport async function getCliVersion(): Promise<string> {\n // using the meta.url will resolve to the code running from the cli\n // this will find the package.json in cli package.\n const cliPath = await packageDirectory({cwd: fileURLToPath(import.meta.url)})\n if (!cliPath) {\n throw new Error('Unable to resolve root of @sanity/cli module')\n }\n\n let pkg: PackageJson | undefined\n try {\n pkg = await readPackageJson(path.join(cliPath, 'package.json'))\n } catch (err) {\n throw new Error(`Unable to read @sanity/cli/package.json: ${(err as Error).message}`)\n }\n\n return pkg.version\n}\n"],"names":["path","fileURLToPath","packageDirectory","readPackageJson","getCliVersion","cliPath","cwd","url","Error","pkg","join","err","message","version"],"mappings":"AAAA,OAAOA,UAAU,YAAW;AAC5B,SAAQC,aAAa,QAAO,WAAU;AAEtC,SAAQC,gBAAgB,QAAO,oBAAmB;AAElD,SAA0BC,eAAe,QAAO,uBAAsB;AAEtE;;;;;CAKC,GACD,OAAO,eAAeC;IACpB,mEAAmE;IACnE,kDAAkD;IAClD,MAAMC,UAAU,MAAMH,iBAAiB;QAACI,KAAKL,cAAc,YAAYM,GAAG;IAAC;IAC3E,IAAI,CAACF,SAAS;QACZ,MAAM,IAAIG,MAAM;IAClB;IAEA,IAAIC;IACJ,IAAI;QACFA,MAAM,MAAMN,gBAAgBH,KAAKU,IAAI,CAACL,SAAS;IACjD,EAAE,OAAOM,KAAK;QACZ,MAAM,IAAIH,MAAM,CAAC,yCAAyC,EAAE,AAACG,IAAcC,OAAO,EAAE;IACtF;IAEA,OAAOH,IAAII,OAAO;AACpB"}
|
|
@@ -12,21 +12,7 @@ declare const packageJsonSchema: z.ZodObject<{
|
|
|
12
12
|
devDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
13
13
|
exports: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
14
14
|
peerDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
15
|
-
},
|
|
16
|
-
name: string;
|
|
17
|
-
version: string;
|
|
18
|
-
exports?: Record<string, any> | undefined;
|
|
19
|
-
dependencies?: Record<string, string> | undefined;
|
|
20
|
-
devDependencies?: Record<string, string> | undefined;
|
|
21
|
-
peerDependencies?: Record<string, string> | undefined;
|
|
22
|
-
}, {
|
|
23
|
-
name: string;
|
|
24
|
-
version: string;
|
|
25
|
-
exports?: Record<string, any> | undefined;
|
|
26
|
-
dependencies?: Record<string, string> | undefined;
|
|
27
|
-
devDependencies?: Record<string, string> | undefined;
|
|
28
|
-
peerDependencies?: Record<string, string> | undefined;
|
|
29
|
-
}>;
|
|
15
|
+
}, z.core.$strip>;
|
|
30
16
|
/**
|
|
31
17
|
* Minimal representation of a package.json.
|
|
32
18
|
*
|
|
@@ -36,7 +36,7 @@ import { z } from 'zod';
|
|
|
36
36
|
if (success) {
|
|
37
37
|
return data;
|
|
38
38
|
}
|
|
39
|
-
throw new Error(`Invalid package.json at "${filePath}": ${error.
|
|
39
|
+
throw new Error(`Invalid package.json at "${filePath}": ${error.issues.map((err)=>err.message).join('\n')}`);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
//# sourceMappingURL=readPackageJson.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/util/readPackageJson.ts"],"sourcesContent":["import {readFile} from 'node:fs/promises'\n\nimport {z} from 'zod'\n\n/**\n * Feel free to add properties to this,\n * 🟠ℹ️ BUT ENSURE OPTIONAL STUFF IS ACTUALLY OPTIONAL ℹ️🟠\n * 🟠ℹ️ SINCE THIS IS USED IN A NUMBER OF LOCATIONS WHERE ℹ️🟠\n * 🟠ℹ️ WE CANNOT ENFORCE/GUARANTEE ANY PARTICULAR PROPS ℹ️🟠\n */\nconst packageJsonSchema = z.object({\n name: z.string(),\n version: z.string(),\n\n dependencies: z.record(z.string(), z.string()).optional(),\n devDependencies: z.record(z.string(), z.string()).optional(),\n exports: z.record(z.string(), z.any()).optional(),\n peerDependencies: z.record(z.string(), z.string()).optional(),\n})\n\n/**\n * Minimal representation of a package.json.\n *\n * @internal\n */\nexport type PackageJson = z.infer<typeof packageJsonSchema>\n\n/**\n * Read the `package.json` file at the given path\n *\n * @param filePath - Path to package.json to read\n * @param skipSchemaValidation - Skip schema validation if true\n * @returns The parsed package.json\n * @internal\n */\nexport async function readPackageJson(\n filePath: string,\n skipSchemaValidation = false,\n): Promise<PackageJson> {\n let pkg: unknown\n try {\n pkg = JSON.parse(await readFile(filePath, 'utf8'))\n } catch (err: unknown) {\n throw new Error(`Failed to read \"${filePath}\"`, {cause: err})\n }\n\n if (skipSchemaValidation) {\n return pkg as PackageJson\n }\n\n const {data, error, success} = packageJsonSchema.safeParse(pkg)\n if (success) {\n return data\n }\n\n throw new Error(\n `Invalid package.json at \"${filePath}\": ${error.
|
|
1
|
+
{"version":3,"sources":["../../src/util/readPackageJson.ts"],"sourcesContent":["import {readFile} from 'node:fs/promises'\n\nimport {z} from 'zod'\n\n/**\n * Feel free to add properties to this,\n * 🟠ℹ️ BUT ENSURE OPTIONAL STUFF IS ACTUALLY OPTIONAL ℹ️🟠\n * 🟠ℹ️ SINCE THIS IS USED IN A NUMBER OF LOCATIONS WHERE ℹ️🟠\n * 🟠ℹ️ WE CANNOT ENFORCE/GUARANTEE ANY PARTICULAR PROPS ℹ️🟠\n */\nconst packageJsonSchema = z.object({\n name: z.string(),\n version: z.string(),\n\n dependencies: z.record(z.string(), z.string()).optional(),\n devDependencies: z.record(z.string(), z.string()).optional(),\n exports: z.record(z.string(), z.any()).optional(),\n peerDependencies: z.record(z.string(), z.string()).optional(),\n})\n\n/**\n * Minimal representation of a package.json.\n *\n * @internal\n */\nexport type PackageJson = z.infer<typeof packageJsonSchema>\n\n/**\n * Read the `package.json` file at the given path\n *\n * @param filePath - Path to package.json to read\n * @param skipSchemaValidation - Skip schema validation if true\n * @returns The parsed package.json\n * @internal\n */\nexport async function readPackageJson(\n filePath: string,\n skipSchemaValidation = false,\n): Promise<PackageJson> {\n let pkg: unknown\n try {\n pkg = JSON.parse(await readFile(filePath, 'utf8'))\n } catch (err: unknown) {\n throw new Error(`Failed to read \"${filePath}\"`, {cause: err})\n }\n\n if (skipSchemaValidation) {\n return pkg as PackageJson\n }\n\n const {data, error, success} = packageJsonSchema.safeParse(pkg)\n if (success) {\n return data\n }\n\n throw new Error(\n `Invalid package.json at \"${filePath}\": ${error.issues.map((err) => err.message).join('\\n')}`,\n )\n}\n"],"names":["readFile","z","packageJsonSchema","object","name","string","version","dependencies","record","optional","devDependencies","exports","any","peerDependencies","readPackageJson","filePath","skipSchemaValidation","pkg","JSON","parse","err","Error","cause","data","error","success","safeParse","issues","map","message","join"],"mappings":"AAAA,SAAQA,QAAQ,QAAO,mBAAkB;AAEzC,SAAQC,CAAC,QAAO,MAAK;AAErB;;;;;CAKC,GACD,MAAMC,oBAAoBD,EAAEE,MAAM,CAAC;IACjCC,MAAMH,EAAEI,MAAM;IACdC,SAASL,EAAEI,MAAM;IAEjBE,cAAcN,EAAEO,MAAM,CAACP,EAAEI,MAAM,IAAIJ,EAAEI,MAAM,IAAII,QAAQ;IACvDC,iBAAiBT,EAAEO,MAAM,CAACP,EAAEI,MAAM,IAAIJ,EAAEI,MAAM,IAAII,QAAQ;IAC1DE,SAASV,EAAEO,MAAM,CAACP,EAAEI,MAAM,IAAIJ,EAAEW,GAAG,IAAIH,QAAQ;IAC/CI,kBAAkBZ,EAAEO,MAAM,CAACP,EAAEI,MAAM,IAAIJ,EAAEI,MAAM,IAAII,QAAQ;AAC7D;AASA;;;;;;;CAOC,GACD,OAAO,eAAeK,gBACpBC,QAAgB,EAChBC,uBAAuB,KAAK;IAE5B,IAAIC;IACJ,IAAI;QACFA,MAAMC,KAAKC,KAAK,CAAC,MAAMnB,SAASe,UAAU;IAC5C,EAAE,OAAOK,KAAc;QACrB,MAAM,IAAIC,MAAM,CAAC,gBAAgB,EAAEN,SAAS,CAAC,CAAC,EAAE;YAACO,OAAOF;QAAG;IAC7D;IAEA,IAAIJ,sBAAsB;QACxB,OAAOC;IACT;IAEA,MAAM,EAACM,IAAI,EAAEC,KAAK,EAAEC,OAAO,EAAC,GAAGvB,kBAAkBwB,SAAS,CAACT;IAC3D,IAAIQ,SAAS;QACX,OAAOF;IACT;IAEA,MAAM,IAAIF,MACR,CAAC,yBAAyB,EAAEN,SAAS,GAAG,EAAES,MAAMG,MAAM,CAACC,GAAG,CAAC,CAACR,MAAQA,IAAIS,OAAO,EAAEC,IAAI,CAAC,OAAO;AAEjG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function uniqBy<T>(array: T[], key: keyof T): T[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Native implementation instead of lodash/uniqBy
|
|
2
|
+
export function uniqBy(array, key) {
|
|
3
|
+
const seen = new Set();
|
|
4
|
+
return array.filter((item)=>{
|
|
5
|
+
const value = item[key];
|
|
6
|
+
if (seen.has(value)) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
seen.add(value);
|
|
10
|
+
return true;
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=uniqBy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/util/uniqBy.ts"],"sourcesContent":["// Native implementation instead of lodash/uniqBy\nexport function uniqBy<T>(array: T[], key: keyof T): T[] {\n const seen = new Set()\n return array.filter((item) => {\n const value = item[key]\n if (seen.has(value)) {\n return false\n }\n seen.add(value)\n return true\n })\n}\n"],"names":["uniqBy","array","key","seen","Set","filter","item","value","has","add"],"mappings":"AAAA,iDAAiD;AACjD,OAAO,SAASA,OAAUC,KAAU,EAAEC,GAAY;IAChD,MAAMC,OAAO,IAAIC;IACjB,OAAOH,MAAMI,MAAM,CAAC,CAACC;QACnB,MAAMC,QAAQD,IAAI,CAACJ,IAAI;QACvB,IAAIC,KAAKK,GAAG,CAACD,QAAQ;YACnB,OAAO;QACT;QACAJ,KAAKM,GAAG,CAACF;QACT,OAAO;IACT;AACF"}
|
package/oclif.manifest.json
CHANGED
|
@@ -2466,32 +2466,6 @@
|
|
|
2466
2466
|
"logs.js"
|
|
2467
2467
|
]
|
|
2468
2468
|
},
|
|
2469
|
-
"mcp:configure": {
|
|
2470
|
-
"aliases": [],
|
|
2471
|
-
"args": {},
|
|
2472
|
-
"description": "Configure Sanity MCP server for AI editors (Cursor, VS Code, Claude Code)",
|
|
2473
|
-
"examples": [
|
|
2474
|
-
{
|
|
2475
|
-
"command": "<%= config.bin %> <%= command.id %>",
|
|
2476
|
-
"description": "Configure Sanity MCP server for detected AI editors"
|
|
2477
|
-
}
|
|
2478
|
-
],
|
|
2479
|
-
"flags": {},
|
|
2480
|
-
"hasDynamicHelp": false,
|
|
2481
|
-
"hiddenAliases": [],
|
|
2482
|
-
"id": "mcp:configure",
|
|
2483
|
-
"pluginAlias": "@sanity/cli",
|
|
2484
|
-
"pluginName": "@sanity/cli",
|
|
2485
|
-
"pluginType": "core",
|
|
2486
|
-
"strict": true,
|
|
2487
|
-
"isESM": true,
|
|
2488
|
-
"relativePath": [
|
|
2489
|
-
"dist",
|
|
2490
|
-
"commands",
|
|
2491
|
-
"mcp",
|
|
2492
|
-
"configure.js"
|
|
2493
|
-
]
|
|
2494
|
-
},
|
|
2495
2469
|
"manifest:extract": {
|
|
2496
2470
|
"aliases": [],
|
|
2497
2471
|
"args": {},
|
|
@@ -2531,6 +2505,32 @@
|
|
|
2531
2505
|
"extract.js"
|
|
2532
2506
|
]
|
|
2533
2507
|
},
|
|
2508
|
+
"mcp:configure": {
|
|
2509
|
+
"aliases": [],
|
|
2510
|
+
"args": {},
|
|
2511
|
+
"description": "Configure Sanity MCP server for AI editors (Cursor, VS Code, Claude Code)",
|
|
2512
|
+
"examples": [
|
|
2513
|
+
{
|
|
2514
|
+
"command": "<%= config.bin %> <%= command.id %>",
|
|
2515
|
+
"description": "Configure Sanity MCP server for detected AI editors"
|
|
2516
|
+
}
|
|
2517
|
+
],
|
|
2518
|
+
"flags": {},
|
|
2519
|
+
"hasDynamicHelp": false,
|
|
2520
|
+
"hiddenAliases": [],
|
|
2521
|
+
"id": "mcp:configure",
|
|
2522
|
+
"pluginAlias": "@sanity/cli",
|
|
2523
|
+
"pluginName": "@sanity/cli",
|
|
2524
|
+
"pluginType": "core",
|
|
2525
|
+
"strict": true,
|
|
2526
|
+
"isESM": true,
|
|
2527
|
+
"relativePath": [
|
|
2528
|
+
"dist",
|
|
2529
|
+
"commands",
|
|
2530
|
+
"mcp",
|
|
2531
|
+
"configure.js"
|
|
2532
|
+
]
|
|
2533
|
+
},
|
|
2534
2534
|
"media:create-aspect": {
|
|
2535
2535
|
"aliases": [],
|
|
2536
2536
|
"args": {},
|
|
@@ -2781,118 +2781,6 @@
|
|
|
2781
2781
|
"import.js"
|
|
2782
2782
|
]
|
|
2783
2783
|
},
|
|
2784
|
-
"openapi:get": {
|
|
2785
|
-
"aliases": [],
|
|
2786
|
-
"args": {
|
|
2787
|
-
"slug": {
|
|
2788
|
-
"description": "Slug of the OpenAPI specification to retrieve",
|
|
2789
|
-
"name": "slug",
|
|
2790
|
-
"required": true
|
|
2791
|
-
}
|
|
2792
|
-
},
|
|
2793
|
-
"description": "Get an OpenAPI specification by slug",
|
|
2794
|
-
"examples": [
|
|
2795
|
-
{
|
|
2796
|
-
"command": "<%= config.bin %> <%= command.id %> query",
|
|
2797
|
-
"description": "Get a specification (YAML format, default)"
|
|
2798
|
-
},
|
|
2799
|
-
{
|
|
2800
|
-
"command": "<%= config.bin %> <%= command.id %> query --format=json",
|
|
2801
|
-
"description": "Get specification in JSON format"
|
|
2802
|
-
},
|
|
2803
|
-
{
|
|
2804
|
-
"command": "<%= config.bin %> <%= command.id %> query --web",
|
|
2805
|
-
"description": "Open specification in browser"
|
|
2806
|
-
},
|
|
2807
|
-
{
|
|
2808
|
-
"command": "<%= config.bin %> <%= command.id %> query > query-api.yaml",
|
|
2809
|
-
"description": "Pipe to file"
|
|
2810
|
-
}
|
|
2811
|
-
],
|
|
2812
|
-
"flags": {
|
|
2813
|
-
"format": {
|
|
2814
|
-
"description": "Output format: yaml (default), json",
|
|
2815
|
-
"name": "format",
|
|
2816
|
-
"default": "yaml",
|
|
2817
|
-
"hasDynamicHelp": false,
|
|
2818
|
-
"multiple": false,
|
|
2819
|
-
"options": [
|
|
2820
|
-
"yaml",
|
|
2821
|
-
"json"
|
|
2822
|
-
],
|
|
2823
|
-
"type": "option"
|
|
2824
|
-
},
|
|
2825
|
-
"web": {
|
|
2826
|
-
"char": "w",
|
|
2827
|
-
"description": "Open in web browser",
|
|
2828
|
-
"name": "web",
|
|
2829
|
-
"allowNo": false,
|
|
2830
|
-
"type": "boolean"
|
|
2831
|
-
}
|
|
2832
|
-
},
|
|
2833
|
-
"hasDynamicHelp": false,
|
|
2834
|
-
"hiddenAliases": [],
|
|
2835
|
-
"id": "openapi:get",
|
|
2836
|
-
"pluginAlias": "@sanity/cli",
|
|
2837
|
-
"pluginName": "@sanity/cli",
|
|
2838
|
-
"pluginType": "core",
|
|
2839
|
-
"strict": true,
|
|
2840
|
-
"isESM": true,
|
|
2841
|
-
"relativePath": [
|
|
2842
|
-
"dist",
|
|
2843
|
-
"commands",
|
|
2844
|
-
"openapi",
|
|
2845
|
-
"get.js"
|
|
2846
|
-
]
|
|
2847
|
-
},
|
|
2848
|
-
"openapi:list": {
|
|
2849
|
-
"aliases": [],
|
|
2850
|
-
"args": {},
|
|
2851
|
-
"description": "List all available OpenAPI specifications",
|
|
2852
|
-
"examples": [
|
|
2853
|
-
{
|
|
2854
|
-
"command": "<%= config.bin %> <%= command.id %>",
|
|
2855
|
-
"description": "List all available OpenAPI specs"
|
|
2856
|
-
},
|
|
2857
|
-
{
|
|
2858
|
-
"command": "<%= config.bin %> <%= command.id %> --json",
|
|
2859
|
-
"description": "List with JSON output"
|
|
2860
|
-
},
|
|
2861
|
-
{
|
|
2862
|
-
"command": "<%= config.bin %> <%= command.id %> --web",
|
|
2863
|
-
"description": "Open HTTP Reference in browser"
|
|
2864
|
-
}
|
|
2865
|
-
],
|
|
2866
|
-
"flags": {
|
|
2867
|
-
"json": {
|
|
2868
|
-
"description": "Output JSON",
|
|
2869
|
-
"name": "json",
|
|
2870
|
-
"allowNo": false,
|
|
2871
|
-
"type": "boolean"
|
|
2872
|
-
},
|
|
2873
|
-
"web": {
|
|
2874
|
-
"char": "w",
|
|
2875
|
-
"description": "Open HTTP Reference in web browser",
|
|
2876
|
-
"name": "web",
|
|
2877
|
-
"allowNo": false,
|
|
2878
|
-
"type": "boolean"
|
|
2879
|
-
}
|
|
2880
|
-
},
|
|
2881
|
-
"hasDynamicHelp": false,
|
|
2882
|
-
"hiddenAliases": [],
|
|
2883
|
-
"id": "openapi:list",
|
|
2884
|
-
"pluginAlias": "@sanity/cli",
|
|
2885
|
-
"pluginName": "@sanity/cli",
|
|
2886
|
-
"pluginType": "core",
|
|
2887
|
-
"strict": true,
|
|
2888
|
-
"isESM": true,
|
|
2889
|
-
"relativePath": [
|
|
2890
|
-
"dist",
|
|
2891
|
-
"commands",
|
|
2892
|
-
"openapi",
|
|
2893
|
-
"list.js"
|
|
2894
|
-
]
|
|
2895
|
-
},
|
|
2896
2784
|
"projects:list": {
|
|
2897
2785
|
"aliases": [],
|
|
2898
2786
|
"args": {},
|
|
@@ -2992,6 +2880,7 @@
|
|
|
2992
2880
|
"manifest-dir": {
|
|
2993
2881
|
"description": "Directory containing manifest file",
|
|
2994
2882
|
"name": "manifest-dir",
|
|
2883
|
+
"default": "./dist/static",
|
|
2995
2884
|
"hasDynamicHelp": false,
|
|
2996
2885
|
"multiple": false,
|
|
2997
2886
|
"type": "option"
|
|
@@ -3018,6 +2907,78 @@
|
|
|
3018
2907
|
"delete.js"
|
|
3019
2908
|
]
|
|
3020
2909
|
},
|
|
2910
|
+
"schema:deploy": {
|
|
2911
|
+
"aliases": [],
|
|
2912
|
+
"args": {},
|
|
2913
|
+
"description": "Deploy schema documents into workspace datasets.\n\n**Note**: This command is experimental and subject to change.\n\nThis operation (re-)generates a manifest file describing the sanity config workspace by default.\nTo re-use an existing manifest file, use --no-extract-manifest.",
|
|
2914
|
+
"examples": [
|
|
2915
|
+
{
|
|
2916
|
+
"command": "<%= config.bin %> <%= command.id %>",
|
|
2917
|
+
"description": "Deploy all workspace schemas"
|
|
2918
|
+
},
|
|
2919
|
+
{
|
|
2920
|
+
"command": "<%= config.bin %> <%= command.id %> --workspace default",
|
|
2921
|
+
"description": "Deploy the schema for only the workspace \"default\""
|
|
2922
|
+
},
|
|
2923
|
+
{
|
|
2924
|
+
"command": "<%= config.bin %> <%= command.id %> --no-extract-manifest",
|
|
2925
|
+
"description": "Runs using a pre-existing manifest file. Config changes in sanity.config will not be picked up in this case."
|
|
2926
|
+
}
|
|
2927
|
+
],
|
|
2928
|
+
"flags": {
|
|
2929
|
+
"extract-manifest": {
|
|
2930
|
+
"description": "Disables manifest generation - the command will fail if no manifest exists",
|
|
2931
|
+
"name": "extract-manifest",
|
|
2932
|
+
"allowNo": true,
|
|
2933
|
+
"type": "boolean"
|
|
2934
|
+
},
|
|
2935
|
+
"manifest-dir": {
|
|
2936
|
+
"description": "Directory containing manifest file",
|
|
2937
|
+
"name": "manifest-dir",
|
|
2938
|
+
"default": "./dist/static",
|
|
2939
|
+
"hasDynamicHelp": false,
|
|
2940
|
+
"helpValue": "<directory>",
|
|
2941
|
+
"multiple": false,
|
|
2942
|
+
"type": "option"
|
|
2943
|
+
},
|
|
2944
|
+
"tag": {
|
|
2945
|
+
"description": "Add a tag suffix to the schema id",
|
|
2946
|
+
"name": "tag",
|
|
2947
|
+
"hasDynamicHelp": false,
|
|
2948
|
+
"helpValue": "<tag>",
|
|
2949
|
+
"multiple": false,
|
|
2950
|
+
"type": "option"
|
|
2951
|
+
},
|
|
2952
|
+
"verbose": {
|
|
2953
|
+
"description": "Print detailed information during deployment",
|
|
2954
|
+
"name": "verbose",
|
|
2955
|
+
"allowNo": false,
|
|
2956
|
+
"type": "boolean"
|
|
2957
|
+
},
|
|
2958
|
+
"workspace": {
|
|
2959
|
+
"description": "The name of the workspace to deploy a schema for",
|
|
2960
|
+
"name": "workspace",
|
|
2961
|
+
"hasDynamicHelp": false,
|
|
2962
|
+
"helpValue": "<name>",
|
|
2963
|
+
"multiple": false,
|
|
2964
|
+
"type": "option"
|
|
2965
|
+
}
|
|
2966
|
+
},
|
|
2967
|
+
"hasDynamicHelp": false,
|
|
2968
|
+
"hiddenAliases": [],
|
|
2969
|
+
"id": "schema:deploy",
|
|
2970
|
+
"pluginAlias": "@sanity/cli",
|
|
2971
|
+
"pluginName": "@sanity/cli",
|
|
2972
|
+
"pluginType": "core",
|
|
2973
|
+
"strict": true,
|
|
2974
|
+
"isESM": true,
|
|
2975
|
+
"relativePath": [
|
|
2976
|
+
"dist",
|
|
2977
|
+
"commands",
|
|
2978
|
+
"schema",
|
|
2979
|
+
"deploy.js"
|
|
2980
|
+
]
|
|
2981
|
+
},
|
|
3021
2982
|
"schema:extract": {
|
|
3022
2983
|
"aliases": [],
|
|
3023
2984
|
"args": {},
|
|
@@ -3075,6 +3036,78 @@
|
|
|
3075
3036
|
"extract.js"
|
|
3076
3037
|
]
|
|
3077
3038
|
},
|
|
3039
|
+
"schema:list": {
|
|
3040
|
+
"aliases": [],
|
|
3041
|
+
"args": {},
|
|
3042
|
+
"description": "Lists all schemas in the current dataset.\n\n**Note**: This command is experimental and subject to change.\n\nThis operation (re-)generates a manifest file describing the sanity config workspace by default.\nTo re-use an existing manifest file, use --no-extract-manifest.",
|
|
3043
|
+
"examples": [
|
|
3044
|
+
{
|
|
3045
|
+
"command": "<%= config.bin %> <%= command.id %>",
|
|
3046
|
+
"description": "List all schemas found in any workspace dataset in a table"
|
|
3047
|
+
},
|
|
3048
|
+
{
|
|
3049
|
+
"command": "<%= config.bin %> <%= command.id %> --id _.schemas.workspaceName",
|
|
3050
|
+
"description": "Get a schema for a given id"
|
|
3051
|
+
},
|
|
3052
|
+
{
|
|
3053
|
+
"command": "<%= config.bin %> <%= command.id %> --json",
|
|
3054
|
+
"description": "Get stored schemas as pretty-printed json-array"
|
|
3055
|
+
},
|
|
3056
|
+
{
|
|
3057
|
+
"command": "<%= config.bin %> <%= command.id %> --json --id _.schemas.workspaceName",
|
|
3058
|
+
"description": "Get singular stored schema as pretty-printed json-object"
|
|
3059
|
+
},
|
|
3060
|
+
{
|
|
3061
|
+
"command": "<%= config.bin %> <%= command.id %> --no-extract-manifest",
|
|
3062
|
+
"description": "Runs using a pre-existing manifest file. Config changes in sanity.config will not be picked up in this case."
|
|
3063
|
+
}
|
|
3064
|
+
],
|
|
3065
|
+
"flags": {
|
|
3066
|
+
"extract-manifest": {
|
|
3067
|
+
"description": "Disables manifest generation - the command will fail if no manifest exists",
|
|
3068
|
+
"name": "extract-manifest",
|
|
3069
|
+
"allowNo": true,
|
|
3070
|
+
"type": "boolean"
|
|
3071
|
+
},
|
|
3072
|
+
"id": {
|
|
3073
|
+
"description": "Fetch a single schema by id",
|
|
3074
|
+
"name": "id",
|
|
3075
|
+
"hasDynamicHelp": false,
|
|
3076
|
+
"helpValue": "<schema_id>",
|
|
3077
|
+
"multiple": false,
|
|
3078
|
+
"type": "option"
|
|
3079
|
+
},
|
|
3080
|
+
"json": {
|
|
3081
|
+
"description": "Get schema as json",
|
|
3082
|
+
"name": "json",
|
|
3083
|
+
"allowNo": false,
|
|
3084
|
+
"type": "boolean"
|
|
3085
|
+
},
|
|
3086
|
+
"manifest-dir": {
|
|
3087
|
+
"description": "Directory containing manifest file",
|
|
3088
|
+
"name": "manifest-dir",
|
|
3089
|
+
"default": "./dist/static",
|
|
3090
|
+
"hasDynamicHelp": false,
|
|
3091
|
+
"helpValue": "<directory>",
|
|
3092
|
+
"multiple": false,
|
|
3093
|
+
"type": "option"
|
|
3094
|
+
}
|
|
3095
|
+
},
|
|
3096
|
+
"hasDynamicHelp": false,
|
|
3097
|
+
"hiddenAliases": [],
|
|
3098
|
+
"id": "schema:list",
|
|
3099
|
+
"pluginAlias": "@sanity/cli",
|
|
3100
|
+
"pluginName": "@sanity/cli",
|
|
3101
|
+
"pluginType": "core",
|
|
3102
|
+
"strict": true,
|
|
3103
|
+
"isESM": true,
|
|
3104
|
+
"relativePath": [
|
|
3105
|
+
"dist",
|
|
3106
|
+
"commands",
|
|
3107
|
+
"schema",
|
|
3108
|
+
"list.js"
|
|
3109
|
+
]
|
|
3110
|
+
},
|
|
3078
3111
|
"schema:validate": {
|
|
3079
3112
|
"aliases": [],
|
|
3080
3113
|
"args": {},
|
|
@@ -3508,6 +3541,118 @@
|
|
|
3508
3541
|
"list.js"
|
|
3509
3542
|
]
|
|
3510
3543
|
},
|
|
3544
|
+
"openapi:get": {
|
|
3545
|
+
"aliases": [],
|
|
3546
|
+
"args": {
|
|
3547
|
+
"slug": {
|
|
3548
|
+
"description": "Slug of the OpenAPI specification to retrieve",
|
|
3549
|
+
"name": "slug",
|
|
3550
|
+
"required": true
|
|
3551
|
+
}
|
|
3552
|
+
},
|
|
3553
|
+
"description": "Get an OpenAPI specification by slug",
|
|
3554
|
+
"examples": [
|
|
3555
|
+
{
|
|
3556
|
+
"command": "<%= config.bin %> <%= command.id %> query",
|
|
3557
|
+
"description": "Get a specification (YAML format, default)"
|
|
3558
|
+
},
|
|
3559
|
+
{
|
|
3560
|
+
"command": "<%= config.bin %> <%= command.id %> query --format=json",
|
|
3561
|
+
"description": "Get specification in JSON format"
|
|
3562
|
+
},
|
|
3563
|
+
{
|
|
3564
|
+
"command": "<%= config.bin %> <%= command.id %> query --web",
|
|
3565
|
+
"description": "Open specification in browser"
|
|
3566
|
+
},
|
|
3567
|
+
{
|
|
3568
|
+
"command": "<%= config.bin %> <%= command.id %> query > query-api.yaml",
|
|
3569
|
+
"description": "Pipe to file"
|
|
3570
|
+
}
|
|
3571
|
+
],
|
|
3572
|
+
"flags": {
|
|
3573
|
+
"format": {
|
|
3574
|
+
"description": "Output format: yaml (default), json",
|
|
3575
|
+
"name": "format",
|
|
3576
|
+
"default": "yaml",
|
|
3577
|
+
"hasDynamicHelp": false,
|
|
3578
|
+
"multiple": false,
|
|
3579
|
+
"options": [
|
|
3580
|
+
"yaml",
|
|
3581
|
+
"json"
|
|
3582
|
+
],
|
|
3583
|
+
"type": "option"
|
|
3584
|
+
},
|
|
3585
|
+
"web": {
|
|
3586
|
+
"char": "w",
|
|
3587
|
+
"description": "Open in web browser",
|
|
3588
|
+
"name": "web",
|
|
3589
|
+
"allowNo": false,
|
|
3590
|
+
"type": "boolean"
|
|
3591
|
+
}
|
|
3592
|
+
},
|
|
3593
|
+
"hasDynamicHelp": false,
|
|
3594
|
+
"hiddenAliases": [],
|
|
3595
|
+
"id": "openapi:get",
|
|
3596
|
+
"pluginAlias": "@sanity/cli",
|
|
3597
|
+
"pluginName": "@sanity/cli",
|
|
3598
|
+
"pluginType": "core",
|
|
3599
|
+
"strict": true,
|
|
3600
|
+
"isESM": true,
|
|
3601
|
+
"relativePath": [
|
|
3602
|
+
"dist",
|
|
3603
|
+
"commands",
|
|
3604
|
+
"openapi",
|
|
3605
|
+
"get.js"
|
|
3606
|
+
]
|
|
3607
|
+
},
|
|
3608
|
+
"openapi:list": {
|
|
3609
|
+
"aliases": [],
|
|
3610
|
+
"args": {},
|
|
3611
|
+
"description": "List all available OpenAPI specifications",
|
|
3612
|
+
"examples": [
|
|
3613
|
+
{
|
|
3614
|
+
"command": "<%= config.bin %> <%= command.id %>",
|
|
3615
|
+
"description": "List all available OpenAPI specs"
|
|
3616
|
+
},
|
|
3617
|
+
{
|
|
3618
|
+
"command": "<%= config.bin %> <%= command.id %> --json",
|
|
3619
|
+
"description": "List with JSON output"
|
|
3620
|
+
},
|
|
3621
|
+
{
|
|
3622
|
+
"command": "<%= config.bin %> <%= command.id %> --web",
|
|
3623
|
+
"description": "Open HTTP Reference in browser"
|
|
3624
|
+
}
|
|
3625
|
+
],
|
|
3626
|
+
"flags": {
|
|
3627
|
+
"json": {
|
|
3628
|
+
"description": "Output JSON",
|
|
3629
|
+
"name": "json",
|
|
3630
|
+
"allowNo": false,
|
|
3631
|
+
"type": "boolean"
|
|
3632
|
+
},
|
|
3633
|
+
"web": {
|
|
3634
|
+
"char": "w",
|
|
3635
|
+
"description": "Open HTTP Reference in web browser",
|
|
3636
|
+
"name": "web",
|
|
3637
|
+
"allowNo": false,
|
|
3638
|
+
"type": "boolean"
|
|
3639
|
+
}
|
|
3640
|
+
},
|
|
3641
|
+
"hasDynamicHelp": false,
|
|
3642
|
+
"hiddenAliases": [],
|
|
3643
|
+
"id": "openapi:list",
|
|
3644
|
+
"pluginAlias": "@sanity/cli",
|
|
3645
|
+
"pluginName": "@sanity/cli",
|
|
3646
|
+
"pluginType": "core",
|
|
3647
|
+
"strict": true,
|
|
3648
|
+
"isESM": true,
|
|
3649
|
+
"relativePath": [
|
|
3650
|
+
"dist",
|
|
3651
|
+
"commands",
|
|
3652
|
+
"openapi",
|
|
3653
|
+
"list.js"
|
|
3654
|
+
]
|
|
3655
|
+
},
|
|
3511
3656
|
"dataset:alias:create": {
|
|
3512
3657
|
"aliases": [],
|
|
3513
3658
|
"args": {
|
|
@@ -3802,5 +3947,5 @@
|
|
|
3802
3947
|
]
|
|
3803
3948
|
}
|
|
3804
3949
|
},
|
|
3805
|
-
"version": "6.0.0-alpha.
|
|
3950
|
+
"version": "6.0.0-alpha.6"
|
|
3806
3951
|
}
|