161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2021-2023 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit BasicServicesKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport type { AsyncCallback, Callback } from './@ohos.base'; 2261847f8eSopenharmony_ciimport type Want from './@ohos.app.ability.Want'; 2361847f8eSopenharmony_ciimport type rpc from './@ohos.rpc'; 2461847f8eSopenharmony_ci 2561847f8eSopenharmony_ci/** 2661847f8eSopenharmony_ci * This module provides the capability to manage application accounts. 2761847f8eSopenharmony_ci * 2861847f8eSopenharmony_ci * @namespace appAccount 2961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 3061847f8eSopenharmony_ci * @since 7 3161847f8eSopenharmony_ci */ 3261847f8eSopenharmony_cideclare namespace appAccount { 3361847f8eSopenharmony_ci /** 3461847f8eSopenharmony_ci * Obtains the AppAccountManager instance. 3561847f8eSopenharmony_ci * 3661847f8eSopenharmony_ci * @returns { AppAccountManager } Returns the instance of the AppAccountManager. 3761847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 3861847f8eSopenharmony_ci * @since 7 3961847f8eSopenharmony_ci */ 4061847f8eSopenharmony_ci function createAppAccountManager(): AppAccountManager; 4161847f8eSopenharmony_ci 4261847f8eSopenharmony_ci /** 4361847f8eSopenharmony_ci * Provides methods for managing application accounts. 4461847f8eSopenharmony_ci * 4561847f8eSopenharmony_ci * @interface AppAccountManager 4661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 4761847f8eSopenharmony_ci * @since 7 4861847f8eSopenharmony_ci */ 4961847f8eSopenharmony_ci interface AppAccountManager { 5061847f8eSopenharmony_ci /** 5161847f8eSopenharmony_ci * Adds the account name and extra information of this application to the account management service. 5261847f8eSopenharmony_ci * <p> 5361847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 5461847f8eSopenharmony_ci * 5561847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account to add. 5661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 5761847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 5861847f8eSopenharmony_ci * @since 7 5961847f8eSopenharmony_ci * @deprecated since 9 6061847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#createAccount 6161847f8eSopenharmony_ci */ 6261847f8eSopenharmony_ci addAccount(name: string, callback: AsyncCallback<void>): void; 6361847f8eSopenharmony_ci 6461847f8eSopenharmony_ci /** 6561847f8eSopenharmony_ci * Adds the account name and extra information of this application to the account management service. 6661847f8eSopenharmony_ci * <p> 6761847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 6861847f8eSopenharmony_ci * 6961847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account to add. 7061847f8eSopenharmony_ci * @param { string } extraInfo - Indicates the extra information of the application account to add. 7161847f8eSopenharmony_ci * The extra information cannot be sensitive information of the application account. 7261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 7361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 7461847f8eSopenharmony_ci * @since 7 7561847f8eSopenharmony_ci * @deprecated since 9 7661847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#createAccount 7761847f8eSopenharmony_ci */ 7861847f8eSopenharmony_ci addAccount(name: string, extraInfo: string, callback: AsyncCallback<void>): void; 7961847f8eSopenharmony_ci 8061847f8eSopenharmony_ci /** 8161847f8eSopenharmony_ci * Adds the account name and extra information of this application to the account management service. 8261847f8eSopenharmony_ci * <p> 8361847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 8461847f8eSopenharmony_ci * 8561847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account to add. 8661847f8eSopenharmony_ci * @param { string } [extraInfo] - Indicates the extra information of the application account to add. 8761847f8eSopenharmony_ci * The extra information cannot be sensitive information of the application account. 8861847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 8961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 9061847f8eSopenharmony_ci * @since 7 9161847f8eSopenharmony_ci * @deprecated since 9 9261847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#createAccount 9361847f8eSopenharmony_ci */ 9461847f8eSopenharmony_ci addAccount(name: string, extraInfo?: string): Promise<void>; 9561847f8eSopenharmony_ci 9661847f8eSopenharmony_ci /** 9761847f8eSopenharmony_ci * Creates the account name and extra information of this application to the account management service. 9861847f8eSopenharmony_ci * <p> 9961847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 10061847f8eSopenharmony_ci * 10161847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account to add. 10261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 10361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 10461847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 10561847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 10661847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name. 10761847f8eSopenharmony_ci * @throws { BusinessError } 12300004 - Account already exists. 10861847f8eSopenharmony_ci * @throws { BusinessError } 12300007 - The number of accounts reaches the upper limit. 10961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 11061847f8eSopenharmony_ci * @since 9 11161847f8eSopenharmony_ci */ 11261847f8eSopenharmony_ci createAccount(name: string, callback: AsyncCallback<void>): void; 11361847f8eSopenharmony_ci 11461847f8eSopenharmony_ci /** 11561847f8eSopenharmony_ci * Creates the account name and extra information of this application to the account management service. 11661847f8eSopenharmony_ci * <p> 11761847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 11861847f8eSopenharmony_ci * 11961847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account to add. 12061847f8eSopenharmony_ci * @param { CreateAccountOptions } options - Indicates the extra information of the application account to add. 12161847f8eSopenharmony_ci * The extra information cannot be sensitive information of the application account. 12261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 12361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 12461847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 12561847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 12661847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name or options. 12761847f8eSopenharmony_ci * @throws { BusinessError } 12300004 - Account already exists. 12861847f8eSopenharmony_ci * @throws { BusinessError } 12300007 - The number of accounts reaches the upper limit. 12961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 13061847f8eSopenharmony_ci * @since 9 13161847f8eSopenharmony_ci */ 13261847f8eSopenharmony_ci createAccount(name: string, options: CreateAccountOptions, callback: AsyncCallback<void>): void; 13361847f8eSopenharmony_ci 13461847f8eSopenharmony_ci /** 13561847f8eSopenharmony_ci * Creates the account name and extra information of this application to the account management service. 13661847f8eSopenharmony_ci * <p> 13761847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 13861847f8eSopenharmony_ci * 13961847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account to add. 14061847f8eSopenharmony_ci * @param { CreateAccountOptions } [options] - Indicates the extra information of the application account to add. 14161847f8eSopenharmony_ci * The extra information cannot be sensitive information of the application account. 14261847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 14361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 14461847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 14561847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 14661847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name or options. 14761847f8eSopenharmony_ci * @throws { BusinessError } 12300004 - Account already exists. 14861847f8eSopenharmony_ci * @throws { BusinessError } 12300007 - The number of accounts reaches the upper limit. 14961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 15061847f8eSopenharmony_ci * @since 9 15161847f8eSopenharmony_ci */ 15261847f8eSopenharmony_ci createAccount(name: string, options?: CreateAccountOptions): Promise<void>; 15361847f8eSopenharmony_ci 15461847f8eSopenharmony_ci /** 15561847f8eSopenharmony_ci * Adds an application account of a specified owner implicitly. 15661847f8eSopenharmony_ci * 15761847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 15861847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 15961847f8eSopenharmony_ci * @param { object } options - Indicates the authenticator-specific options for the request. 16061847f8eSopenharmony_ci * @param { AuthenticatorCallback } callback - Indicates the authenticator callback. 16161847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 16261847f8eSopenharmony_ci * @since 8 16361847f8eSopenharmony_ci * @deprecated since 9 16461847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#createAccountImplicitly 16561847f8eSopenharmony_ci */ 16661847f8eSopenharmony_ci addAccountImplicitly( 16761847f8eSopenharmony_ci owner: string, 16861847f8eSopenharmony_ci authType: string, 16961847f8eSopenharmony_ci options: { [key: string]: any }, 17061847f8eSopenharmony_ci callback: AuthenticatorCallback 17161847f8eSopenharmony_ci ): void; 17261847f8eSopenharmony_ci 17361847f8eSopenharmony_ci /** 17461847f8eSopenharmony_ci * Creates an application account of a specified owner implicitly. 17561847f8eSopenharmony_ci * 17661847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 17761847f8eSopenharmony_ci * @param { AuthCallback } callback - Indicates the authenticator callback. 17861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 17961847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 18061847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 18161847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid owner. 18261847f8eSopenharmony_ci * @throws { BusinessError } 12300007 - The number of accounts reaches the upper limit. 18361847f8eSopenharmony_ci * @throws { BusinessError } 12300010 - Account service busy. 18461847f8eSopenharmony_ci * @throws { BusinessError } 12300113 - Authenticator service not found. 18561847f8eSopenharmony_ci * @throws { BusinessError } 12300114 - Authenticator service exception. 18661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 18761847f8eSopenharmony_ci * @since 9 18861847f8eSopenharmony_ci */ 18961847f8eSopenharmony_ci createAccountImplicitly(owner: string, callback: AuthCallback): void; 19061847f8eSopenharmony_ci 19161847f8eSopenharmony_ci /** 19261847f8eSopenharmony_ci * Creates an application account of a specified owner implicitly. 19361847f8eSopenharmony_ci * 19461847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 19561847f8eSopenharmony_ci * @param { CreateAccountImplicitlyOptions } options - Indicates the authenticator-specific options for the request. 19661847f8eSopenharmony_ci * @param { AuthCallback } callback - Indicates the authenticator callback. 19761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 19861847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 19961847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 20061847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid owner or options. 20161847f8eSopenharmony_ci * @throws { BusinessError } 12300007 - The number of accounts reaches the upper limit. 20261847f8eSopenharmony_ci * @throws { BusinessError } 12300010 - Account service busy. 20361847f8eSopenharmony_ci * @throws { BusinessError } 12300113 - Authenticator service not found. 20461847f8eSopenharmony_ci * @throws { BusinessError } 12300114 - Authenticator service exception. 20561847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 20661847f8eSopenharmony_ci * @since 9 20761847f8eSopenharmony_ci */ 20861847f8eSopenharmony_ci createAccountImplicitly(owner: string, options: CreateAccountImplicitlyOptions, callback: AuthCallback): void; 20961847f8eSopenharmony_ci 21061847f8eSopenharmony_ci /** 21161847f8eSopenharmony_ci * Deletes an application account from the account management service. 21261847f8eSopenharmony_ci * <p> 21361847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 21461847f8eSopenharmony_ci * 21561847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account to delete. 21661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 21761847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 21861847f8eSopenharmony_ci * @since 7 21961847f8eSopenharmony_ci * @deprecated since 9 22061847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#removeAccount 22161847f8eSopenharmony_ci */ 22261847f8eSopenharmony_ci deleteAccount(name: string, callback: AsyncCallback<void>): void; 22361847f8eSopenharmony_ci 22461847f8eSopenharmony_ci /** 22561847f8eSopenharmony_ci * Deletes an application account from the account management service. 22661847f8eSopenharmony_ci * <p> 22761847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 22861847f8eSopenharmony_ci * 22961847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account to delete. 23061847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 23161847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 23261847f8eSopenharmony_ci * @since 7 23361847f8eSopenharmony_ci * @deprecated since 9 23461847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#removeAccount 23561847f8eSopenharmony_ci */ 23661847f8eSopenharmony_ci deleteAccount(name: string): Promise<void>; 23761847f8eSopenharmony_ci 23861847f8eSopenharmony_ci /** 23961847f8eSopenharmony_ci * Removes an application account from the account management service. 24061847f8eSopenharmony_ci * <p> 24161847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 24261847f8eSopenharmony_ci * 24361847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account to delete. 24461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 24561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 24661847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 24761847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 24861847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name. 24961847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 25061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 25161847f8eSopenharmony_ci * @since 9 25261847f8eSopenharmony_ci */ 25361847f8eSopenharmony_ci removeAccount(name: string, callback: AsyncCallback<void>): void; 25461847f8eSopenharmony_ci 25561847f8eSopenharmony_ci /** 25661847f8eSopenharmony_ci * Removes an application account from the account management service. 25761847f8eSopenharmony_ci * <p> 25861847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 25961847f8eSopenharmony_ci * 26061847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account to delete. 26161847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 26261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 26361847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 26461847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 26561847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name. 26661847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 26761847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 26861847f8eSopenharmony_ci * @since 9 26961847f8eSopenharmony_ci */ 27061847f8eSopenharmony_ci removeAccount(name: string): Promise<void>; 27161847f8eSopenharmony_ci 27261847f8eSopenharmony_ci /** 27361847f8eSopenharmony_ci * Disables a third-party application with the specified bundle name from 27461847f8eSopenharmony_ci * accessing the given application account. 27561847f8eSopenharmony_ci * 27661847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account to disable access from 27761847f8eSopenharmony_ci * the third-party application. 27861847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the third-party application. 27961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 28061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 28161847f8eSopenharmony_ci * @since 7 28261847f8eSopenharmony_ci * @deprecated since 9 28361847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#setAppAccess 28461847f8eSopenharmony_ci */ 28561847f8eSopenharmony_ci disableAppAccess(name: string, bundleName: string, callback: AsyncCallback<void>): void; 28661847f8eSopenharmony_ci 28761847f8eSopenharmony_ci /** 28861847f8eSopenharmony_ci * Disables a third-party application with the specified bundle name from 28961847f8eSopenharmony_ci * accessing the given application account. 29061847f8eSopenharmony_ci * 29161847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account to disable access from 29261847f8eSopenharmony_ci * the third-party application. 29361847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the third-party application. 29461847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 29561847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 29661847f8eSopenharmony_ci * @since 7 29761847f8eSopenharmony_ci * @deprecated since 9 29861847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#setAppAccess 29961847f8eSopenharmony_ci */ 30061847f8eSopenharmony_ci disableAppAccess(name: string, bundleName: string): Promise<void>; 30161847f8eSopenharmony_ci 30261847f8eSopenharmony_ci /** 30361847f8eSopenharmony_ci * Enables a third-party application with the specified bundle name to access the given application 30461847f8eSopenharmony_ci * account for data query and listening. 30561847f8eSopenharmony_ci * 30661847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 30761847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the third-party application. 30861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 30961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 31061847f8eSopenharmony_ci * @since 7 31161847f8eSopenharmony_ci * @deprecated since 9 31261847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#setAppAccess 31361847f8eSopenharmony_ci */ 31461847f8eSopenharmony_ci enableAppAccess(name: string, bundleName: string, callback: AsyncCallback<void>): void; 31561847f8eSopenharmony_ci 31661847f8eSopenharmony_ci /** 31761847f8eSopenharmony_ci * Enables a third-party application with the specified bundle name to access the given application 31861847f8eSopenharmony_ci * account for data query and listening. 31961847f8eSopenharmony_ci * 32061847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 32161847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the third-party application. 32261847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 32361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 32461847f8eSopenharmony_ci * @since 7 32561847f8eSopenharmony_ci * @deprecated since 9 32661847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#setAppAccess 32761847f8eSopenharmony_ci */ 32861847f8eSopenharmony_ci enableAppAccess(name: string, bundleName: string): Promise<void>; 32961847f8eSopenharmony_ci 33061847f8eSopenharmony_ci /** 33161847f8eSopenharmony_ci * Sets a third-party application with the specified bundle name to access the given application 33261847f8eSopenharmony_ci * account for data query and listening. 33361847f8eSopenharmony_ci * 33461847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 33561847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the third-party application. 33661847f8eSopenharmony_ci * @param { boolean } isAccessible - Indicates the accessibility flag, true for accessible, false for inaccessible. 33761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 33861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 33961847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 34061847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 34161847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name or bundleName. 34261847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 34361847f8eSopenharmony_ci * @throws { BusinessError } 12400001 - Application not found. 34461847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 34561847f8eSopenharmony_ci * @since 9 34661847f8eSopenharmony_ci */ 34761847f8eSopenharmony_ci setAppAccess(name: string, bundleName: string, isAccessible: boolean, callback: AsyncCallback<void>): void; 34861847f8eSopenharmony_ci 34961847f8eSopenharmony_ci /** 35061847f8eSopenharmony_ci * Sets a third-party application with the specified bundle name to access the given application 35161847f8eSopenharmony_ci * account for data query and listening. 35261847f8eSopenharmony_ci * 35361847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 35461847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the third-party application. 35561847f8eSopenharmony_ci * @param { boolean } isAccessible - Indicates the accessibility flag, true for accessible, false for inaccessible. 35661847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 35761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 35861847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 35961847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 36061847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name or bundleName. 36161847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 36261847f8eSopenharmony_ci * @throws { BusinessError } 12400001 - Application not found. 36361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 36461847f8eSopenharmony_ci * @since 9 36561847f8eSopenharmony_ci */ 36661847f8eSopenharmony_ci setAppAccess(name: string, bundleName: string, isAccessible: boolean): Promise<void>; 36761847f8eSopenharmony_ci 36861847f8eSopenharmony_ci /** 36961847f8eSopenharmony_ci * Checks whether a third-party application with the specified bundle name is allowed to access 37061847f8eSopenharmony_ci * the given application account for data query and listening. 37161847f8eSopenharmony_ci * 37261847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 37361847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the third-party application. 37461847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Asynchronous callback interface. 37561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 37661847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 37761847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 37861847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name or bundleName. 37961847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 38061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 38161847f8eSopenharmony_ci * @since 9 38261847f8eSopenharmony_ci */ 38361847f8eSopenharmony_ci checkAppAccess(name: string, bundleName: string, callback: AsyncCallback<boolean>): void; 38461847f8eSopenharmony_ci 38561847f8eSopenharmony_ci /** 38661847f8eSopenharmony_ci * Checks whether a third-party application with the specified bundle name is allowed to access 38761847f8eSopenharmony_ci * the given application account for data query and listening. 38861847f8eSopenharmony_ci * 38961847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 39061847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the third-party application. 39161847f8eSopenharmony_ci * @returns { Promise<boolean> } The promise returned by the function. 39261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 39361847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 39461847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 39561847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name or bundleName. 39661847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 39761847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 39861847f8eSopenharmony_ci * @since 9 39961847f8eSopenharmony_ci */ 40061847f8eSopenharmony_ci checkAppAccess(name: string, bundleName: string): Promise<boolean>; 40161847f8eSopenharmony_ci 40261847f8eSopenharmony_ci /** 40361847f8eSopenharmony_ci * Checks whether a specified application account allows application data synchronization. 40461847f8eSopenharmony_ci * <p> 40561847f8eSopenharmony_ci * If the same OHOS account has logged in to multiple devices, these devices constitute a super device 40661847f8eSopenharmony_ci * through the distributed networking. On the connected devices, you can call this method to check 40761847f8eSopenharmony_ci * whether application data can be synchronized. 40861847f8eSopenharmony_ci * <p> 40961847f8eSopenharmony_ci * 41061847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 41161847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 41261847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Asynchronous callback interface. 41361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 41461847f8eSopenharmony_ci * @since 7 41561847f8eSopenharmony_ci * @deprecated since 9 41661847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#checkDataSyncEnabled 41761847f8eSopenharmony_ci */ 41861847f8eSopenharmony_ci checkAppAccountSyncEnable(name: string, callback: AsyncCallback<boolean>): void; 41961847f8eSopenharmony_ci 42061847f8eSopenharmony_ci /** 42161847f8eSopenharmony_ci * Checks whether a specified application account allows application data synchronization. 42261847f8eSopenharmony_ci * <p> 42361847f8eSopenharmony_ci * If the same OHOS account has logged in to multiple devices, these devices constitute a super device 42461847f8eSopenharmony_ci * through the distributed networking. On the connected devices, you can call this method to check 42561847f8eSopenharmony_ci * whether application data can be synchronized. 42661847f8eSopenharmony_ci * <p> 42761847f8eSopenharmony_ci * 42861847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 42961847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 43061847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns {@code true} if application data synchronization is allowed; returns {@code false} otherwise. 43161847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 43261847f8eSopenharmony_ci * @since 7 43361847f8eSopenharmony_ci * @deprecated since 9 43461847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#checkDataSyncEnabled 43561847f8eSopenharmony_ci */ 43661847f8eSopenharmony_ci checkAppAccountSyncEnable(name: string): Promise<boolean>; 43761847f8eSopenharmony_ci 43861847f8eSopenharmony_ci /** 43961847f8eSopenharmony_ci * Checks whether application data synchronization is enabled for the specified account. 44061847f8eSopenharmony_ci * <p> 44161847f8eSopenharmony_ci * If the same OHOS account has logged in to multiple devices, these devices constitute a super device 44261847f8eSopenharmony_ci * through the distributed networking. On the connected devices, you can call this method to check 44361847f8eSopenharmony_ci * whether application data can be synchronized. 44461847f8eSopenharmony_ci * <p> 44561847f8eSopenharmony_ci * 44661847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 44761847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 44861847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Asynchronous callback interface. 44961847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 45061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 45161847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 45261847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 45361847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name. 45461847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 45561847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 45661847f8eSopenharmony_ci * @since 9 45761847f8eSopenharmony_ci */ 45861847f8eSopenharmony_ci checkDataSyncEnabled(name: string, callback: AsyncCallback<boolean>): void; 45961847f8eSopenharmony_ci 46061847f8eSopenharmony_ci /** 46161847f8eSopenharmony_ci * Checks whether application data synchronization is enabled for the specified account. 46261847f8eSopenharmony_ci * <p> 46361847f8eSopenharmony_ci * If the same OHOS account has logged in to multiple devices, these devices constitute a super device 46461847f8eSopenharmony_ci * through the distributed networking. On the connected devices, you can call this method to check 46561847f8eSopenharmony_ci * whether application data can be synchronized. 46661847f8eSopenharmony_ci * <p> 46761847f8eSopenharmony_ci * 46861847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 46961847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 47061847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns {@code true} if application data synchronization is allowed; returns {@code false} otherwise. 47161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 47261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 47361847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 47461847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 47561847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name. 47661847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 47761847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 47861847f8eSopenharmony_ci * @since 9 47961847f8eSopenharmony_ci */ 48061847f8eSopenharmony_ci checkDataSyncEnabled(name: string): Promise<boolean>; 48161847f8eSopenharmony_ci 48261847f8eSopenharmony_ci /** 48361847f8eSopenharmony_ci * Sets the credential for this application account. 48461847f8eSopenharmony_ci * 48561847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 48661847f8eSopenharmony_ci * @param { string } credentialType - Indicates the type of the credential to set. 48761847f8eSopenharmony_ci * @param { string } credential - Indicates the credential to set. 48861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 48961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 49061847f8eSopenharmony_ci * @since 7 49161847f8eSopenharmony_ci * @deprecated since 9 49261847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#setCredential 49361847f8eSopenharmony_ci */ 49461847f8eSopenharmony_ci setAccountCredential(name: string, credentialType: string, credential: string, callback: AsyncCallback<void>): void; 49561847f8eSopenharmony_ci 49661847f8eSopenharmony_ci /** 49761847f8eSopenharmony_ci * Sets the credential for this application account. 49861847f8eSopenharmony_ci * 49961847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 50061847f8eSopenharmony_ci * @param { string } credentialType - Indicates the type of the credential to set. 50161847f8eSopenharmony_ci * @param { string } credential - Indicates the credential to set. 50261847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 50361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 50461847f8eSopenharmony_ci * @since 7 50561847f8eSopenharmony_ci * @deprecated since 9 50661847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#setCredential 50761847f8eSopenharmony_ci */ 50861847f8eSopenharmony_ci setAccountCredential(name: string, credentialType: string, credential: string): Promise<void>; 50961847f8eSopenharmony_ci 51061847f8eSopenharmony_ci /** 51161847f8eSopenharmony_ci * Sets the credential for this application account. 51261847f8eSopenharmony_ci * 51361847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 51461847f8eSopenharmony_ci * @param { string } credentialType - Indicates the type of the credential to set. 51561847f8eSopenharmony_ci * @param { string } credential - Indicates the credential to set. 51661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 51761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 51861847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 51961847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 52061847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name, credentialType or credential. 52161847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 52261847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 52361847f8eSopenharmony_ci * @since 9 52461847f8eSopenharmony_ci */ 52561847f8eSopenharmony_ci setCredential(name: string, credentialType: string, credential: string, callback: AsyncCallback<void>): void; 52661847f8eSopenharmony_ci 52761847f8eSopenharmony_ci /** 52861847f8eSopenharmony_ci * Sets the credential for this application account. 52961847f8eSopenharmony_ci * 53061847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 53161847f8eSopenharmony_ci * @param { string } credentialType - Indicates the type of the credential to set. 53261847f8eSopenharmony_ci * @param { string } credential - Indicates the credential to set. 53361847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 53461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 53561847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 53661847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 53761847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name, credentialType or credential. 53861847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 53961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 54061847f8eSopenharmony_ci * @since 9 54161847f8eSopenharmony_ci */ 54261847f8eSopenharmony_ci setCredential(name: string, credentialType: string, credential: string): Promise<void>; 54361847f8eSopenharmony_ci 54461847f8eSopenharmony_ci /** 54561847f8eSopenharmony_ci * Sets extra information for this application account. 54661847f8eSopenharmony_ci * <p> 54761847f8eSopenharmony_ci * You can call this method when you forget the extra information of your application account or 54861847f8eSopenharmony_ci * need to modify the extra information. 54961847f8eSopenharmony_ci * 55061847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 55161847f8eSopenharmony_ci * @param { string } extraInfo - Indicates the extra information to set. 55261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 55361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 55461847f8eSopenharmony_ci * @since 7 55561847f8eSopenharmony_ci * @deprecated since 9 55661847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#setCustomData 55761847f8eSopenharmony_ci */ 55861847f8eSopenharmony_ci setAccountExtraInfo(name: string, extraInfo: string, callback: AsyncCallback<void>): void; 55961847f8eSopenharmony_ci 56061847f8eSopenharmony_ci /** 56161847f8eSopenharmony_ci * Sets extra information for this application account. 56261847f8eSopenharmony_ci * <p> 56361847f8eSopenharmony_ci * You can call this method when you forget the extra information of your application account or 56461847f8eSopenharmony_ci * need to modify the extra information. 56561847f8eSopenharmony_ci * 56661847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 56761847f8eSopenharmony_ci * @param { string } extraInfo - Indicates the extra information to set. 56861847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 56961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 57061847f8eSopenharmony_ci * @since 7 57161847f8eSopenharmony_ci * @deprecated since 9 57261847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#setCustomData 57361847f8eSopenharmony_ci */ 57461847f8eSopenharmony_ci setAccountExtraInfo(name: string, extraInfo: string): Promise<void>; 57561847f8eSopenharmony_ci 57661847f8eSopenharmony_ci /** 57761847f8eSopenharmony_ci * Sets whether a specified application account allows application data synchronization. 57861847f8eSopenharmony_ci * <p> 57961847f8eSopenharmony_ci * If the same OHOS account has logged in to multiple devices, these devices constitute a super device 58061847f8eSopenharmony_ci * through the distributed networking. On the connected devices, you can call this method to set whether to 58161847f8eSopenharmony_ci * allow cross-device data synchronization. If synchronization is allowed, application data can be synchronized 58261847f8eSopenharmony_ci * among these devices in the event of any changes related to the application account. 58361847f8eSopenharmony_ci * If synchronization is not allowed, the application data is stored only on the local device. 58461847f8eSopenharmony_ci * <p> 58561847f8eSopenharmony_ci * <b>Application account-related changes</b>: adding or deleting an application account, setting extra 58661847f8eSopenharmony_ci * information (such as updating a token), and setting data associated with this application account 58761847f8eSopenharmony_ci * <p> 58861847f8eSopenharmony_ci * <b>Application data that can be synchronized</b>: application account name, token, 58961847f8eSopenharmony_ci * and data associated with this application account 59061847f8eSopenharmony_ci * <p> 59161847f8eSopenharmony_ci * 59261847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 59361847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 59461847f8eSopenharmony_ci * @param { boolean } isEnable - Specifies whether to allow application data synchronization. 59561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 59661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 59761847f8eSopenharmony_ci * @since 7 59861847f8eSopenharmony_ci * @deprecated since 9 59961847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#setDataSyncEnabled 60061847f8eSopenharmony_ci */ 60161847f8eSopenharmony_ci setAppAccountSyncEnable(name: string, isEnable: boolean, callback: AsyncCallback<void>): void; 60261847f8eSopenharmony_ci 60361847f8eSopenharmony_ci /** 60461847f8eSopenharmony_ci * Sets whether a specified application account allows application data synchronization. 60561847f8eSopenharmony_ci * <p> 60661847f8eSopenharmony_ci * If the same OHOS account has logged in to multiple devices, these devices constitute a super device 60761847f8eSopenharmony_ci * through the distributed networking. On the connected devices, you can call this method to set whether to 60861847f8eSopenharmony_ci * allow cross-device data synchronization. If synchronization is allowed, application data can be synchronized 60961847f8eSopenharmony_ci * among these devices in the event of any changes related to the application account. 61061847f8eSopenharmony_ci * If synchronization is not allowed, the application data is stored only on the local device. 61161847f8eSopenharmony_ci * <p> 61261847f8eSopenharmony_ci * <b>Application account-related changes</b>: adding or deleting an application account, setting extra 61361847f8eSopenharmony_ci * information (such as updating a token), and setting data associated with this application account 61461847f8eSopenharmony_ci * <p> 61561847f8eSopenharmony_ci * <b>Application data that can be synchronized</b>: application account name, token, 61661847f8eSopenharmony_ci * and data associated with this application account 61761847f8eSopenharmony_ci * <p> 61861847f8eSopenharmony_ci * 61961847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 62061847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 62161847f8eSopenharmony_ci * @param { boolean } isEnable - Specifies whether to allow application data synchronization. 62261847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 62361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 62461847f8eSopenharmony_ci * @since 7 62561847f8eSopenharmony_ci * @deprecated since 9 62661847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#setDataSyncEnabled 62761847f8eSopenharmony_ci */ 62861847f8eSopenharmony_ci setAppAccountSyncEnable(name: string, isEnable: boolean): Promise<void>; 62961847f8eSopenharmony_ci 63061847f8eSopenharmony_ci /** 63161847f8eSopenharmony_ci * Sets whether a specified application account enables application data synchronization. 63261847f8eSopenharmony_ci * <p> 63361847f8eSopenharmony_ci * If the same OHOS account has logged in to multiple devices, these devices constitute a super device 63461847f8eSopenharmony_ci * through the distributed networking. On the connected devices, you can call this method to set whether to 63561847f8eSopenharmony_ci * enable cross-device data synchronization. If synchronization is enabled, application data can be synchronized 63661847f8eSopenharmony_ci * among these devices in the event of any changes related to the application account. 63761847f8eSopenharmony_ci * If synchronization is not enabled, the application data is stored only on the local device. 63861847f8eSopenharmony_ci * <p> 63961847f8eSopenharmony_ci * <b>Application account-related changes</b>: adding or deleting an application account, setting extra 64061847f8eSopenharmony_ci * information (such as updating a token), and setting data associated with this application account 64161847f8eSopenharmony_ci * <p> 64261847f8eSopenharmony_ci * <b>Application data that can be synchronized</b>: application account name, token, 64361847f8eSopenharmony_ci * and data associated with this application account 64461847f8eSopenharmony_ci * <p> 64561847f8eSopenharmony_ci * 64661847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 64761847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 64861847f8eSopenharmony_ci * @param { boolean } isEnabled - Specifies whether to enable application data synchronization. 64961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 65061847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 65161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 65261847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 65361847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 65461847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name. 65561847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 65661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 65761847f8eSopenharmony_ci * @since 9 65861847f8eSopenharmony_ci */ 65961847f8eSopenharmony_ci setDataSyncEnabled(name: string, isEnabled: boolean, callback: AsyncCallback<void>): void; 66061847f8eSopenharmony_ci 66161847f8eSopenharmony_ci /** 66261847f8eSopenharmony_ci * Sets whether a specified application account enables application data synchronization. 66361847f8eSopenharmony_ci * <p> 66461847f8eSopenharmony_ci * If the same OHOS account has logged in to multiple devices, these devices constitute a super device 66561847f8eSopenharmony_ci * through the distributed networking. On the connected devices, you can call this method to set whether to 66661847f8eSopenharmony_ci * enable cross-device data synchronization. If synchronization is enabled, application data can be synchronized 66761847f8eSopenharmony_ci * among these devices in the event of any changes related to the application account. 66861847f8eSopenharmony_ci * If synchronization is not enabled, the application data is stored only on the local device. 66961847f8eSopenharmony_ci * <p> 67061847f8eSopenharmony_ci * <b>Application account-related changes</b>: adding or deleting an application account, setting extra 67161847f8eSopenharmony_ci * information (such as updating a token), and setting data associated with this application account 67261847f8eSopenharmony_ci * <p> 67361847f8eSopenharmony_ci * <b>Application data that can be synchronized</b>: application account name, token, 67461847f8eSopenharmony_ci * and data associated with this application account 67561847f8eSopenharmony_ci * <p> 67661847f8eSopenharmony_ci * 67761847f8eSopenharmony_ci * @permission ohos.permission.DISTRIBUTED_DATASYNC 67861847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 67961847f8eSopenharmony_ci * @param { boolean } isEnabled - Specifies whether to enable application data synchronization. 68061847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 68161847f8eSopenharmony_ci * @throws { BusinessError } 201 - Permission denied. 68261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 68361847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 68461847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 68561847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name. 68661847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 68761847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 68861847f8eSopenharmony_ci * @since 9 68961847f8eSopenharmony_ci */ 69061847f8eSopenharmony_ci setDataSyncEnabled(name: string, isEnabled: boolean): Promise<void>; 69161847f8eSopenharmony_ci 69261847f8eSopenharmony_ci /** 69361847f8eSopenharmony_ci * Sets data associated with this application account. 69461847f8eSopenharmony_ci * 69561847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 69661847f8eSopenharmony_ci * @param { string } key - Indicates the key of the data to set. The key can be customized. 69761847f8eSopenharmony_ci * @param { string } value - Indicates the value of the data to set. 69861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 69961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 70061847f8eSopenharmony_ci * @since 7 70161847f8eSopenharmony_ci * @deprecated since 9 70261847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#setCustomData 70361847f8eSopenharmony_ci */ 70461847f8eSopenharmony_ci setAssociatedData(name: string, key: string, value: string, callback: AsyncCallback<void>): void; 70561847f8eSopenharmony_ci 70661847f8eSopenharmony_ci /** 70761847f8eSopenharmony_ci * Sets data associated with this application account. 70861847f8eSopenharmony_ci * 70961847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 71061847f8eSopenharmony_ci * @param { string } key - Indicates the key of the data to set. The key can be customized. 71161847f8eSopenharmony_ci * @param { string } value - Indicates the value of the data to set. 71261847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 71361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 71461847f8eSopenharmony_ci * @since 7 71561847f8eSopenharmony_ci * @deprecated since 9 71661847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#setCustomData 71761847f8eSopenharmony_ci */ 71861847f8eSopenharmony_ci setAssociatedData(name: string, key: string, value: string): Promise<void>; 71961847f8eSopenharmony_ci 72061847f8eSopenharmony_ci /** 72161847f8eSopenharmony_ci * Sets data associated with this application account. 72261847f8eSopenharmony_ci * 72361847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 72461847f8eSopenharmony_ci * @param { string } key - Indicates the key of the data to set. The key can be customized. 72561847f8eSopenharmony_ci * @param { string } value - Indicates the value of the data to set. 72661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 72761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 72861847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 72961847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 73061847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name, key or value. 73161847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 73261847f8eSopenharmony_ci * @throws { BusinessError } 12400003 - The number of custom data reaches the upper limit. 73361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 73461847f8eSopenharmony_ci * @since 9 73561847f8eSopenharmony_ci */ 73661847f8eSopenharmony_ci setCustomData(name: string, key: string, value: string, callback: AsyncCallback<void>): void; 73761847f8eSopenharmony_ci 73861847f8eSopenharmony_ci /** 73961847f8eSopenharmony_ci * Sets data associated with this application account. 74061847f8eSopenharmony_ci * 74161847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 74261847f8eSopenharmony_ci * @param { string } key - Indicates the key of the data to set. The key can be customized. 74361847f8eSopenharmony_ci * @param { string } value - Indicates the value of the data to set. 74461847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 74561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 74661847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 74761847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 74861847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name, key or value. 74961847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 75061847f8eSopenharmony_ci * @throws { BusinessError } 12400003 - The number of custom data reaches the upper limit. 75161847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 75261847f8eSopenharmony_ci * @since 9 75361847f8eSopenharmony_ci */ 75461847f8eSopenharmony_ci setCustomData(name: string, key: string, value: string): Promise<void>; 75561847f8eSopenharmony_ci 75661847f8eSopenharmony_ci /** 75761847f8eSopenharmony_ci * Obtains information about all accessible accounts. 75861847f8eSopenharmony_ci * This method applies to the following accounts: 75961847f8eSopenharmony_ci * <br> Accounts of this application. 76061847f8eSopenharmony_ci * <br> Accounts of third-party applications. To obtain such information, 76161847f8eSopenharmony_ci * <br> your application must have gained authorization from the third-party applications. 76261847f8eSopenharmony_ci * 76361847f8eSopenharmony_ci * @permission ohos.permission.GET_ALL_APP_ACCOUNTS 76461847f8eSopenharmony_ci * @param { AsyncCallback<Array<AppAccountInfo>> } callback - Asynchronous callback interface. 76561847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 76661847f8eSopenharmony_ci * @since 7 76761847f8eSopenharmony_ci * @deprecated since 9 76861847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#getAllAccounts 76961847f8eSopenharmony_ci */ 77061847f8eSopenharmony_ci getAllAccessibleAccounts(callback: AsyncCallback<Array<AppAccountInfo>>): void; 77161847f8eSopenharmony_ci 77261847f8eSopenharmony_ci /** 77361847f8eSopenharmony_ci * Obtains information about all accessible accounts. 77461847f8eSopenharmony_ci * This method applies to the following accounts: 77561847f8eSopenharmony_ci * <br> Accounts of this application. 77661847f8eSopenharmony_ci * <br> Accounts of third-party applications. To obtain such information, 77761847f8eSopenharmony_ci * <br> your application must have gained authorization from the third-party applications. 77861847f8eSopenharmony_ci * 77961847f8eSopenharmony_ci * @permission ohos.permission.GET_ALL_APP_ACCOUNTS 78061847f8eSopenharmony_ci * @returns { Promise<Array<AppAccountInfo>> } Returns a list of application accounts. 78161847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 78261847f8eSopenharmony_ci * @since 7 78361847f8eSopenharmony_ci * @deprecated since 9 78461847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#getAllAccounts 78561847f8eSopenharmony_ci */ 78661847f8eSopenharmony_ci getAllAccessibleAccounts(): Promise<Array<AppAccountInfo>>; 78761847f8eSopenharmony_ci 78861847f8eSopenharmony_ci /** 78961847f8eSopenharmony_ci * Obtains information about all accessible accounts. 79061847f8eSopenharmony_ci * This method applies to the following accounts: 79161847f8eSopenharmony_ci * <br> Accounts of this application. 79261847f8eSopenharmony_ci * <br> Accounts of third-party applications. To obtain such information, 79361847f8eSopenharmony_ci * <br> your application must have gained authorization from the third-party applications or 79461847f8eSopenharmony_ci * <br> have gained the ohos.permission.GET_ALL_APP_ACCOUNTS permission. 79561847f8eSopenharmony_ci * 79661847f8eSopenharmony_ci * @param { AsyncCallback<Array<AppAccountInfo>> } callback - Asynchronous callback interface. Returns a list of application accounts. 79761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 79861847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 79961847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 80061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 80161847f8eSopenharmony_ci * @since 9 80261847f8eSopenharmony_ci */ 80361847f8eSopenharmony_ci getAllAccounts(callback: AsyncCallback<Array<AppAccountInfo>>): void; 80461847f8eSopenharmony_ci 80561847f8eSopenharmony_ci /** 80661847f8eSopenharmony_ci * Obtains information about all accessible accounts. 80761847f8eSopenharmony_ci * This method applies to the following accounts: 80861847f8eSopenharmony_ci * <br> Accounts of this application. 80961847f8eSopenharmony_ci * <br> Accounts of third-party applications. To obtain such information, 81061847f8eSopenharmony_ci * <br> your application must have gained authorization from the third-party applications or 81161847f8eSopenharmony_ci * <br> have gained the ohos.permission.GET_ALL_APP_ACCOUNTS permission. 81261847f8eSopenharmony_ci * 81361847f8eSopenharmony_ci * @returns { Promise<Array<AppAccountInfo>> } Returns a list of application accounts. 81461847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 81561847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 81661847f8eSopenharmony_ci * @since 9 81761847f8eSopenharmony_ci */ 81861847f8eSopenharmony_ci getAllAccounts(): Promise<Array<AppAccountInfo>>; 81961847f8eSopenharmony_ci 82061847f8eSopenharmony_ci /** 82161847f8eSopenharmony_ci * Obtains information about all accounts of a specified account owner. 82261847f8eSopenharmony_ci * This method applies to the following accounts: 82361847f8eSopenharmony_ci * <br> Accounts of this application. 82461847f8eSopenharmony_ci * <br> Accounts of third-party applications. To obtain such information, 82561847f8eSopenharmony_ci * <br> your application must have gained authorization from the third-party applications. 82661847f8eSopenharmony_ci * 82761847f8eSopenharmony_ci * @permission ohos.permission.GET_ALL_APP_ACCOUNTS 82861847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 82961847f8eSopenharmony_ci * @param { AsyncCallback<Array<AppAccountInfo>> } callback - Asynchronous callback interface. Returns a list of application accounts. 83061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 83161847f8eSopenharmony_ci * @since 7 83261847f8eSopenharmony_ci * @deprecated since 9 83361847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#getAccountsByOwner 83461847f8eSopenharmony_ci */ 83561847f8eSopenharmony_ci getAllAccounts(owner: string, callback: AsyncCallback<Array<AppAccountInfo>>): void; 83661847f8eSopenharmony_ci 83761847f8eSopenharmony_ci /** 83861847f8eSopenharmony_ci * Obtains information about all accounts of a specified account owner. 83961847f8eSopenharmony_ci * This method applies to the following accounts: 84061847f8eSopenharmony_ci * <br> Accounts of this application. 84161847f8eSopenharmony_ci * <br> Accounts of third-party applications. To obtain such information, 84261847f8eSopenharmony_ci * <br> your application must have gained authorization from the third-party applications. 84361847f8eSopenharmony_ci * 84461847f8eSopenharmony_ci * @permission ohos.permission.GET_ALL_APP_ACCOUNTS 84561847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 84661847f8eSopenharmony_ci * @returns { Promise<Array<AppAccountInfo>> } Returns a list of application accounts. 84761847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 84861847f8eSopenharmony_ci * @since 7 84961847f8eSopenharmony_ci * @deprecated since 9 85061847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#getAccountsByOwner 85161847f8eSopenharmony_ci */ 85261847f8eSopenharmony_ci getAllAccounts(owner: string): Promise<Array<AppAccountInfo>>; 85361847f8eSopenharmony_ci 85461847f8eSopenharmony_ci /** 85561847f8eSopenharmony_ci * Gets information about all accounts of a specified account owner. 85661847f8eSopenharmony_ci * This method applies to the following accounts: 85761847f8eSopenharmony_ci * <br> Accounts of this application. 85861847f8eSopenharmony_ci * <br> Accounts of third-party applications. To obtain such information, 85961847f8eSopenharmony_ci * <br> your application must have gained authorization from the third-party applications or 86061847f8eSopenharmony_ci * <br> have gained the ohos.permission.GET_ALL_APP_ACCOUNTS permission. 86161847f8eSopenharmony_ci * 86261847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 86361847f8eSopenharmony_ci * @param { AsyncCallback<Array<AppAccountInfo>> } callback - Asynchronous callback interface. Returns a list of application accounts. 86461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 86561847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 86661847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 86761847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid owner. 86861847f8eSopenharmony_ci * @throws { BusinessError } 12400001 - Application not found. 86961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 87061847f8eSopenharmony_ci * @since 9 87161847f8eSopenharmony_ci */ 87261847f8eSopenharmony_ci getAccountsByOwner(owner: string, callback: AsyncCallback<Array<AppAccountInfo>>): void; 87361847f8eSopenharmony_ci 87461847f8eSopenharmony_ci /** 87561847f8eSopenharmony_ci * Gets information about all accounts of a specified account owner. 87661847f8eSopenharmony_ci * This method applies to the following accounts: 87761847f8eSopenharmony_ci * <br> Accounts of this application. 87861847f8eSopenharmony_ci * <br> Accounts of third-party applications. To obtain such information, 87961847f8eSopenharmony_ci * <br> your application must have gained authorization from the third-party applications or 88061847f8eSopenharmony_ci * <br> have gained the ohos.permission.GET_ALL_APP_ACCOUNTS permission. 88161847f8eSopenharmony_ci * 88261847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 88361847f8eSopenharmony_ci * @returns { Promise<Array<AppAccountInfo>> } Returns a list of application accounts. 88461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 88561847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 88661847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 88761847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid owner. 88861847f8eSopenharmony_ci * @throws { BusinessError } 12400001 - Application not found. 88961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 89061847f8eSopenharmony_ci * @since 9 89161847f8eSopenharmony_ci */ 89261847f8eSopenharmony_ci getAccountsByOwner(owner: string): Promise<Array<AppAccountInfo>>; 89361847f8eSopenharmony_ci 89461847f8eSopenharmony_ci /** 89561847f8eSopenharmony_ci * Obtains the credential of this application account. 89661847f8eSopenharmony_ci * 89761847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 89861847f8eSopenharmony_ci * @param { string } credentialType - Indicates the type of the credential to obtain. 89961847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - Asynchronous callback interface. Returns the credential of the application account. 90061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 90161847f8eSopenharmony_ci * @since 7 90261847f8eSopenharmony_ci * @deprecated since 9 90361847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#getCredential 90461847f8eSopenharmony_ci */ 90561847f8eSopenharmony_ci getAccountCredential(name: string, credentialType: string, callback: AsyncCallback<string>): void; 90661847f8eSopenharmony_ci 90761847f8eSopenharmony_ci /** 90861847f8eSopenharmony_ci * Obtains the credential of this application account. 90961847f8eSopenharmony_ci * 91061847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 91161847f8eSopenharmony_ci * @param { string } credentialType - Indicates the type of the credential to obtain. 91261847f8eSopenharmony_ci * @returns { Promise<string> } Returns the credential of the application account. 91361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 91461847f8eSopenharmony_ci * @since 7 91561847f8eSopenharmony_ci * @deprecated since 9 91661847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#getCredential 91761847f8eSopenharmony_ci */ 91861847f8eSopenharmony_ci getAccountCredential(name: string, credentialType: string): Promise<string>; 91961847f8eSopenharmony_ci 92061847f8eSopenharmony_ci /** 92161847f8eSopenharmony_ci * Obtains the credential of this application account. 92261847f8eSopenharmony_ci * 92361847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 92461847f8eSopenharmony_ci * @param { string } credentialType - Indicates the type of the credential to obtain. 92561847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - Asynchronous callback interface. Returns the credential of the application account. 92661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 92761847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 92861847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 92961847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name or credentialType. 93061847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 93161847f8eSopenharmony_ci * @throws { BusinessError } 12300102 - Credential not found. 93261847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 93361847f8eSopenharmony_ci * @since 9 93461847f8eSopenharmony_ci */ 93561847f8eSopenharmony_ci getCredential(name: string, credentialType: string, callback: AsyncCallback<string>): void; 93661847f8eSopenharmony_ci 93761847f8eSopenharmony_ci /** 93861847f8eSopenharmony_ci * Obtains the credential of this application account. 93961847f8eSopenharmony_ci * 94061847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 94161847f8eSopenharmony_ci * @param { string } credentialType - Indicates the type of the credential to obtain. 94261847f8eSopenharmony_ci * @returns { Promise<string> } Returns the credential of the application account. 94361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 94461847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 94561847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 94661847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name or credentialType. 94761847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 94861847f8eSopenharmony_ci * @throws { BusinessError } 12300102 - Credential not found. 94961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 95061847f8eSopenharmony_ci * @since 9 95161847f8eSopenharmony_ci */ 95261847f8eSopenharmony_ci getCredential(name: string, credentialType: string): Promise<string>; 95361847f8eSopenharmony_ci 95461847f8eSopenharmony_ci /** 95561847f8eSopenharmony_ci * Obtains extra information of this application account. 95661847f8eSopenharmony_ci * 95761847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 95861847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - Asynchronous callback interface. 95961847f8eSopenharmony_ci * Returns the extra information of the account; returns {@code null} in other scenarios, 96061847f8eSopenharmony_ci * for example, if the account does not exist. 96161847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 96261847f8eSopenharmony_ci * @since 7 96361847f8eSopenharmony_ci * @deprecated since 9 96461847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#getCustomData 96561847f8eSopenharmony_ci */ 96661847f8eSopenharmony_ci getAccountExtraInfo(name: string, callback: AsyncCallback<string>): void; 96761847f8eSopenharmony_ci 96861847f8eSopenharmony_ci /** 96961847f8eSopenharmony_ci * Obtains extra information of this application account. 97061847f8eSopenharmony_ci * 97161847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 97261847f8eSopenharmony_ci * @returns { Promise<string> } Returns the extra information of the account; returns {@code null} in other scenarios, 97361847f8eSopenharmony_ci * for example, if the account does not exist. 97461847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 97561847f8eSopenharmony_ci * @since 7 97661847f8eSopenharmony_ci * @deprecated since 9 97761847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#getCustomData 97861847f8eSopenharmony_ci */ 97961847f8eSopenharmony_ci getAccountExtraInfo(name: string): Promise<string>; 98061847f8eSopenharmony_ci 98161847f8eSopenharmony_ci /** 98261847f8eSopenharmony_ci * Obtains data associated with this application account. 98361847f8eSopenharmony_ci * 98461847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 98561847f8eSopenharmony_ci * @param { string } key - Indicates the key of the data to obtain. 98661847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - Asynchronous callback interface. Returns the associated data of the application account. 98761847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 98861847f8eSopenharmony_ci * @since 7 98961847f8eSopenharmony_ci * @deprecated since 9 99061847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#getCustomData 99161847f8eSopenharmony_ci */ 99261847f8eSopenharmony_ci getAssociatedData(name: string, key: string, callback: AsyncCallback<string>): void; 99361847f8eSopenharmony_ci 99461847f8eSopenharmony_ci /** 99561847f8eSopenharmony_ci * Obtains data associated with this application account. 99661847f8eSopenharmony_ci * 99761847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 99861847f8eSopenharmony_ci * @param { string } key - Indicates the key of the data to obtain. 99961847f8eSopenharmony_ci * @returns { Promise<string> } Returns the associated data of the application account. 100061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 100161847f8eSopenharmony_ci * @since 7 100261847f8eSopenharmony_ci * @deprecated since 9 100361847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#getCustomData 100461847f8eSopenharmony_ci */ 100561847f8eSopenharmony_ci getAssociatedData(name: string, key: string): Promise<string>; 100661847f8eSopenharmony_ci 100761847f8eSopenharmony_ci /** 100861847f8eSopenharmony_ci * Obtains data associated with this application account. 100961847f8eSopenharmony_ci * 101061847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 101161847f8eSopenharmony_ci * @param { string } key - Indicates the key of the data to obtain. 101261847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - Asynchronous callback interface. Returns the associated data of the application account. 101361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 101461847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 101561847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 101661847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name or key. 101761847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 101861847f8eSopenharmony_ci * @throws { BusinessError } 12400002 - Custom data not found. 101961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 102061847f8eSopenharmony_ci * @since 9 102161847f8eSopenharmony_ci */ 102261847f8eSopenharmony_ci getCustomData(name: string, key: string, callback: AsyncCallback<string>): void; 102361847f8eSopenharmony_ci 102461847f8eSopenharmony_ci /** 102561847f8eSopenharmony_ci * Obtains data associated with this application account. 102661847f8eSopenharmony_ci * 102761847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 102861847f8eSopenharmony_ci * @param { string } key - Indicates the key of the data to obtain. 102961847f8eSopenharmony_ci * @returns { Promise<string> } Returns the associated data of the application account. 103061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 103161847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 103261847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 103361847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name or key. 103461847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 103561847f8eSopenharmony_ci * @throws { BusinessError } 12400002 - Custom data not found 103661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 103761847f8eSopenharmony_ci * @since 9 103861847f8eSopenharmony_ci */ 103961847f8eSopenharmony_ci getCustomData(name: string, key: string): Promise<string>; 104061847f8eSopenharmony_ci 104161847f8eSopenharmony_ci /** 104261847f8eSopenharmony_ci * Obtains data associated with the specified account synchronously. 104361847f8eSopenharmony_ci * 104461847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 104561847f8eSopenharmony_ci * @param { string } key - Indicates the key of the data to obtain. 104661847f8eSopenharmony_ci * @returns { string } Returns the associated data of the application account. 104761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 104861847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 104961847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 105061847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name or key. 105161847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 105261847f8eSopenharmony_ci * @throws { BusinessError } 12400002 - Custom data not found. 105361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 105461847f8eSopenharmony_ci * @since 9 105561847f8eSopenharmony_ci */ 105661847f8eSopenharmony_ci getCustomDataSync(name: string, key: string): string; 105761847f8eSopenharmony_ci 105861847f8eSopenharmony_ci /** 105961847f8eSopenharmony_ci * Subscribes to the change events of accounts of the specified owners. 106061847f8eSopenharmony_ci * <p> 106161847f8eSopenharmony_ci * When the account owner updates the account, the subscriber will receive a notification 106261847f8eSopenharmony_ci * about the account change event. 106361847f8eSopenharmony_ci * 106461847f8eSopenharmony_ci * @param { 'change' } type - Event type. 106561847f8eSopenharmony_ci * @param { Array<string> } owners - Indicates the account owners, which are specified 106661847f8eSopenharmony_ci * by {@link AppAccount#AppAccount(String name, String owner)}. 106761847f8eSopenharmony_ci * @param { Callback<Array<AppAccountInfo>> } callback - Asynchronous callback interface. 106861847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 106961847f8eSopenharmony_ci * @since 7 107061847f8eSopenharmony_ci * @deprecated since 9 107161847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#on 107261847f8eSopenharmony_ci */ 107361847f8eSopenharmony_ci on(type: 'change', owners: Array<string>, callback: Callback<Array<AppAccountInfo>>): void; 107461847f8eSopenharmony_ci 107561847f8eSopenharmony_ci /** 107661847f8eSopenharmony_ci * Subscribes to the change events of accounts of the specified owners. 107761847f8eSopenharmony_ci * <p> 107861847f8eSopenharmony_ci * When the account owner updates the account, the subscriber will receive a notification 107961847f8eSopenharmony_ci * about the account change event. 108061847f8eSopenharmony_ci * 108161847f8eSopenharmony_ci * @param { 'accountChange' } type - Event type. 108261847f8eSopenharmony_ci * @param { Array<string> } owners - Indicates the account owners, which are specified 108361847f8eSopenharmony_ci * by {@link AppAccount#AppAccount(String name, String owner)}. 108461847f8eSopenharmony_ci * @param { Callback<Array<AppAccountInfo>> } callback - Asynchronous callback interface. 108561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 108661847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 108761847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 108861847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid type or owners. 108961847f8eSopenharmony_ci * @throws { BusinessError } 12400001 - Application not found. 109061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 109161847f8eSopenharmony_ci * @since 9 109261847f8eSopenharmony_ci */ 109361847f8eSopenharmony_ci on(type: 'accountChange', owners: Array<string>, callback: Callback<Array<AppAccountInfo>>): void; 109461847f8eSopenharmony_ci 109561847f8eSopenharmony_ci /** 109661847f8eSopenharmony_ci * Unsubscribes from account events. 109761847f8eSopenharmony_ci * 109861847f8eSopenharmony_ci * @param { 'change' } type - Event type. 109961847f8eSopenharmony_ci * @param { Callback<Array<AppAccountInfo>> } [callback] - Asynchronous callback interface. 110061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 110161847f8eSopenharmony_ci * @since 7 110261847f8eSopenharmony_ci * @deprecated since 9 110361847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#off 110461847f8eSopenharmony_ci */ 110561847f8eSopenharmony_ci off(type: 'change', callback?: Callback<Array<AppAccountInfo>>): void; 110661847f8eSopenharmony_ci 110761847f8eSopenharmony_ci /** 110861847f8eSopenharmony_ci * Unsubscribes from account events. 110961847f8eSopenharmony_ci * 111061847f8eSopenharmony_ci * @param { 'accountChange' } type - Event type. 111161847f8eSopenharmony_ci * @param { Callback<Array<AppAccountInfo>> } [callback] - Asynchronous callback interface. 111261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 111361847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 111461847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 111561847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid type. 111661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 111761847f8eSopenharmony_ci * @since 9 111861847f8eSopenharmony_ci */ 111961847f8eSopenharmony_ci off(type: 'accountChange', callback?: Callback<Array<AppAccountInfo>>): void; 112061847f8eSopenharmony_ci 112161847f8eSopenharmony_ci /** 112261847f8eSopenharmony_ci * Authenticates an application account to get an oauth token. 112361847f8eSopenharmony_ci * 112461847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application or third-party applications. 112561847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 112661847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 112761847f8eSopenharmony_ci * @param { object } options - Indicates the authenticator-specific options for the request. 112861847f8eSopenharmony_ci * @param { AuthenticatorCallback } callback - Indicates the authenticator callback. 112961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 113061847f8eSopenharmony_ci * @since 8 113161847f8eSopenharmony_ci * @deprecated since 9 113261847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#auth 113361847f8eSopenharmony_ci */ 113461847f8eSopenharmony_ci authenticate( 113561847f8eSopenharmony_ci name: string, 113661847f8eSopenharmony_ci owner: string, 113761847f8eSopenharmony_ci authType: string, 113861847f8eSopenharmony_ci options: { [key: string]: any }, 113961847f8eSopenharmony_ci callback: AuthenticatorCallback 114061847f8eSopenharmony_ci ): void; 114161847f8eSopenharmony_ci 114261847f8eSopenharmony_ci /** 114361847f8eSopenharmony_ci * Authenticates an application account to get an auth token. 114461847f8eSopenharmony_ci * 114561847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application or third-party applications. 114661847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 114761847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 114861847f8eSopenharmony_ci * @param { AuthCallback } callback - Indicates the authenticator callback. 114961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 115061847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 115161847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 115261847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name, owner or authType. 115361847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 115461847f8eSopenharmony_ci * @throws { BusinessError } 12300010 - Account service busy. 115561847f8eSopenharmony_ci * @throws { BusinessError } 12300113 - Authenticator service not found. 115661847f8eSopenharmony_ci * @throws { BusinessError } 12300114 - Authenticator service exception. 115761847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 115861847f8eSopenharmony_ci * @since 9 115961847f8eSopenharmony_ci */ 116061847f8eSopenharmony_ci auth(name: string, owner: string, authType: string, callback: AuthCallback): void; 116161847f8eSopenharmony_ci 116261847f8eSopenharmony_ci /** 116361847f8eSopenharmony_ci * Authenticates an application account to get an auth token. 116461847f8eSopenharmony_ci * 116561847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application or third-party applications. 116661847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 116761847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 116861847f8eSopenharmony_ci * @param { Record<string, Object> } options - Indicates the authenticator-specific options for the request. 116961847f8eSopenharmony_ci * @param { AuthCallback } callback - Indicates the authenticator callback. 117061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 117161847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 117261847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 117361847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name, owner, authType or options. 117461847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 117561847f8eSopenharmony_ci * @throws { BusinessError } 12300010 - Account service busy. 117661847f8eSopenharmony_ci * @throws { BusinessError } 12300113 - Authenticator service not found. 117761847f8eSopenharmony_ci * @throws { BusinessError } 12300114 - Authenticator service exception. 117861847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 117961847f8eSopenharmony_ci * @since 9 118061847f8eSopenharmony_ci */ 118161847f8eSopenharmony_ci auth( 118261847f8eSopenharmony_ci name: string, 118361847f8eSopenharmony_ci owner: string, 118461847f8eSopenharmony_ci authType: string, 118561847f8eSopenharmony_ci options: Record<string, Object>, 118661847f8eSopenharmony_ci callback: AuthCallback 118761847f8eSopenharmony_ci ): void; 118861847f8eSopenharmony_ci 118961847f8eSopenharmony_ci /** 119061847f8eSopenharmony_ci * Gets an oauth token with the specified authentication type from a particular application account. 119161847f8eSopenharmony_ci * 119261847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application or third-party applications. 119361847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 119461847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 119561847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - Asynchronous callback interface. Returns an oauth token. 119661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 119761847f8eSopenharmony_ci * @since 8 119861847f8eSopenharmony_ci * @deprecated since 9 119961847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#getAuthToken 120061847f8eSopenharmony_ci */ 120161847f8eSopenharmony_ci getOAuthToken(name: string, owner: string, authType: string, callback: AsyncCallback<string>): void; 120261847f8eSopenharmony_ci 120361847f8eSopenharmony_ci /** 120461847f8eSopenharmony_ci * Gets an oauth token with the specified authentication type from a particular application account. 120561847f8eSopenharmony_ci * 120661847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application or third-party applications. 120761847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 120861847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 120961847f8eSopenharmony_ci * @returns { Promise<string> } Returns an oauth token. 121061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 121161847f8eSopenharmony_ci * @since 8 121261847f8eSopenharmony_ci * @deprecated since 9 121361847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#getAuthToken 121461847f8eSopenharmony_ci */ 121561847f8eSopenharmony_ci getOAuthToken(name: string, owner: string, authType: string): Promise<string>; 121661847f8eSopenharmony_ci 121761847f8eSopenharmony_ci /** 121861847f8eSopenharmony_ci * Gets an auth token with the specified authentication type from a particular application account. 121961847f8eSopenharmony_ci * 122061847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application or third-party applications. 122161847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 122261847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 122361847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - Asynchronous callback interface. Returns an auth token. 122461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 122561847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 122661847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 122761847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name, owner or authType. 122861847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 122961847f8eSopenharmony_ci * @throws { BusinessError } 12300107 - AuthType not found. 123061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 123161847f8eSopenharmony_ci * @since 9 123261847f8eSopenharmony_ci */ 123361847f8eSopenharmony_ci getAuthToken(name: string, owner: string, authType: string, callback: AsyncCallback<string>): void; 123461847f8eSopenharmony_ci 123561847f8eSopenharmony_ci /** 123661847f8eSopenharmony_ci * Gets an auth token with the specified authentication type from a particular application account. 123761847f8eSopenharmony_ci * 123861847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application or third-party applications. 123961847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 124061847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 124161847f8eSopenharmony_ci * @returns { Promise<string> } Returns an auth token. 124261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 124361847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 124461847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 124561847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name, owner or authType. 124661847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 124761847f8eSopenharmony_ci * @throws { BusinessError } 12300107 - AuthType not found. 124861847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 124961847f8eSopenharmony_ci * @since 9 125061847f8eSopenharmony_ci */ 125161847f8eSopenharmony_ci getAuthToken(name: string, owner: string, authType: string): Promise<string>; 125261847f8eSopenharmony_ci 125361847f8eSopenharmony_ci /** 125461847f8eSopenharmony_ci * Sets an oauth token with the specified authentication type for a particular account. 125561847f8eSopenharmony_ci * <p> 125661847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 125761847f8eSopenharmony_ci * 125861847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application. 125961847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 126061847f8eSopenharmony_ci * @param { string } token - Indicates the oauth token. 126161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 126261847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 126361847f8eSopenharmony_ci * @since 8 126461847f8eSopenharmony_ci * @deprecated since 9 126561847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#setAuthToken 126661847f8eSopenharmony_ci */ 126761847f8eSopenharmony_ci setOAuthToken(name: string, authType: string, token: string, callback: AsyncCallback<void>): void; 126861847f8eSopenharmony_ci 126961847f8eSopenharmony_ci /** 127061847f8eSopenharmony_ci * Sets an oauth token with the specified authentication type for a particular account. 127161847f8eSopenharmony_ci * <p> 127261847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 127361847f8eSopenharmony_ci * 127461847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application. 127561847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 127661847f8eSopenharmony_ci * @param { string } token - Indicates the oauth token. 127761847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 127861847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 127961847f8eSopenharmony_ci * @since 8 128061847f8eSopenharmony_ci * @deprecated since 9 128161847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#setAuthToken 128261847f8eSopenharmony_ci */ 128361847f8eSopenharmony_ci setOAuthToken(name: string, authType: string, token: string): Promise<void>; 128461847f8eSopenharmony_ci 128561847f8eSopenharmony_ci /** 128661847f8eSopenharmony_ci * Sets an auth token with the specified authentication type for a particular account. 128761847f8eSopenharmony_ci * <p> 128861847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 128961847f8eSopenharmony_ci * 129061847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application. 129161847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 129261847f8eSopenharmony_ci * @param { string } token - Indicates the auth token. 129361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 129461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 129561847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 129661847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 129761847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name, authType or token. 129861847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 129961847f8eSopenharmony_ci * @throws { BusinessError } 12400004 - The number of tokens reaches the upper limit. 130061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 130161847f8eSopenharmony_ci * @since 9 130261847f8eSopenharmony_ci */ 130361847f8eSopenharmony_ci setAuthToken(name: string, authType: string, token: string, callback: AsyncCallback<void>): void; 130461847f8eSopenharmony_ci 130561847f8eSopenharmony_ci /** 130661847f8eSopenharmony_ci * Sets an auth token with the specified authentication type for a particular account. 130761847f8eSopenharmony_ci * <p> 130861847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 130961847f8eSopenharmony_ci * 131061847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application. 131161847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 131261847f8eSopenharmony_ci * @param { string } token - Indicates the auth token. 131361847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 131461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 131561847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 131661847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 131761847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name, authType or token. 131861847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 131961847f8eSopenharmony_ci * @throws { BusinessError } 12400004 - The number of tokens reaches the upper limit. 132061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 132161847f8eSopenharmony_ci * @since 9 132261847f8eSopenharmony_ci */ 132361847f8eSopenharmony_ci setAuthToken(name: string, authType: string, token: string): Promise<void>; 132461847f8eSopenharmony_ci 132561847f8eSopenharmony_ci /** 132661847f8eSopenharmony_ci * Deletes an oauth token for the specified application account. 132761847f8eSopenharmony_ci * <p> 132861847f8eSopenharmony_ci * Only tokens visible to the caller application can be deleted. 132961847f8eSopenharmony_ci * 133061847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application or third-party applications. 133161847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 133261847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 133361847f8eSopenharmony_ci * @param { string } token - Indicates the oauth token. 133461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback Asynchronous callback interface. 133561847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 133661847f8eSopenharmony_ci * @since 8 133761847f8eSopenharmony_ci * @deprecated since 9 133861847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#deleteAuthToken 133961847f8eSopenharmony_ci */ 134061847f8eSopenharmony_ci deleteOAuthToken(name: string, owner: string, authType: string, token: string, callback: AsyncCallback<void>): void; 134161847f8eSopenharmony_ci 134261847f8eSopenharmony_ci /** 134361847f8eSopenharmony_ci * Deletes an oauth token for the specified application account. 134461847f8eSopenharmony_ci * <p> 134561847f8eSopenharmony_ci * Only tokens visible to the caller application can be deleted. 134661847f8eSopenharmony_ci * 134761847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application or third-party applications. 134861847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 134961847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 135061847f8eSopenharmony_ci * @param { string } token - Indicates the oauth token. 135161847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 135261847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 135361847f8eSopenharmony_ci * @since 8 135461847f8eSopenharmony_ci * @deprecated since 9 135561847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#deleteAuthToken 135661847f8eSopenharmony_ci */ 135761847f8eSopenharmony_ci deleteOAuthToken(name: string, owner: string, authType: string, token: string): Promise<void>; 135861847f8eSopenharmony_ci 135961847f8eSopenharmony_ci /** 136061847f8eSopenharmony_ci * Deletes an auth token for the specified application account. 136161847f8eSopenharmony_ci * <p> 136261847f8eSopenharmony_ci * Only tokens visible to the caller application can be deleted. 136361847f8eSopenharmony_ci * 136461847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application or third-party applications. 136561847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 136661847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 136761847f8eSopenharmony_ci * @param { string } token - Indicates the auth token. 136861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 136961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 137061847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 137161847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 137261847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name, owner, authType or token. 137361847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 137461847f8eSopenharmony_ci * @throws { BusinessError } 12300107 - AuthType not found. 137561847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 137661847f8eSopenharmony_ci * @since 9 137761847f8eSopenharmony_ci */ 137861847f8eSopenharmony_ci deleteAuthToken(name: string, owner: string, authType: string, token: string, callback: AsyncCallback<void>): void; 137961847f8eSopenharmony_ci 138061847f8eSopenharmony_ci /** 138161847f8eSopenharmony_ci * Deletes an auth token for the specified application account. 138261847f8eSopenharmony_ci * <p> 138361847f8eSopenharmony_ci * Only tokens visible to the caller application can be deleted. 138461847f8eSopenharmony_ci * 138561847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application or third-party applications. 138661847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 138761847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 138861847f8eSopenharmony_ci * @param { string } token - Indicates the auth token. 138961847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 139061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 139161847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 139261847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 139361847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name, owner, authType or token. 139461847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 139561847f8eSopenharmony_ci * @throws { BusinessError } 12300107 - AuthType not found. 139661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 139761847f8eSopenharmony_ci * @since 9 139861847f8eSopenharmony_ci */ 139961847f8eSopenharmony_ci deleteAuthToken(name: string, owner: string, authType: string, token: string): Promise<void>; 140061847f8eSopenharmony_ci 140161847f8eSopenharmony_ci /** 140261847f8eSopenharmony_ci * Sets the oauth token visibility of the specified authentication type to a third-party application. 140361847f8eSopenharmony_ci * <p> 140461847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 140561847f8eSopenharmony_ci * 140661847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application. 140761847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 140861847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the third-party application. 140961847f8eSopenharmony_ci * @param { boolean } isVisible - Indicates the bool value of visibility. 141061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 141161847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 141261847f8eSopenharmony_ci * @since 8 141361847f8eSopenharmony_ci * @deprecated since 9 141461847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#setAuthTokenVisibility 141561847f8eSopenharmony_ci */ 141661847f8eSopenharmony_ci setOAuthTokenVisibility( 141761847f8eSopenharmony_ci name: string, 141861847f8eSopenharmony_ci authType: string, 141961847f8eSopenharmony_ci bundleName: string, 142061847f8eSopenharmony_ci isVisible: boolean, 142161847f8eSopenharmony_ci callback: AsyncCallback<void> 142261847f8eSopenharmony_ci ): void; 142361847f8eSopenharmony_ci 142461847f8eSopenharmony_ci /** 142561847f8eSopenharmony_ci * Sets the oauth token visibility of the specified authentication type to a third-party application. 142661847f8eSopenharmony_ci * <p> 142761847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 142861847f8eSopenharmony_ci * 142961847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application. 143061847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 143161847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the third-party application. 143261847f8eSopenharmony_ci * @param { boolean } isVisible - Indicates the bool value of visibility. 143361847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 143461847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 143561847f8eSopenharmony_ci * @since 8 143661847f8eSopenharmony_ci * @deprecated since 9 143761847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#setAuthTokenVisibility 143861847f8eSopenharmony_ci */ 143961847f8eSopenharmony_ci setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVisible: boolean): Promise<void>; 144061847f8eSopenharmony_ci 144161847f8eSopenharmony_ci /** 144261847f8eSopenharmony_ci * Sets the auth token visibility of the specified authentication type to a third-party application. 144361847f8eSopenharmony_ci * <p> 144461847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 144561847f8eSopenharmony_ci * 144661847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application. 144761847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 144861847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the third-party application. 144961847f8eSopenharmony_ci * @param { boolean } isVisible - Indicates the bool value of visibility. 145061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 145161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 145261847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 145361847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 145461847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name, authType or bundleName. 145561847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 145661847f8eSopenharmony_ci * @throws { BusinessError } 12300107 - AuthType not found. 145761847f8eSopenharmony_ci * @throws { BusinessError } 12400001 - Application not found. 145861847f8eSopenharmony_ci * @throws { BusinessError } 12400005 - The size of authorization list reaches the upper limit. 145961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 146061847f8eSopenharmony_ci * @since 9 146161847f8eSopenharmony_ci */ 146261847f8eSopenharmony_ci setAuthTokenVisibility( 146361847f8eSopenharmony_ci name: string, 146461847f8eSopenharmony_ci authType: string, 146561847f8eSopenharmony_ci bundleName: string, 146661847f8eSopenharmony_ci isVisible: boolean, 146761847f8eSopenharmony_ci callback: AsyncCallback<void> 146861847f8eSopenharmony_ci ): void; 146961847f8eSopenharmony_ci 147061847f8eSopenharmony_ci /** 147161847f8eSopenharmony_ci * Sets the auth token visibility of the specified authentication type to a third-party application. 147261847f8eSopenharmony_ci * <p> 147361847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 147461847f8eSopenharmony_ci * 147561847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application. 147661847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 147761847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the third-party application. 147861847f8eSopenharmony_ci * @param { boolean } isVisible - Indicates the bool value of visibility. 147961847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 148061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 148161847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 148261847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 148361847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name, authType or bundleName. 148461847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 148561847f8eSopenharmony_ci * @throws { BusinessError } 12300107 - AuthType not found. 148661847f8eSopenharmony_ci * @throws { BusinessError } 12400001 - Application not found. 148761847f8eSopenharmony_ci * @throws { BusinessError } 12400005 - The size of authorization list reaches the upper limit. 148861847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 148961847f8eSopenharmony_ci * @since 9 149061847f8eSopenharmony_ci */ 149161847f8eSopenharmony_ci setAuthTokenVisibility(name: string, authType: string, bundleName: string, isVisible: boolean): Promise<void>; 149261847f8eSopenharmony_ci 149361847f8eSopenharmony_ci /** 149461847f8eSopenharmony_ci * Checks the oauth token visibility of the specified authentication type for a third-party application. 149561847f8eSopenharmony_ci * <p> 149661847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 149761847f8eSopenharmony_ci * 149861847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application or third-party applications. 149961847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 150061847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the third-party application. 150161847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Asynchronous callback interface. Returns the bool value of visibility. 150261847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 150361847f8eSopenharmony_ci * @since 8 150461847f8eSopenharmony_ci * @deprecated since 9 150561847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#checkAuthTokenVisibility 150661847f8eSopenharmony_ci */ 150761847f8eSopenharmony_ci checkOAuthTokenVisibility( 150861847f8eSopenharmony_ci name: string, 150961847f8eSopenharmony_ci authType: string, 151061847f8eSopenharmony_ci bundleName: string, 151161847f8eSopenharmony_ci callback: AsyncCallback<boolean> 151261847f8eSopenharmony_ci ): void; 151361847f8eSopenharmony_ci 151461847f8eSopenharmony_ci /** 151561847f8eSopenharmony_ci * Checks the oauth token visibility of the specified authentication type for a third-party application. 151661847f8eSopenharmony_ci * <p> 151761847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 151861847f8eSopenharmony_ci * 151961847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application or third-party applications. 152061847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 152161847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the third-party application. 152261847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns the bool value of visibility. 152361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 152461847f8eSopenharmony_ci * @since 8 152561847f8eSopenharmony_ci * @deprecated since 9 152661847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#checkAuthTokenVisibility 152761847f8eSopenharmony_ci */ 152861847f8eSopenharmony_ci checkOAuthTokenVisibility(name: string, authType: string, bundleName: string): Promise<boolean>; 152961847f8eSopenharmony_ci 153061847f8eSopenharmony_ci /** 153161847f8eSopenharmony_ci * Checks the auth token visibility of the specified authentication type for a third-party application. 153261847f8eSopenharmony_ci * <p> 153361847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 153461847f8eSopenharmony_ci * 153561847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application or third-party applications. 153661847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 153761847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the third-party application. 153861847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Asynchronous callback interface. 153961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 154061847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 154161847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 154261847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name, authType or bundleName. 154361847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 154461847f8eSopenharmony_ci * @throws { BusinessError } 12300107 - AuthType not found. 154561847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 154661847f8eSopenharmony_ci * @since 9 154761847f8eSopenharmony_ci */ 154861847f8eSopenharmony_ci checkAuthTokenVisibility( 154961847f8eSopenharmony_ci name: string, 155061847f8eSopenharmony_ci authType: string, 155161847f8eSopenharmony_ci bundleName: string, 155261847f8eSopenharmony_ci callback: AsyncCallback<boolean> 155361847f8eSopenharmony_ci ): void; 155461847f8eSopenharmony_ci 155561847f8eSopenharmony_ci /** 155661847f8eSopenharmony_ci * Checks the auth token visibility of the specified authentication type for a third-party application. 155761847f8eSopenharmony_ci * <p> 155861847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 155961847f8eSopenharmony_ci * 156061847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application or third-party applications. 156161847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 156261847f8eSopenharmony_ci * @param { string } bundleName - Indicates the bundle name of the third-party application. 156361847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns the bool value of visibility. 156461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 156561847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 156661847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 156761847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name, authType or bundleName. 156861847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 156961847f8eSopenharmony_ci * @throws { BusinessError } 12300107 - AuthType not found. 157061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 157161847f8eSopenharmony_ci * @since 9 157261847f8eSopenharmony_ci */ 157361847f8eSopenharmony_ci checkAuthTokenVisibility(name: string, authType: string, bundleName: string): Promise<boolean>; 157461847f8eSopenharmony_ci 157561847f8eSopenharmony_ci /** 157661847f8eSopenharmony_ci * Gets all oauth tokens visible to the caller application. 157761847f8eSopenharmony_ci * 157861847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application or third-party applications. 157961847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 158061847f8eSopenharmony_ci * @param { AsyncCallback<Array<OAuthTokenInfo>> } callback - Asynchronous callback interface. 158161847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 158261847f8eSopenharmony_ci * @since 8 158361847f8eSopenharmony_ci * @deprecated since 9 158461847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#getAllAuthTokens 158561847f8eSopenharmony_ci */ 158661847f8eSopenharmony_ci getAllOAuthTokens(name: string, owner: string, callback: AsyncCallback<Array<OAuthTokenInfo>>): void; 158761847f8eSopenharmony_ci 158861847f8eSopenharmony_ci /** 158961847f8eSopenharmony_ci * Gets all oauth tokens visible to the caller application. 159061847f8eSopenharmony_ci * 159161847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application or third-party applications. 159261847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 159361847f8eSopenharmony_ci * @returns { Promise<Array<OAuthTokenInfo>> } Returns a list of oauth tokens visible to the caller application. 159461847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 159561847f8eSopenharmony_ci * @since 8 159661847f8eSopenharmony_ci * @deprecated since 9 159761847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#getAllAuthTokens 159861847f8eSopenharmony_ci */ 159961847f8eSopenharmony_ci getAllOAuthTokens(name: string, owner: string): Promise<Array<OAuthTokenInfo>>; 160061847f8eSopenharmony_ci 160161847f8eSopenharmony_ci /** 160261847f8eSopenharmony_ci * Gets all auth tokens visible to the caller application. 160361847f8eSopenharmony_ci * 160461847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application or third-party applications. 160561847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 160661847f8eSopenharmony_ci * @param { AsyncCallback<Array<AuthTokenInfo>> } callback - Asynchronous callback interface. 160761847f8eSopenharmony_ci * Returns a list of auth tokens visible to the caller application. 160861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 160961847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 161061847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 161161847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name or owner. 161261847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 161361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 161461847f8eSopenharmony_ci * @since 9 161561847f8eSopenharmony_ci */ 161661847f8eSopenharmony_ci getAllAuthTokens(name: string, owner: string, callback: AsyncCallback<Array<AuthTokenInfo>>): void; 161761847f8eSopenharmony_ci 161861847f8eSopenharmony_ci /** 161961847f8eSopenharmony_ci * Gets all auth tokens visible to the caller application. 162061847f8eSopenharmony_ci * 162161847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application or third-party applications. 162261847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 162361847f8eSopenharmony_ci * @returns { Promise<Array<AuthTokenInfo>> } Returns a list of auth tokens visible to the caller application. 162461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 162561847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 162661847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 162761847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name or owner. 162861847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 162961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 163061847f8eSopenharmony_ci * @since 9 163161847f8eSopenharmony_ci */ 163261847f8eSopenharmony_ci getAllAuthTokens(name: string, owner: string): Promise<Array<AuthTokenInfo>>; 163361847f8eSopenharmony_ci 163461847f8eSopenharmony_ci /** 163561847f8eSopenharmony_ci * Gets the open authorization list with a specified authentication type for a particular application account. 163661847f8eSopenharmony_ci * <p> 163761847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 163861847f8eSopenharmony_ci * 163961847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application. 164061847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 164161847f8eSopenharmony_ci * @param { AsyncCallback<Array<string>> } callback - Asynchronous callback interface. 164261847f8eSopenharmony_ci * Returns the open authorization list of the specified authentication type. 164361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 164461847f8eSopenharmony_ci * @since 8 164561847f8eSopenharmony_ci * @deprecated since 9 164661847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#getAuthList 164761847f8eSopenharmony_ci */ 164861847f8eSopenharmony_ci getOAuthList(name: string, authType: string, callback: AsyncCallback<Array<string>>): void; 164961847f8eSopenharmony_ci 165061847f8eSopenharmony_ci /** 165161847f8eSopenharmony_ci * Gets the open authorization list with a specified authentication type for a particular application account. 165261847f8eSopenharmony_ci * <p> 165361847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 165461847f8eSopenharmony_ci * 165561847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application. 165661847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 165761847f8eSopenharmony_ci * @returns { Promise<Array<string>> } Returns the open authorization list of the specified authentication type. 165861847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 165961847f8eSopenharmony_ci * @since 8 166061847f8eSopenharmony_ci * @deprecated since 9 166161847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#getAuthList 166261847f8eSopenharmony_ci */ 166361847f8eSopenharmony_ci getOAuthList(name: string, authType: string): Promise<Array<string>>; 166461847f8eSopenharmony_ci 166561847f8eSopenharmony_ci /** 166661847f8eSopenharmony_ci * Gets the open authorization list with a specified authentication type for a particular application account. 166761847f8eSopenharmony_ci * <p> 166861847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 166961847f8eSopenharmony_ci * 167061847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application. 167161847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 167261847f8eSopenharmony_ci * @param { AsyncCallback<Array<string>> } callback - Asynchronous callback interface. 167361847f8eSopenharmony_ci * Returns the open authorization list of the specified authentication type. 167461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 167561847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 167661847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 167761847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name or authType. 167861847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 167961847f8eSopenharmony_ci * @throws { BusinessError } 12300107 - AuthType not found. 168061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 168161847f8eSopenharmony_ci * @since 9 168261847f8eSopenharmony_ci */ 168361847f8eSopenharmony_ci getAuthList(name: string, authType: string, callback: AsyncCallback<Array<string>>): void; 168461847f8eSopenharmony_ci 168561847f8eSopenharmony_ci /** 168661847f8eSopenharmony_ci * Gets the open authorization list with a specified authentication type for a particular application account. 168761847f8eSopenharmony_ci * <p> 168861847f8eSopenharmony_ci * Only the owner of the application account has the permission to call this method. 168961847f8eSopenharmony_ci * 169061847f8eSopenharmony_ci * @param { string } name - Indicates the account name of your application. 169161847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 169261847f8eSopenharmony_ci * @returns { Promise<Array<string>> } Returns the open authorization list of the specified authentication type. 169361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 169461847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 169561847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 169661847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name or authType. 169761847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 169861847f8eSopenharmony_ci * @throws { BusinessError } 12300107 - AuthType not found. 169961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 170061847f8eSopenharmony_ci * @since 9 170161847f8eSopenharmony_ci */ 170261847f8eSopenharmony_ci getAuthList(name: string, authType: string): Promise<Array<string>>; 170361847f8eSopenharmony_ci 170461847f8eSopenharmony_ci /** 170561847f8eSopenharmony_ci * Gets the authenticator callback with the specified session id. 170661847f8eSopenharmony_ci * <p> 170761847f8eSopenharmony_ci * Only the owner of the authenticator has the permission to call this method. 170861847f8eSopenharmony_ci * 170961847f8eSopenharmony_ci * @param { string } sessionId - Indicates the id of a authentication session. 171061847f8eSopenharmony_ci * @param { AsyncCallback<AuthenticatorCallback> } callback - Asynchronous callback interface. 171161847f8eSopenharmony_ci * Returns the authenticator callback related to the session id. 171261847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 171361847f8eSopenharmony_ci * @since 8 171461847f8eSopenharmony_ci * @deprecated since 9 171561847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#getAuthCallback 171661847f8eSopenharmony_ci */ 171761847f8eSopenharmony_ci getAuthenticatorCallback(sessionId: string, callback: AsyncCallback<AuthenticatorCallback>): void; 171861847f8eSopenharmony_ci 171961847f8eSopenharmony_ci /** 172061847f8eSopenharmony_ci * Gets the authenticator callback with the specified session id. 172161847f8eSopenharmony_ci * <p> 172261847f8eSopenharmony_ci * Only the owner of the authenticator has the permission to call this method. 172361847f8eSopenharmony_ci * 172461847f8eSopenharmony_ci * @param { string } sessionId - Indicates the id of a authentication session. 172561847f8eSopenharmony_ci * @returns { Promise<AuthenticatorCallback> } Returns the authenticator callback related to the session id. 172661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 172761847f8eSopenharmony_ci * @since 8 172861847f8eSopenharmony_ci * @deprecated since 9 172961847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#getAuthCallback 173061847f8eSopenharmony_ci */ 173161847f8eSopenharmony_ci getAuthenticatorCallback(sessionId: string): Promise<AuthenticatorCallback>; 173261847f8eSopenharmony_ci 173361847f8eSopenharmony_ci /** 173461847f8eSopenharmony_ci * Obtains the authenticator callback with the specified session id. 173561847f8eSopenharmony_ci * <p> 173661847f8eSopenharmony_ci * Only the owner of the authenticator has the permission to call this method. 173761847f8eSopenharmony_ci * 173861847f8eSopenharmony_ci * @param { string } sessionId - Indicates the id of a authentication session. 173961847f8eSopenharmony_ci * @param { AsyncCallback<AuthCallback> } callback - Asynchronous callback interface. 174061847f8eSopenharmony_ci * Returns the authenticator callback related to the session id. 174161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 174261847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 174361847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 174461847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid sessionId. 174561847f8eSopenharmony_ci * @throws { BusinessError } 12300108 - Session not found. 174661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 174761847f8eSopenharmony_ci * @since 9 174861847f8eSopenharmony_ci */ 174961847f8eSopenharmony_ci getAuthCallback(sessionId: string, callback: AsyncCallback<AuthCallback>): void; 175061847f8eSopenharmony_ci 175161847f8eSopenharmony_ci /** 175261847f8eSopenharmony_ci * Obtains the authenticator callback with the specified session id. 175361847f8eSopenharmony_ci * <p> 175461847f8eSopenharmony_ci * Only the owner of the authenticator has the permission to call this method. 175561847f8eSopenharmony_ci * 175661847f8eSopenharmony_ci * @param { string } sessionId - Indicates the id of a authentication session. 175761847f8eSopenharmony_ci * @returns { Promise<AuthCallback> } Returns the authenticator callback related to the session id. 175861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 175961847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 176061847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 176161847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid sessionId. 176261847f8eSopenharmony_ci * @throws { BusinessError } 12300108 - Session not found. 176361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 176461847f8eSopenharmony_ci * @since 9 176561847f8eSopenharmony_ci */ 176661847f8eSopenharmony_ci getAuthCallback(sessionId: string): Promise<AuthCallback>; 176761847f8eSopenharmony_ci 176861847f8eSopenharmony_ci /** 176961847f8eSopenharmony_ci * Gets the authenticator information of an application account. 177061847f8eSopenharmony_ci * 177161847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 177261847f8eSopenharmony_ci * @param { AsyncCallback<AuthenticatorInfo> } callback - Asynchronous callback interface. 177361847f8eSopenharmony_ci * Returns the authenticator information of the application account. 177461847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 177561847f8eSopenharmony_ci * @since 8 177661847f8eSopenharmony_ci * @deprecated since 9 177761847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#queryAuthenticatorInfo 177861847f8eSopenharmony_ci */ 177961847f8eSopenharmony_ci getAuthenticatorInfo(owner: string, callback: AsyncCallback<AuthenticatorInfo>): void; 178061847f8eSopenharmony_ci 178161847f8eSopenharmony_ci /** 178261847f8eSopenharmony_ci * Gets the authenticator information of an application account. 178361847f8eSopenharmony_ci * 178461847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 178561847f8eSopenharmony_ci * @returns { Promise<AuthenticatorInfo> } Returns the authenticator information of the application account. 178661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 178761847f8eSopenharmony_ci * @since 8 178861847f8eSopenharmony_ci * @deprecated since 9 178961847f8eSopenharmony_ci * @useinstead appAccount.AppAccountManager#queryAuthenticatorInfo 179061847f8eSopenharmony_ci */ 179161847f8eSopenharmony_ci getAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo>; 179261847f8eSopenharmony_ci 179361847f8eSopenharmony_ci /** 179461847f8eSopenharmony_ci * Queries the authenticator information of an application account. 179561847f8eSopenharmony_ci * 179661847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 179761847f8eSopenharmony_ci * @param { AsyncCallback<AuthenticatorInfo> } callback - Asynchronous callback interface. 179861847f8eSopenharmony_ci * Returns the authenticator information of the application account. 179961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 180061847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 180161847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 180261847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid owner. 180361847f8eSopenharmony_ci * @throws { BusinessError } 12300113 - Authenticator service not found. 180461847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 180561847f8eSopenharmony_ci * @since 9 180661847f8eSopenharmony_ci */ 180761847f8eSopenharmony_ci queryAuthenticatorInfo(owner: string, callback: AsyncCallback<AuthenticatorInfo>): void; 180861847f8eSopenharmony_ci 180961847f8eSopenharmony_ci /** 181061847f8eSopenharmony_ci * Queries the authenticator information of an application account. 181161847f8eSopenharmony_ci * 181261847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner of your application or third-party applications. 181361847f8eSopenharmony_ci * @returns { Promise<AuthenticatorInfo> } Returns the authenticator information of the application account. 181461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 181561847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 181661847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 181761847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid owner. 181861847f8eSopenharmony_ci * @throws { BusinessError } 12300113 - Authenticator service not found. 181961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 182061847f8eSopenharmony_ci * @since 9 182161847f8eSopenharmony_ci */ 182261847f8eSopenharmony_ci queryAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo>; 182361847f8eSopenharmony_ci 182461847f8eSopenharmony_ci /** 182561847f8eSopenharmony_ci * Checks whether a particular account has all specified labels. 182661847f8eSopenharmony_ci * 182761847f8eSopenharmony_ci * @param { string } name - Indicates the account name. 182861847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner. 182961847f8eSopenharmony_ci * @param { Array<string> } labels - Indicates an array of labels to check. 183061847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Asynchronous callback interface. 183161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 183261847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 183361847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 183461847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name, owner or labels. 183561847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 183661847f8eSopenharmony_ci * @throws { BusinessError } 12300010 - Account service busy. 183761847f8eSopenharmony_ci * @throws { BusinessError } 12300113 - Authenticator service not found. 183861847f8eSopenharmony_ci * @throws { BusinessError } 12300114 - Authenticator service exception. 183961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 184061847f8eSopenharmony_ci * @since 9 184161847f8eSopenharmony_ci */ 184261847f8eSopenharmony_ci checkAccountLabels(name: string, owner: string, labels: Array<string>, callback: AsyncCallback<boolean>): void; 184361847f8eSopenharmony_ci 184461847f8eSopenharmony_ci /** 184561847f8eSopenharmony_ci * Checks whether a particular account has all specified labels. 184661847f8eSopenharmony_ci * 184761847f8eSopenharmony_ci * @param { string } name - Indicates the account name. 184861847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner. 184961847f8eSopenharmony_ci * @param { Array<string> } labels - Indicates an array of labels to check. 185061847f8eSopenharmony_ci * @returns { Promise<boolean> } The promise returned by the function. 185161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 185261847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 185361847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 185461847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name, owner or labels. 185561847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 185661847f8eSopenharmony_ci * @throws { BusinessError } 12300010 - Account service busy. 185761847f8eSopenharmony_ci * @throws { BusinessError } 12300113 - Authenticator service not found. 185861847f8eSopenharmony_ci * @throws { BusinessError } 12300114 - Authenticator service exception. 185961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 186061847f8eSopenharmony_ci * @since 9 186161847f8eSopenharmony_ci */ 186261847f8eSopenharmony_ci checkAccountLabels(name: string, owner: string, labels: Array<string>): Promise<boolean>; 186361847f8eSopenharmony_ci 186461847f8eSopenharmony_ci /** 186561847f8eSopenharmony_ci * Deletes the credential of the specified application account. 186661847f8eSopenharmony_ci * 186761847f8eSopenharmony_ci * @param { string } name - Indicates the account name. 186861847f8eSopenharmony_ci * @param { string } credentialType - Indicates the type of the credential to delete. 186961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Asynchronous callback interface. 187061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 187161847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 187261847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 187361847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name or credentialType. 187461847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 187561847f8eSopenharmony_ci * @throws { BusinessError } 12300102 - Credential not found. 187661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 187761847f8eSopenharmony_ci * @since 9 187861847f8eSopenharmony_ci */ 187961847f8eSopenharmony_ci deleteCredential(name: string, credentialType: string, callback: AsyncCallback<void>): void; 188061847f8eSopenharmony_ci 188161847f8eSopenharmony_ci /** 188261847f8eSopenharmony_ci * Deletes the credential of the specified application account. 188361847f8eSopenharmony_ci * 188461847f8eSopenharmony_ci * @param { string } name - Indicates the account name. 188561847f8eSopenharmony_ci * @param { string } credentialType - Indicates the type of the credential to delete. 188661847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 188761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 188861847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 188961847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 189061847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name or credentialType. 189161847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 189261847f8eSopenharmony_ci * @throws { BusinessError } 12300102 - Credential not found. 189361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 189461847f8eSopenharmony_ci * @since 9 189561847f8eSopenharmony_ci */ 189661847f8eSopenharmony_ci deleteCredential(name: string, credentialType: string): Promise<void>; 189761847f8eSopenharmony_ci 189861847f8eSopenharmony_ci /** 189961847f8eSopenharmony_ci * Selects a list of accounts that satisfied with the specified options. 190061847f8eSopenharmony_ci * 190161847f8eSopenharmony_ci * @param { SelectAccountsOptions } options - Indicates the options for selecting account. 190261847f8eSopenharmony_ci * @param { AsyncCallback<Array<AppAccountInfo>> } callback - Asynchronous callback interface. 190361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 190461847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 190561847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 190661847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid options. 190761847f8eSopenharmony_ci * @throws { BusinessError } 12300010 - Account service busy. 190861847f8eSopenharmony_ci * @throws { BusinessError } 12300114 - Authenticator service exception. 190961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 191061847f8eSopenharmony_ci * @since 9 191161847f8eSopenharmony_ci */ 191261847f8eSopenharmony_ci selectAccountsByOptions(options: SelectAccountsOptions, callback: AsyncCallback<Array<AppAccountInfo>>): void; 191361847f8eSopenharmony_ci 191461847f8eSopenharmony_ci /** 191561847f8eSopenharmony_ci * Selects a list of accounts that satisfied with the specified options. 191661847f8eSopenharmony_ci * 191761847f8eSopenharmony_ci * @param { SelectAccountsOptions } options - Indicates the options for selecting account. 191861847f8eSopenharmony_ci * @returns { Promise<Array<AppAccountInfo>> } Returns a list of accounts. 191961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 192061847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 192161847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 192261847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid options. 192361847f8eSopenharmony_ci * @throws { BusinessError } 12300010 - Account service busy. 192461847f8eSopenharmony_ci * @throws { BusinessError } 12300114 - Authenticator service exception. 192561847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 192661847f8eSopenharmony_ci * @since 9 192761847f8eSopenharmony_ci */ 192861847f8eSopenharmony_ci selectAccountsByOptions(options: SelectAccountsOptions): Promise<Array<AppAccountInfo>>; 192961847f8eSopenharmony_ci 193061847f8eSopenharmony_ci /** 193161847f8eSopenharmony_ci * Verifies the credential to ensure the user is the owner of the specified account. 193261847f8eSopenharmony_ci * 193361847f8eSopenharmony_ci * @param { string } name - Indicates the account name. 193461847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner. 193561847f8eSopenharmony_ci * @param { AuthCallback } callback - Indicates the authenticator callback. 193661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 193761847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 193861847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 193961847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name or owner. 194061847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 194161847f8eSopenharmony_ci * @throws { BusinessError } 12300010 - Account service busy. 194261847f8eSopenharmony_ci * @throws { BusinessError } 12300113 - Authenticator service not found. 194361847f8eSopenharmony_ci * @throws { BusinessError } 12300114 - Authenticator service exception. 194461847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 194561847f8eSopenharmony_ci * @since 9 194661847f8eSopenharmony_ci */ 194761847f8eSopenharmony_ci verifyCredential(name: string, owner: string, callback: AuthCallback): void; 194861847f8eSopenharmony_ci /** 194961847f8eSopenharmony_ci * Verifies the credential to ensure the user is the owner of the specified account. 195061847f8eSopenharmony_ci * 195161847f8eSopenharmony_ci * @param { string } name - Indicates the account name. 195261847f8eSopenharmony_ci * @param { string } owner - Indicates the account owner. 195361847f8eSopenharmony_ci * @param { VerifyCredentialOptions } options - Indicates the options for verifying credential. 195461847f8eSopenharmony_ci * @param { AuthCallback } callback - Indicates the authenticator callback. 195561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 195661847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 195761847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 195861847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid name, owner or options. 195961847f8eSopenharmony_ci * @throws { BusinessError } 12300003 - Account not found. 196061847f8eSopenharmony_ci * @throws { BusinessError } 12300010 - Account service busy. 196161847f8eSopenharmony_ci * @throws { BusinessError } 12300113 - Authenticator service not found. 196261847f8eSopenharmony_ci * @throws { BusinessError } 12300114 - Authenticator service exception. 196361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 196461847f8eSopenharmony_ci * @since 9 196561847f8eSopenharmony_ci */ 196661847f8eSopenharmony_ci verifyCredential(name: string, owner: string, options: VerifyCredentialOptions, callback: AuthCallback): void; 196761847f8eSopenharmony_ci 196861847f8eSopenharmony_ci /** 196961847f8eSopenharmony_ci * Sets properties for the specified account authenticator. 197061847f8eSopenharmony_ci * <p> 197161847f8eSopenharmony_ci * If the authenticator supports setting its properties, 197261847f8eSopenharmony_ci * the caller will normally be redirected to an Ability specified by Want for property setting. 197361847f8eSopenharmony_ci * 197461847f8eSopenharmony_ci * @param { string } owner - Indicates the owner of authenticator. 197561847f8eSopenharmony_ci * @param { AuthCallback } callback - Indicates the authenticator callback. 197661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 197761847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 197861847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 197961847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid owner. 198061847f8eSopenharmony_ci * @throws { BusinessError } 12300010 - Account service busy. 198161847f8eSopenharmony_ci * @throws { BusinessError } 12300113 - Authenticator service not found. 198261847f8eSopenharmony_ci * @throws { BusinessError } 12300114 - Authenticator service exception. 198361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 198461847f8eSopenharmony_ci * @since 9 198561847f8eSopenharmony_ci */ 198661847f8eSopenharmony_ci setAuthenticatorProperties(owner: string, callback: AuthCallback): void; 198761847f8eSopenharmony_ci /** 198861847f8eSopenharmony_ci * Sets properties for the specified account authenticator. 198961847f8eSopenharmony_ci * <p> 199061847f8eSopenharmony_ci * If the authenticator supports setting its properties, 199161847f8eSopenharmony_ci * the caller will normally be redirected to an Ability specified by Want for property setting. 199261847f8eSopenharmony_ci * 199361847f8eSopenharmony_ci * @param { string } owner - Indicates the owner of authenticator. 199461847f8eSopenharmony_ci * @param { SetPropertiesOptions } options - Indicates the options for setting properties. 199561847f8eSopenharmony_ci * @param { AuthCallback } callback - Indicates the authenticator callback. 199661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 199761847f8eSopenharmony_ci * <br> 2. Incorrect parameter types. 199861847f8eSopenharmony_ci * @throws { BusinessError } 12300001 - System service exception. 199961847f8eSopenharmony_ci * @throws { BusinessError } 12300002 - Invalid owner or options. 200061847f8eSopenharmony_ci * @throws { BusinessError } 12300010 - Account service busy. 200161847f8eSopenharmony_ci * @throws { BusinessError } 12300113 - Authenticator service not found. 200261847f8eSopenharmony_ci * @throws { BusinessError } 12300114 - Authenticator service exception. 200361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 200461847f8eSopenharmony_ci * @since 9 200561847f8eSopenharmony_ci */ 200661847f8eSopenharmony_ci setAuthenticatorProperties(owner: string, options: SetPropertiesOptions, callback: AuthCallback): void; 200761847f8eSopenharmony_ci } 200861847f8eSopenharmony_ci 200961847f8eSopenharmony_ci /** 201061847f8eSopenharmony_ci * Provides basic information of an application account, including the account owner and name. 201161847f8eSopenharmony_ci * 201261847f8eSopenharmony_ci * @interface AppAccountInfo 201361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 201461847f8eSopenharmony_ci * @since 7 201561847f8eSopenharmony_ci */ 201661847f8eSopenharmony_ci interface AppAccountInfo { 201761847f8eSopenharmony_ci /** 201861847f8eSopenharmony_ci * The owner an application account. 201961847f8eSopenharmony_ci * 202061847f8eSopenharmony_ci * @type { string } 202161847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 202261847f8eSopenharmony_ci * @since 7 202361847f8eSopenharmony_ci */ 202461847f8eSopenharmony_ci owner: string; 202561847f8eSopenharmony_ci 202661847f8eSopenharmony_ci /** 202761847f8eSopenharmony_ci * The name an application account. 202861847f8eSopenharmony_ci * 202961847f8eSopenharmony_ci * @type { string } 203061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 203161847f8eSopenharmony_ci * @since 7 203261847f8eSopenharmony_ci */ 203361847f8eSopenharmony_ci name: string; 203461847f8eSopenharmony_ci } 203561847f8eSopenharmony_ci 203661847f8eSopenharmony_ci /** 203761847f8eSopenharmony_ci * Provides basic information of an oauth token, including the authentication type and token value. 203861847f8eSopenharmony_ci * 203961847f8eSopenharmony_ci * @interface OAuthTokenInfo 204061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 204161847f8eSopenharmony_ci * @since 8 204261847f8eSopenharmony_ci * @deprecated since 9 204361847f8eSopenharmony_ci * @useinstead appAccount.AuthTokenInfo 204461847f8eSopenharmony_ci */ 204561847f8eSopenharmony_ci interface OAuthTokenInfo { 204661847f8eSopenharmony_ci /** 204761847f8eSopenharmony_ci * The authentication type. 204861847f8eSopenharmony_ci * 204961847f8eSopenharmony_ci * @type { string } 205061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 205161847f8eSopenharmony_ci * @since 8 205261847f8eSopenharmony_ci * @deprecated since 9 205361847f8eSopenharmony_ci */ 205461847f8eSopenharmony_ci authType: string; 205561847f8eSopenharmony_ci 205661847f8eSopenharmony_ci /** 205761847f8eSopenharmony_ci * The token value. 205861847f8eSopenharmony_ci * 205961847f8eSopenharmony_ci * @type { string } 206061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 206161847f8eSopenharmony_ci * @since 8 206261847f8eSopenharmony_ci * @deprecated since 9 206361847f8eSopenharmony_ci */ 206461847f8eSopenharmony_ci token: string; 206561847f8eSopenharmony_ci } 206661847f8eSopenharmony_ci 206761847f8eSopenharmony_ci /** 206861847f8eSopenharmony_ci * Provides basic information of an auth token, including the authentication type and token value. 206961847f8eSopenharmony_ci * 207061847f8eSopenharmony_ci * @interface AuthTokenInfo 207161847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 207261847f8eSopenharmony_ci * @since 9 207361847f8eSopenharmony_ci */ 207461847f8eSopenharmony_ci interface AuthTokenInfo { 207561847f8eSopenharmony_ci /** 207661847f8eSopenharmony_ci * The authentication type. 207761847f8eSopenharmony_ci * 207861847f8eSopenharmony_ci * @type { string } 207961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 208061847f8eSopenharmony_ci * @since 9 208161847f8eSopenharmony_ci */ 208261847f8eSopenharmony_ci authType: string; 208361847f8eSopenharmony_ci 208461847f8eSopenharmony_ci /** 208561847f8eSopenharmony_ci * The token value. 208661847f8eSopenharmony_ci * 208761847f8eSopenharmony_ci * @type { string } 208861847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 208961847f8eSopenharmony_ci * @since 9 209061847f8eSopenharmony_ci */ 209161847f8eSopenharmony_ci token: string; 209261847f8eSopenharmony_ci 209361847f8eSopenharmony_ci /** 209461847f8eSopenharmony_ci * The account to which the token belongs. 209561847f8eSopenharmony_ci * 209661847f8eSopenharmony_ci * @type { ?AppAccountInfo } 209761847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 209861847f8eSopenharmony_ci * @since 9 209961847f8eSopenharmony_ci */ 210061847f8eSopenharmony_ci account?: AppAccountInfo; 210161847f8eSopenharmony_ci } 210261847f8eSopenharmony_ci 210361847f8eSopenharmony_ci /** 210461847f8eSopenharmony_ci * Provides basic information of an authenticator, including the authenticator owner, icon id and label id. 210561847f8eSopenharmony_ci * 210661847f8eSopenharmony_ci * @interface AuthenticatorInfo 210761847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 210861847f8eSopenharmony_ci * @since 8 210961847f8eSopenharmony_ci */ 211061847f8eSopenharmony_ci interface AuthenticatorInfo { 211161847f8eSopenharmony_ci /** 211261847f8eSopenharmony_ci * The owner of an authenticator. 211361847f8eSopenharmony_ci * 211461847f8eSopenharmony_ci * @type { string } 211561847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 211661847f8eSopenharmony_ci * @since 8 211761847f8eSopenharmony_ci */ 211861847f8eSopenharmony_ci owner: string; 211961847f8eSopenharmony_ci 212061847f8eSopenharmony_ci /** 212161847f8eSopenharmony_ci * The icon id of an authenticator. 212261847f8eSopenharmony_ci * 212361847f8eSopenharmony_ci * @type { number } 212461847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 212561847f8eSopenharmony_ci * @since 8 212661847f8eSopenharmony_ci */ 212761847f8eSopenharmony_ci iconId: number; 212861847f8eSopenharmony_ci 212961847f8eSopenharmony_ci /** 213061847f8eSopenharmony_ci * The label id of an authenticator. 213161847f8eSopenharmony_ci * 213261847f8eSopenharmony_ci * @type { number } 213361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 213461847f8eSopenharmony_ci * @since 8 213561847f8eSopenharmony_ci */ 213661847f8eSopenharmony_ci labelId: number; 213761847f8eSopenharmony_ci } 213861847f8eSopenharmony_ci 213961847f8eSopenharmony_ci /** 214061847f8eSopenharmony_ci * Provides the definition of the authentication result. 214161847f8eSopenharmony_ci * 214261847f8eSopenharmony_ci * @interface AuthResult 214361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 214461847f8eSopenharmony_ci * @since 9 214561847f8eSopenharmony_ci */ 214661847f8eSopenharmony_ci interface AuthResult { 214761847f8eSopenharmony_ci /** 214861847f8eSopenharmony_ci * The account information. 214961847f8eSopenharmony_ci * 215061847f8eSopenharmony_ci * @type { ?AppAccountInfo } 215161847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 215261847f8eSopenharmony_ci * @since 9 215361847f8eSopenharmony_ci */ 215461847f8eSopenharmony_ci account?: AppAccountInfo; 215561847f8eSopenharmony_ci 215661847f8eSopenharmony_ci /** 215761847f8eSopenharmony_ci * The token information. 215861847f8eSopenharmony_ci * 215961847f8eSopenharmony_ci * @type { ?AuthTokenInfo } 216061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 216161847f8eSopenharmony_ci * @since 9 216261847f8eSopenharmony_ci */ 216361847f8eSopenharmony_ci tokenInfo?: AuthTokenInfo; 216461847f8eSopenharmony_ci } 216561847f8eSopenharmony_ci 216661847f8eSopenharmony_ci /** 216761847f8eSopenharmony_ci * Provides the available options for creating an account. 216861847f8eSopenharmony_ci * 216961847f8eSopenharmony_ci * @interface CreateAccountOptions 217061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 217161847f8eSopenharmony_ci * @since 9 217261847f8eSopenharmony_ci */ 217361847f8eSopenharmony_ci interface CreateAccountOptions { 217461847f8eSopenharmony_ci /** 217561847f8eSopenharmony_ci * The custom data for creating an account, 217661847f8eSopenharmony_ci * which can be further modified by function setCustomData. 217761847f8eSopenharmony_ci * 217861847f8eSopenharmony_ci * @type { ?Record<string, string> } 217961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 218061847f8eSopenharmony_ci * @since 9 218161847f8eSopenharmony_ci */ 218261847f8eSopenharmony_ci customData?: Record<string, string>; 218361847f8eSopenharmony_ci } 218461847f8eSopenharmony_ci 218561847f8eSopenharmony_ci /** 218661847f8eSopenharmony_ci * Provides the available options for creating an account implicitly. 218761847f8eSopenharmony_ci * 218861847f8eSopenharmony_ci * @interface CreateAccountImplicitlyOptions 218961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 219061847f8eSopenharmony_ci * @since 9 219161847f8eSopenharmony_ci */ 219261847f8eSopenharmony_ci interface CreateAccountImplicitlyOptions { 219361847f8eSopenharmony_ci /** 219461847f8eSopenharmony_ci * The required labels for creating an account. 219561847f8eSopenharmony_ci * 219661847f8eSopenharmony_ci * @type { ?Array<string> } 219761847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 219861847f8eSopenharmony_ci * @since 9 219961847f8eSopenharmony_ci */ 220061847f8eSopenharmony_ci requiredLabels?: Array<string>; 220161847f8eSopenharmony_ci 220261847f8eSopenharmony_ci /** 220361847f8eSopenharmony_ci * The authentication type. 220461847f8eSopenharmony_ci * 220561847f8eSopenharmony_ci * @type { ?string } 220661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 220761847f8eSopenharmony_ci * @since 9 220861847f8eSopenharmony_ci */ 220961847f8eSopenharmony_ci authType?: string; 221061847f8eSopenharmony_ci 221161847f8eSopenharmony_ci /** 221261847f8eSopenharmony_ci * The authenticator-specific parameters. 221361847f8eSopenharmony_ci * The list of reserved parameter name: 221461847f8eSopenharmony_ci * 1. Constants.KEY_CALLER_BUNDLE_NAME; 221561847f8eSopenharmony_ci * The above parameters are set by the appAccount management service and can be used for identify the caller. 221661847f8eSopenharmony_ci * 221761847f8eSopenharmony_ci * @type { ?Record<string, Object> } 221861847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 221961847f8eSopenharmony_ci * @since 9 222061847f8eSopenharmony_ci */ 222161847f8eSopenharmony_ci parameters?: Record<string, Object>; 222261847f8eSopenharmony_ci } 222361847f8eSopenharmony_ci 222461847f8eSopenharmony_ci /** 222561847f8eSopenharmony_ci * Provides the available options for selecting accounts. 222661847f8eSopenharmony_ci * 222761847f8eSopenharmony_ci * @interface SelectAccountsOptions 222861847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 222961847f8eSopenharmony_ci * @since 9 223061847f8eSopenharmony_ci */ 223161847f8eSopenharmony_ci interface SelectAccountsOptions { 223261847f8eSopenharmony_ci /** 223361847f8eSopenharmony_ci * The list of accounts allowed to be selected. 223461847f8eSopenharmony_ci * 223561847f8eSopenharmony_ci * @type { ?Array<AppAccountInfo> } 223661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 223761847f8eSopenharmony_ci * @since 9 223861847f8eSopenharmony_ci */ 223961847f8eSopenharmony_ci allowedAccounts?: Array<AppAccountInfo>; 224061847f8eSopenharmony_ci 224161847f8eSopenharmony_ci /** 224261847f8eSopenharmony_ci * The list of account owners, whose accounts allowed to be selected. 224361847f8eSopenharmony_ci * 224461847f8eSopenharmony_ci * @type { ?Array<string> } 224561847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 224661847f8eSopenharmony_ci * @since 9 224761847f8eSopenharmony_ci */ 224861847f8eSopenharmony_ci allowedOwners?: Array<string>; 224961847f8eSopenharmony_ci 225061847f8eSopenharmony_ci /** 225161847f8eSopenharmony_ci * The labels required for the selected accounts. 225261847f8eSopenharmony_ci * 225361847f8eSopenharmony_ci * @type { ?Array<string> } 225461847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 225561847f8eSopenharmony_ci * @since 9 225661847f8eSopenharmony_ci */ 225761847f8eSopenharmony_ci requiredLabels?: Array<string>; 225861847f8eSopenharmony_ci } 225961847f8eSopenharmony_ci 226061847f8eSopenharmony_ci /** 226161847f8eSopenharmony_ci * Provides the available options for verifying credential. 226261847f8eSopenharmony_ci * 226361847f8eSopenharmony_ci * @interface VerifyCredentialOptions 226461847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 226561847f8eSopenharmony_ci * @since 9 226661847f8eSopenharmony_ci */ 226761847f8eSopenharmony_ci interface VerifyCredentialOptions { 226861847f8eSopenharmony_ci /** 226961847f8eSopenharmony_ci * The credential type to be verified. 227061847f8eSopenharmony_ci * 227161847f8eSopenharmony_ci * @type { ?string } 227261847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 227361847f8eSopenharmony_ci * @since 9 227461847f8eSopenharmony_ci */ 227561847f8eSopenharmony_ci credentialType?: string; 227661847f8eSopenharmony_ci 227761847f8eSopenharmony_ci /** 227861847f8eSopenharmony_ci * The credential to be verified. 227961847f8eSopenharmony_ci * 228061847f8eSopenharmony_ci * @type { ?string } 228161847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 228261847f8eSopenharmony_ci * @since 9 228361847f8eSopenharmony_ci */ 228461847f8eSopenharmony_ci credential?: string; 228561847f8eSopenharmony_ci 228661847f8eSopenharmony_ci /** 228761847f8eSopenharmony_ci * The authenticator-specific parameters. 228861847f8eSopenharmony_ci * The list of reserved parameter name: 228961847f8eSopenharmony_ci * 1. Constants.KEY_CALLER_BUNDLE_NAME; 229061847f8eSopenharmony_ci * The above parameters are set by the appAccount management service and can be used for identify the caller. 229161847f8eSopenharmony_ci * 229261847f8eSopenharmony_ci * @type { ?Record<string, Object> } 229361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 229461847f8eSopenharmony_ci * @since 9 229561847f8eSopenharmony_ci */ 229661847f8eSopenharmony_ci parameters?: Record<string, Object>; 229761847f8eSopenharmony_ci } 229861847f8eSopenharmony_ci 229961847f8eSopenharmony_ci /** 230061847f8eSopenharmony_ci * Provides the available options for setting properties. 230161847f8eSopenharmony_ci * 230261847f8eSopenharmony_ci * @interface SetPropertiesOptions 230361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 230461847f8eSopenharmony_ci * @since 9 230561847f8eSopenharmony_ci */ 230661847f8eSopenharmony_ci interface SetPropertiesOptions { 230761847f8eSopenharmony_ci /** 230861847f8eSopenharmony_ci * The properties to be set. 230961847f8eSopenharmony_ci * 231061847f8eSopenharmony_ci * @type { ?Record<string, Object> } 231161847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 231261847f8eSopenharmony_ci * @since 9 231361847f8eSopenharmony_ci */ 231461847f8eSopenharmony_ci properties?: Record<string, Object>; 231561847f8eSopenharmony_ci 231661847f8eSopenharmony_ci /** 231761847f8eSopenharmony_ci * The authenticator-specific parameters. 231861847f8eSopenharmony_ci * The list of reserved parameter name: 231961847f8eSopenharmony_ci * 1. Constants.KEY_CALLER_BUNDLE_NAME; 232061847f8eSopenharmony_ci * The above parameters are set by the appAccount management service and can be used for identify the caller. 232161847f8eSopenharmony_ci * 232261847f8eSopenharmony_ci * @type { ?Record<string, Object> } 232361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 232461847f8eSopenharmony_ci * @since 9 232561847f8eSopenharmony_ci */ 232661847f8eSopenharmony_ci parameters?: Record<string, Object>; 232761847f8eSopenharmony_ci } 232861847f8eSopenharmony_ci 232961847f8eSopenharmony_ci /** 233061847f8eSopenharmony_ci * Provides constants definition. 233161847f8eSopenharmony_ci * 233261847f8eSopenharmony_ci * @enum { string } Constants 233361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 233461847f8eSopenharmony_ci * @since 8 233561847f8eSopenharmony_ci */ 233661847f8eSopenharmony_ci enum Constants { 233761847f8eSopenharmony_ci /** 233861847f8eSopenharmony_ci * Indicates the action for adding account implicitly. 233961847f8eSopenharmony_ci * 234061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 234161847f8eSopenharmony_ci * @since 8 234261847f8eSopenharmony_ci * @deprecated since 9 234361847f8eSopenharmony_ci * @useinstead appAccount.Constants#ACTION_CREATE_ACCOUNT_IMPLICITLY 234461847f8eSopenharmony_ci */ 234561847f8eSopenharmony_ci ACTION_ADD_ACCOUNT_IMPLICITLY = 'addAccountImplicitly', 234661847f8eSopenharmony_ci 234761847f8eSopenharmony_ci /** 234861847f8eSopenharmony_ci * Indicates the action for authenticating. 234961847f8eSopenharmony_ci * 235061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 235161847f8eSopenharmony_ci * @since 8 235261847f8eSopenharmony_ci * @deprecated since 9 235361847f8eSopenharmony_ci * @useinstead appAccount.Constants#ACTION_AUTH 235461847f8eSopenharmony_ci */ 235561847f8eSopenharmony_ci ACTION_AUTHENTICATE = 'authenticate', 235661847f8eSopenharmony_ci 235761847f8eSopenharmony_ci /** 235861847f8eSopenharmony_ci * Indicates the action for creating account implicitly. 235961847f8eSopenharmony_ci * 236061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 236161847f8eSopenharmony_ci * @since 9 236261847f8eSopenharmony_ci */ 236361847f8eSopenharmony_ci ACTION_CREATE_ACCOUNT_IMPLICITLY = 'createAccountImplicitly', 236461847f8eSopenharmony_ci 236561847f8eSopenharmony_ci /** 236661847f8eSopenharmony_ci * Indicates the action for authenticating. 236761847f8eSopenharmony_ci * 236861847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 236961847f8eSopenharmony_ci * @since 9 237061847f8eSopenharmony_ci */ 237161847f8eSopenharmony_ci ACTION_AUTH = 'auth', 237261847f8eSopenharmony_ci 237361847f8eSopenharmony_ci /** 237461847f8eSopenharmony_ci * Indicates the action for verifying credential. 237561847f8eSopenharmony_ci * 237661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 237761847f8eSopenharmony_ci * @since 9 237861847f8eSopenharmony_ci */ 237961847f8eSopenharmony_ci ACTION_VERIFY_CREDENTIAL = 'verifyCredential', 238061847f8eSopenharmony_ci 238161847f8eSopenharmony_ci /** 238261847f8eSopenharmony_ci * Indicates the action for set authenticator properties. 238361847f8eSopenharmony_ci * 238461847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 238561847f8eSopenharmony_ci * @since 9 238661847f8eSopenharmony_ci */ 238761847f8eSopenharmony_ci ACTION_SET_AUTHENTICATOR_PROPERTIES = 'setAuthenticatorProperties', 238861847f8eSopenharmony_ci 238961847f8eSopenharmony_ci /** 239061847f8eSopenharmony_ci * Indicates the key of name. 239161847f8eSopenharmony_ci * 239261847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 239361847f8eSopenharmony_ci * @since 8 239461847f8eSopenharmony_ci */ 239561847f8eSopenharmony_ci KEY_NAME = 'name', 239661847f8eSopenharmony_ci 239761847f8eSopenharmony_ci /** 239861847f8eSopenharmony_ci * Indicates the key of owner. 239961847f8eSopenharmony_ci * 240061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 240161847f8eSopenharmony_ci * @since 8 240261847f8eSopenharmony_ci */ 240361847f8eSopenharmony_ci KEY_OWNER = 'owner', 240461847f8eSopenharmony_ci 240561847f8eSopenharmony_ci /** 240661847f8eSopenharmony_ci * Indicates the key of token. 240761847f8eSopenharmony_ci * 240861847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 240961847f8eSopenharmony_ci * @since 8 241061847f8eSopenharmony_ci */ 241161847f8eSopenharmony_ci KEY_TOKEN = 'token', 241261847f8eSopenharmony_ci 241361847f8eSopenharmony_ci /** 241461847f8eSopenharmony_ci * Indicates the key of action. 241561847f8eSopenharmony_ci * 241661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 241761847f8eSopenharmony_ci * @since 8 241861847f8eSopenharmony_ci */ 241961847f8eSopenharmony_ci KEY_ACTION = 'action', 242061847f8eSopenharmony_ci 242161847f8eSopenharmony_ci /** 242261847f8eSopenharmony_ci * Indicates the key of authentication type. 242361847f8eSopenharmony_ci * 242461847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 242561847f8eSopenharmony_ci * @since 8 242661847f8eSopenharmony_ci */ 242761847f8eSopenharmony_ci KEY_AUTH_TYPE = 'authType', 242861847f8eSopenharmony_ci 242961847f8eSopenharmony_ci /** 243061847f8eSopenharmony_ci * Indicates the key of session id. 243161847f8eSopenharmony_ci * 243261847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 243361847f8eSopenharmony_ci * @since 8 243461847f8eSopenharmony_ci */ 243561847f8eSopenharmony_ci KEY_SESSION_ID = 'sessionId', 243661847f8eSopenharmony_ci 243761847f8eSopenharmony_ci /** 243861847f8eSopenharmony_ci * Indicates the key of caller pid. 243961847f8eSopenharmony_ci * 244061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 244161847f8eSopenharmony_ci * @since 8 244261847f8eSopenharmony_ci */ 244361847f8eSopenharmony_ci KEY_CALLER_PID = 'callerPid', 244461847f8eSopenharmony_ci 244561847f8eSopenharmony_ci /** 244661847f8eSopenharmony_ci * Indicates the key of caller uid. 244761847f8eSopenharmony_ci * 244861847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 244961847f8eSopenharmony_ci * @since 8 245061847f8eSopenharmony_ci */ 245161847f8eSopenharmony_ci KEY_CALLER_UID = 'callerUid', 245261847f8eSopenharmony_ci 245361847f8eSopenharmony_ci /** 245461847f8eSopenharmony_ci * Indicates the key of caller bundle name. 245561847f8eSopenharmony_ci * 245661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 245761847f8eSopenharmony_ci * @since 8 245861847f8eSopenharmony_ci */ 245961847f8eSopenharmony_ci KEY_CALLER_BUNDLE_NAME = 'callerBundleName', 246061847f8eSopenharmony_ci 246161847f8eSopenharmony_ci /** 246261847f8eSopenharmony_ci * Indicates the key of required labels. 246361847f8eSopenharmony_ci * 246461847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 246561847f8eSopenharmony_ci * @since 9 246661847f8eSopenharmony_ci */ 246761847f8eSopenharmony_ci KEY_REQUIRED_LABELS = 'requiredLabels', 246861847f8eSopenharmony_ci 246961847f8eSopenharmony_ci /** 247061847f8eSopenharmony_ci * Indicates the key of boolean result. 247161847f8eSopenharmony_ci * 247261847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 247361847f8eSopenharmony_ci * @since 9 247461847f8eSopenharmony_ci */ 247561847f8eSopenharmony_ci KEY_BOOLEAN_RESULT = 'booleanResult' 247661847f8eSopenharmony_ci } 247761847f8eSopenharmony_ci 247861847f8eSopenharmony_ci /** 247961847f8eSopenharmony_ci * Provides result code definition. 248061847f8eSopenharmony_ci * 248161847f8eSopenharmony_ci * @enum { number } ResultCode 248261847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 248361847f8eSopenharmony_ci * @since 8 248461847f8eSopenharmony_ci * @deprecated since 9 248561847f8eSopenharmony_ci */ 248661847f8eSopenharmony_ci enum ResultCode { 248761847f8eSopenharmony_ci /** 248861847f8eSopenharmony_ci * Indicates the success result. 248961847f8eSopenharmony_ci * 249061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 249161847f8eSopenharmony_ci * @since 8 249261847f8eSopenharmony_ci * @deprecated since 9 249361847f8eSopenharmony_ci */ 249461847f8eSopenharmony_ci SUCCESS = 0, 249561847f8eSopenharmony_ci 249661847f8eSopenharmony_ci /** 249761847f8eSopenharmony_ci * Indicates the result of account not exist. 249861847f8eSopenharmony_ci * 249961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 250061847f8eSopenharmony_ci * @since 8 250161847f8eSopenharmony_ci * @deprecated since 9 250261847f8eSopenharmony_ci */ 250361847f8eSopenharmony_ci ERROR_ACCOUNT_NOT_EXIST = 10001, 250461847f8eSopenharmony_ci 250561847f8eSopenharmony_ci /** 250661847f8eSopenharmony_ci * Indicates the result of account service exception. 250761847f8eSopenharmony_ci * 250861847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 250961847f8eSopenharmony_ci * @since 8 251061847f8eSopenharmony_ci * @deprecated since 9 251161847f8eSopenharmony_ci */ 251261847f8eSopenharmony_ci ERROR_APP_ACCOUNT_SERVICE_EXCEPTION = 10002, 251361847f8eSopenharmony_ci 251461847f8eSopenharmony_ci /** 251561847f8eSopenharmony_ci * Indicates the result of password is invalid. 251661847f8eSopenharmony_ci * 251761847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 251861847f8eSopenharmony_ci * @since 8 251961847f8eSopenharmony_ci * @deprecated since 9 252061847f8eSopenharmony_ci */ 252161847f8eSopenharmony_ci ERROR_INVALID_PASSWORD = 10003, 252261847f8eSopenharmony_ci 252361847f8eSopenharmony_ci /** 252461847f8eSopenharmony_ci * Indicates the result of request is invalid. 252561847f8eSopenharmony_ci * 252661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 252761847f8eSopenharmony_ci * @since 8 252861847f8eSopenharmony_ci * @deprecated since 9 252961847f8eSopenharmony_ci */ 253061847f8eSopenharmony_ci ERROR_INVALID_REQUEST = 10004, 253161847f8eSopenharmony_ci 253261847f8eSopenharmony_ci /** 253361847f8eSopenharmony_ci * Indicates the result of response is invalid. 253461847f8eSopenharmony_ci * 253561847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 253661847f8eSopenharmony_ci * @since 8 253761847f8eSopenharmony_ci * @deprecated since 9 253861847f8eSopenharmony_ci */ 253961847f8eSopenharmony_ci ERROR_INVALID_RESPONSE = 10005, 254061847f8eSopenharmony_ci 254161847f8eSopenharmony_ci /** 254261847f8eSopenharmony_ci * Indicates the result of network exception. 254361847f8eSopenharmony_ci * 254461847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 254561847f8eSopenharmony_ci * @since 8 254661847f8eSopenharmony_ci * @deprecated since 9 254761847f8eSopenharmony_ci */ 254861847f8eSopenharmony_ci ERROR_NETWORK_EXCEPTION = 10006, 254961847f8eSopenharmony_ci 255061847f8eSopenharmony_ci /** 255161847f8eSopenharmony_ci * Indicates the result of network exception. 255261847f8eSopenharmony_ci * 255361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 255461847f8eSopenharmony_ci * @since 8 255561847f8eSopenharmony_ci * @deprecated since 9 255661847f8eSopenharmony_ci */ 255761847f8eSopenharmony_ci ERROR_OAUTH_AUTHENTICATOR_NOT_EXIST = 10007, 255861847f8eSopenharmony_ci 255961847f8eSopenharmony_ci /** 256061847f8eSopenharmony_ci * Indicates the result of auth has been canceled. 256161847f8eSopenharmony_ci * 256261847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 256361847f8eSopenharmony_ci * @since 8 256461847f8eSopenharmony_ci * @deprecated since 9 256561847f8eSopenharmony_ci */ 256661847f8eSopenharmony_ci ERROR_OAUTH_CANCELED = 10008, 256761847f8eSopenharmony_ci 256861847f8eSopenharmony_ci /** 256961847f8eSopenharmony_ci * Indicates the result of auth list is too large. 257061847f8eSopenharmony_ci * 257161847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 257261847f8eSopenharmony_ci * @since 8 257361847f8eSopenharmony_ci * @deprecated since 9 257461847f8eSopenharmony_ci */ 257561847f8eSopenharmony_ci ERROR_OAUTH_LIST_TOO_LARGE = 10009, 257661847f8eSopenharmony_ci 257761847f8eSopenharmony_ci /** 257861847f8eSopenharmony_ci * Indicates the result of auth service is busy. 257961847f8eSopenharmony_ci * 258061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 258161847f8eSopenharmony_ci * @since 8 258261847f8eSopenharmony_ci * @deprecated since 9 258361847f8eSopenharmony_ci */ 258461847f8eSopenharmony_ci ERROR_OAUTH_SERVICE_BUSY = 10010, 258561847f8eSopenharmony_ci 258661847f8eSopenharmony_ci /** 258761847f8eSopenharmony_ci * Indicates the result of auth service exception. 258861847f8eSopenharmony_ci * 258961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 259061847f8eSopenharmony_ci * @since 8 259161847f8eSopenharmony_ci * @deprecated since 9 259261847f8eSopenharmony_ci */ 259361847f8eSopenharmony_ci ERROR_OAUTH_SERVICE_EXCEPTION = 10011, 259461847f8eSopenharmony_ci 259561847f8eSopenharmony_ci /** 259661847f8eSopenharmony_ci * Indicates the result of auth session is not exist. 259761847f8eSopenharmony_ci * 259861847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 259961847f8eSopenharmony_ci * @since 8 260061847f8eSopenharmony_ci * @deprecated since 9 260161847f8eSopenharmony_ci */ 260261847f8eSopenharmony_ci ERROR_OAUTH_SESSION_NOT_EXIST = 10012, 260361847f8eSopenharmony_ci 260461847f8eSopenharmony_ci /** 260561847f8eSopenharmony_ci * Indicates the result of auth timeout. 260661847f8eSopenharmony_ci * 260761847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 260861847f8eSopenharmony_ci * @since 8 260961847f8eSopenharmony_ci * @deprecated since 9 261061847f8eSopenharmony_ci */ 261161847f8eSopenharmony_ci ERROR_OAUTH_TIMEOUT = 10013, 261261847f8eSopenharmony_ci 261361847f8eSopenharmony_ci /** 261461847f8eSopenharmony_ci * Indicates the result of token is not exist. 261561847f8eSopenharmony_ci * 261661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 261761847f8eSopenharmony_ci * @since 8 261861847f8eSopenharmony_ci * @deprecated since 9 261961847f8eSopenharmony_ci */ 262061847f8eSopenharmony_ci ERROR_OAUTH_TOKEN_NOT_EXIST = 10014, 262161847f8eSopenharmony_ci 262261847f8eSopenharmony_ci /** 262361847f8eSopenharmony_ci * Indicates the result of token is too many. 262461847f8eSopenharmony_ci * 262561847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 262661847f8eSopenharmony_ci * @since 8 262761847f8eSopenharmony_ci * @deprecated since 9 262861847f8eSopenharmony_ci */ 262961847f8eSopenharmony_ci ERROR_OAUTH_TOKEN_TOO_MANY = 10015, 263061847f8eSopenharmony_ci 263161847f8eSopenharmony_ci /** 263261847f8eSopenharmony_ci * Indicates the result of not supported action. 263361847f8eSopenharmony_ci * 263461847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 263561847f8eSopenharmony_ci * @since 8 263661847f8eSopenharmony_ci * @deprecated since 9 263761847f8eSopenharmony_ci */ 263861847f8eSopenharmony_ci ERROR_OAUTH_UNSUPPORT_ACTION = 10016, 263961847f8eSopenharmony_ci 264061847f8eSopenharmony_ci /** 264161847f8eSopenharmony_ci * Indicates the result of not supported auth type. 264261847f8eSopenharmony_ci * 264361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 264461847f8eSopenharmony_ci * @since 8 264561847f8eSopenharmony_ci * @deprecated since 9 264661847f8eSopenharmony_ci */ 264761847f8eSopenharmony_ci ERROR_OAUTH_UNSUPPORT_AUTH_TYPE = 10017, 264861847f8eSopenharmony_ci 264961847f8eSopenharmony_ci /** 265061847f8eSopenharmony_ci * Indicates the result of permission denied. 265161847f8eSopenharmony_ci * 265261847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 265361847f8eSopenharmony_ci * @since 8 265461847f8eSopenharmony_ci * @deprecated since 9 265561847f8eSopenharmony_ci */ 265661847f8eSopenharmony_ci ERROR_PERMISSION_DENIED = 10018 265761847f8eSopenharmony_ci } 265861847f8eSopenharmony_ci 265961847f8eSopenharmony_ci /** 266061847f8eSopenharmony_ci * Provides methods for authenticator callback. 266161847f8eSopenharmony_ci * 266261847f8eSopenharmony_ci * @interface AuthenticatorCallback 266361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 266461847f8eSopenharmony_ci * @since 8 266561847f8eSopenharmony_ci * @deprecated since 9 266661847f8eSopenharmony_ci * @useinstead AppAccount.AuthCallback 266761847f8eSopenharmony_ci */ 266861847f8eSopenharmony_ci interface AuthenticatorCallback { 266961847f8eSopenharmony_ci /** 267061847f8eSopenharmony_ci * Notifies the client of the authentication result. 267161847f8eSopenharmony_ci * 267261847f8eSopenharmony_ci * @type { function } 267361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 267461847f8eSopenharmony_ci * @since 8 267561847f8eSopenharmony_ci * @deprecated since 9 267661847f8eSopenharmony_ci */ 267761847f8eSopenharmony_ci onResult: (code: number, result: { [key: string]: any }) => void; 267861847f8eSopenharmony_ci 267961847f8eSopenharmony_ci /** 268061847f8eSopenharmony_ci * Notifies the client that the authentication request need to be redirected. 268161847f8eSopenharmony_ci * 268261847f8eSopenharmony_ci * @type { function } 268361847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 268461847f8eSopenharmony_ci * @since 8 268561847f8eSopenharmony_ci * @deprecated since 9 268661847f8eSopenharmony_ci */ 268761847f8eSopenharmony_ci onRequestRedirected: (request: Want) => void; 268861847f8eSopenharmony_ci } 268961847f8eSopenharmony_ci 269061847f8eSopenharmony_ci /** 269161847f8eSopenharmony_ci * Provides methods for authentication callback. 269261847f8eSopenharmony_ci * 269361847f8eSopenharmony_ci * @interface AuthCallback 269461847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 269561847f8eSopenharmony_ci * @since 9 269661847f8eSopenharmony_ci */ 269761847f8eSopenharmony_ci interface AuthCallback { 269861847f8eSopenharmony_ci /** 269961847f8eSopenharmony_ci * Notifies the client of the authentication result. 270061847f8eSopenharmony_ci * 270161847f8eSopenharmony_ci * @type { function } 270261847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 270361847f8eSopenharmony_ci * @since 9 270461847f8eSopenharmony_ci */ 270561847f8eSopenharmony_ci onResult: (code: number, result?: AuthResult) => void; 270661847f8eSopenharmony_ci 270761847f8eSopenharmony_ci /** 270861847f8eSopenharmony_ci * Notifies the client that the authentication request need to be redirected. 270961847f8eSopenharmony_ci * 271061847f8eSopenharmony_ci * @type { function } 271161847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 271261847f8eSopenharmony_ci * @since 9 271361847f8eSopenharmony_ci */ 271461847f8eSopenharmony_ci onRequestRedirected: (request: Want) => void; 271561847f8eSopenharmony_ci 271661847f8eSopenharmony_ci /** 271761847f8eSopenharmony_ci * Notifies the client that the request is continued. 271861847f8eSopenharmony_ci * 271961847f8eSopenharmony_ci * @type { ?function } 272061847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 272161847f8eSopenharmony_ci * @since 9 272261847f8eSopenharmony_ci */ 272361847f8eSopenharmony_ci onRequestContinued?: () => void; 272461847f8eSopenharmony_ci } 272561847f8eSopenharmony_ci 272661847f8eSopenharmony_ci /** 272761847f8eSopenharmony_ci * Provides methods for authenticator. 272861847f8eSopenharmony_ci * 272961847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 273061847f8eSopenharmony_ci * @since 8 273161847f8eSopenharmony_ci * @name Authenticator 273261847f8eSopenharmony_ci */ 273361847f8eSopenharmony_ci class Authenticator { 273461847f8eSopenharmony_ci /** 273561847f8eSopenharmony_ci * Adds an application account of a specified owner implicitly. 273661847f8eSopenharmony_ci * 273761847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 273861847f8eSopenharmony_ci * @param { string } callerBundleName - Indicates the caller bundle name. 273961847f8eSopenharmony_ci * @param { object } options - Indicates the authenticator-specific options for the request. 274061847f8eSopenharmony_ci * @param { AuthenticatorCallback } callback - Indicates the authenticator callback. 274161847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 274261847f8eSopenharmony_ci * @since 8 274361847f8eSopenharmony_ci * @deprecated since 9 274461847f8eSopenharmony_ci * @useinstead appAccount.Authenticator#createAccountImplicitly 274561847f8eSopenharmony_ci */ 274661847f8eSopenharmony_ci addAccountImplicitly( 274761847f8eSopenharmony_ci authType: string, 274861847f8eSopenharmony_ci callerBundleName: string, 274961847f8eSopenharmony_ci options: { [key: string]: any }, 275061847f8eSopenharmony_ci callback: AuthenticatorCallback 275161847f8eSopenharmony_ci ): void; 275261847f8eSopenharmony_ci 275361847f8eSopenharmony_ci /** 275461847f8eSopenharmony_ci * Creates an application account of a specified owner implicitly. 275561847f8eSopenharmony_ci * 275661847f8eSopenharmony_ci * @param { CreateAccountImplicitlyOptions } options - Indicates the authenticator-specific options for the request. 275761847f8eSopenharmony_ci * @param { AuthCallback } callback - Indicates the authenticator callback. 275861847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 275961847f8eSopenharmony_ci * @since 9 276061847f8eSopenharmony_ci */ 276161847f8eSopenharmony_ci createAccountImplicitly(options: CreateAccountImplicitlyOptions, callback: AuthCallback): void; 276261847f8eSopenharmony_ci 276361847f8eSopenharmony_ci /** 276461847f8eSopenharmony_ci * Authenticates an application account to get an oauth token. 276561847f8eSopenharmony_ci * 276661847f8eSopenharmony_ci * @param { string } name - Indicates the account name. 276761847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 276861847f8eSopenharmony_ci * @param { string } callerBundleName - Indicates the caller bundle name. 276961847f8eSopenharmony_ci * @param { object } options - Indicates the authenticator-specific options for the request. 277061847f8eSopenharmony_ci * @param { AuthenticatorCallback } callback - Indicates the authenticator callback. 277161847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 277261847f8eSopenharmony_ci * @since 8 277361847f8eSopenharmony_ci * @deprecated since 9 277461847f8eSopenharmony_ci * @useinstead appAccount.Authenticator#auth 277561847f8eSopenharmony_ci */ 277661847f8eSopenharmony_ci authenticate( 277761847f8eSopenharmony_ci name: string, 277861847f8eSopenharmony_ci authType: string, 277961847f8eSopenharmony_ci callerBundleName: string, 278061847f8eSopenharmony_ci options: { [key: string]: any }, 278161847f8eSopenharmony_ci callback: AuthenticatorCallback 278261847f8eSopenharmony_ci ): void; 278361847f8eSopenharmony_ci 278461847f8eSopenharmony_ci /** 278561847f8eSopenharmony_ci * Authenticates an application account to get an oauth token. 278661847f8eSopenharmony_ci * 278761847f8eSopenharmony_ci * @param { string } name - Indicates the account name. 278861847f8eSopenharmony_ci * @param { string } authType - Indicates the authentication type. 278961847f8eSopenharmony_ci * @param { Record<string, Object> } options - Indicates the authenticator-specific options for the request. 279061847f8eSopenharmony_ci * @param { AuthCallback } callback - Indicates the authenticator callback. 279161847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 279261847f8eSopenharmony_ci * @since 9 279361847f8eSopenharmony_ci */ 279461847f8eSopenharmony_ci auth(name: string, authType: string, options: Record<string, Object>, callback: AuthCallback): void; 279561847f8eSopenharmony_ci 279661847f8eSopenharmony_ci /** 279761847f8eSopenharmony_ci * Verifies the credential to ensure the user is the owner of the specified application account. 279861847f8eSopenharmony_ci * <p> 279961847f8eSopenharmony_ci * The credential can be provided in the options, otherwise an Ability will normally be returned, 280061847f8eSopenharmony_ci * which can be started by the caller to further verify credential. 280161847f8eSopenharmony_ci * 280261847f8eSopenharmony_ci * @param { string } name - Indicates the name of the application account. 280361847f8eSopenharmony_ci * @param { VerifyCredentialOptions } options - Indicates the options for verifying credential. 280461847f8eSopenharmony_ci * @param { AuthCallback } callback - Indicates the authenticator callback. 280561847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 280661847f8eSopenharmony_ci * @since 9 280761847f8eSopenharmony_ci */ 280861847f8eSopenharmony_ci verifyCredential(name: string, options: VerifyCredentialOptions, callback: AuthCallback): void; 280961847f8eSopenharmony_ci 281061847f8eSopenharmony_ci /** 281161847f8eSopenharmony_ci * Sets properties for the authenticator. 281261847f8eSopenharmony_ci * 281361847f8eSopenharmony_ci * @param { SetPropertiesOptions } options - Indicates the options for setting properties. 281461847f8eSopenharmony_ci * @param { AuthCallback } callback - Indicates the authenticator callback. 281561847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 281661847f8eSopenharmony_ci * @since 9 281761847f8eSopenharmony_ci */ 281861847f8eSopenharmony_ci setProperties(options: SetPropertiesOptions, callback: AuthCallback): void; 281961847f8eSopenharmony_ci 282061847f8eSopenharmony_ci /** 282161847f8eSopenharmony_ci * Checks whether a particular account has all specified labels. 282261847f8eSopenharmony_ci * 282361847f8eSopenharmony_ci * @param { string } name - Indicates the account name. 282461847f8eSopenharmony_ci * @param { Array<string> } labels - Indicates an array of labels to check. 282561847f8eSopenharmony_ci * @param { AuthCallback } callback - Indicates the authenticator callback. 282661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 282761847f8eSopenharmony_ci * @since 9 282861847f8eSopenharmony_ci */ 282961847f8eSopenharmony_ci checkAccountLabels(name: string, labels: Array<string>, callback: AuthCallback): void; 283061847f8eSopenharmony_ci 283161847f8eSopenharmony_ci /** 283261847f8eSopenharmony_ci * Checks whether the specified account can be removed. 283361847f8eSopenharmony_ci * 283461847f8eSopenharmony_ci * @param { string } name - Indicates the account name. 283561847f8eSopenharmony_ci * @param { AuthCallback } callback - Indicates the authenticator callback. 283661847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 283761847f8eSopenharmony_ci * @since 9 283861847f8eSopenharmony_ci */ 283961847f8eSopenharmony_ci checkAccountRemovable(name: string, callback: AuthCallback): void; 284061847f8eSopenharmony_ci 284161847f8eSopenharmony_ci /** 284261847f8eSopenharmony_ci * Gets the remote object of the authenticator for remote procedure call. 284361847f8eSopenharmony_ci * 284461847f8eSopenharmony_ci * @returns { rpc.RemoteObject } Returns a remote object. 284561847f8eSopenharmony_ci * @syscap SystemCapability.Account.AppAccount 284661847f8eSopenharmony_ci * @since 9 284761847f8eSopenharmony_ci */ 284861847f8eSopenharmony_ci getRemoteObject(): rpc.RemoteObject; 284961847f8eSopenharmony_ci } 285061847f8eSopenharmony_ci} 285161847f8eSopenharmony_ci 285261847f8eSopenharmony_ciexport default appAccount; 2853