signs of life
This commit is contained in:
21
docs/windows-ssh.md
Normal file
21
docs/windows-ssh.md
Normal file
@@ -0,0 +1,21 @@
|
||||
https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=powershell&pivots=windows-server-2025
|
||||
|
||||
|
||||
if (!(Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue)) {
|
||||
Write-Output "Firewall Rule 'OpenSSH-Server-In-TCP' does not exist, creating it..."
|
||||
New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 2222
|
||||
} else {
|
||||
Write-Output "Firewall rule 'OpenSSH-Server-In-TCP' has been created and exists."
|
||||
}
|
||||
|
||||
|
||||
|
||||
https://learn.microsoft.com/en-us/windows/wsl/networking#mirrored-mode-networking
|
||||
|
||||
New-NetFirewallHyperVRule -Name "WslSshServer" -DisplayName "WslSshServer" -Direction Inbound -VMCreatorId '{40E0AC32-46A5-438A-A0B2-2B479E8F2E90}' -Protocol TCP -LocalPorts 22
|
||||
|
||||
|
||||
Get-NetFirewallHyperVRule |
|
||||
Where-Object { $_.Enabled -eq 'True' } |
|
||||
Get-NetFirewallPortFilter |
|
||||
Where-Object { $_.LocalPort -eq 22 }
|
||||
@@ -23,7 +23,7 @@
|
||||
"@biomejs/biome": "2.3.8",
|
||||
"@effect/language-service": "^0.57.1",
|
||||
"@types/bun": "latest",
|
||||
"turbo": "^2.6.1",
|
||||
"turbo": "^2.6.3",
|
||||
"typescript": "^5.9.3",
|
||||
"ultracite": "6.3.8"
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ const generateIndexFile = (
|
||||
];
|
||||
|
||||
for (const { filename, typeName } of resourceTypes) {
|
||||
lines.push(`export * as ${typeName} from './${filename}';`);
|
||||
lines.push(`export * as ${typeName} from './${filename}.gen';`);
|
||||
}
|
||||
|
||||
lines.push('');
|
||||
@@ -212,6 +212,45 @@ const generateDscConfigTypes = (
|
||||
return lines.join('\n');
|
||||
};
|
||||
|
||||
/**
|
||||
* Generate a resource union file that provides strong typing for the configuration DSL
|
||||
*/
|
||||
const generateResourceUnion = (
|
||||
resourceTypes: Array<{ type: string; filename: string; typeName: string }>,
|
||||
) => {
|
||||
const lines = [
|
||||
'// This file is auto-generated. Do not edit manually.',
|
||||
"import * as S from 'effect/Schema';",
|
||||
"import * as Resources from './index';",
|
||||
'',
|
||||
'/**',
|
||||
' * A discriminated union of all available DSC resources with their specific properties',
|
||||
' */',
|
||||
'export const ResourceUnion = S.Union(',
|
||||
];
|
||||
|
||||
for (const { type, typeName } of resourceTypes) {
|
||||
lines.push(' S.Struct({');
|
||||
lines.push(` type: S.Literal("${type}"),`);
|
||||
lines.push(' name: S.String,');
|
||||
lines.push(' dependsOn: S.optional(S.Array(S.String)),');
|
||||
lines.push(` properties: Resources.${typeName}.${typeName},`);
|
||||
lines.push(
|
||||
' metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),',
|
||||
);
|
||||
lines.push(' }),');
|
||||
}
|
||||
|
||||
lines.push(');');
|
||||
lines.push('');
|
||||
lines.push(
|
||||
'export type ResourceUnion = S.Schema.Type<typeof ResourceUnion>;',
|
||||
);
|
||||
lines.push('');
|
||||
|
||||
return lines.join('\n');
|
||||
};
|
||||
|
||||
const genDscResourcesTypes = Effect.gen(function* () {
|
||||
yield* Effect.log('Starting DSC resources types generation...');
|
||||
|
||||
@@ -320,6 +359,12 @@ const genDscResourcesTypes = Effect.gen(function* () {
|
||||
const typesListPath = path.join(outputDir, '_resource-types.gen.ts');
|
||||
yield* fs.writeFileString(typesListPath, typesListContent);
|
||||
yield* Effect.log('Generated: _resource-types.gen.ts');
|
||||
|
||||
// Generate resource union file
|
||||
const unionContent = generateResourceUnion(generatedTypes);
|
||||
const unionPath = path.join(outputDir, '_resource-union.gen.ts');
|
||||
yield* fs.writeFileString(unionPath, unionContent);
|
||||
yield* Effect.log('Generated: _resource-union.gen.ts');
|
||||
}
|
||||
|
||||
yield* Effect.log('');
|
||||
|
||||
@@ -64,18 +64,28 @@ function getRefName(ref: string): string {
|
||||
return parts.at(-1) ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a schema represents null
|
||||
*/
|
||||
function isJsonSchemaNull(s: JsonSchema): boolean {
|
||||
return (
|
||||
typeof s === 'object' &&
|
||||
s !== null &&
|
||||
(s.type === 'null' || ('const' in s && s.const === null))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a schema is nullable (has null in type array, nullable: true, or null in oneOf/anyOf)
|
||||
*/
|
||||
function isNullable(schema: JsonSchema): boolean {
|
||||
if (typeof schema !== 'object' || schema === null) return false;
|
||||
if (schema.nullable) return true;
|
||||
if (Array.isArray(schema.type) && schema.type.includes('null')) return true;
|
||||
// Check for null in oneOf/anyOf
|
||||
const items = schema.oneOf || schema.anyOf;
|
||||
if (items) {
|
||||
return items.some(
|
||||
(s) => s.type === 'null' || ('const' in s && s.const === null),
|
||||
);
|
||||
return items.some(isJsonSchemaNull);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -84,6 +94,7 @@ function isNullable(schema: JsonSchema): boolean {
|
||||
* Get the non-null type from a schema
|
||||
*/
|
||||
function getNonNullType(schema: JsonSchema): string | undefined {
|
||||
if (typeof schema !== 'object' || schema === null) return;
|
||||
if (Array.isArray(schema.type)) {
|
||||
const nonNull = schema.type.filter((t) => t !== 'null');
|
||||
return nonNull.length === 1 ? nonNull[0] : undefined;
|
||||
@@ -121,6 +132,7 @@ function findDependencies(schema: JsonSchema): Set<string> {
|
||||
const deps = new Set<string>();
|
||||
|
||||
function traverse(s: JsonSchema): void {
|
||||
if (typeof s !== 'object' || s === null) return;
|
||||
if (s.$ref) {
|
||||
deps.add(getRefName(s.$ref));
|
||||
}
|
||||
@@ -271,6 +283,9 @@ function sortDefinitions(
|
||||
* Generate TypeScript type for a JSON Schema (used for recursive type declarations)
|
||||
*/
|
||||
function generateTsType(schema: JsonSchema, _ctx: ConversionContext): string {
|
||||
if (typeof schema === 'boolean') {
|
||||
return schema ? 'any' : 'never';
|
||||
}
|
||||
if (schema.$ref) {
|
||||
const refName = getRefName(schema.$ref);
|
||||
const pascalName = toPascalCase(refName);
|
||||
@@ -290,7 +305,7 @@ function generateTsType(schema: JsonSchema, _ctx: ConversionContext): string {
|
||||
if (schema.oneOf || schema.anyOf) {
|
||||
const items = schema.oneOf || schema.anyOf || [];
|
||||
const types = items
|
||||
.filter((s) => s.type !== 'null' && !('const' in s && s.const === null))
|
||||
.filter((s) => !isJsonSchemaNull(s))
|
||||
.map((s) => generateTsType(s, _ctx));
|
||||
return types.join(' | ');
|
||||
}
|
||||
@@ -362,6 +377,9 @@ function generateEffectSchema(
|
||||
schema: JsonSchema,
|
||||
ctx: ConversionContext,
|
||||
): string {
|
||||
if (typeof schema === 'boolean') {
|
||||
return schema ? 'S.Unknown' : 'S.Never';
|
||||
}
|
||||
// Handle $ref
|
||||
if (schema.$ref) {
|
||||
const refName = getRefName(schema.$ref);
|
||||
@@ -394,9 +412,7 @@ function generateEffectSchema(
|
||||
// Handle oneOf / anyOf (union)
|
||||
if (schema.oneOf || schema.anyOf) {
|
||||
const items = schema.oneOf || schema.anyOf || [];
|
||||
const nonNullItems = items.filter(
|
||||
(s) => s.type !== 'null' && !('const' in s && s.const === null),
|
||||
);
|
||||
const nonNullItems = items.filter((s) => !isJsonSchemaNull(s));
|
||||
|
||||
if (nonNullItems.length === 0) {
|
||||
return 'S.Null';
|
||||
@@ -406,18 +422,14 @@ function generateEffectSchema(
|
||||
const firstItem = nonNullItems[0];
|
||||
if (!firstItem) return 'S.Unknown';
|
||||
const innerSchema = generateEffectSchema(firstItem, ctx);
|
||||
const hasNull = items.some(
|
||||
(s) => s.type === 'null' || ('const' in s && s.const === null),
|
||||
);
|
||||
const hasNull = items.some(isJsonSchemaNull);
|
||||
return hasNull ? `S.NullOr(${innerSchema})` : innerSchema;
|
||||
}
|
||||
|
||||
const members = nonNullItems
|
||||
.map((s) => generateEffectSchema(s, ctx))
|
||||
.join(', ');
|
||||
const hasNull = items.some(
|
||||
(s) => s.type === 'null' || ('const' in s && s.const === null),
|
||||
);
|
||||
const hasNull = items.some(isJsonSchemaNull);
|
||||
return hasNull ? `S.Union(${members}, S.Null)` : `S.Union(${members})`;
|
||||
}
|
||||
|
||||
|
||||
95
src/bin.ts
95
src/bin.ts
@@ -1,38 +1,97 @@
|
||||
import { Command } from '@effect/cli';
|
||||
import { Command as PlatformCommand } from '@effect/platform';
|
||||
import { BunContext, BunRuntime } from '@effect/platform-bun';
|
||||
import { Effect } from 'effect';
|
||||
import pkg from '../package.json' with { type: 'json' };
|
||||
import { defineConfig } from './dsl';
|
||||
import { CommandUtils } from './utils';
|
||||
import {
|
||||
decodeAndPrettyLogTestResult,
|
||||
decodeAndPrettyLogSetResult,
|
||||
} from './dsc-utils';
|
||||
|
||||
import type { Configuration } from './dsc-schema-types/configuration.gen';
|
||||
|
||||
const machineConfig: typeof Configuration.Type = {
|
||||
const machineConfig = defineConfig({
|
||||
$schema: 'https://aka.ms/dsc/schemas/v3/config/document.json',
|
||||
resources: [
|
||||
// {
|
||||
// name: 'example-registry-key',
|
||||
// type: 'Microsoft.Windows/Registry',
|
||||
// properties: {
|
||||
// keyPath: 'HKCU\\Software\\WinosConfig',
|
||||
// valueName: 'Version',
|
||||
// valueData: {
|
||||
// String: pkg.version,
|
||||
// },
|
||||
// _exist: true,
|
||||
// },
|
||||
// },
|
||||
{
|
||||
name: 'must be unique',
|
||||
type: 'Microsoft.Windows/Registry',
|
||||
name: 'Ripgrep',
|
||||
type: 'Microsoft.WinGet/Package',
|
||||
properties: {
|
||||
keyPath: 'HKCU\\example\\key',
|
||||
valueName: 'Example',
|
||||
valueData: {
|
||||
String: 'Example Value',
|
||||
},
|
||||
id: 'BurntSushi.ripgrep.MSVC',
|
||||
_exist: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
|
||||
const diffCommand = Command.make('diff', {}, () =>
|
||||
const runDscConfig = (
|
||||
subcommand: 'set' | 'test',
|
||||
options: { whatIf?: boolean } = {},
|
||||
) =>
|
||||
Effect.gen(function* () {
|
||||
yield* Effect.log('diff');
|
||||
yield* Effect.log('diff2');
|
||||
const args = ['config', subcommand, '--file', '-'];
|
||||
if (options.whatIf) {
|
||||
args.push('--what-if');
|
||||
}
|
||||
|
||||
yield* Effect.logDebug(`Running dsc ${args.join(' ')}`);
|
||||
|
||||
const command = PlatformCommand.make('dsc', ...args).pipe(
|
||||
PlatformCommand.feed(JSON.stringify(machineConfig)),
|
||||
);
|
||||
|
||||
const { exitCode, stdout, stderr } =
|
||||
yield* CommandUtils.runCommandBuffered(command);
|
||||
|
||||
if (stderr) {
|
||||
yield* Effect.logError(stderr);
|
||||
}
|
||||
|
||||
if (exitCode !== 0) {
|
||||
yield* Effect.logError(`DSC exited with code ${exitCode}`);
|
||||
}
|
||||
|
||||
if (stdout) {
|
||||
if (subcommand === 'test') {
|
||||
yield* decodeAndPrettyLogTestResult(stdout);
|
||||
} else if (subcommand === 'set') {
|
||||
yield* decodeAndPrettyLogSetResult(stdout);
|
||||
} else {
|
||||
try {
|
||||
const parsed = JSON.parse(stdout);
|
||||
yield* Effect.log(JSON.stringify(parsed, null, 2));
|
||||
} catch {
|
||||
yield* Effect.log(stdout);
|
||||
}
|
||||
}
|
||||
} else if (exitCode === 0 && !stderr) {
|
||||
yield* Effect.log('DSC completed successfully with no output.');
|
||||
}
|
||||
});
|
||||
|
||||
const setCommand = Command.make('set', {}, () =>
|
||||
Effect.gen(function* () {
|
||||
yield* Effect.log('Applying configuration changes...');
|
||||
yield* runDscConfig('set').pipe(Effect.scoped);
|
||||
}),
|
||||
);
|
||||
|
||||
const applyCommand = Command.make('apply', {}, () =>
|
||||
const testCommand = Command.make('test', {}, () =>
|
||||
Effect.gen(function* () {
|
||||
yield* Effect.log('apply');
|
||||
yield* Effect.log('apply2');
|
||||
yield* Effect.log('Running configuration test...');
|
||||
yield* runDscConfig('test').pipe(Effect.scoped);
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -40,7 +99,7 @@ const cliName = 'winos-config';
|
||||
|
||||
const app = Command.make(cliName, {}).pipe(
|
||||
Command.withDescription('NixOS-like tool for windows'),
|
||||
Command.withSubcommands([diffCommand, applyCommand]),
|
||||
Command.withSubcommands([setCommand, testCommand]),
|
||||
);
|
||||
|
||||
const cli = Command.run(app, {
|
||||
|
||||
106
src/dsc-resource-schema-types/_resource-types.gen.ts
Normal file
106
src/dsc-resource-schema-types/_resource-types.gen.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
/**
|
||||
* All available DSC resource types on this system
|
||||
*/
|
||||
export const DscResourceTypes = S.Literal(
|
||||
'Microsoft.DSC.Debug/Echo',
|
||||
'Microsoft.DSC.Transitional/RunCommandOnSet',
|
||||
'Microsoft.PowerToys/AdvancedPasteSettings',
|
||||
'Microsoft.PowerToys/AlwaysOnTopSettings',
|
||||
'Microsoft.PowerToys/AppSettings',
|
||||
'Microsoft.PowerToys/AwakeSettings',
|
||||
'Microsoft.PowerToys/ColorPickerSettings',
|
||||
'Microsoft.PowerToys/CropAndLockSettings',
|
||||
'Microsoft.PowerToys/EnvironmentVariablesSettings',
|
||||
'Microsoft.PowerToys/FancyZonesSettings',
|
||||
'Microsoft.PowerToys/FileLocksmithSettings',
|
||||
'Microsoft.PowerToys/FindMyMouseSettings',
|
||||
'Microsoft.PowerToys/HostsSettings',
|
||||
'Microsoft.PowerToys/ImageResizerSettings',
|
||||
'Microsoft.PowerToys/KeyboardManagerSettings',
|
||||
'Microsoft.PowerToys/MeasureToolSettings',
|
||||
'Microsoft.PowerToys/MouseHighlighterSettings',
|
||||
'Microsoft.PowerToys/MouseJumpSettings',
|
||||
'Microsoft.PowerToys/MousePointerCrosshairsSettings',
|
||||
'Microsoft.PowerToys/PeekSettings',
|
||||
'Microsoft.PowerToys/PowerAccentSettings',
|
||||
'Microsoft.PowerToys/PowerOCRSettings',
|
||||
'Microsoft.PowerToys/PowerRenameSettings',
|
||||
'Microsoft.PowerToys/RegistryPreviewSettings',
|
||||
'Microsoft.PowerToys/ShortcutGuideSettings',
|
||||
'Microsoft.PowerToys/WorkspacesSettings',
|
||||
'Microsoft.PowerToys/ZoomItSettings',
|
||||
'Microsoft.WinGet/AdminSettings',
|
||||
'Microsoft.WinGet/Package',
|
||||
'Microsoft.WinGet/Source',
|
||||
'Microsoft.WinGet/UserSettingsFile',
|
||||
'Microsoft.Windows/RebootPending',
|
||||
'Microsoft.Windows/Registry',
|
||||
'Microsoft/OSInfo',
|
||||
);
|
||||
|
||||
export type DscResourceType = S.Schema.Type<typeof DscResourceTypes>;
|
||||
|
||||
/**
|
||||
* Map of resource type to generated file
|
||||
*/
|
||||
export const ResourceTypeToFile = {
|
||||
'Microsoft.DSC.Debug/Echo': 'microsoft-dsc-debug-echo.gen',
|
||||
'Microsoft.DSC.Transitional/RunCommandOnSet':
|
||||
'microsoft-dsc-transitional-runcommandonset.gen',
|
||||
'Microsoft.PowerToys/AdvancedPasteSettings':
|
||||
'microsoft-powertoys-advancedpastesettings.gen',
|
||||
'Microsoft.PowerToys/AlwaysOnTopSettings':
|
||||
'microsoft-powertoys-alwaysontopsettings.gen',
|
||||
'Microsoft.PowerToys/AppSettings': 'microsoft-powertoys-appsettings.gen',
|
||||
'Microsoft.PowerToys/AwakeSettings': 'microsoft-powertoys-awakesettings.gen',
|
||||
'Microsoft.PowerToys/ColorPickerSettings':
|
||||
'microsoft-powertoys-colorpickersettings.gen',
|
||||
'Microsoft.PowerToys/CropAndLockSettings':
|
||||
'microsoft-powertoys-cropandlocksettings.gen',
|
||||
'Microsoft.PowerToys/EnvironmentVariablesSettings':
|
||||
'microsoft-powertoys-environmentvariablessettings.gen',
|
||||
'Microsoft.PowerToys/FancyZonesSettings':
|
||||
'microsoft-powertoys-fancyzonessettings.gen',
|
||||
'Microsoft.PowerToys/FileLocksmithSettings':
|
||||
'microsoft-powertoys-filelocksmithsettings.gen',
|
||||
'Microsoft.PowerToys/FindMyMouseSettings':
|
||||
'microsoft-powertoys-findmymousesettings.gen',
|
||||
'Microsoft.PowerToys/HostsSettings': 'microsoft-powertoys-hostssettings.gen',
|
||||
'Microsoft.PowerToys/ImageResizerSettings':
|
||||
'microsoft-powertoys-imageresizersettings.gen',
|
||||
'Microsoft.PowerToys/KeyboardManagerSettings':
|
||||
'microsoft-powertoys-keyboardmanagersettings.gen',
|
||||
'Microsoft.PowerToys/MeasureToolSettings':
|
||||
'microsoft-powertoys-measuretoolsettings.gen',
|
||||
'Microsoft.PowerToys/MouseHighlighterSettings':
|
||||
'microsoft-powertoys-mousehighlightersettings.gen',
|
||||
'Microsoft.PowerToys/MouseJumpSettings':
|
||||
'microsoft-powertoys-mousejumpsettings.gen',
|
||||
'Microsoft.PowerToys/MousePointerCrosshairsSettings':
|
||||
'microsoft-powertoys-mousepointercrosshairssettings.gen',
|
||||
'Microsoft.PowerToys/PeekSettings': 'microsoft-powertoys-peeksettings.gen',
|
||||
'Microsoft.PowerToys/PowerAccentSettings':
|
||||
'microsoft-powertoys-poweraccentsettings.gen',
|
||||
'Microsoft.PowerToys/PowerOCRSettings':
|
||||
'microsoft-powertoys-powerocrsettings.gen',
|
||||
'Microsoft.PowerToys/PowerRenameSettings':
|
||||
'microsoft-powertoys-powerrenamesettings.gen',
|
||||
'Microsoft.PowerToys/RegistryPreviewSettings':
|
||||
'microsoft-powertoys-registrypreviewsettings.gen',
|
||||
'Microsoft.PowerToys/ShortcutGuideSettings':
|
||||
'microsoft-powertoys-shortcutguidesettings.gen',
|
||||
'Microsoft.PowerToys/WorkspacesSettings':
|
||||
'microsoft-powertoys-workspacessettings.gen',
|
||||
'Microsoft.PowerToys/ZoomItSettings':
|
||||
'microsoft-powertoys-zoomitsettings.gen',
|
||||
'Microsoft.WinGet/AdminSettings': 'microsoft-winget-adminsettings.gen',
|
||||
'Microsoft.WinGet/Package': 'microsoft-winget-package.gen',
|
||||
'Microsoft.WinGet/Source': 'microsoft-winget-source.gen',
|
||||
'Microsoft.WinGet/UserSettingsFile': 'microsoft-winget-usersettingsfile.gen',
|
||||
'Microsoft.Windows/RebootPending': 'microsoft-windows-rebootpending.gen',
|
||||
'Microsoft.Windows/Registry': 'microsoft-windows-registry.gen',
|
||||
'Microsoft/OSInfo': 'microsoft-osinfo.gen',
|
||||
} as const;
|
||||
300
src/dsc-resource-schema-types/_resource-union.gen.ts
Normal file
300
src/dsc-resource-schema-types/_resource-union.gen.ts
Normal file
@@ -0,0 +1,300 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
import * as Resources from './index';
|
||||
|
||||
/**
|
||||
* A discriminated union of all available DSC resources with their specific properties
|
||||
*/
|
||||
export const ResourceUnion = S.Union(
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.DSC.Debug/Echo'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties: Resources.MicrosoftDSCDebugEcho.MicrosoftDSCDebugEcho,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.DSC.Transitional/RunCommandOnSet'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftDSCTransitionalRunCommandOnSet
|
||||
.MicrosoftDSCTransitionalRunCommandOnSet,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/AdvancedPasteSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysAdvancedPasteSettings
|
||||
.MicrosoftPowerToysAdvancedPasteSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/AlwaysOnTopSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysAlwaysOnTopSettings
|
||||
.MicrosoftPowerToysAlwaysOnTopSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/AppSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysAppSettings.MicrosoftPowerToysAppSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/AwakeSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysAwakeSettings.MicrosoftPowerToysAwakeSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/ColorPickerSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysColorPickerSettings
|
||||
.MicrosoftPowerToysColorPickerSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/CropAndLockSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysCropAndLockSettings
|
||||
.MicrosoftPowerToysCropAndLockSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/EnvironmentVariablesSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysEnvironmentVariablesSettings
|
||||
.MicrosoftPowerToysEnvironmentVariablesSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/FancyZonesSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysFancyZonesSettings
|
||||
.MicrosoftPowerToysFancyZonesSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/FileLocksmithSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysFileLocksmithSettings
|
||||
.MicrosoftPowerToysFileLocksmithSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/FindMyMouseSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysFindMyMouseSettings
|
||||
.MicrosoftPowerToysFindMyMouseSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/HostsSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysHostsSettings.MicrosoftPowerToysHostsSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/ImageResizerSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysImageResizerSettings
|
||||
.MicrosoftPowerToysImageResizerSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/KeyboardManagerSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysKeyboardManagerSettings
|
||||
.MicrosoftPowerToysKeyboardManagerSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/MeasureToolSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysMeasureToolSettings
|
||||
.MicrosoftPowerToysMeasureToolSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/MouseHighlighterSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysMouseHighlighterSettings
|
||||
.MicrosoftPowerToysMouseHighlighterSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/MouseJumpSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysMouseJumpSettings
|
||||
.MicrosoftPowerToysMouseJumpSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/MousePointerCrosshairsSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysMousePointerCrosshairsSettings
|
||||
.MicrosoftPowerToysMousePointerCrosshairsSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/PeekSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysPeekSettings.MicrosoftPowerToysPeekSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/PowerAccentSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysPowerAccentSettings
|
||||
.MicrosoftPowerToysPowerAccentSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/PowerOCRSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysPowerOCRSettings
|
||||
.MicrosoftPowerToysPowerOCRSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/PowerRenameSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysPowerRenameSettings
|
||||
.MicrosoftPowerToysPowerRenameSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/RegistryPreviewSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysRegistryPreviewSettings
|
||||
.MicrosoftPowerToysRegistryPreviewSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/ShortcutGuideSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysShortcutGuideSettings
|
||||
.MicrosoftPowerToysShortcutGuideSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/WorkspacesSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysWorkspacesSettings
|
||||
.MicrosoftPowerToysWorkspacesSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.PowerToys/ZoomItSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftPowerToysZoomItSettings
|
||||
.MicrosoftPowerToysZoomItSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.WinGet/AdminSettings'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftWinGetAdminSettings.MicrosoftWinGetAdminSettings,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.WinGet/Package'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties: Resources.MicrosoftWinGetPackage.MicrosoftWinGetPackage,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.WinGet/Source'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties: Resources.MicrosoftWinGetSource.MicrosoftWinGetSource,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.WinGet/UserSettingsFile'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftWinGetUserSettingsFile.MicrosoftWinGetUserSettingsFile,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.Windows/RebootPending'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties:
|
||||
Resources.MicrosoftWindowsRebootPending.MicrosoftWindowsRebootPending,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft.Windows/Registry'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties: Resources.MicrosoftWindowsRegistry.MicrosoftWindowsRegistry,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
S.Struct({
|
||||
type: S.Literal('Microsoft/OSInfo'),
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.Array(S.String)),
|
||||
properties: Resources.MicrosoftOSInfo.MicrosoftOSInfo,
|
||||
metadata: S.optional(S.Record({ key: S.String, value: S.Unknown })),
|
||||
}),
|
||||
);
|
||||
|
||||
export type ResourceUnion = S.Schema.Type<typeof ResourceUnion>;
|
||||
37
src/dsc-resource-schema-types/index.ts
Normal file
37
src/dsc-resource-schema-types/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
// Re-exports all DSC resource schema types
|
||||
|
||||
export * as MicrosoftDSCDebugEcho from './microsoft-dsc-debug-echo.gen';
|
||||
export * as MicrosoftDSCTransitionalRunCommandOnSet from './microsoft-dsc-transitional-runcommandonset.gen';
|
||||
export * as MicrosoftOSInfo from './microsoft-osinfo.gen';
|
||||
export * as MicrosoftPowerToysAdvancedPasteSettings from './microsoft-powertoys-advancedpastesettings.gen';
|
||||
export * as MicrosoftPowerToysAlwaysOnTopSettings from './microsoft-powertoys-alwaysontopsettings.gen';
|
||||
export * as MicrosoftPowerToysAppSettings from './microsoft-powertoys-appsettings.gen';
|
||||
export * as MicrosoftPowerToysAwakeSettings from './microsoft-powertoys-awakesettings.gen';
|
||||
export * as MicrosoftPowerToysColorPickerSettings from './microsoft-powertoys-colorpickersettings.gen';
|
||||
export * as MicrosoftPowerToysCropAndLockSettings from './microsoft-powertoys-cropandlocksettings.gen';
|
||||
export * as MicrosoftPowerToysEnvironmentVariablesSettings from './microsoft-powertoys-environmentvariablessettings.gen';
|
||||
export * as MicrosoftPowerToysFancyZonesSettings from './microsoft-powertoys-fancyzonessettings.gen';
|
||||
export * as MicrosoftPowerToysFileLocksmithSettings from './microsoft-powertoys-filelocksmithsettings.gen';
|
||||
export * as MicrosoftPowerToysFindMyMouseSettings from './microsoft-powertoys-findmymousesettings.gen';
|
||||
export * as MicrosoftPowerToysHostsSettings from './microsoft-powertoys-hostssettings.gen';
|
||||
export * as MicrosoftPowerToysImageResizerSettings from './microsoft-powertoys-imageresizersettings.gen';
|
||||
export * as MicrosoftPowerToysKeyboardManagerSettings from './microsoft-powertoys-keyboardmanagersettings.gen';
|
||||
export * as MicrosoftPowerToysMeasureToolSettings from './microsoft-powertoys-measuretoolsettings.gen';
|
||||
export * as MicrosoftPowerToysMouseHighlighterSettings from './microsoft-powertoys-mousehighlightersettings.gen';
|
||||
export * as MicrosoftPowerToysMouseJumpSettings from './microsoft-powertoys-mousejumpsettings.gen';
|
||||
export * as MicrosoftPowerToysMousePointerCrosshairsSettings from './microsoft-powertoys-mousepointercrosshairssettings.gen';
|
||||
export * as MicrosoftPowerToysPeekSettings from './microsoft-powertoys-peeksettings.gen';
|
||||
export * as MicrosoftPowerToysPowerAccentSettings from './microsoft-powertoys-poweraccentsettings.gen';
|
||||
export * as MicrosoftPowerToysPowerOCRSettings from './microsoft-powertoys-powerocrsettings.gen';
|
||||
export * as MicrosoftPowerToysPowerRenameSettings from './microsoft-powertoys-powerrenamesettings.gen';
|
||||
export * as MicrosoftPowerToysRegistryPreviewSettings from './microsoft-powertoys-registrypreviewsettings.gen';
|
||||
export * as MicrosoftPowerToysShortcutGuideSettings from './microsoft-powertoys-shortcutguidesettings.gen';
|
||||
export * as MicrosoftPowerToysWorkspacesSettings from './microsoft-powertoys-workspacessettings.gen';
|
||||
export * as MicrosoftPowerToysZoomItSettings from './microsoft-powertoys-zoomitsettings.gen';
|
||||
export * as MicrosoftWindowsRebootPending from './microsoft-windows-rebootpending.gen';
|
||||
export * as MicrosoftWindowsRegistry from './microsoft-windows-registry.gen';
|
||||
export * as MicrosoftWinGetAdminSettings from './microsoft-winget-adminsettings.gen';
|
||||
export * as MicrosoftWinGetPackage from './microsoft-winget-package.gen';
|
||||
export * as MicrosoftWinGetSource from './microsoft-winget-source.gen';
|
||||
export * as MicrosoftWinGetUserSettingsFile from './microsoft-winget-usersettingsfile.gen';
|
||||
@@ -0,0 +1,18 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const Output = S.Union(
|
||||
S.Array(S.Unknown),
|
||||
S.Boolean,
|
||||
S.Number,
|
||||
S.Unknown,
|
||||
S.Unknown,
|
||||
S.String,
|
||||
S.String,
|
||||
);
|
||||
export type Output = S.Schema.Type<typeof Output>;
|
||||
|
||||
export const MicrosoftDSCDebugEcho = S.Struct({
|
||||
output: Output,
|
||||
});
|
||||
export type MicrosoftDSCDebugEcho = S.Schema.Type<typeof MicrosoftDSCDebugEcho>;
|
||||
@@ -0,0 +1,11 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftDSCTransitionalRunCommandOnSet = S.Struct({
|
||||
arguments: S.optional(S.Array(S.Unknown)),
|
||||
executable: S.String,
|
||||
exitCode: S.optional(S.Number),
|
||||
});
|
||||
export type MicrosoftDSCTransitionalRunCommandOnSet = S.Schema.Type<
|
||||
typeof MicrosoftDSCTransitionalRunCommandOnSet
|
||||
>;
|
||||
17
src/dsc-resource-schema-types/microsoft-osinfo.gen.ts
Normal file
17
src/dsc-resource-schema-types/microsoft-osinfo.gen.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
/** Returns information about the operating system.
|
||||
|
||||
https://learn.microsoft.com/powershell/dsc/reference/microsoft/osinfo/resource
|
||||
*/
|
||||
export const MicrosoftOSInfo = S.Struct({
|
||||
$id: S.optional(S.String),
|
||||
architecture: S.optional(S.String),
|
||||
bitness: S.optional(S.Literal('32', '64', 'unknown')),
|
||||
codename: S.optional(S.String),
|
||||
edition: S.optional(S.String),
|
||||
family: S.optional(S.Literal('Linux', 'macOS', 'Windows')),
|
||||
version: S.optional(S.String),
|
||||
});
|
||||
export type MicrosoftOSInfo = S.Schema.Type<typeof MicrosoftOSInfo>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysAdvancedPasteSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysAdvancedPasteSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysAdvancedPasteSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysAlwaysOnTopSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysAlwaysOnTopSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysAlwaysOnTopSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysAppSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysAppSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysAppSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysAwakeSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysAwakeSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysAwakeSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysColorPickerSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysColorPickerSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysColorPickerSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysCropAndLockSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysCropAndLockSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysCropAndLockSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysEnvironmentVariablesSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysEnvironmentVariablesSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysEnvironmentVariablesSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysFancyZonesSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysFancyZonesSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysFancyZonesSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysFileLocksmithSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysFileLocksmithSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysFileLocksmithSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysFindMyMouseSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysFindMyMouseSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysFindMyMouseSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysHostsSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysHostsSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysHostsSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysImageResizerSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysImageResizerSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysImageResizerSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysKeyboardManagerSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysKeyboardManagerSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysKeyboardManagerSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysMeasureToolSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysMeasureToolSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysMeasureToolSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysMouseHighlighterSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysMouseHighlighterSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysMouseHighlighterSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysMouseJumpSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysMouseJumpSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysMouseJumpSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysMousePointerCrosshairsSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysMousePointerCrosshairsSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysMousePointerCrosshairsSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysPeekSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysPeekSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysPeekSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysPowerAccentSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysPowerAccentSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysPowerAccentSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysPowerOCRSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysPowerOCRSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysPowerOCRSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysPowerRenameSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysPowerRenameSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysPowerRenameSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysRegistryPreviewSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysRegistryPreviewSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysRegistryPreviewSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysShortcutGuideSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysShortcutGuideSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysShortcutGuideSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysWorkspacesSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysWorkspacesSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysWorkspacesSettings
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftPowerToysZoomItSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.NullOr(S.Boolean)),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftPowerToysZoomItSettings = S.Schema.Type<
|
||||
typeof MicrosoftPowerToysZoomItSettings
|
||||
>;
|
||||
@@ -0,0 +1,11 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftWindowsRebootPending = S.NullOr(
|
||||
S.Struct({
|
||||
rebootPending: S.optional(S.Boolean),
|
||||
}),
|
||||
);
|
||||
export type MicrosoftWindowsRebootPending = S.Schema.Type<
|
||||
typeof MicrosoftWindowsRebootPending
|
||||
>;
|
||||
@@ -0,0 +1,41 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const Metadata = S.Struct({
|
||||
whatIf: S.optional(S.NullOr(S.Array(S.String))),
|
||||
});
|
||||
export type Metadata = S.Schema.Type<typeof Metadata>;
|
||||
|
||||
export const RegistryValueData = S.Union(
|
||||
S.Literal('None'),
|
||||
S.Struct({
|
||||
String: S.String,
|
||||
}),
|
||||
S.Struct({
|
||||
ExpandString: S.String,
|
||||
}),
|
||||
S.Struct({
|
||||
Binary: S.Array(S.Number),
|
||||
}),
|
||||
S.Struct({
|
||||
DWord: S.Number,
|
||||
}),
|
||||
S.Struct({
|
||||
MultiString: S.Array(S.String),
|
||||
}),
|
||||
S.Struct({
|
||||
QWord: S.Number,
|
||||
}),
|
||||
);
|
||||
export type RegistryValueData = S.Schema.Type<typeof RegistryValueData>;
|
||||
|
||||
export const MicrosoftWindowsRegistry = S.Struct({
|
||||
_exist: S.optional(S.NullOr(S.Boolean)),
|
||||
_metadata: S.optional(S.NullOr(Metadata)),
|
||||
keyPath: S.String,
|
||||
valueData: S.optional(S.NullOr(RegistryValueData)),
|
||||
valueName: S.optional(S.NullOr(S.String)),
|
||||
});
|
||||
export type MicrosoftWindowsRegistry = S.Schema.Type<
|
||||
typeof MicrosoftWindowsRegistry
|
||||
>;
|
||||
@@ -0,0 +1,10 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftWinGetAdminSettings = S.Struct({
|
||||
_inDesiredState: S.optional(S.Boolean),
|
||||
settings: S.optional(S.Unknown),
|
||||
});
|
||||
export type MicrosoftWinGetAdminSettings = S.Schema.Type<
|
||||
typeof MicrosoftWinGetAdminSettings
|
||||
>;
|
||||
@@ -0,0 +1,24 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftWinGetPackage = S.Struct({
|
||||
_exist: S.optional(S.Boolean),
|
||||
_inDesiredState: S.optional(S.Boolean),
|
||||
acceptAgreements: S.optional(S.Boolean),
|
||||
id: S.String,
|
||||
installMode: S.optional(S.Literal('default', 'silent', 'interactive')),
|
||||
matchOption: S.optional(
|
||||
S.Literal(
|
||||
'equals',
|
||||
'equalsCaseInsensitive',
|
||||
'startsWithCaseInsensitive',
|
||||
'containsCaseInsensitive',
|
||||
),
|
||||
),
|
||||
source: S.optional(S.String),
|
||||
useLatest: S.optional(S.Boolean),
|
||||
version: S.optional(S.String),
|
||||
});
|
||||
export type MicrosoftWinGetPackage = S.Schema.Type<
|
||||
typeof MicrosoftWinGetPackage
|
||||
>;
|
||||
14
src/dsc-resource-schema-types/microsoft-winget-source.gen.ts
Normal file
14
src/dsc-resource-schema-types/microsoft-winget-source.gen.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftWinGetSource = S.Struct({
|
||||
_exist: S.optional(S.Boolean),
|
||||
_inDesiredState: S.optional(S.Boolean),
|
||||
acceptAgreements: S.optional(S.Boolean),
|
||||
argument: S.optional(S.String),
|
||||
explicit: S.optional(S.Boolean),
|
||||
name: S.String,
|
||||
trustLevel: S.optional(S.Literal('undefined', 'none', 'trusted')),
|
||||
type: S.optional(S.String),
|
||||
});
|
||||
export type MicrosoftWinGetSource = S.Schema.Type<typeof MicrosoftWinGetSource>;
|
||||
@@ -0,0 +1,11 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const MicrosoftWinGetUserSettingsFile = S.Struct({
|
||||
_inDesiredState: S.optional(S.Boolean),
|
||||
action: S.optional(S.Literal('Partial', 'Full')),
|
||||
settings: S.Unknown,
|
||||
});
|
||||
export type MicrosoftWinGetUserSettingsFile = S.Schema.Type<
|
||||
typeof MicrosoftWinGetUserSettingsFile
|
||||
>;
|
||||
@@ -1,86 +1,81 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const Operation = S.Literal(
|
||||
"get",
|
||||
"set",
|
||||
"test",
|
||||
"export"
|
||||
);
|
||||
export const Operation = S.Literal('get', 'set', 'test', 'export');
|
||||
export type Operation = S.Schema.Type<typeof Operation>;
|
||||
|
||||
export const ExecutionKind = S.Literal(
|
||||
"actual",
|
||||
"whatIf"
|
||||
);
|
||||
export const ExecutionKind = S.Literal('actual', 'whatIf');
|
||||
export type ExecutionKind = S.Schema.Type<typeof ExecutionKind>;
|
||||
|
||||
export const SecurityContextKind = S.Literal(
|
||||
"current",
|
||||
"elevated",
|
||||
"restricted"
|
||||
'current',
|
||||
'elevated',
|
||||
'restricted',
|
||||
);
|
||||
export type SecurityContextKind = S.Schema.Type<typeof SecurityContextKind>;
|
||||
|
||||
export const MicrosoftDscMetadata = S.Struct({
|
||||
"version": S.optional(S.NullOr(S.String)),
|
||||
"operation": S.optional(S.NullOr(Operation)),
|
||||
"executionType": S.optional(S.NullOr(ExecutionKind)),
|
||||
"startDatetime": S.optional(S.NullOr(S.String)),
|
||||
"endDatetime": S.optional(S.NullOr(S.String)),
|
||||
"duration": S.optional(S.NullOr(S.String)),
|
||||
"securityContext": S.optional(S.NullOr(SecurityContextKind))
|
||||
version: S.optional(S.NullOr(S.String)),
|
||||
operation: S.optional(S.NullOr(Operation)),
|
||||
executionType: S.optional(S.NullOr(ExecutionKind)),
|
||||
startDatetime: S.optional(S.NullOr(S.String)),
|
||||
endDatetime: S.optional(S.NullOr(S.String)),
|
||||
duration: S.optional(S.NullOr(S.String)),
|
||||
securityContext: S.optional(S.NullOr(SecurityContextKind)),
|
||||
});
|
||||
export type MicrosoftDscMetadata = S.Schema.Type<typeof MicrosoftDscMetadata>;
|
||||
|
||||
export const Metadata = S.Struct({
|
||||
"Microsoft.DSC": S.optional(S.NullOr(MicrosoftDscMetadata))
|
||||
'Microsoft.DSC': S.optional(S.NullOr(MicrosoftDscMetadata)),
|
||||
});
|
||||
export type Metadata = S.Schema.Type<typeof Metadata>;
|
||||
|
||||
export const ResourceGetResponse = S.Struct({
|
||||
"actualState": S.Unknown
|
||||
actualState: S.Unknown,
|
||||
});
|
||||
export type ResourceGetResponse = S.Schema.Type<typeof ResourceGetResponse>;
|
||||
|
||||
export const MessageLevel = S.Literal(
|
||||
"error",
|
||||
"warning",
|
||||
"information"
|
||||
);
|
||||
export const MessageLevel = S.Literal('error', 'warning', 'information');
|
||||
export type MessageLevel = S.Schema.Type<typeof MessageLevel>;
|
||||
|
||||
export const ResourceMessage = S.Struct({
|
||||
"name": S.String,
|
||||
"type": S.String,
|
||||
"message": S.String,
|
||||
"level": MessageLevel
|
||||
name: S.String,
|
||||
type: S.String,
|
||||
message: S.String,
|
||||
level: MessageLevel,
|
||||
});
|
||||
export type ResourceMessage = S.Schema.Type<typeof ResourceMessage>;
|
||||
|
||||
export const ConfigurationGetResult = S.Struct({
|
||||
"metadata": S.optional(S.NullOr(Metadata)),
|
||||
"results": S.Array(S.suspend((): S.Schema<ResourceGetResult> => ResourceGetResult)),
|
||||
"messages": S.Array(ResourceMessage),
|
||||
"hadErrors": S.Boolean
|
||||
metadata: S.optional(S.NullOr(Metadata)),
|
||||
results: S.Array(
|
||||
S.suspend((): S.Schema<ResourceGetResult> => ResourceGetResult),
|
||||
),
|
||||
messages: S.Array(ResourceMessage),
|
||||
hadErrors: S.Boolean,
|
||||
});
|
||||
export type ConfigurationGetResult = S.Schema.Type<typeof ConfigurationGetResult>;
|
||||
export type ConfigurationGetResult = S.Schema.Type<
|
||||
typeof ConfigurationGetResult
|
||||
>;
|
||||
|
||||
// Recursive type declarations
|
||||
interface ResourceGetResult {
|
||||
readonly "metadata"?: Metadata | null;
|
||||
readonly "name": string;
|
||||
readonly "type": string;
|
||||
readonly "result": GetResult
|
||||
readonly metadata?: Metadata | null;
|
||||
readonly name: string;
|
||||
readonly type: string;
|
||||
readonly result: GetResult;
|
||||
}
|
||||
type GetResult = ResourceGetResponse | ReadonlyArray<ResourceGetResult>
|
||||
type GetResult = ResourceGetResponse | ReadonlyArray<ResourceGetResult>;
|
||||
|
||||
// Recursive schema definitions
|
||||
export const ResourceGetResult = S.Struct({
|
||||
"metadata": S.optional(S.NullOr(Metadata)),
|
||||
"name": S.String,
|
||||
"type": S.String,
|
||||
"result": S.suspend((): S.Schema<GetResult> => GetResult)
|
||||
metadata: S.optional(S.NullOr(Metadata)),
|
||||
name: S.String,
|
||||
type: S.String,
|
||||
result: S.suspend((): S.Schema<GetResult> => GetResult),
|
||||
}) as unknown as S.Schema<ResourceGetResult>;
|
||||
|
||||
export const GetResult = S.Union(ResourceGetResponse, S.Array(S.suspend((): S.Schema<ResourceGetResult> => ResourceGetResult))) as unknown as S.Schema<GetResult>;
|
||||
export const GetResult = S.Union(
|
||||
ResourceGetResponse,
|
||||
S.Array(S.suspend((): S.Schema<ResourceGetResult> => ResourceGetResult)),
|
||||
) as unknown as S.Schema<GetResult>;
|
||||
|
||||
@@ -1,88 +1,83 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const Operation = S.Literal(
|
||||
"get",
|
||||
"set",
|
||||
"test",
|
||||
"export"
|
||||
);
|
||||
export const Operation = S.Literal('get', 'set', 'test', 'export');
|
||||
export type Operation = S.Schema.Type<typeof Operation>;
|
||||
|
||||
export const ExecutionKind = S.Literal(
|
||||
"actual",
|
||||
"whatIf"
|
||||
);
|
||||
export const ExecutionKind = S.Literal('actual', 'whatIf');
|
||||
export type ExecutionKind = S.Schema.Type<typeof ExecutionKind>;
|
||||
|
||||
export const SecurityContextKind = S.Literal(
|
||||
"current",
|
||||
"elevated",
|
||||
"restricted"
|
||||
'current',
|
||||
'elevated',
|
||||
'restricted',
|
||||
);
|
||||
export type SecurityContextKind = S.Schema.Type<typeof SecurityContextKind>;
|
||||
|
||||
export const MicrosoftDscMetadata = S.Struct({
|
||||
"version": S.optional(S.NullOr(S.String)),
|
||||
"operation": S.optional(S.NullOr(Operation)),
|
||||
"executionType": S.optional(S.NullOr(ExecutionKind)),
|
||||
"startDatetime": S.optional(S.NullOr(S.String)),
|
||||
"endDatetime": S.optional(S.NullOr(S.String)),
|
||||
"duration": S.optional(S.NullOr(S.String)),
|
||||
"securityContext": S.optional(S.NullOr(SecurityContextKind))
|
||||
version: S.optional(S.NullOr(S.String)),
|
||||
operation: S.optional(S.NullOr(Operation)),
|
||||
executionType: S.optional(S.NullOr(ExecutionKind)),
|
||||
startDatetime: S.optional(S.NullOr(S.String)),
|
||||
endDatetime: S.optional(S.NullOr(S.String)),
|
||||
duration: S.optional(S.NullOr(S.String)),
|
||||
securityContext: S.optional(S.NullOr(SecurityContextKind)),
|
||||
});
|
||||
export type MicrosoftDscMetadata = S.Schema.Type<typeof MicrosoftDscMetadata>;
|
||||
|
||||
export const Metadata = S.Struct({
|
||||
"Microsoft.DSC": S.optional(S.NullOr(MicrosoftDscMetadata))
|
||||
'Microsoft.DSC': S.optional(S.NullOr(MicrosoftDscMetadata)),
|
||||
});
|
||||
export type Metadata = S.Schema.Type<typeof Metadata>;
|
||||
|
||||
export const ResourceSetResponse = S.Struct({
|
||||
"beforeState": S.Unknown,
|
||||
"afterState": S.Unknown,
|
||||
"changedProperties": S.optional(S.NullOr(S.Array(S.String)))
|
||||
beforeState: S.Unknown,
|
||||
afterState: S.Unknown,
|
||||
changedProperties: S.optional(S.NullOr(S.Array(S.String))),
|
||||
});
|
||||
export type ResourceSetResponse = S.Schema.Type<typeof ResourceSetResponse>;
|
||||
|
||||
export const MessageLevel = S.Literal(
|
||||
"error",
|
||||
"warning",
|
||||
"information"
|
||||
);
|
||||
export const MessageLevel = S.Literal('error', 'warning', 'information');
|
||||
export type MessageLevel = S.Schema.Type<typeof MessageLevel>;
|
||||
|
||||
export const ResourceMessage = S.Struct({
|
||||
"name": S.String,
|
||||
"type": S.String,
|
||||
"message": S.String,
|
||||
"level": MessageLevel
|
||||
name: S.String,
|
||||
type: S.String,
|
||||
message: S.String,
|
||||
level: MessageLevel,
|
||||
});
|
||||
export type ResourceMessage = S.Schema.Type<typeof ResourceMessage>;
|
||||
|
||||
export const ConfigurationSetResult = S.Struct({
|
||||
"metadata": S.optional(S.NullOr(Metadata)),
|
||||
"results": S.Array(S.suspend((): S.Schema<ResourceSetResult> => ResourceSetResult)),
|
||||
"messages": S.Array(ResourceMessage),
|
||||
"hadErrors": S.Boolean
|
||||
metadata: S.optional(S.NullOr(Metadata)),
|
||||
results: S.Array(
|
||||
S.suspend((): S.Schema<ResourceSetResult> => ResourceSetResult),
|
||||
),
|
||||
messages: S.Array(ResourceMessage),
|
||||
hadErrors: S.Boolean,
|
||||
});
|
||||
export type ConfigurationSetResult = S.Schema.Type<typeof ConfigurationSetResult>;
|
||||
export type ConfigurationSetResult = S.Schema.Type<
|
||||
typeof ConfigurationSetResult
|
||||
>;
|
||||
|
||||
// Recursive type declarations
|
||||
interface ResourceSetResult {
|
||||
readonly "metadata"?: Metadata | null;
|
||||
readonly "name": string;
|
||||
readonly "type": string;
|
||||
readonly "result": SetResult
|
||||
readonly metadata?: Metadata | null;
|
||||
readonly name: string;
|
||||
readonly type: string;
|
||||
readonly result: SetResult;
|
||||
}
|
||||
type SetResult = ResourceSetResponse | ReadonlyArray<ResourceSetResult>
|
||||
type SetResult = ResourceSetResponse | ReadonlyArray<ResourceSetResult>;
|
||||
|
||||
// Recursive schema definitions
|
||||
export const ResourceSetResult = S.Struct({
|
||||
"metadata": S.optional(S.NullOr(Metadata)),
|
||||
"name": S.String,
|
||||
"type": S.String,
|
||||
"result": S.suspend((): S.Schema<SetResult> => SetResult)
|
||||
metadata: S.optional(S.NullOr(Metadata)),
|
||||
name: S.String,
|
||||
type: S.String,
|
||||
result: S.suspend((): S.Schema<SetResult> => SetResult),
|
||||
}) as unknown as S.Schema<ResourceSetResult>;
|
||||
|
||||
export const SetResult = S.Union(ResourceSetResponse, S.Array(S.suspend((): S.Schema<ResourceSetResult> => ResourceSetResult))) as unknown as S.Schema<SetResult>;
|
||||
export const SetResult = S.Union(
|
||||
ResourceSetResponse,
|
||||
S.Array(S.suspend((): S.Schema<ResourceSetResult> => ResourceSetResult)),
|
||||
) as unknown as S.Schema<SetResult>;
|
||||
|
||||
@@ -1,89 +1,84 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const Operation = S.Literal(
|
||||
"get",
|
||||
"set",
|
||||
"test",
|
||||
"export"
|
||||
);
|
||||
export const Operation = S.Literal('get', 'set', 'test', 'export');
|
||||
export type Operation = S.Schema.Type<typeof Operation>;
|
||||
|
||||
export const ExecutionKind = S.Literal(
|
||||
"actual",
|
||||
"whatIf"
|
||||
);
|
||||
export const ExecutionKind = S.Literal('actual', 'whatIf');
|
||||
export type ExecutionKind = S.Schema.Type<typeof ExecutionKind>;
|
||||
|
||||
export const SecurityContextKind = S.Literal(
|
||||
"current",
|
||||
"elevated",
|
||||
"restricted"
|
||||
'current',
|
||||
'elevated',
|
||||
'restricted',
|
||||
);
|
||||
export type SecurityContextKind = S.Schema.Type<typeof SecurityContextKind>;
|
||||
|
||||
export const MicrosoftDscMetadata = S.Struct({
|
||||
"version": S.optional(S.NullOr(S.String)),
|
||||
"operation": S.optional(S.NullOr(Operation)),
|
||||
"executionType": S.optional(S.NullOr(ExecutionKind)),
|
||||
"startDatetime": S.optional(S.NullOr(S.String)),
|
||||
"endDatetime": S.optional(S.NullOr(S.String)),
|
||||
"duration": S.optional(S.NullOr(S.String)),
|
||||
"securityContext": S.optional(S.NullOr(SecurityContextKind))
|
||||
version: S.optional(S.NullOr(S.String)),
|
||||
operation: S.optional(S.NullOr(Operation)),
|
||||
executionType: S.optional(S.NullOr(ExecutionKind)),
|
||||
startDatetime: S.optional(S.NullOr(S.String)),
|
||||
endDatetime: S.optional(S.NullOr(S.String)),
|
||||
duration: S.optional(S.NullOr(S.String)),
|
||||
securityContext: S.optional(S.NullOr(SecurityContextKind)),
|
||||
});
|
||||
export type MicrosoftDscMetadata = S.Schema.Type<typeof MicrosoftDscMetadata>;
|
||||
|
||||
export const Metadata = S.Struct({
|
||||
"Microsoft.DSC": S.optional(S.NullOr(MicrosoftDscMetadata))
|
||||
'Microsoft.DSC': S.optional(S.NullOr(MicrosoftDscMetadata)),
|
||||
});
|
||||
export type Metadata = S.Schema.Type<typeof Metadata>;
|
||||
|
||||
export const ResourceTestResponse = S.Struct({
|
||||
"desiredState": S.Unknown,
|
||||
"actualState": S.Unknown,
|
||||
"inDesiredState": S.Boolean,
|
||||
"differingProperties": S.Array(S.String)
|
||||
desiredState: S.Unknown,
|
||||
actualState: S.Unknown,
|
||||
inDesiredState: S.Boolean,
|
||||
differingProperties: S.Array(S.String),
|
||||
});
|
||||
export type ResourceTestResponse = S.Schema.Type<typeof ResourceTestResponse>;
|
||||
|
||||
export const MessageLevel = S.Literal(
|
||||
"error",
|
||||
"warning",
|
||||
"information"
|
||||
);
|
||||
export const MessageLevel = S.Literal('error', 'warning', 'information');
|
||||
export type MessageLevel = S.Schema.Type<typeof MessageLevel>;
|
||||
|
||||
export const ResourceMessage = S.Struct({
|
||||
"name": S.String,
|
||||
"type": S.String,
|
||||
"message": S.String,
|
||||
"level": MessageLevel
|
||||
name: S.String,
|
||||
type: S.String,
|
||||
message: S.String,
|
||||
level: MessageLevel,
|
||||
});
|
||||
export type ResourceMessage = S.Schema.Type<typeof ResourceMessage>;
|
||||
|
||||
export const ConfigurationTestResult = S.Struct({
|
||||
"metadata": S.optional(S.NullOr(Metadata)),
|
||||
"results": S.Array(S.suspend((): S.Schema<ResourceTestResult> => ResourceTestResult)),
|
||||
"messages": S.Array(ResourceMessage),
|
||||
"hadErrors": S.Boolean
|
||||
metadata: S.optional(S.NullOr(Metadata)),
|
||||
results: S.Array(
|
||||
S.suspend((): S.Schema<ResourceTestResult> => ResourceTestResult),
|
||||
),
|
||||
messages: S.Array(ResourceMessage),
|
||||
hadErrors: S.Boolean,
|
||||
});
|
||||
export type ConfigurationTestResult = S.Schema.Type<typeof ConfigurationTestResult>;
|
||||
export type ConfigurationTestResult = S.Schema.Type<
|
||||
typeof ConfigurationTestResult
|
||||
>;
|
||||
|
||||
// Recursive type declarations
|
||||
interface ResourceTestResult {
|
||||
readonly "metadata"?: Metadata | null;
|
||||
readonly "name": string;
|
||||
readonly "type": string;
|
||||
readonly "result": TestResult
|
||||
readonly metadata?: Metadata | null;
|
||||
readonly name: string;
|
||||
readonly type: string;
|
||||
readonly result: TestResult;
|
||||
}
|
||||
type TestResult = ResourceTestResponse | ReadonlyArray<ResourceTestResult>
|
||||
type TestResult = ResourceTestResponse | ReadonlyArray<ResourceTestResult>;
|
||||
|
||||
// Recursive schema definitions
|
||||
export const ResourceTestResult = S.Struct({
|
||||
"metadata": S.optional(S.NullOr(Metadata)),
|
||||
"name": S.String,
|
||||
"type": S.String,
|
||||
"result": S.suspend((): S.Schema<TestResult> => TestResult)
|
||||
metadata: S.optional(S.NullOr(Metadata)),
|
||||
name: S.String,
|
||||
type: S.String,
|
||||
result: S.suspend((): S.Schema<TestResult> => TestResult),
|
||||
}) as unknown as S.Schema<ResourceTestResult>;
|
||||
|
||||
export const TestResult = S.Union(ResourceTestResponse, S.Array(S.suspend((): S.Schema<ResourceTestResult> => ResourceTestResult))) as unknown as S.Schema<TestResult>;
|
||||
export const TestResult = S.Union(
|
||||
ResourceTestResponse,
|
||||
S.Array(S.suspend((): S.Schema<ResourceTestResult> => ResourceTestResult)),
|
||||
) as unknown as S.Schema<TestResult>;
|
||||
|
||||
@@ -2,81 +2,98 @@
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const DataType = S.Literal(
|
||||
"string",
|
||||
"secureString",
|
||||
"int",
|
||||
"bool",
|
||||
"object",
|
||||
"secureObject",
|
||||
"array"
|
||||
'string',
|
||||
'secureString',
|
||||
'int',
|
||||
'bool',
|
||||
'object',
|
||||
'secureObject',
|
||||
'array',
|
||||
);
|
||||
export type DataType = S.Schema.Type<typeof DataType>;
|
||||
|
||||
export const Parameter = S.Struct({
|
||||
"type": DataType,
|
||||
"defaultValue": S.optional(S.Unknown),
|
||||
"allowedValues": S.optional(S.NullOr(S.Array(S.Unknown))),
|
||||
"minValue": S.optional(S.NullOr(S.Number)),
|
||||
"maxValue": S.optional(S.NullOr(S.Number)),
|
||||
"minLength": S.optional(S.NullOr(S.Number)),
|
||||
"maxLength": S.optional(S.NullOr(S.Number)),
|
||||
"description": S.optional(S.NullOr(S.String)),
|
||||
"metadata": S.optional(S.NullOr(S.Record({ key: S.String, value: S.Unknown })))
|
||||
type: DataType,
|
||||
defaultValue: S.optional(S.Unknown),
|
||||
allowedValues: S.optional(S.NullOr(S.Array(S.Unknown))),
|
||||
minValue: S.optional(S.NullOr(S.Number)),
|
||||
maxValue: S.optional(S.NullOr(S.Number)),
|
||||
minLength: S.optional(S.NullOr(S.Number)),
|
||||
maxLength: S.optional(S.NullOr(S.Number)),
|
||||
description: S.optional(S.NullOr(S.String)),
|
||||
metadata: S.optional(S.NullOr(S.Record({ key: S.String, value: S.Unknown }))),
|
||||
});
|
||||
export type Parameter = S.Schema.Type<typeof Parameter>;
|
||||
|
||||
export const Resource = S.Struct({
|
||||
"type": S.String,
|
||||
"name": S.String,
|
||||
"dependsOn": S.optional(S.NullOr(S.Array(S.String))),
|
||||
"properties": S.optional(S.NullOr(S.Record({ key: S.String, value: S.Unknown }))),
|
||||
"metadata": S.optional(S.NullOr(S.Record({ key: S.String, value: S.Unknown })))
|
||||
type: S.String,
|
||||
name: S.String,
|
||||
dependsOn: S.optional(S.NullOr(S.Array(S.String))),
|
||||
properties: S.optional(
|
||||
S.NullOr(S.Record({ key: S.String, value: S.Unknown })),
|
||||
),
|
||||
metadata: S.optional(S.NullOr(S.Record({ key: S.String, value: S.Unknown }))),
|
||||
});
|
||||
export type Resource = S.Schema.Type<typeof Resource>;
|
||||
|
||||
export const Operation = S.Literal(
|
||||
"get",
|
||||
"set",
|
||||
"test",
|
||||
"export"
|
||||
);
|
||||
export const Operation = S.Literal('get', 'set', 'test', 'export');
|
||||
export type Operation = S.Schema.Type<typeof Operation>;
|
||||
|
||||
export const ExecutionKind = S.Literal(
|
||||
"actual",
|
||||
"whatIf"
|
||||
);
|
||||
export const ExecutionKind = S.Literal('actual', 'whatIf');
|
||||
export type ExecutionKind = S.Schema.Type<typeof ExecutionKind>;
|
||||
|
||||
export const SecurityContextKind = S.Literal(
|
||||
"current",
|
||||
"elevated",
|
||||
"restricted"
|
||||
'current',
|
||||
'elevated',
|
||||
'restricted',
|
||||
);
|
||||
export type SecurityContextKind = S.Schema.Type<typeof SecurityContextKind>;
|
||||
|
||||
export const MicrosoftDscMetadata = S.Struct({
|
||||
"version": S.optional(S.NullOr(S.String)),
|
||||
"operation": S.optional(S.NullOr(Operation)),
|
||||
"executionType": S.optional(S.NullOr(ExecutionKind)),
|
||||
"startDatetime": S.optional(S.NullOr(S.String)),
|
||||
"endDatetime": S.optional(S.NullOr(S.String)),
|
||||
"duration": S.optional(S.NullOr(S.String)),
|
||||
"securityContext": S.optional(S.NullOr(SecurityContextKind))
|
||||
version: S.optional(S.NullOr(S.String)),
|
||||
operation: S.optional(S.NullOr(Operation)),
|
||||
executionType: S.optional(S.NullOr(ExecutionKind)),
|
||||
startDatetime: S.optional(S.NullOr(S.String)),
|
||||
endDatetime: S.optional(S.NullOr(S.String)),
|
||||
duration: S.optional(S.NullOr(S.String)),
|
||||
securityContext: S.optional(S.NullOr(SecurityContextKind)),
|
||||
});
|
||||
export type MicrosoftDscMetadata = S.Schema.Type<typeof MicrosoftDscMetadata>;
|
||||
|
||||
export const Metadata = S.Struct({
|
||||
"Microsoft.DSC": S.optional(S.NullOr(MicrosoftDscMetadata))
|
||||
'Microsoft.DSC': S.optional(S.NullOr(MicrosoftDscMetadata)),
|
||||
});
|
||||
export type Metadata = S.Schema.Type<typeof Metadata>;
|
||||
|
||||
export const Configuration = S.Struct({
|
||||
"$schema": S.Literal("https://aka.ms/dsc/schemas/v3/bundled/config/document.json", "https://aka.ms/dsc/schemas/v3.0/bundled/config/document.json", "https://aka.ms/dsc/schemas/v3.0.0/bundled/config/document.json", "https://aka.ms/dsc/schemas/v3/bundled/config/document.vscode.json", "https://aka.ms/dsc/schemas/v3.0/bundled/config/document.vscode.json", "https://aka.ms/dsc/schemas/v3.0.0/bundled/config/document.vscode.json", "https://aka.ms/dsc/schemas/v3/config/document.json", "https://aka.ms/dsc/schemas/v3.0/config/document.json", "https://aka.ms/dsc/schemas/v3.0.0/config/document.json", "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.json", "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/config/document.json", "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/config/document.json", "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.vscode.json", "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/config/document.vscode.json", "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/config/document.vscode.json", "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.json", "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.json", "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.json"),
|
||||
"contentVersion": S.optional(S.NullOr(S.String)),
|
||||
"parameters": S.optional(S.NullOr(S.Record({ key: S.String, value: Parameter }))),
|
||||
"variables": S.optional(S.NullOr(S.Record({ key: S.String, value: S.Unknown }))),
|
||||
"resources": S.Array(Resource),
|
||||
"metadata": S.optional(S.NullOr(Metadata))
|
||||
$schema: S.Literal(
|
||||
'https://aka.ms/dsc/schemas/v3/bundled/config/document.json',
|
||||
'https://aka.ms/dsc/schemas/v3.0/bundled/config/document.json',
|
||||
'https://aka.ms/dsc/schemas/v3.0.0/bundled/config/document.json',
|
||||
'https://aka.ms/dsc/schemas/v3/bundled/config/document.vscode.json',
|
||||
'https://aka.ms/dsc/schemas/v3.0/bundled/config/document.vscode.json',
|
||||
'https://aka.ms/dsc/schemas/v3.0.0/bundled/config/document.vscode.json',
|
||||
'https://aka.ms/dsc/schemas/v3/config/document.json',
|
||||
'https://aka.ms/dsc/schemas/v3.0/config/document.json',
|
||||
'https://aka.ms/dsc/schemas/v3.0.0/config/document.json',
|
||||
'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.json',
|
||||
'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/config/document.json',
|
||||
'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/config/document.json',
|
||||
'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/config/document.vscode.json',
|
||||
'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/config/document.vscode.json',
|
||||
'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/config/document.vscode.json',
|
||||
'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/config/document.json',
|
||||
'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/config/document.json',
|
||||
'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/config/document.json',
|
||||
),
|
||||
contentVersion: S.optional(S.NullOr(S.String)),
|
||||
parameters: S.optional(
|
||||
S.NullOr(S.Record({ key: S.String, value: Parameter })),
|
||||
),
|
||||
variables: S.optional(
|
||||
S.NullOr(S.Record({ key: S.String, value: S.Unknown })),
|
||||
),
|
||||
resources: S.Array(Resource),
|
||||
metadata: S.optional(S.NullOr(Metadata)),
|
||||
});
|
||||
export type Configuration = S.Schema.Type<typeof Configuration>;
|
||||
|
||||
@@ -2,36 +2,41 @@
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const Kind = S.Literal(
|
||||
"adapter",
|
||||
"exporter",
|
||||
"group",
|
||||
"importer",
|
||||
"resource"
|
||||
'adapter',
|
||||
'exporter',
|
||||
'group',
|
||||
'importer',
|
||||
'resource',
|
||||
);
|
||||
export type Kind = S.Schema.Type<typeof Kind>;
|
||||
|
||||
export const Capability = S.Union(S.Literal("get"), S.Literal("set"), S.Literal("setHandlesExist"), S.Literal("whatIf"), S.Literal("test"), S.Literal("delete"), S.Literal("export"), S.Literal("resolve"));
|
||||
export const Capability = S.Union(
|
||||
S.Literal('get'),
|
||||
S.Literal('set'),
|
||||
S.Literal('setHandlesExist'),
|
||||
S.Literal('whatIf'),
|
||||
S.Literal('test'),
|
||||
S.Literal('delete'),
|
||||
S.Literal('export'),
|
||||
S.Literal('resolve'),
|
||||
);
|
||||
export type Capability = S.Schema.Type<typeof Capability>;
|
||||
|
||||
export const ImplementedAs = S.NullOr(S.String);
|
||||
export type ImplementedAs = S.Schema.Type<typeof ImplementedAs>;
|
||||
|
||||
export const DscResource = S.Struct({
|
||||
"type": S.String,
|
||||
"kind": S.Struct({
|
||||
|
||||
}),
|
||||
"version": S.String,
|
||||
"capabilities": S.Array(Capability),
|
||||
"path": S.String,
|
||||
"description": S.optional(S.NullOr(S.String)),
|
||||
"directory": S.String,
|
||||
"implementedAs": S.Struct({
|
||||
|
||||
}),
|
||||
"author": S.optional(S.NullOr(S.String)),
|
||||
"properties": S.Array(S.String),
|
||||
"requireAdapter": S.optional(S.NullOr(S.String)),
|
||||
"manifest": S.optional(S.Unknown)
|
||||
type: S.String,
|
||||
kind: S.Struct({}),
|
||||
version: S.String,
|
||||
capabilities: S.Array(Capability),
|
||||
path: S.String,
|
||||
description: S.optional(S.NullOr(S.String)),
|
||||
directory: S.String,
|
||||
implementedAs: S.Struct({}),
|
||||
author: S.optional(S.NullOr(S.String)),
|
||||
properties: S.Array(S.String),
|
||||
requireAdapter: S.optional(S.NullOr(S.String)),
|
||||
manifest: S.optional(S.Unknown),
|
||||
});
|
||||
export type DscResource = S.Schema.Type<typeof DscResource>;
|
||||
|
||||
@@ -2,62 +2,57 @@
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const ResourceGetResponse = S.Struct({
|
||||
"actualState": S.Unknown
|
||||
actualState: S.Unknown,
|
||||
});
|
||||
export type ResourceGetResponse = S.Schema.Type<typeof ResourceGetResponse>;
|
||||
|
||||
export const Operation = S.Literal(
|
||||
"get",
|
||||
"set",
|
||||
"test",
|
||||
"export"
|
||||
);
|
||||
export const Operation = S.Literal('get', 'set', 'test', 'export');
|
||||
export type Operation = S.Schema.Type<typeof Operation>;
|
||||
|
||||
export const ExecutionKind = S.Literal(
|
||||
"actual",
|
||||
"whatIf"
|
||||
);
|
||||
export const ExecutionKind = S.Literal('actual', 'whatIf');
|
||||
export type ExecutionKind = S.Schema.Type<typeof ExecutionKind>;
|
||||
|
||||
export const SecurityContextKind = S.Literal(
|
||||
"current",
|
||||
"elevated",
|
||||
"restricted"
|
||||
'current',
|
||||
'elevated',
|
||||
'restricted',
|
||||
);
|
||||
export type SecurityContextKind = S.Schema.Type<typeof SecurityContextKind>;
|
||||
|
||||
export const MicrosoftDscMetadata = S.Struct({
|
||||
"version": S.optional(S.NullOr(S.String)),
|
||||
"operation": S.optional(S.NullOr(Operation)),
|
||||
"executionType": S.optional(S.NullOr(ExecutionKind)),
|
||||
"startDatetime": S.optional(S.NullOr(S.String)),
|
||||
"endDatetime": S.optional(S.NullOr(S.String)),
|
||||
"duration": S.optional(S.NullOr(S.String)),
|
||||
"securityContext": S.optional(S.NullOr(SecurityContextKind))
|
||||
version: S.optional(S.NullOr(S.String)),
|
||||
operation: S.optional(S.NullOr(Operation)),
|
||||
executionType: S.optional(S.NullOr(ExecutionKind)),
|
||||
startDatetime: S.optional(S.NullOr(S.String)),
|
||||
endDatetime: S.optional(S.NullOr(S.String)),
|
||||
duration: S.optional(S.NullOr(S.String)),
|
||||
securityContext: S.optional(S.NullOr(SecurityContextKind)),
|
||||
});
|
||||
export type MicrosoftDscMetadata = S.Schema.Type<typeof MicrosoftDscMetadata>;
|
||||
|
||||
export const Metadata = S.Struct({
|
||||
"Microsoft.DSC": S.optional(S.NullOr(MicrosoftDscMetadata))
|
||||
'Microsoft.DSC': S.optional(S.NullOr(MicrosoftDscMetadata)),
|
||||
});
|
||||
export type Metadata = S.Schema.Type<typeof Metadata>;
|
||||
|
||||
// Recursive type declarations
|
||||
interface ResourceGetResult {
|
||||
readonly "metadata"?: Metadata | null;
|
||||
readonly "name": string;
|
||||
readonly "type": string;
|
||||
readonly "result": GetResult
|
||||
readonly metadata?: Metadata | null;
|
||||
readonly name: string;
|
||||
readonly type: string;
|
||||
readonly result: GetResult;
|
||||
}
|
||||
type GetResult = ResourceGetResponse | ReadonlyArray<ResourceGetResult>
|
||||
type GetResult = ResourceGetResponse | ReadonlyArray<ResourceGetResult>;
|
||||
|
||||
// Recursive schema definitions
|
||||
export const ResourceGetResult = S.Struct({
|
||||
"metadata": S.optional(S.NullOr(Metadata)),
|
||||
"name": S.String,
|
||||
"type": S.String,
|
||||
"result": S.suspend((): S.Schema<GetResult> => GetResult)
|
||||
metadata: S.optional(S.NullOr(Metadata)),
|
||||
name: S.String,
|
||||
type: S.String,
|
||||
result: S.suspend((): S.Schema<GetResult> => GetResult),
|
||||
}) as unknown as S.Schema<ResourceGetResult>;
|
||||
|
||||
export const GetResult = S.Union(ResourceGetResponse, S.Array(S.suspend((): S.Schema<ResourceGetResult> => ResourceGetResult))) as unknown as S.Schema<GetResult>;
|
||||
export const GetResult = S.Union(
|
||||
ResourceGetResponse,
|
||||
S.Array(S.suspend((): S.Schema<ResourceGetResult> => ResourceGetResult)),
|
||||
) as unknown as S.Schema<GetResult>;
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
// This file is auto-generated. Do not edit manually.
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const Include = S.Union(S.Struct({
|
||||
"configurationFile": S.String
|
||||
}), S.Struct({
|
||||
"configurationContent": S.String
|
||||
}));
|
||||
export const Include = S.Union(
|
||||
S.Struct({
|
||||
configurationFile: S.String,
|
||||
}),
|
||||
S.Struct({
|
||||
configurationContent: S.String,
|
||||
}),
|
||||
);
|
||||
export type Include = S.Schema.Type<typeof Include>;
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const ResolveResult = S.Struct({
|
||||
"configuration": S.Unknown,
|
||||
"parameters": S.optional(S.NullOr(S.Record({ key: S.String, value: S.Unknown })))
|
||||
configuration: S.Unknown,
|
||||
parameters: S.optional(
|
||||
S.NullOr(S.Record({ key: S.String, value: S.Unknown })),
|
||||
),
|
||||
});
|
||||
export type ResolveResult = S.Schema.Type<typeof ResolveResult>;
|
||||
|
||||
@@ -2,128 +2,152 @@
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const Kind = S.Literal(
|
||||
"adapter",
|
||||
"exporter",
|
||||
"group",
|
||||
"importer",
|
||||
"resource"
|
||||
'adapter',
|
||||
'exporter',
|
||||
'group',
|
||||
'importer',
|
||||
'resource',
|
||||
);
|
||||
export type Kind = S.Schema.Type<typeof Kind>;
|
||||
|
||||
export const ArgKind = S.Union(S.String, S.Struct({
|
||||
"jsonInputArg": S.String,
|
||||
"mandatory": S.optional(S.NullOr(S.Boolean))
|
||||
}));
|
||||
export const ArgKind = S.Union(
|
||||
S.String,
|
||||
S.Struct({
|
||||
jsonInputArg: S.String,
|
||||
mandatory: S.optional(S.NullOr(S.Boolean)),
|
||||
}),
|
||||
);
|
||||
export type ArgKind = S.Schema.Type<typeof ArgKind>;
|
||||
|
||||
export const InputKind = S.Union(S.Literal("env"), S.Literal("stdin"));
|
||||
export const InputKind = S.Union(S.Literal('env'), S.Literal('stdin'));
|
||||
export type InputKind = S.Schema.Type<typeof InputKind>;
|
||||
|
||||
export const GetMethod = S.Struct({
|
||||
"executable": S.String,
|
||||
"args": S.optional(S.NullOr(S.Array(ArgKind))),
|
||||
"input": S.optional(S.NullOr(InputKind))
|
||||
executable: S.String,
|
||||
args: S.optional(S.NullOr(S.Array(ArgKind))),
|
||||
input: S.optional(S.NullOr(InputKind)),
|
||||
});
|
||||
export type GetMethod = S.Schema.Type<typeof GetMethod>;
|
||||
|
||||
export const ReturnKind = S.Union(S.Literal("state"), S.Literal("stateAndDiff"));
|
||||
export const ReturnKind = S.Union(
|
||||
S.Literal('state'),
|
||||
S.Literal('stateAndDiff'),
|
||||
);
|
||||
export type ReturnKind = S.Schema.Type<typeof ReturnKind>;
|
||||
|
||||
export const SetMethod = S.Struct({
|
||||
"executable": S.String,
|
||||
"args": S.optional(S.NullOr(S.Array(ArgKind))),
|
||||
"input": S.optional(S.NullOr(InputKind)),
|
||||
"implementsPretest": S.optional(S.NullOr(S.Boolean)),
|
||||
"handlesExist": S.optional(S.NullOr(S.Boolean)),
|
||||
"return": S.optional(S.NullOr(ReturnKind))
|
||||
executable: S.String,
|
||||
args: S.optional(S.NullOr(S.Array(ArgKind))),
|
||||
input: S.optional(S.NullOr(InputKind)),
|
||||
implementsPretest: S.optional(S.NullOr(S.Boolean)),
|
||||
handlesExist: S.optional(S.NullOr(S.Boolean)),
|
||||
return: S.optional(S.NullOr(ReturnKind)),
|
||||
});
|
||||
export type SetMethod = S.Schema.Type<typeof SetMethod>;
|
||||
|
||||
export const TestMethod = S.Struct({
|
||||
"executable": S.String,
|
||||
"args": S.optional(S.NullOr(S.Array(ArgKind))),
|
||||
"input": S.optional(S.NullOr(InputKind)),
|
||||
"return": S.optional(S.NullOr(ReturnKind))
|
||||
executable: S.String,
|
||||
args: S.optional(S.NullOr(S.Array(ArgKind))),
|
||||
input: S.optional(S.NullOr(InputKind)),
|
||||
return: S.optional(S.NullOr(ReturnKind)),
|
||||
});
|
||||
export type TestMethod = S.Schema.Type<typeof TestMethod>;
|
||||
|
||||
export const DeleteMethod = S.Struct({
|
||||
"executable": S.String,
|
||||
"args": S.optional(S.NullOr(S.Array(ArgKind))),
|
||||
"input": S.optional(S.NullOr(InputKind))
|
||||
executable: S.String,
|
||||
args: S.optional(S.NullOr(S.Array(ArgKind))),
|
||||
input: S.optional(S.NullOr(InputKind)),
|
||||
});
|
||||
export type DeleteMethod = S.Schema.Type<typeof DeleteMethod>;
|
||||
|
||||
export const ExportMethod = S.Struct({
|
||||
"executable": S.String,
|
||||
"args": S.optional(S.NullOr(S.Array(ArgKind))),
|
||||
"input": S.optional(S.NullOr(InputKind))
|
||||
executable: S.String,
|
||||
args: S.optional(S.NullOr(S.Array(ArgKind))),
|
||||
input: S.optional(S.NullOr(InputKind)),
|
||||
});
|
||||
export type ExportMethod = S.Schema.Type<typeof ExportMethod>;
|
||||
|
||||
export const ResolveMethod = S.Struct({
|
||||
"executable": S.String,
|
||||
"args": S.optional(S.NullOr(S.Array(ArgKind))),
|
||||
"input": S.optional(S.NullOr(InputKind))
|
||||
executable: S.String,
|
||||
args: S.optional(S.NullOr(S.Array(ArgKind))),
|
||||
input: S.optional(S.NullOr(InputKind)),
|
||||
});
|
||||
export type ResolveMethod = S.Schema.Type<typeof ResolveMethod>;
|
||||
|
||||
export const ValidateMethod = S.Struct({
|
||||
"executable": S.String,
|
||||
"args": S.optional(S.NullOr(S.Array(ArgKind))),
|
||||
"input": S.optional(S.NullOr(InputKind))
|
||||
executable: S.String,
|
||||
args: S.optional(S.NullOr(S.Array(ArgKind))),
|
||||
input: S.optional(S.NullOr(InputKind)),
|
||||
});
|
||||
export type ValidateMethod = S.Schema.Type<typeof ValidateMethod>;
|
||||
|
||||
export const ListMethod = S.Struct({
|
||||
"executable": S.String,
|
||||
"args": S.optional(S.NullOr(S.Array(S.String)))
|
||||
executable: S.String,
|
||||
args: S.optional(S.NullOr(S.Array(S.String))),
|
||||
});
|
||||
export type ListMethod = S.Schema.Type<typeof ListMethod>;
|
||||
|
||||
export const ConfigKind = S.Union(S.Literal("full"), S.Literal("sequence"));
|
||||
export const ConfigKind = S.Union(S.Literal('full'), S.Literal('sequence'));
|
||||
export type ConfigKind = S.Schema.Type<typeof ConfigKind>;
|
||||
|
||||
export const Adapter = S.Struct({
|
||||
"list": S.Struct({
|
||||
|
||||
}),
|
||||
"config": S.Struct({
|
||||
|
||||
})
|
||||
list: S.Struct({}),
|
||||
config: S.Struct({}),
|
||||
});
|
||||
export type Adapter = S.Schema.Type<typeof Adapter>;
|
||||
|
||||
export const SchemaCommand = S.Struct({
|
||||
"executable": S.String,
|
||||
"args": S.optional(S.NullOr(S.Array(S.String)))
|
||||
executable: S.String,
|
||||
args: S.optional(S.NullOr(S.Array(S.String))),
|
||||
});
|
||||
export type SchemaCommand = S.Schema.Type<typeof SchemaCommand>;
|
||||
|
||||
export const SchemaKind = S.Union(S.Struct({
|
||||
"command": SchemaCommand
|
||||
}), S.Struct({
|
||||
"embedded": S.Unknown
|
||||
}));
|
||||
export const SchemaKind = S.Union(
|
||||
S.Struct({
|
||||
command: SchemaCommand,
|
||||
}),
|
||||
S.Struct({
|
||||
embedded: S.Unknown,
|
||||
}),
|
||||
);
|
||||
export type SchemaKind = S.Schema.Type<typeof SchemaKind>;
|
||||
|
||||
export const ResourceManifest = S.Struct({
|
||||
"$schema": S.Literal("https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json", "https://aka.ms/dsc/schemas/v3.0/bundled/resource/manifest.json", "https://aka.ms/dsc/schemas/v3.0.0/bundled/resource/manifest.json", "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.vscode.json", "https://aka.ms/dsc/schemas/v3.0/bundled/resource/manifest.vscode.json", "https://aka.ms/dsc/schemas/v3.0.0/bundled/resource/manifest.vscode.json", "https://aka.ms/dsc/schemas/v3/resource/manifest.json", "https://aka.ms/dsc/schemas/v3.0/resource/manifest.json", "https://aka.ms/dsc/schemas/v3.0.0/resource/manifest.json", "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.json", "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.json", "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.json", "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.vscode.json", "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.vscode.json", "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.vscode.json", "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.json", "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.json", "https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json"),
|
||||
"type": S.String,
|
||||
"kind": S.optional(S.NullOr(Kind)),
|
||||
"version": S.String,
|
||||
"description": S.optional(S.NullOr(S.String)),
|
||||
"tags": S.optional(S.NullOr(S.Array(S.String))),
|
||||
"get": S.optional(S.NullOr(GetMethod)),
|
||||
"set": S.optional(S.NullOr(SetMethod)),
|
||||
"whatIf": S.optional(S.NullOr(SetMethod)),
|
||||
"test": S.optional(S.NullOr(TestMethod)),
|
||||
"delete": S.optional(S.NullOr(DeleteMethod)),
|
||||
"export": S.optional(S.NullOr(ExportMethod)),
|
||||
"resolve": S.optional(S.NullOr(ResolveMethod)),
|
||||
"validate": S.optional(S.NullOr(ValidateMethod)),
|
||||
"adapter": S.optional(S.NullOr(Adapter)),
|
||||
"exitCodes": S.optional(S.NullOr(S.Record({ key: S.String, value: S.String }))),
|
||||
"schema": S.optional(S.NullOr(SchemaKind))
|
||||
$schema: S.Literal(
|
||||
'https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.json',
|
||||
'https://aka.ms/dsc/schemas/v3.0/bundled/resource/manifest.json',
|
||||
'https://aka.ms/dsc/schemas/v3.0.0/bundled/resource/manifest.json',
|
||||
'https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.vscode.json',
|
||||
'https://aka.ms/dsc/schemas/v3.0/bundled/resource/manifest.vscode.json',
|
||||
'https://aka.ms/dsc/schemas/v3.0.0/bundled/resource/manifest.vscode.json',
|
||||
'https://aka.ms/dsc/schemas/v3/resource/manifest.json',
|
||||
'https://aka.ms/dsc/schemas/v3.0/resource/manifest.json',
|
||||
'https://aka.ms/dsc/schemas/v3.0.0/resource/manifest.json',
|
||||
'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.json',
|
||||
'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.json',
|
||||
'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.json',
|
||||
'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/bundled/resource/manifest.vscode.json',
|
||||
'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/bundled/resource/manifest.vscode.json',
|
||||
'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/bundled/resource/manifest.vscode.json',
|
||||
'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3/resource/manifest.json',
|
||||
'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0/resource/manifest.json',
|
||||
'https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/v3.0.0/resource/manifest.json',
|
||||
),
|
||||
type: S.String,
|
||||
kind: S.optional(S.NullOr(Kind)),
|
||||
version: S.String,
|
||||
description: S.optional(S.NullOr(S.String)),
|
||||
tags: S.optional(S.NullOr(S.Array(S.String))),
|
||||
get: S.optional(S.NullOr(GetMethod)),
|
||||
set: S.optional(S.NullOr(SetMethod)),
|
||||
whatIf: S.optional(S.NullOr(SetMethod)),
|
||||
test: S.optional(S.NullOr(TestMethod)),
|
||||
delete: S.optional(S.NullOr(DeleteMethod)),
|
||||
export: S.optional(S.NullOr(ExportMethod)),
|
||||
resolve: S.optional(S.NullOr(ResolveMethod)),
|
||||
validate: S.optional(S.NullOr(ValidateMethod)),
|
||||
adapter: S.optional(S.NullOr(Adapter)),
|
||||
exitCodes: S.optional(S.NullOr(S.Record({ key: S.String, value: S.String }))),
|
||||
schema: S.optional(S.NullOr(SchemaKind)),
|
||||
});
|
||||
export type ResourceManifest = S.Schema.Type<typeof ResourceManifest>;
|
||||
|
||||
@@ -2,64 +2,59 @@
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const ResourceSetResponse = S.Struct({
|
||||
"beforeState": S.Unknown,
|
||||
"afterState": S.Unknown,
|
||||
"changedProperties": S.optional(S.NullOr(S.Array(S.String)))
|
||||
beforeState: S.Unknown,
|
||||
afterState: S.Unknown,
|
||||
changedProperties: S.optional(S.NullOr(S.Array(S.String))),
|
||||
});
|
||||
export type ResourceSetResponse = S.Schema.Type<typeof ResourceSetResponse>;
|
||||
|
||||
export const Operation = S.Literal(
|
||||
"get",
|
||||
"set",
|
||||
"test",
|
||||
"export"
|
||||
);
|
||||
export const Operation = S.Literal('get', 'set', 'test', 'export');
|
||||
export type Operation = S.Schema.Type<typeof Operation>;
|
||||
|
||||
export const ExecutionKind = S.Literal(
|
||||
"actual",
|
||||
"whatIf"
|
||||
);
|
||||
export const ExecutionKind = S.Literal('actual', 'whatIf');
|
||||
export type ExecutionKind = S.Schema.Type<typeof ExecutionKind>;
|
||||
|
||||
export const SecurityContextKind = S.Literal(
|
||||
"current",
|
||||
"elevated",
|
||||
"restricted"
|
||||
'current',
|
||||
'elevated',
|
||||
'restricted',
|
||||
);
|
||||
export type SecurityContextKind = S.Schema.Type<typeof SecurityContextKind>;
|
||||
|
||||
export const MicrosoftDscMetadata = S.Struct({
|
||||
"version": S.optional(S.NullOr(S.String)),
|
||||
"operation": S.optional(S.NullOr(Operation)),
|
||||
"executionType": S.optional(S.NullOr(ExecutionKind)),
|
||||
"startDatetime": S.optional(S.NullOr(S.String)),
|
||||
"endDatetime": S.optional(S.NullOr(S.String)),
|
||||
"duration": S.optional(S.NullOr(S.String)),
|
||||
"securityContext": S.optional(S.NullOr(SecurityContextKind))
|
||||
version: S.optional(S.NullOr(S.String)),
|
||||
operation: S.optional(S.NullOr(Operation)),
|
||||
executionType: S.optional(S.NullOr(ExecutionKind)),
|
||||
startDatetime: S.optional(S.NullOr(S.String)),
|
||||
endDatetime: S.optional(S.NullOr(S.String)),
|
||||
duration: S.optional(S.NullOr(S.String)),
|
||||
securityContext: S.optional(S.NullOr(SecurityContextKind)),
|
||||
});
|
||||
export type MicrosoftDscMetadata = S.Schema.Type<typeof MicrosoftDscMetadata>;
|
||||
|
||||
export const Metadata = S.Struct({
|
||||
"Microsoft.DSC": S.optional(S.NullOr(MicrosoftDscMetadata))
|
||||
'Microsoft.DSC': S.optional(S.NullOr(MicrosoftDscMetadata)),
|
||||
});
|
||||
export type Metadata = S.Schema.Type<typeof Metadata>;
|
||||
|
||||
// Recursive type declarations
|
||||
interface ResourceSetResult {
|
||||
readonly "metadata"?: Metadata | null;
|
||||
readonly "name": string;
|
||||
readonly "type": string;
|
||||
readonly "result": SetResult
|
||||
readonly metadata?: Metadata | null;
|
||||
readonly name: string;
|
||||
readonly type: string;
|
||||
readonly result: SetResult;
|
||||
}
|
||||
type SetResult = ResourceSetResponse | ReadonlyArray<ResourceSetResult>
|
||||
type SetResult = ResourceSetResponse | ReadonlyArray<ResourceSetResult>;
|
||||
|
||||
// Recursive schema definitions
|
||||
export const ResourceSetResult = S.Struct({
|
||||
"metadata": S.optional(S.NullOr(Metadata)),
|
||||
"name": S.String,
|
||||
"type": S.String,
|
||||
"result": S.suspend((): S.Schema<SetResult> => SetResult)
|
||||
metadata: S.optional(S.NullOr(Metadata)),
|
||||
name: S.String,
|
||||
type: S.String,
|
||||
result: S.suspend((): S.Schema<SetResult> => SetResult),
|
||||
}) as unknown as S.Schema<ResourceSetResult>;
|
||||
|
||||
export const SetResult = S.Union(ResourceSetResponse, S.Array(S.suspend((): S.Schema<ResourceSetResult> => ResourceSetResult))) as unknown as S.Schema<SetResult>;
|
||||
export const SetResult = S.Union(
|
||||
ResourceSetResponse,
|
||||
S.Array(S.suspend((): S.Schema<ResourceSetResult> => ResourceSetResult)),
|
||||
) as unknown as S.Schema<SetResult>;
|
||||
|
||||
@@ -2,65 +2,60 @@
|
||||
import * as S from 'effect/Schema';
|
||||
|
||||
export const ResourceTestResponse = S.Struct({
|
||||
"desiredState": S.Unknown,
|
||||
"actualState": S.Unknown,
|
||||
"inDesiredState": S.Boolean,
|
||||
"differingProperties": S.Array(S.String)
|
||||
desiredState: S.Unknown,
|
||||
actualState: S.Unknown,
|
||||
inDesiredState: S.Boolean,
|
||||
differingProperties: S.Array(S.String),
|
||||
});
|
||||
export type ResourceTestResponse = S.Schema.Type<typeof ResourceTestResponse>;
|
||||
|
||||
export const Operation = S.Literal(
|
||||
"get",
|
||||
"set",
|
||||
"test",
|
||||
"export"
|
||||
);
|
||||
export const Operation = S.Literal('get', 'set', 'test', 'export');
|
||||
export type Operation = S.Schema.Type<typeof Operation>;
|
||||
|
||||
export const ExecutionKind = S.Literal(
|
||||
"actual",
|
||||
"whatIf"
|
||||
);
|
||||
export const ExecutionKind = S.Literal('actual', 'whatIf');
|
||||
export type ExecutionKind = S.Schema.Type<typeof ExecutionKind>;
|
||||
|
||||
export const SecurityContextKind = S.Literal(
|
||||
"current",
|
||||
"elevated",
|
||||
"restricted"
|
||||
'current',
|
||||
'elevated',
|
||||
'restricted',
|
||||
);
|
||||
export type SecurityContextKind = S.Schema.Type<typeof SecurityContextKind>;
|
||||
|
||||
export const MicrosoftDscMetadata = S.Struct({
|
||||
"version": S.optional(S.NullOr(S.String)),
|
||||
"operation": S.optional(S.NullOr(Operation)),
|
||||
"executionType": S.optional(S.NullOr(ExecutionKind)),
|
||||
"startDatetime": S.optional(S.NullOr(S.String)),
|
||||
"endDatetime": S.optional(S.NullOr(S.String)),
|
||||
"duration": S.optional(S.NullOr(S.String)),
|
||||
"securityContext": S.optional(S.NullOr(SecurityContextKind))
|
||||
version: S.optional(S.NullOr(S.String)),
|
||||
operation: S.optional(S.NullOr(Operation)),
|
||||
executionType: S.optional(S.NullOr(ExecutionKind)),
|
||||
startDatetime: S.optional(S.NullOr(S.String)),
|
||||
endDatetime: S.optional(S.NullOr(S.String)),
|
||||
duration: S.optional(S.NullOr(S.String)),
|
||||
securityContext: S.optional(S.NullOr(SecurityContextKind)),
|
||||
});
|
||||
export type MicrosoftDscMetadata = S.Schema.Type<typeof MicrosoftDscMetadata>;
|
||||
|
||||
export const Metadata = S.Struct({
|
||||
"Microsoft.DSC": S.optional(S.NullOr(MicrosoftDscMetadata))
|
||||
'Microsoft.DSC': S.optional(S.NullOr(MicrosoftDscMetadata)),
|
||||
});
|
||||
export type Metadata = S.Schema.Type<typeof Metadata>;
|
||||
|
||||
// Recursive type declarations
|
||||
interface ResourceTestResult {
|
||||
readonly "metadata"?: Metadata | null;
|
||||
readonly "name": string;
|
||||
readonly "type": string;
|
||||
readonly "result": TestResult
|
||||
readonly metadata?: Metadata | null;
|
||||
readonly name: string;
|
||||
readonly type: string;
|
||||
readonly result: TestResult;
|
||||
}
|
||||
type TestResult = ResourceTestResponse | ReadonlyArray<ResourceTestResult>
|
||||
type TestResult = ResourceTestResponse | ReadonlyArray<ResourceTestResult>;
|
||||
|
||||
// Recursive schema definitions
|
||||
export const ResourceTestResult = S.Struct({
|
||||
"metadata": S.optional(S.NullOr(Metadata)),
|
||||
"name": S.String,
|
||||
"type": S.String,
|
||||
"result": S.suspend((): S.Schema<TestResult> => TestResult)
|
||||
metadata: S.optional(S.NullOr(Metadata)),
|
||||
name: S.String,
|
||||
type: S.String,
|
||||
result: S.suspend((): S.Schema<TestResult> => TestResult),
|
||||
}) as unknown as S.Schema<ResourceTestResult>;
|
||||
|
||||
export const TestResult = S.Union(ResourceTestResponse, S.Array(S.suspend((): S.Schema<ResourceTestResult> => ResourceTestResult))) as unknown as S.Schema<TestResult>;
|
||||
export const TestResult = S.Union(
|
||||
ResourceTestResponse,
|
||||
S.Array(S.suspend((): S.Schema<ResourceTestResult> => ResourceTestResult)),
|
||||
) as unknown as S.Schema<TestResult>;
|
||||
|
||||
123
src/dsc-utils.ts
Normal file
123
src/dsc-utils.ts
Normal file
@@ -0,0 +1,123 @@
|
||||
import { Effect, Console, Schema as S } from 'effect';
|
||||
import type {
|
||||
ConfigurationTestResult,
|
||||
ResourceTestResponse,
|
||||
} from './dsc-schema-types/configuration-test-result.gen';
|
||||
import { ConfigurationTestResult as ConfigurationTestResultSchema } from './dsc-schema-types/configuration-test-result.gen';
|
||||
import type {
|
||||
ConfigurationSetResult,
|
||||
ResourceSetResponse,
|
||||
} from './dsc-schema-types/configuration-set-result.gen';
|
||||
import { ConfigurationSetResult as ConfigurationSetResultSchema } from './dsc-schema-types/configuration-set-result.gen';
|
||||
|
||||
/**
|
||||
* Decodes and pretty-logs the result of a DSC configuration test operation.
|
||||
*/
|
||||
export const decodeAndPrettyLogTestResult = (stdout: string) =>
|
||||
Effect.gen(function* () {
|
||||
const raw = JSON.parse(stdout);
|
||||
const result = yield* S.decodeUnknown(ConfigurationTestResultSchema)(raw);
|
||||
|
||||
const allInDesiredState = result.results.every((res) =>
|
||||
'inDesiredState' in res.result
|
||||
? (res.result as ResourceTestResponse).inDesiredState
|
||||
: true,
|
||||
);
|
||||
|
||||
yield* Console.log('\n--- DSC Test Result Summary ---');
|
||||
|
||||
if (result.hadErrors) {
|
||||
yield* Console.error('🔴 Execution errors occurred during testing.');
|
||||
}
|
||||
|
||||
if (allInDesiredState) {
|
||||
yield* Console.log('✅ All resources are in the desired state.');
|
||||
} else {
|
||||
yield* Console.log('⚠️ Some resources are NOT in the desired state.');
|
||||
}
|
||||
|
||||
for (const res of result.results) {
|
||||
if ('inDesiredState' in res.result) {
|
||||
const testResponse = res.result as ResourceTestResponse;
|
||||
const status = testResponse.inDesiredState ? '✅' : '❌';
|
||||
yield* Console.log(`${status} [${res.type}] ${res.name}`);
|
||||
|
||||
if (
|
||||
!testResponse.inDesiredState &&
|
||||
testResponse.differingProperties.length > 0
|
||||
) {
|
||||
yield* Console.log(
|
||||
` Differing properties: ${testResponse.differingProperties.join(', ')}`,
|
||||
);
|
||||
|
||||
for (const prop of testResponse.differingProperties) {
|
||||
const desired = (testResponse.desiredState as any)?.[prop];
|
||||
const actual = (testResponse.actualState as any)?.[prop];
|
||||
yield* Console.log(` - ${prop}:`);
|
||||
yield* Console.log(` Desired: ${JSON.stringify(desired)}`);
|
||||
yield* Console.log(` Actual: ${JSON.stringify(actual)}`);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
yield* Console.log(`📦 [Group: ${res.type}] ${res.name}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (result.messages.length > 0) {
|
||||
yield* Console.log('\nMessages:');
|
||||
for (const msg of result.messages) {
|
||||
const icon =
|
||||
msg.level === 'error' ? '🔴' : msg.level === 'warning' ? '🟠' : '🔵';
|
||||
yield* Console.log(`${icon} [${msg.type}] ${msg.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
yield* Console.log('-------------------------------\n');
|
||||
});
|
||||
|
||||
/**
|
||||
* Decodes and pretty-logs the result of a DSC configuration set operation.
|
||||
*/
|
||||
export const decodeAndPrettyLogSetResult = (stdout: string) =>
|
||||
Effect.gen(function* () {
|
||||
const raw = JSON.parse(stdout);
|
||||
const result = yield* S.decodeUnknown(ConfigurationSetResultSchema)(raw);
|
||||
|
||||
yield* Console.log('\n--- DSC Set Result Summary ---');
|
||||
|
||||
if (result.hadErrors) {
|
||||
yield* Console.error('❌ Configuration set completed with errors.');
|
||||
} else {
|
||||
yield* Console.log('✅ Configuration set completed successfully.');
|
||||
}
|
||||
|
||||
for (const res of result.results) {
|
||||
if ('afterState' in res.result) {
|
||||
const setResponse = res.result as ResourceSetResponse;
|
||||
const changed =
|
||||
setResponse.changedProperties &&
|
||||
setResponse.changedProperties.length > 0;
|
||||
const status = changed ? '🔄' : '✅';
|
||||
yield* Console.log(`${status} [${res.type}] ${res.name}`);
|
||||
|
||||
if (changed) {
|
||||
yield* Console.log(
|
||||
` Changed properties: ${setResponse.changedProperties!.join(', ')}`,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
yield* Console.log(`📦 [Group: ${res.type}] ${res.name}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (result.messages.length > 0) {
|
||||
yield* Console.log('\nMessages:');
|
||||
for (const msg of result.messages) {
|
||||
const icon =
|
||||
msg.level === 'error' ? '🔴' : msg.level === 'warning' ? '🟠' : '🔵';
|
||||
yield* Console.log(`${icon} [${msg.type}] ${msg.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
yield* Console.log('-------------------------------\n');
|
||||
});
|
||||
36
src/dsl.ts
Normal file
36
src/dsl.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import * as S from 'effect/Schema';
|
||||
import { ResourceUnion } from './dsc-resource-schema-types/_resource-union.gen';
|
||||
import { Configuration as DscConfiguration } from './dsc-schema-types/configuration.gen';
|
||||
|
||||
/**
|
||||
* Enhanced configuration schema with strong typing for resources.
|
||||
* This extends the base DSC Configuration schema but overrides the 'resources'
|
||||
* field with our strongly-typed union of all resources available on this system.
|
||||
*/
|
||||
export const Configuration = S.Struct({
|
||||
...DscConfiguration.fields,
|
||||
resources: S.Array(ResourceUnion),
|
||||
});
|
||||
|
||||
export type Configuration = S.Schema.Type<typeof Configuration>;
|
||||
|
||||
/**
|
||||
* Helper to define a configuration with full type safety.
|
||||
* This provides a nice developer experience when defining the system state.
|
||||
*
|
||||
* @example
|
||||
* const myConfig = defineConfig({
|
||||
* $schema: 'https://aka.ms/dsc/schemas/v3/config/document.json',
|
||||
* resources: [
|
||||
* {
|
||||
* type: 'Microsoft.WinGet/Package',
|
||||
* name: 'Install VSCode',
|
||||
* properties: {
|
||||
* id: 'Microsoft.VisualStudioCode',
|
||||
* ensure: 'Present'
|
||||
* }
|
||||
* }
|
||||
* ]
|
||||
* });
|
||||
*/
|
||||
export const defineConfig = (config: Configuration): Configuration => config;
|
||||
59
src/utils.ts
Normal file
59
src/utils.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import { Command, Path } from '@effect/platform';
|
||||
|
||||
import { Effect, Option, pipe, Stream, String } from 'effect';
|
||||
|
||||
export const CommandUtils = {
|
||||
withLog: <A, E, R>(
|
||||
cmd: Command.Command,
|
||||
runner: (cmd: Command.Command) => Effect.Effect<A, E, R>,
|
||||
) =>
|
||||
Effect.gen(function* () {
|
||||
const flattenedCmd = Command.flatten(cmd);
|
||||
const [firstCmd] = flattenedCmd;
|
||||
yield* Effect.logDebug(
|
||||
`Running: '${flattenedCmd
|
||||
.map((c) => `${c.command} ${c.args.join(' ')}`)
|
||||
.join(' | ')}' in ${Option.getOrElse(firstCmd.cwd, () => '.')}`,
|
||||
);
|
||||
return yield* runner(cmd);
|
||||
}),
|
||||
/**
|
||||
* Command.workingDirectory does not set the PWD env var.
|
||||
*/
|
||||
withCwd: (cwd: string) =>
|
||||
Effect.gen(function* () {
|
||||
const path = yield* Path.Path;
|
||||
const absoluteCwd = path.resolve(path.join(process.cwd(), cwd));
|
||||
return (cmd: Command.Command) =>
|
||||
cmd.pipe(
|
||||
Command.workingDirectory(absoluteCwd),
|
||||
Command.env({ PWD: absoluteCwd }),
|
||||
);
|
||||
}),
|
||||
bufferStringStream: <E, R>(
|
||||
stream: Stream.Stream<Uint8Array, E, R>,
|
||||
): Effect.Effect<string, E, R> =>
|
||||
stream.pipe(
|
||||
Stream.decodeText(),
|
||||
Stream.runFold(String.empty, String.concat),
|
||||
),
|
||||
runCommandBuffered: (command: Command.Command) =>
|
||||
pipe(
|
||||
Command.start(command),
|
||||
Effect.flatMap((process) =>
|
||||
Effect.all(
|
||||
[
|
||||
process.exitCode,
|
||||
CommandUtils.bufferStringStream(process.stdout),
|
||||
CommandUtils.bufferStringStream(process.stderr),
|
||||
],
|
||||
{ concurrency: 3 },
|
||||
),
|
||||
),
|
||||
Effect.map(([exitCode, stdout, stderr]) => ({
|
||||
exitCode,
|
||||
stdout,
|
||||
stderr,
|
||||
})),
|
||||
),
|
||||
};
|
||||
Reference in New Issue
Block a user