;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. #@41 NPM package name for keytar to execute. (defconst keytar-package-name "@emacs-grammarly/keytar-cli" (#$ . 87)) #@61 Return non-nil if IN-CMD executed succesfully. (fn IN-CMD) (defalias 'keytar--execute #[257 "\302 \303\304\"\216\305\306\307!\310U+\207" [message-log-max inhibit-message current-window-configuration make-closure #[0 "\301\300!\207" [V0 set-window-configuration] 2] t nil shell-command 0] 5 (#$ . 204)]) #@64 Return result in string after IN-CMD is executed. (fn IN-CMD) (defalias 'keytar--execute-string #[257 "\302 \303\304\"\216\305\306\307\310!!+\207" [message-log-max inhibit-message current-window-configuration make-closure #[0 "\301\300!\207" [V0 set-window-configuration] 2] t nil string-trim shell-command-to-string] 5 (#$ . 518)]) #@55 Return non-nil if `keytar-cli' installed succesfully. (defalias 'keytar-installed-p #[0 "\300\301!\207" [keytar--execute "keytar --help"] 2 (#$ . 862)]) #@32 Key before using `keytar-cli'. (defalias 'keytar--ckeck #[0 "\301 ?\205\n\302\303\"\207" [keytar-package-name keytar-installed-p user-error "[ERROR] Make sure you have installed `%s` through `npm`"] 3 (#$ . 1021)]) #@54 Return nil if RESULT is invalid output. (fn RESULT) (defalias 'keytar--valid-return #[257 "\211\301\230\206#\302\303\304\305#)\266\203\206#\306\303\304\305#)\266\203?\205(\211\207" [inhibit-changing-match-data "null" "TypeError:" nil t string-match "Not enough arguments"] 8 (#$ . 1244)]) #@37 Install keytar package through npm. (defalias 'keytar-install #[0 "\301\302\303\"!\203\304\305\"\207\306\307\"\207" [keytar-package-name keytar--execute format "npm install -g %s" message "Successfully install `%s` through `npm`!" user-error "Failed to install` %s` through `npm`, make sure you have npm installed"] 4 (#$ . 1553) nil]) #@76 Get the stored password for the SERVICE and ACCOUNT. (fn SERVICE ACCOUNT) (defalias 'keytar-get-password #[514 "\300 \210\301\302\303\304#!!\207" [keytar--ckeck keytar--valid-return keytar--execute-string format "keytar get-pass -s %s -a %s"] 8 (#$ . 1900)]) #@171 Save the PASSWORD for the SERVICE and ACCOUNT to the keychain. Adds a new entry if necessary, or updates an existing entry if one exists. (fn SERVICE ACCOUNT PASSWORD) (defalias 'keytar-set-password #[771 "\300 \210\301\302\303$!\207" [keytar--ckeck keytar--execute format "keytar set-pass -s %s -a %s -p %s"] 9 (#$ . 2169)]) #@79 Delete the stored password for the SERVICE and ACCOUNT. (fn SERVICE ACCOUNT) (defalias 'keytar-delete-password #[514 "\300 \210\301\302\303#!\207" [keytar--ckeck keytar--execute format "keytar delete-pass -s %s -a %s"] 7 (#$ . 2506)]) #@79 Find all accounts and password for the SERVICE in the keychain. (fn SERVICE) (defalias 'keytar-find-credentials #[257 "\300 \210\301\302\303\304\"!!\207" [keytar--ckeck keytar--valid-return keytar--execute-string format "keytar find-creds -s %s"] 6 (#$ . 2750)]) #@127 Find a password for the SERVICE in the keychain. This is ideal for scenarios where an account is not required. (fn SERVICE) (defalias 'keytar-find-password #[257 "\300 \210\301\302\303\304\"!!\207" [keytar--ckeck keytar--valid-return keytar--execute-string format "keytar find-pass -s %s"] 6 (#$ . 3022)]) (provide 'keytar)