Add requiredSaleorVersion field to AppManifest (#186)

* Add requiredSaleorVersion field to AppManifest

* Create .changeset/great-dogs-cheer.md

* Update types.ts

* Update src/types.ts

Co-authored-by: Przemysław Łada <przlada@gmail.com>

---------

Co-authored-by: Przemysław Łada <przlada@gmail.com>
This commit is contained in:
Lukasz Ostrowski 2023-03-14 13:41:46 +01:00 committed by GitHub
parent f7d38dc8d7
commit 5744aa4ffd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
"@saleor/app-sdk": minor
---
Add requiredSaleorVersion field to AppManifest, so Saleor can validate it during installation

View file

@ -249,4 +249,18 @@ export interface AppManifest {
Be aware that subscription queries are required in manifest sections
*/
webhooks?: WebhookManifest[];
/**
* Allows app installation for specific Saleor versions, using semver.
* https://github.com/npm/node-semver#versions
*
* If not set, Saleor will allow installation for every version
*
* In Saleor versions lower than 3.13, this field will be ignored
*
* Examples:
* ">=3.10" - allow for versions 3.10 or newer
* ">=3.10 <4" - allow for versions 3.10 and newer, but not 4.0 and newer
* ">=3.10 <4 || 4.0.0" - 3.10 and newer, less than 4, but allow exactly 4.0.0
*/
requiredSaleorVersion?: string;
}