Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema draft for WinGet configure #2851

Merged
merged 5 commits into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actions/spelling/allow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ dotnet
downlevel
downloader
downloaders
dsc
dsx
dword
DWORDLONG
Expand Down
132 changes: 132 additions & 0 deletions schemas/JSON/configuration/configuration.schema.0.1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
{
"$id": "https://aka.ms/schemas/dsc/configuration.schema.0.1.yaml",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "A representation of a configuration used by an orchestrator for WinDSC.",
"type": "object",
"properties": {
"assertions": {
"type": "array",
"items": { "$ref": "#/defs/resource" }
},
"resources": {
"type": "array",
"items": { "$ref": "#/defs/resource" }
},
"parameters": {
"type": "array",
"items": { "$ref": "#/defs/resource" },
"description": "Resources that retrieve information via a 'get' operation."
},
"configurationVersion": {
"type": "string",
"default": "0.1",
"pattern": "^(?P<major>0|[1-9]\\d*)\\.(?P<minor>0|[1-9]\\d*)\\.(?P<patch>0|[1-9]\\d*)(?:-(?P<prerelease>(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"description": "The configuration syntax version"
}
},
"$defs": {
"resource": {
"type": "object",
"properties": {
"resource": {
"type": "string",
"maxLength": 128,
"description": "The name of the resource."
},
"id": {
"$ref": "#/defs/id"
},
"dependsOn": {
"type": [ "array", "null" ],
"items": {
"type": "string"
},
"uniqueItems": true,
"description": "The list of resource ids identifying dependencies."
},
"directives": {
"type": "object",
"properties": {
"module": {
"$ref": "#/defs/module"
},
"description": {
"$ref": "#/defs/description"
},
"requiredVersion": {
"$ref": "#/defs/version"
},
"timeoutSeconds": {
"type": "integer",
"minimum": 0,
"maximum": 6000,
"description": "The number of seconds to wait before timing out."
},
"runAs": {
"type": "string",
"enum": [
"admin",
"user"
],
"description": "Enum determining whether to run as admin or user. Default is user."
},
"sha256Hash": {
"type": "string",
"pattern": "^[A-Fa-f0-9]{64}$",
"description": "SHA256 hash of the resource."
},
"optional": {
"type": [ "boolean", "null" ],
"description": "Indicates whether to inform the orchestrator to prompt user for install. Default is false."
},
"confirm": {
"type": [ "boolean", "null" ],
"description": "Indicates whether to prompt the user for confirmation before initiation."
},
"signerThumbprint": {
"type": "string",
"pattern": "^[A-Fa-f0-9]{40}$",
"description": "The signer thumbprint."
},
"onFailure": {
"type": "string",
"enum": [
"continue",
"stop"
],
"description": "Determines the behavior if a failure is encountered."
}
},
"additionalProperties": true
},
"settings": {
"type": "object"
}
},
"required": [
"resource",
"id"
ryfu-msft marked this conversation as resolved.
Show resolved Hide resolved
]
},
"id": {
"type": "string",
"maxLength": 128,
"description": "The identifier of this item."
},
"module": {
"type": "string",
"maxLength": 128,
"description": "The name of the module."
},
"description": {
"type": "string",
"maxLength": 512,
"description": "The description of the desired state."
},
"version": {
"type": "string",
"pattern": "^(?P<major>0|[1-9]\\d*)\\.(?P<minor>0|[1-9]\\d*)\\.(?P<patch>0|[1-9]\\d*)(?:-(?P<prerelease>(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"maxLength": 128
}
}
}