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

Function storeUserScriptSecret

src/utils/userScriptSecrets.ts:624–640  ·  view source on GitHub ↗
(
	app: App | undefined,
	command: IUserScript,
	settingName: string,
	value: string,
	existingRef?: string,
	option?: UserScriptOptionDefinition,
)

Source from the content-addressed store, hash-verified

622}
623
624export async function storeUserScriptSecret(
625 app: App | undefined,
626 command: IUserScript,
627 settingName: string,
628 value: string,
629 existingRef?: string,
630 option?: UserScriptOptionDefinition,
631): Promise<string | null> {
632 if (value.length === 0) return null;
633
634 const secretRef =
635 existingRef?.trim() ||
636 (await buildAvailableSecretRef(app, command, settingName, value, option));
637 const stored = await writeSecretStorageEntry(app, secretRef, value);
638
639 return stored ? secretRef : null;
640}
641
642export async function clearUserScriptSecret(
643 app: App | undefined,

Callers 3

addSecretInputMethod · 0.90

Calls 2

buildAvailableSecretRefFunction · 0.85
writeSecretStorageEntryFunction · 0.85

Tested by

no test coverage detected