blob: df82fdbc47c9f6162702ce688829f41675d596a6 [file] [log] [blame]
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file was generated by:
// tools/json_schema_compiler/compiler.py.
// NOTE: The format of types has changed. 'FooType' is now
// 'chrome.passwordsPrivate.FooType'.
// Please run the closure compiler before committing changes.
// See https://chromium.googlesource.com/chromium/src/+/main/docs/closure_compilation.md
/**
* @fileoverview Externs generated from namespace: passwordsPrivate
* @externs
*/
/** @const */
chrome.passwordsPrivate = {};
/**
* @enum {string}
*/
chrome.passwordsPrivate.PlaintextReason = {
VIEW: 'VIEW',
COPY: 'COPY',
EDIT: 'EDIT',
};
/**
* @enum {string}
*/
chrome.passwordsPrivate.ExportProgressStatus = {
NOT_STARTED: 'NOT_STARTED',
IN_PROGRESS: 'IN_PROGRESS',
SUCCEEDED: 'SUCCEEDED',
FAILED_CANCELLED: 'FAILED_CANCELLED',
FAILED_WRITE_FAILED: 'FAILED_WRITE_FAILED',
};
/**
* @enum {string}
*/
chrome.passwordsPrivate.CompromiseType = {
LEAKED: 'LEAKED',
PHISHED: 'PHISHED',
REUSED: 'REUSED',
WEAK: 'WEAK',
};
/**
* @enum {string}
*/
chrome.passwordsPrivate.PasswordStoreSet = {
DEVICE: 'DEVICE',
ACCOUNT: 'ACCOUNT',
DEVICE_AND_ACCOUNT: 'DEVICE_AND_ACCOUNT',
};
/**
* @enum {string}
*/
chrome.passwordsPrivate.PasswordCheckState = {
IDLE: 'IDLE',
RUNNING: 'RUNNING',
CANCELED: 'CANCELED',
OFFLINE: 'OFFLINE',
SIGNED_OUT: 'SIGNED_OUT',
NO_PASSWORDS: 'NO_PASSWORDS',
QUOTA_LIMIT: 'QUOTA_LIMIT',
OTHER_ERROR: 'OTHER_ERROR',
};
/**
* @enum {string}
*/
chrome.passwordsPrivate.ImportResultsStatus = {
UNKNOWN_ERROR: 'UNKNOWN_ERROR',
SUCCESS: 'SUCCESS',
IO_ERROR: 'IO_ERROR',
BAD_FORMAT: 'BAD_FORMAT',
DISMISSED: 'DISMISSED',
MAX_FILE_SIZE: 'MAX_FILE_SIZE',
IMPORT_ALREADY_ACTIVE: 'IMPORT_ALREADY_ACTIVE',
NUM_PASSWORDS_EXCEEDED: 'NUM_PASSWORDS_EXCEEDED',
};
/**
* @enum {string}
*/
chrome.passwordsPrivate.ImportEntryStatus = {
UNKNOWN_ERROR: 'UNKNOWN_ERROR',
MISSING_PASSWORD: 'MISSING_PASSWORD',
MISSING_URL: 'MISSING_URL',
INVALID_URL: 'INVALID_URL',
NON_ASCII_URL: 'NON_ASCII_URL',
LONG_URL: 'LONG_URL',
LONG_PASSWORD: 'LONG_PASSWORD',
LONG_USERNAME: 'LONG_USERNAME',
CONFLICT_PROFILE: 'CONFLICT_PROFILE',
CONFLICT_ACCOUNT: 'CONFLICT_ACCOUNT',
LONG_NOTE: 'LONG_NOTE',
LONG_CONCATENATED_NOTE: 'LONG_CONCATENATED_NOTE',
};
/**
* @typedef {{
* status: !chrome.passwordsPrivate.ImportEntryStatus,
* url: string,
* username: string
* }}
*/
chrome.passwordsPrivate.ImportEntry;
/**
* @typedef {{
* status: !chrome.passwordsPrivate.ImportResultsStatus,
* numberImported: number,
* failedImports: !Array<!chrome.passwordsPrivate.ImportEntry>,
* fileName: string
* }}
*/
chrome.passwordsPrivate.ImportResults;
/**
* @typedef {{
* signonRealm: string,
* shown: string,
* link: string
* }}
*/
chrome.passwordsPrivate.UrlCollection;
/**
* @typedef {{
* compromiseTime: number,
* elapsedTimeSinceCompromise: string,
* compromiseTypes: !Array<!chrome.passwordsPrivate.CompromiseType>,
* isMuted: boolean
* }}
*/
chrome.passwordsPrivate.CompromisedInfo;
/**
* @typedef {{
* name: string,
* url: string
* }}
*/
chrome.passwordsPrivate.DomainInfo;
/**
* @typedef {{
* urls: !chrome.passwordsPrivate.UrlCollection,
* affiliatedDomains: (!Array<!chrome.passwordsPrivate.DomainInfo>|undefined),
* username: string,
* password: (string|undefined),
* federationText: (string|undefined),
* id: number,
* storedIn: !chrome.passwordsPrivate.PasswordStoreSet,
* isAndroidCredential: boolean,
* note: (string|undefined),
* changePasswordUrl: (string|undefined),
* compromisedInfo: (!chrome.passwordsPrivate.CompromisedInfo|undefined)
* }}
*/
chrome.passwordsPrivate.PasswordUiEntry;
/**
* @typedef {{
* name: string,
* iconUrl: string,
* entries: !Array<!chrome.passwordsPrivate.PasswordUiEntry>
* }}
*/
chrome.passwordsPrivate.CredentialGroup;
/**
* @typedef {{
* urls: !chrome.passwordsPrivate.UrlCollection,
* id: number
* }}
*/
chrome.passwordsPrivate.ExceptionEntry;
/**
* @typedef {{
* status: !chrome.passwordsPrivate.ExportProgressStatus,
* folderName: (string|undefined)
* }}
*/
chrome.passwordsPrivate.PasswordExportProgress;
/**
* @typedef {{
* state: !chrome.passwordsPrivate.PasswordCheckState,
* totalNumberOfPasswords: (number|undefined),
* alreadyProcessed: (number|undefined),
* remainingInQueue: (number|undefined),
* elapsedTimeSinceLastCheck: (string|undefined)
* }}
*/
chrome.passwordsPrivate.PasswordCheckStatus;
/**
* @typedef {{
* url: string,
* username: string,
* password: string,
* note: string,
* useAccountStore: boolean
* }}
*/
chrome.passwordsPrivate.AddPasswordOptions;
/**
* @typedef {{
* username: string,
* password: string,
* note: (string|undefined)
* }}
*/
chrome.passwordsPrivate.ChangeSavedPasswordParams;
/**
* Function that logs that the Passwords page was accessed from the Chrome
* Settings WebUI.
*/
chrome.passwordsPrivate.recordPasswordsPageAccessInSettings = function() {};
/**
* Changes the saved password corresponding to |id|. Invokes |callback| or
* raises an error depending on whether the operation succeeded.
* @param {number} id The id for the password entry being updated.
* @param {!chrome.passwordsPrivate.ChangeSavedPasswordParams} params The
* dictionary which holds the changed parameters.
* @param {function(number): void=} callback The callback that gets invoked in
* the end.
*/
chrome.passwordsPrivate.changeSavedPassword = function(id, params, callback) {};
/**
* Removes the saved password corresponding to |id| in |fromStores|. If no saved
* password for this pair exists, this function is a no-op.
* @param {number} id The id for the password entry being removed.
* @param {!chrome.passwordsPrivate.PasswordStoreSet} fromStores The store(s)
* from which the password entry is being removed.
*/
chrome.passwordsPrivate.removeSavedPassword = function(id, fromStores) {};
/**
* Removes the saved password exception corresponding to |id|. If no exception
* with this id exists, this function is a no-op. This will remove exception
* from both stores.
* @param {number} id The id for the exception url entry is being removed.
*/
chrome.passwordsPrivate.removePasswordException = function(id) {};
/**
* Undoes the last removal of saved password(s) or exception(s).
*/
chrome.passwordsPrivate.undoRemoveSavedPasswordOrException = function() {};
/**
* Returns the plaintext password corresponding to |id|. Note that on some
* operating systems, this call may result in an OS-level reauthentication. Once
* the password has been fetched, it will be returned via |callback|.
* @param {number} id The id for the password entry being being retrieved.
* @param {!chrome.passwordsPrivate.PlaintextReason} reason The reason why the
* plaintext password is requested.
* @param {function(string): void} callback The callback that gets invoked with
* the retrieved password.
*/
chrome.passwordsPrivate.requestPlaintextPassword = function(id, reason, callback) {};
/**
* Returns the PasswordUiEntries (with |password|, |note| field filled)
* corresponding to |ids|. Note that on some operating systems, this call may
* result in an OS-level reauthentication. Once the PasswordUiEntry has been
* fetched, it will be returned via |callback|.
* @param {!Array<number>} ids Ids for the password entries being retrieved.
* @param {function(!Array<!chrome.passwordsPrivate.PasswordUiEntry>): void}
* callback The callback that gets invoked with the retrieved
* PasswordUiEntries.
*/
chrome.passwordsPrivate.requestCredentialsDetails = function(ids, callback) {};
/**
* Returns the list of saved passwords.
* @param {function(!Array<!chrome.passwordsPrivate.PasswordUiEntry>): void}
* callback Called with the list of saved passwords.
*/
chrome.passwordsPrivate.getSavedPasswordList = function(callback) {};
/**
* Returns the list of Credential groups.
* @param {function(!Array<!chrome.passwordsPrivate.CredentialGroup>): void}
* callback Called with the list of groups.
*/
chrome.passwordsPrivate.getCredentialGroups = function(callback) {};
/**
* Returns the list of password exceptions.
* @param {function(!Array<!chrome.passwordsPrivate.ExceptionEntry>): void}
* callback Called with the list of password exceptions.
*/
chrome.passwordsPrivate.getPasswordExceptionList = function(callback) {};
/**
* Moves passwords currently stored on the device to being stored in the
* signed-in, non-syncing Google Account. For each id, the result is a no-op if
* any of these is true: |id| is invalid; |id| corresponds to a password already
* stored in the account; or the user is not using the account-scoped password
* storage.
* @param {!Array<number>} ids The ids for the password entries being moved.
*/
chrome.passwordsPrivate.movePasswordsToAccount = function(ids) {};
/**
* Triggers the Password Manager password import functionality.
* @param {!chrome.passwordsPrivate.PasswordStoreSet} toStore
* @param {function(!chrome.passwordsPrivate.ImportResults): void} callback
*/
chrome.passwordsPrivate.importPasswords = function(toStore, callback) {};
/**
* Triggers the Password Manager password export functionality. Completion Will
* be signaled by the onPasswordsFileExportProgress event. |callback| will be
* called when the request is started or rejected. If rejected
* $(ref:runtime.lastError) will be set to <code>'in-progress'</code> or
* <code>'reauth-failed'</code>.
* @param {function(): void} callback
*/
chrome.passwordsPrivate.exportPasswords = function(callback) {};
/**
* Requests the export progress status. This is the same as the last value seen
* on the onPasswordsFileExportProgress event. This function is useful for
* checking if an export has already been initiated from an older tab, where we
* might have missed the original event.
* @param {function(!chrome.passwordsPrivate.ExportProgressStatus): void}
* callback
*/
chrome.passwordsPrivate.requestExportProgressStatus = function(callback) {};
/**
* Stops exporting passwords and cleans up any passwords, which were already
* written to the filesystem.
*/
chrome.passwordsPrivate.cancelExportPasswords = function() {};
/**
* Requests the account-storage opt-in state of the current user.
* @param {function(boolean): void} callback
*/
chrome.passwordsPrivate.isOptedInForAccountStorage = function(callback) {};
/**
* Triggers the opt-in or opt-out flow for the account storage.
* @param {boolean} optIn
*/
chrome.passwordsPrivate.optInForAccountStorage = function(optIn) {};
/**
* Requests the latest insecure credentials.
* @param {function(!Array<!chrome.passwordsPrivate.PasswordUiEntry>): void}
* callback
*/
chrome.passwordsPrivate.getInsecureCredentials = function(callback) {};
/**
* Requests to mute |credential| from the password store. Invokes |callback| on
* completion.
* @param {!chrome.passwordsPrivate.PasswordUiEntry} credential
* @param {function(): void=} callback
*/
chrome.passwordsPrivate.muteInsecureCredential = function(credential, callback) {};
/**
* Requests to unmute |credential| from the password store. Invokes |callback|
* on completion.
* @param {!chrome.passwordsPrivate.PasswordUiEntry} credential
* @param {function(): void=} callback
*/
chrome.passwordsPrivate.unmuteInsecureCredential = function(credential, callback) {};
/**
* Records that a change password flow was started for |credential|.
* @param {!chrome.passwordsPrivate.PasswordUiEntry} credential The credential
* for which the flow was triggered.
* @param {function(): void=} callback
*/
chrome.passwordsPrivate.recordChangePasswordFlowStarted = function(credential, callback) {};
/**
* Starts a check for insecure passwords. Invokes |callback| on completion.
* @param {function(): void=} callback
*/
chrome.passwordsPrivate.startPasswordCheck = function(callback) {};
/**
* Stops checking for insecure passwords. Invokes |callback| on completion.
* @param {function(): void=} callback
*/
chrome.passwordsPrivate.stopPasswordCheck = function(callback) {};
/**
* Returns the current status of the check via |callback|.
* @param {function(!chrome.passwordsPrivate.PasswordCheckStatus): void}
* callback
*/
chrome.passwordsPrivate.getPasswordCheckStatus = function(callback) {};
/**
* Requests whether the account store is a default location for saving
* passwords. False means the device store is a default one. Must be called when
* the current user has already opted-in for account storage.
* @param {function(boolean): void} callback
*/
chrome.passwordsPrivate.isAccountStoreDefault = function(callback) {};
/**
* Requests whether the given |url| meets the requirements to save a password
* for it (e.g. valid, has proper scheme etc.) and returns the corresponding
* URLCollection on success. Otherwise it raises an error.
* @param {string} url
* @param {function(!chrome.passwordsPrivate.UrlCollection): void} callback
*/
chrome.passwordsPrivate.getUrlCollection = function(url, callback) {};
/**
* Saves a new password entry described by the given |options|. Invokes
* |callback| or raises an error depending on whether the operation succeeded.
* @param {!chrome.passwordsPrivate.AddPasswordOptions} options Details about a
* new password and storage to be used.
* @param {function(): void=} callback The callback that gets invoked on
* success.
*/
chrome.passwordsPrivate.addPassword = function(options, callback) {};
/**
* Restarts the authentication timeout timer if the user is authenticated.
* @param {function(): void=} callback The callback that gets invoked on
* success.
*/
chrome.passwordsPrivate.extendAuthValidity = function(callback) {};
/**
* Switches Biometric authentication before filling state after successful
* authentication.
*/
chrome.passwordsPrivate.switchBiometricAuthBeforeFillingState = function() {};
/**
* Shows a dialog for creating a shortcut for the Password Manager page.
*/
chrome.passwordsPrivate.showAddShortcutDialog = function() {};
/**
* Fired when the saved passwords list has changed, meaning that an entry has
* been added or removed.
* @type {!ChromeEvent}
*/
chrome.passwordsPrivate.onSavedPasswordsListChanged;
/**
* Fired when the password exceptions list has changed, meaning that an entry
* has been added or removed.
* @type {!ChromeEvent}
*/
chrome.passwordsPrivate.onPasswordExceptionsListChanged;
/**
* Fired when the status of the export has changed.
* @type {!ChromeEvent}
*/
chrome.passwordsPrivate.onPasswordsFileExportProgress;
/**
* Fired when the opt-in state for the account-scoped storage has changed.
* @type {!ChromeEvent}
*/
chrome.passwordsPrivate.onAccountStorageOptInStateChanged;
/**
* Fired when the insecure credentials changed.
* @type {!ChromeEvent}
*/
chrome.passwordsPrivate.onInsecureCredentialsChanged;
/**
* Fired when the status of the password check changes.
* @type {!ChromeEvent}
*/
chrome.passwordsPrivate.onPasswordCheckStatusChanged;
/**
* Fired when the password manager access timed out.
* @type {!ChromeEvent}
*/
chrome.passwordsPrivate.onPasswordManagerAuthTimeout;