{"version":3,"names":["map","key","value","t","object","unknown","pattern","command","name","string","required","description","usage","func","options","array","items","parse","default","alternatives","try","bool","number","allow","rename","ignoreUndefined","examples","desc","cmd","healthCheck","label","healthchecks","isRequired","getDiagnostics","win32AutomaticFix","darwinAutomaticFix","linuxAutomaticFix","runAutomaticFix","dependencyConfig","dependency","platforms","any","keys","ios","scriptPhases","configurations","android","sourceDir","manifestPath","packageName","packageImportPath","packageInstance","dependencyConfiguration","buildTypes","libraryName","componentDescriptors","cmakeListsPath","npmPackageName","optional","projectConfig","linkConfig","commands","healthChecks","dependencies","root","podspecPath","reactNativePath","project","unstable_reactLegacyComponentNames","appName","assets"],"sources":["../src/schema.ts"],"sourcesContent":["/**\n * This schema is used by `cli-config` to validate the structure. Make sure\n * this file stays up to date with `cli-types` package.\n *\n * In the future, it would be great to generate this file automatically from the\n * Typescript types.\n */\nimport t, {SchemaLike} from 'joi';\n\nconst map = (key: RegExp | SchemaLike, value: SchemaLike) =>\n t.object().unknown(true).pattern(key, value);\n\n/**\n * Schema for CommandT\n */\nconst command = t.object({\n name: t.string().required(),\n description: t.string(),\n usage: t.string(),\n func: t.func().required(),\n options: t.array().items(\n t\n .object({\n name: t.string().required(),\n description: t.string(),\n parse: t.func(),\n default: t\n .alternatives()\n .try(t.bool(), t.number(), t.string().allow(''), t.func()),\n })\n .rename('command', 'name', {ignoreUndefined: true}),\n ),\n examples: t.array().items(\n t.object({\n desc: t.string().required(),\n cmd: t.string().required(),\n }),\n ),\n});\n\n/**\n * Schema for HealthChecksT\n */\nconst healthCheck = t.object({\n label: t.string().required(),\n healthchecks: t.array().items(\n t.object({\n label: t.string().required(),\n isRequired: t.bool(),\n description: t.string(),\n getDiagnostics: t.func(),\n win32AutomaticFix: t.func(),\n darwinAutomaticFix: t.func(),\n linuxAutomaticFix: t.func(),\n runAutomaticFix: t.func().required(),\n }),\n ),\n});\n\n/**\n * Schema for UserDependencyConfig\n */\nexport const dependencyConfig = t\n .object({\n dependency: t\n .object({\n platforms: map(t.string(), t.any())\n .keys({\n ios: t\n // IOSDependencyParams\n .object({\n scriptPhases: t.array().items(t.object()),\n configurations: t.array().items(t.string()).default([]),\n })\n .allow(null),\n android: t\n // AndroidDependencyParams\n .object({\n sourceDir: t.string(),\n manifestPath: t.string(),\n packageName: t.string(),\n packageImportPath: t.string(),\n packageInstance: t.string(),\n dependencyConfiguration: t.string(),\n buildTypes: t.array().items(t.string()).default([]),\n libraryName: t.string().allow(null),\n componentDescriptors: t.array().items(t.string()).allow(null),\n cmakeListsPath: t.string().allow(null),\n })\n .allow(null),\n })\n .default(),\n })\n .default(),\n platforms: map(\n t.string(),\n t.object({\n npmPackageName: t.string().optional(),\n dependencyConfig: t.func(),\n projectConfig: t.func(),\n linkConfig: t.func(),\n }),\n ).default({}),\n commands: t.array().items(command).default([]),\n healthChecks: t.array().items(healthCheck).default([]),\n })\n .unknown(true)\n .default();\n\n/**\n * Schema for ProjectConfig\n */\nexport const projectConfig = t\n .object({\n dependencies: map(\n t.string(),\n t\n .object({\n root: t.string(),\n platforms: map(t.string(), t.any()).keys({\n ios: t\n // IOSDependencyConfig\n .object({\n podspecPath: t.string(),\n configurations: t.array().items(t.string()).default([]),\n scriptPhases: t.array().items(t.object()).default([]),\n })\n .allow(null),\n android: t\n // AndroidDependencyConfig\n .object({\n sourceDir: t.string(),\n packageImportPath: t.string(),\n packageInstance: t.string(),\n dependencyConfiguration: t.string(),\n buildTypes: t.array().items(t.string()).default([]),\n libraryName: t.string().allow(null),\n componentDescriptors: t.array().items(t.string()).allow(null),\n cmakeListsPath: t.string().allow(null),\n })\n .allow(null),\n }),\n })\n .allow(null),\n ).default({}),\n reactNativePath: t.string(),\n project: map(t.string(), t.any())\n .keys({\n ios: t\n // IOSProjectParams\n .object({\n sourceDir: t.string(),\n unstable_reactLegacyComponentNames: t\n .array()\n .items(t.string())\n .default([]),\n })\n .default({}),\n android: t\n // AndroidProjectParams\n .object({\n sourceDir: t.string(),\n appName: t.string(),\n manifestPath: t.string(),\n packageName: t.string(),\n dependencyConfiguration: t.string(),\n unstable_reactLegacyComponentNames: t\n .array()\n .items(t.string())\n .default([]),\n })\n .default({}),\n })\n .default(),\n assets: t.array().items(t.string()).default([]),\n commands: t.array().items(command).default([]),\n platforms: map(\n t.string(),\n t.object({\n npmPackageName: t.string().optional(),\n dependencyConfig: t.func(),\n projectConfig: t.func(),\n linkConfig: t.func(),\n }),\n ).default({}),\n })\n .unknown(true)\n .default();\n"],"mappings":";;;;;;AAOA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAkC;AAPlC;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,MAAMA,GAAG,GAAG,CAACC,GAAwB,EAAEC,KAAiB,KACtDC,cAAC,CAACC,MAAM,EAAE,CAACC,OAAO,CAAC,IAAI,CAAC,CAACC,OAAO,CAACL,GAAG,EAAEC,KAAK,CAAC;;AAE9C;AACA;AACA;AACA,MAAMK,OAAO,GAAGJ,cAAC,CAACC,MAAM,CAAC;EACvBI,IAAI,EAAEL,cAAC,CAACM,MAAM,EAAE,CAACC,QAAQ,EAAE;EAC3BC,WAAW,EAAER,cAAC,CAACM,MAAM,EAAE;EACvBG,KAAK,EAAET,cAAC,CAACM,MAAM,EAAE;EACjBI,IAAI,EAAEV,cAAC,CAACU,IAAI,EAAE,CAACH,QAAQ,EAAE;EACzBI,OAAO,EAAEX,cAAC,CAACY,KAAK,EAAE,CAACC,KAAK,CACtBb,cAAC,CACEC,MAAM,CAAC;IACNI,IAAI,EAAEL,cAAC,CAACM,MAAM,EAAE,CAACC,QAAQ,EAAE;IAC3BC,WAAW,EAAER,cAAC,CAACM,MAAM,EAAE;IACvBQ,KAAK,EAAEd,cAAC,CAACU,IAAI,EAAE;IACfK,OAAO,EAAEf,cAAC,CACPgB,YAAY,EAAE,CACdC,GAAG,CAACjB,cAAC,CAACkB,IAAI,EAAE,EAAElB,cAAC,CAACmB,MAAM,EAAE,EAAEnB,cAAC,CAACM,MAAM,EAAE,CAACc,KA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