passwords_private.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. // Copyright 2022 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. // This file was generated by:
  5. // tools/json_schema_compiler/compiler.py.
  6. // NOTE: The format of types has changed. 'FooType' is now
  7. // 'chrome.passwordsPrivate.FooType'.
  8. // Please run the closure compiler before committing changes.
  9. // See https://chromium.googlesource.com/chromium/src/+/main/docs/closure_compilation.md
  10. /** @fileoverview Externs generated from namespace: passwordsPrivate */
  11. /** @const */
  12. chrome.passwordsPrivate = {};
  13. /**
  14. * @enum {string}
  15. */
  16. chrome.passwordsPrivate.PlaintextReason = {
  17. VIEW: 'VIEW',
  18. COPY: 'COPY',
  19. EDIT: 'EDIT',
  20. };
  21. /**
  22. * @enum {string}
  23. */
  24. chrome.passwordsPrivate.ExportProgressStatus = {
  25. NOT_STARTED: 'NOT_STARTED',
  26. IN_PROGRESS: 'IN_PROGRESS',
  27. SUCCEEDED: 'SUCCEEDED',
  28. FAILED_CANCELLED: 'FAILED_CANCELLED',
  29. FAILED_WRITE_FAILED: 'FAILED_WRITE_FAILED',
  30. };
  31. /**
  32. * @enum {string}
  33. */
  34. chrome.passwordsPrivate.CompromiseType = {
  35. LEAKED: 'LEAKED',
  36. PHISHED: 'PHISHED',
  37. PHISHED_AND_LEAKED: 'PHISHED_AND_LEAKED',
  38. };
  39. /**
  40. * @enum {string}
  41. */
  42. chrome.passwordsPrivate.PasswordStoreSet = {
  43. DEVICE: 'DEVICE',
  44. ACCOUNT: 'ACCOUNT',
  45. DEVICE_AND_ACCOUNT: 'DEVICE_AND_ACCOUNT',
  46. };
  47. /**
  48. * @enum {string}
  49. */
  50. chrome.passwordsPrivate.PasswordCheckState = {
  51. IDLE: 'IDLE',
  52. RUNNING: 'RUNNING',
  53. CANCELED: 'CANCELED',
  54. OFFLINE: 'OFFLINE',
  55. SIGNED_OUT: 'SIGNED_OUT',
  56. NO_PASSWORDS: 'NO_PASSWORDS',
  57. QUOTA_LIMIT: 'QUOTA_LIMIT',
  58. OTHER_ERROR: 'OTHER_ERROR',
  59. };
  60. /**
  61. * @enum {string}
  62. */
  63. chrome.passwordsPrivate.ImportResultsStatus = {
  64. UNKNOWN_ERROR: 'UNKNOWN_ERROR',
  65. SUCCESS: 'SUCCESS',
  66. IO_ERROR: 'IO_ERROR',
  67. BAD_FORMAT: 'BAD_FORMAT',
  68. DISMISSED: 'DISMISSED',
  69. MAX_FILE_SIZE: 'MAX_FILE_SIZE',
  70. IMPORT_ALREADY_ACTIVE: 'IMPORT_ALREADY_ACTIVE',
  71. NUM_PASSWORDS_EXCEEDED: 'NUM_PASSWORDS_EXCEEDED',
  72. };
  73. /**
  74. * @enum {string}
  75. */
  76. chrome.passwordsPrivate.ImportEntryStatus = {
  77. UNKNOWN_ERROR: 'UNKNOWN_ERROR',
  78. MISSING_PASSWORD: 'MISSING_PASSWORD',
  79. MISSING_URL: 'MISSING_URL',
  80. INVALID_URL: 'INVALID_URL',
  81. NON_ASCII_URL: 'NON_ASCII_URL',
  82. LONG_URL: 'LONG_URL',
  83. LONG_PASSWORD: 'LONG_PASSWORD',
  84. LONG_USERNAME: 'LONG_USERNAME',
  85. CONFLICT_PROFILE: 'CONFLICT_PROFILE',
  86. CONFLICT_ACCOUNT: 'CONFLICT_ACCOUNT',
  87. };
  88. /**
  89. * @typedef {{
  90. * status: !chrome.passwordsPrivate.ImportEntryStatus,
  91. * url: string,
  92. * username: string
  93. * }}
  94. */
  95. chrome.passwordsPrivate.ImportEntry;
  96. /**
  97. * @typedef {{
  98. * status: !chrome.passwordsPrivate.ImportResultsStatus,
  99. * numberImported: number,
  100. * failedImports: !Array<!chrome.passwordsPrivate.ImportEntry>,
  101. * fileName: string
  102. * }}
  103. */
  104. chrome.passwordsPrivate.ImportResults;
  105. /**
  106. * @typedef {{
  107. * signonRealm: string,
  108. * shown: string,
  109. * link: string
  110. * }}
  111. */
  112. chrome.passwordsPrivate.UrlCollection;
  113. /**
  114. * @typedef {{
  115. * compromiseTime: number,
  116. * elapsedTimeSinceCompromise: string,
  117. * compromiseType: !chrome.passwordsPrivate.CompromiseType,
  118. * isMuted: boolean
  119. * }}
  120. */
  121. chrome.passwordsPrivate.CompromisedInfo;
  122. /**
  123. * @typedef {{
  124. * urls: !chrome.passwordsPrivate.UrlCollection,
  125. * username: string,
  126. * password: (string|undefined),
  127. * federationText: (string|undefined),
  128. * id: number,
  129. * storedIn: !chrome.passwordsPrivate.PasswordStoreSet,
  130. * isAndroidCredential: boolean,
  131. * note: (string|undefined),
  132. * changePasswordUrl: (string|undefined),
  133. * hasStartableScript: boolean,
  134. * compromisedInfo: (!chrome.passwordsPrivate.CompromisedInfo|undefined)
  135. * }}
  136. */
  137. chrome.passwordsPrivate.PasswordUiEntry;
  138. /**
  139. * @typedef {{
  140. * urls: !chrome.passwordsPrivate.UrlCollection,
  141. * id: number
  142. * }}
  143. */
  144. chrome.passwordsPrivate.ExceptionEntry;
  145. /**
  146. * @typedef {{
  147. * status: !chrome.passwordsPrivate.ExportProgressStatus,
  148. * folderName: (string|undefined)
  149. * }}
  150. */
  151. chrome.passwordsPrivate.PasswordExportProgress;
  152. /**
  153. * @typedef {{
  154. * state: !chrome.passwordsPrivate.PasswordCheckState,
  155. * alreadyProcessed: (number|undefined),
  156. * remainingInQueue: (number|undefined),
  157. * elapsedTimeSinceLastCheck: (string|undefined)
  158. * }}
  159. */
  160. chrome.passwordsPrivate.PasswordCheckStatus;
  161. /**
  162. * @typedef {{
  163. * url: string,
  164. * username: string,
  165. * password: string,
  166. * note: string,
  167. * useAccountStore: boolean
  168. * }}
  169. */
  170. chrome.passwordsPrivate.AddPasswordOptions;
  171. /**
  172. * @typedef {{
  173. * username: string,
  174. * password: string,
  175. * note: (string|undefined)
  176. * }}
  177. */
  178. chrome.passwordsPrivate.ChangeSavedPasswordParams;
  179. /**
  180. * Function that logs that the Passwords page was accessed from the Chrome
  181. * Settings WebUI.
  182. */
  183. chrome.passwordsPrivate.recordPasswordsPageAccessInSettings = function() {};
  184. /**
  185. * Changes the saved password corresponding to |id|. Invokes |callback| or
  186. * raises an error depending on whether the operation succeeded.
  187. * @param {number} id The id for the password entry being updated.
  188. * @param {!chrome.passwordsPrivate.ChangeSavedPasswordParams} params The
  189. * dictionary which holds the changed parameters.
  190. * @param {function(number): void=} callback The callback that gets invoked in
  191. * the end.
  192. */
  193. chrome.passwordsPrivate.changeSavedPassword = function(id, params, callback) {};
  194. /**
  195. * Removes the saved password corresponding to |id| in |fromStores|. If no saved
  196. * password for this pair exists, this function is a no-op.
  197. * @param {number} id The id for the password entry being removed.
  198. * @param {!chrome.passwordsPrivate.PasswordStoreSet} fromStores The store(s)
  199. * from which the password entry is being removed.
  200. */
  201. chrome.passwordsPrivate.removeSavedPassword = function(id, fromStores) {};
  202. /**
  203. * Removes the saved password exception corresponding to |id|. If no exception
  204. * with this id exists, this function is a no-op. This will remove exception
  205. * from both stores.
  206. * @param {number} id The id for the exception url entry is being removed.
  207. */
  208. chrome.passwordsPrivate.removePasswordException = function(id) {};
  209. /**
  210. * Undoes the last removal of saved password(s) or exception(s).
  211. */
  212. chrome.passwordsPrivate.undoRemoveSavedPasswordOrException = function() {};
  213. /**
  214. * Returns the plaintext password corresponding to |id|. Note that on some
  215. * operating systems, this call may result in an OS-level reauthentication. Once
  216. * the password has been fetched, it will be returned via |callback|.
  217. * @param {number} id The id for the password entry being being retrieved.
  218. * @param {!chrome.passwordsPrivate.PlaintextReason} reason The reason why the
  219. * plaintext password is requested.
  220. * @param {function(string): void} callback The callback that gets invoked with
  221. * the retrieved password.
  222. */
  223. chrome.passwordsPrivate.requestPlaintextPassword = function(id, reason, callback) {};
  224. /**
  225. * Returns the PasswordUiEntry (with |password| field filled) corresponding to
  226. * |id|. Note that on some operating systems, this call may result in an
  227. * OS-level reauthentication. Once the PasswordUiEntry has been fetched, it will
  228. * be returned via |callback|.
  229. * @param {number} id The id for the password entry being being retrieved.
  230. * @param {function(!chrome.passwordsPrivate.PasswordUiEntry): void} callback
  231. * The callback that gets invoked with the retrieved PasswordUiEntry.
  232. */
  233. chrome.passwordsPrivate.requestCredentialDetails = function(id, callback) {};
  234. /**
  235. * Returns the list of saved passwords.
  236. * @param {function(!Array<!chrome.passwordsPrivate.PasswordUiEntry>): void}
  237. * callback Called with the list of saved passwords.
  238. */
  239. chrome.passwordsPrivate.getSavedPasswordList = function(callback) {};
  240. /**
  241. * Returns the list of password exceptions.
  242. * @param {function(!Array<!chrome.passwordsPrivate.ExceptionEntry>): void}
  243. * callback Called with the list of password exceptions.
  244. */
  245. chrome.passwordsPrivate.getPasswordExceptionList = function(callback) {};
  246. /**
  247. * Moves passwords currently stored on the device to being stored in the
  248. * signed-in, non-syncing Google Account. For each id, the result is a no-op if
  249. * any of these is true: |id| is invalid; |id| corresponds to a password already
  250. * stored in the account; or the user is not using the account-scoped password
  251. * storage.
  252. * @param {!Array<number>} ids The ids for the password entries being moved.
  253. */
  254. chrome.passwordsPrivate.movePasswordsToAccount = function(ids) {};
  255. /**
  256. * Triggers the Password Manager password import functionality.
  257. * @param {!chrome.passwordsPrivate.PasswordStoreSet} toStore
  258. * @param {function(!chrome.passwordsPrivate.ImportResults): void} callback
  259. */
  260. chrome.passwordsPrivate.importPasswords = function(toStore, callback) {};
  261. /**
  262. * Triggers the Password Manager password export functionality. Completion Will
  263. * be signaled by the onPasswordsFileExportProgress event. |callback| will be
  264. * called when the request is started or rejected. If rejected
  265. * $(ref:runtime.lastError) will be set to <code>'in-progress'</code> or
  266. * <code>'reauth-failed'</code>.
  267. * @param {function(): void} callback
  268. */
  269. chrome.passwordsPrivate.exportPasswords = function(callback) {};
  270. /**
  271. * Requests the export progress status. This is the same as the last value seen
  272. * on the onPasswordsFileExportProgress event. This function is useful for
  273. * checking if an export has already been initiated from an older tab, where we
  274. * might have missed the original event.
  275. * @param {function(!chrome.passwordsPrivate.ExportProgressStatus): void}
  276. * callback
  277. */
  278. chrome.passwordsPrivate.requestExportProgressStatus = function(callback) {};
  279. /**
  280. * Stops exporting passwords and cleans up any passwords, which were already
  281. * written to the filesystem.
  282. */
  283. chrome.passwordsPrivate.cancelExportPasswords = function() {};
  284. /**
  285. * Requests the account-storage opt-in state of the current user.
  286. * @param {function(boolean): void} callback
  287. */
  288. chrome.passwordsPrivate.isOptedInForAccountStorage = function(callback) {};
  289. /**
  290. * Triggers the opt-in or opt-out flow for the account storage.
  291. * @param {boolean} optIn
  292. */
  293. chrome.passwordsPrivate.optInForAccountStorage = function(optIn) {};
  294. /**
  295. * Requests the latest compromised credentials.
  296. * @param {function(!Array<!chrome.passwordsPrivate.PasswordUiEntry>): void}
  297. * callback
  298. */
  299. chrome.passwordsPrivate.getCompromisedCredentials = function(callback) {};
  300. /**
  301. * Requests the latest weak credentials.
  302. * @param {function(!Array<!chrome.passwordsPrivate.PasswordUiEntry>): void}
  303. * callback
  304. */
  305. chrome.passwordsPrivate.getWeakCredentials = function(callback) {};
  306. /**
  307. * Requests to mute |credential| from the password store. Invokes |callback| on
  308. * completion.
  309. * @param {!chrome.passwordsPrivate.PasswordUiEntry} credential
  310. * @param {function(): void=} callback
  311. */
  312. chrome.passwordsPrivate.muteInsecureCredential = function(credential, callback) {};
  313. /**
  314. * Requests to unmute |credential| from the password store. Invokes |callback|
  315. * on completion.
  316. * @param {!chrome.passwordsPrivate.PasswordUiEntry} credential
  317. * @param {function(): void=} callback
  318. */
  319. chrome.passwordsPrivate.unmuteInsecureCredential = function(credential, callback) {};
  320. /**
  321. * Records that a change password flow was started for |credential|.
  322. * @param {!chrome.passwordsPrivate.PasswordUiEntry} credential The credential
  323. * for which the flow was triggered.
  324. * @param {boolean} isManualFlow
  325. * @param {function(): void=} callback
  326. */
  327. chrome.passwordsPrivate.recordChangePasswordFlowStarted = function(credential, isManualFlow, callback) {};
  328. /**
  329. * Refreshes the cache for automatic password change scripts if it is stale.
  330. * Invokes `callback` on completion.
  331. * @param {function(): void=} callback
  332. */
  333. chrome.passwordsPrivate.refreshScriptsIfNecessary = function(callback) {};
  334. /**
  335. * Starts a check for insecure passwords. Invokes |callback| on completion.
  336. * @param {function(): void=} callback
  337. */
  338. chrome.passwordsPrivate.startPasswordCheck = function(callback) {};
  339. /**
  340. * Stops checking for insecure passwords. Invokes |callback| on completion.
  341. * @param {function(): void=} callback
  342. */
  343. chrome.passwordsPrivate.stopPasswordCheck = function(callback) {};
  344. /**
  345. * Returns the current status of the check via |callback|.
  346. * @param {function(!chrome.passwordsPrivate.PasswordCheckStatus): void}
  347. * callback
  348. */
  349. chrome.passwordsPrivate.getPasswordCheckStatus = function(callback) {};
  350. /**
  351. * Starts an automated password change for |credential|. Invokes |callback| on
  352. * completion with a boolean parameter that signals whether the credential was
  353. * changed successfully.
  354. * @param {!chrome.passwordsPrivate.PasswordUiEntry} credential
  355. * @param {function(boolean): void=} callback
  356. */
  357. chrome.passwordsPrivate.startAutomatedPasswordChange = function(credential, callback) {};
  358. /**
  359. * Requests whether the account store is a default location for saving
  360. * passwords. False means the device store is a default one. Must be called when
  361. * the current user has already opted-in for account storage.
  362. * @param {function(boolean): void} callback
  363. */
  364. chrome.passwordsPrivate.isAccountStoreDefault = function(callback) {};
  365. /**
  366. * Requests whether the given |url| meets the requirements to save a password
  367. * for it (e.g. valid, has proper scheme etc.) and returns the corresponding
  368. * URLCollection on success. Otherwise it raises an error.
  369. * @param {string} url
  370. * @param {function(!chrome.passwordsPrivate.UrlCollection): void} callback
  371. */
  372. chrome.passwordsPrivate.getUrlCollection = function(url, callback) {};
  373. /**
  374. * Saves a new password entry described by the given |options|. Invokes
  375. * |callback| or raises an error depending on whether the operation succeeded.
  376. * @param {!chrome.passwordsPrivate.AddPasswordOptions} options Details about a
  377. * new password and storage to be used.
  378. * @param {function(): void=} callback The callback that gets invoked on
  379. * success.
  380. */
  381. chrome.passwordsPrivate.addPassword = function(options, callback) {};
  382. /**
  383. * Fired when the saved passwords list has changed, meaning that an entry has
  384. * been added or removed.
  385. * @type {!ChromeEvent}
  386. */
  387. chrome.passwordsPrivate.onSavedPasswordsListChanged;
  388. /**
  389. * Fired when the password exceptions list has changed, meaning that an entry
  390. * has been added or removed.
  391. * @type {!ChromeEvent}
  392. */
  393. chrome.passwordsPrivate.onPasswordExceptionsListChanged;
  394. /**
  395. * Fired when the status of the export has changed.
  396. * @type {!ChromeEvent}
  397. */
  398. chrome.passwordsPrivate.onPasswordsFileExportProgress;
  399. /**
  400. * Fired when the opt-in state for the account-scoped storage has changed.
  401. * @type {!ChromeEvent}
  402. */
  403. chrome.passwordsPrivate.onAccountStorageOptInStateChanged;
  404. /**
  405. * Fired when the compromised credentials changed.
  406. * @type {!ChromeEvent}
  407. */
  408. chrome.passwordsPrivate.onCompromisedCredentialsChanged;
  409. /**
  410. * Fired when the weak credentials changed.
  411. * @type {!ChromeEvent}
  412. */
  413. chrome.passwordsPrivate.onWeakCredentialsChanged;
  414. /**
  415. * Fired when the status of the password check changes.
  416. * @type {!ChromeEvent}
  417. */
  418. chrome.passwordsPrivate.onPasswordCheckStatusChanged;
  419. /**
  420. * Fired when the password manager access timed out.
  421. * @type {!ChromeEvent}
  422. */
  423. chrome.passwordsPrivate.onPasswordManagerAuthTimeout;