MCPcopy Create free account
hub / github.com/chhoumann/quickadd / buildSecretOptionNamesByPath

Function buildSecretOptionNamesByPath

src/services/packageImportService.ts:809–838  ·  view source on GitHub ↗
(
	pkg: QuickAddPackage,
)

Source from the content-addressed store, hash-verified

807}
808
809function buildSecretOptionNamesByPath(
810 pkg: QuickAddPackage,
811): Map<string, ReadonlySet<string> | null> {
812 const secretOptionNamesByPath = new Map<string, ReadonlySet<string> | null>();
813
814 for (const asset of pkg.assets) {
815 if (asset.kind !== "user-script") continue;
816
817 try {
818 const detection = detectUserScriptSecretOptions(
819 decodeFromBase64(asset.content),
820 asset.originalPath,
821 );
822 secretOptionNamesByPath.set(
823 asset.originalPath,
824 detection.foundSecretOptions && detection.names.size === 0
825 ? null
826 : detection.names,
827 );
828 } catch (error) {
829 log.logWarning(
830 `QuickAdd import could not inspect user-script settings '${asset.originalPath}': ${
831 (error as Error)?.message ?? error
832 }`,
833 );
834 }
835 }
836
837 return secretOptionNamesByPath;
838}
839
840async function assetExists(app: App, path: string): Promise<boolean> {
841 try {

Callers 1

applyPackageImportFunction · 0.70

Calls 4

decodeFromBase64Function · 0.90
logWarningMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected