diff --git a/api/@ohos.account.appAccount.d.ts b/api/@ohos.account.appAccount.d.ts index cf053c516802fca3c9d82dcf0dfc68cc10bc4f9f..30824ec01ed756f656ef03690a949db11f7a868f 100644 --- a/api/@ohos.account.appAccount.d.ts +++ b/api/@ohos.account.appAccount.d.ts @@ -21,6 +21,9 @@ import type { AsyncCallback, Callback } from './@ohos.base'; import type Want from './@ohos.app.ability.Want'; import type rpc from './@ohos.rpc'; +/***if arkts 1.2 */ +import type { RecordData } from './@ohos.base'; +/***endif */ /** * This module provides the capability to manage application accounts. @@ -1296,8 +1299,7 @@ declare namespace appAccount { * @throws { BusinessError } 12300113 - Authenticator service not found. * @throws { BusinessError } 12300114 - Authenticator service exception. * @syscap SystemCapability.Account.AppAccount - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ auth( name: string, @@ -1307,6 +1309,32 @@ declare namespace appAccount { callback: AuthCallback ): void; + /** + * Authenticates an application account to get an auth token. + * + * @param { string } name - Indicates the account name of your application or third-party applications. + * @param { string } owner - Indicates the account owner of your application or third-party applications. + * @param { string } authType - Indicates the authentication type. + * @param { RecordData } options - Indicates the authenticator-specific options for the request. + * @param { AuthCallback } callback - Indicates the authenticator callback. + * @throws { BusinessError } 12300001 - System service exception. + * @throws { BusinessError } 12300002 - Invalid name, owner, authType or options. + * @throws { BusinessError } 12300003 - Account not found. + * @throws { BusinessError } 12300010 - Account service busy. + * @throws { BusinessError } 12300113 - Authenticator service not found. + * @throws { BusinessError } 12300114 - Authenticator service exception. + * @syscap SystemCapability.Account.AppAccount + * @since 20 + * @arkts 1.2 + */ + auth( + name: string, + owner: string, + authType: string, + options: RecordData, + callback: AuthCallback + ): void; + /** * Gets an oauth token with the specified authentication type from a particular application account. * @@ -2419,10 +2447,22 @@ declare namespace appAccount { * * @type { ?Record } * @syscap SystemCapability.Account.AppAccount - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ parameters?: Record; + + /** + * The authenticator-specific parameters. + * The list of reserved parameter name: + * 1. Constants.KEY_CALLER_BUNDLE_NAME; + * The above parameters are set by the appAccount management service and can be used for identify the caller. + * + * @type { ?RecordData } + * @syscap SystemCapability.Account.AppAccount + * @since 20 + * @arkts 1.2 + */ + parameters?: RecordData; } /** @@ -2502,10 +2542,22 @@ declare namespace appAccount { * * @type { ?Record } * @syscap SystemCapability.Account.AppAccount - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ parameters?: Record; + + /** + * The authenticator-specific parameters. + * The list of reserved parameter name: + * 1. Constants.KEY_CALLER_BUNDLE_NAME; + * The above parameters are set by the appAccount management service and can be used for identify the caller. + * + * @type { ?RecordData } + * @syscap SystemCapability.Account.AppAccount + * @since 20 + * @arkts 1.2 + */ + parameters?: RecordData; } /** @@ -2522,11 +2574,20 @@ declare namespace appAccount { * * @type { ?Record } * @syscap SystemCapability.Account.AppAccount - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ properties?: Record; + /** + * The properties to be set. + * + * @type { ?RecordData } + * @syscap SystemCapability.Account.AppAccount + * @since 20 + * @arkts 1.2 + */ + properties?: RecordData; + /** * The authenticator-specific parameters. * The list of reserved parameter name: @@ -2535,10 +2596,22 @@ declare namespace appAccount { * * @type { ?Record } * @syscap SystemCapability.Account.AppAccount - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ parameters?: Record; + + /** + * The authenticator-specific parameters. + * The list of reserved parameter name: + * 1. Constants.KEY_CALLER_BUNDLE_NAME; + * The above parameters are set by the appAccount management service and can be used for identify the caller. + * + * @type { ?RecordData } + * @syscap SystemCapability.Account.AppAccount + * @since 20 + * @arkts 1.2 + */ + parameters?: RecordData; } /** @@ -3026,11 +3099,23 @@ declare namespace appAccount { * @param { Record } options - Indicates the authenticator-specific options for the request. * @param { AuthCallback } callback - Indicates the authenticator callback. * @syscap SystemCapability.Account.AppAccount - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ auth(name: string, authType: string, options: Record, callback: AuthCallback): void; + /** + * Authenticates an application account to get an oauth token. + * + * @param { string } name - Indicates the account name. + * @param { string } authType - Indicates the authentication type. + * @param { RecordData } options - Indicates the authenticator-specific options for the request. + * @param { AuthCallback } callback - Indicates the authenticator callback. + * @syscap SystemCapability.Account.AppAccount + * @since 20 + * @arkts 1.2 + */ + auth(name: string, authType: string, options: RecordData, callback: AuthCallback): void; + /** * Verifies the credential to ensure the user is the owner of the specified application account. *

diff --git a/api/@ohos.account.distributedAccount.d.ts b/api/@ohos.account.distributedAccount.d.ts index 330a3bd34159176dbf6faf97860ab04df69bd235..344164b31e525b5672d739392712786df48a9aac 100644 --- a/api/@ohos.account.distributedAccount.d.ts +++ b/api/@ohos.account.distributedAccount.d.ts @@ -19,6 +19,9 @@ */ import type { AsyncCallback } from './@ohos.base'; +/***if arkts 1.2 */ +import type { RecordData } from './@ohos.base'; +/***endif */ /** * This module provides the capability to manage distributed accounts. @@ -380,10 +383,19 @@ declare namespace distributedAccount { * * @type { ?object } * @syscap SystemCapability.Account.OsAccount - * @since arkts {'1.1':'8', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 8 */ scalableData?: object; + + /** + * The scalable data in the distributed information of the OS account. + * + * @type { ?RecordData } + * @syscap SystemCapability.Account.OsAccount + * @since 20 + * @arkts 1.2 + */ + scalableData?: RecordData; } } diff --git a/api/@ohos.account.osAccount.d.ts b/api/@ohos.account.osAccount.d.ts index 79bd3c84580df4c71d1939bc138f5d70190bed3e..bd1504c76514f4d68e131af08fb7f7f5fae30c43 100644 --- a/api/@ohos.account.osAccount.d.ts +++ b/api/@ohos.account.osAccount.d.ts @@ -20,6 +20,9 @@ import type distributedAccount from './@ohos.account.distributedAccount'; import type { AsyncCallback, Callback } from './@ohos.base'; +/***if arkts 1.2 */ +import type { RecordData } from './@ohos.base'; +/***endif */ /** * This module provides the capability to manage os accounts. @@ -3248,11 +3251,21 @@ declare namespace osAccount { * @type { Record } * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ businessParams: Record; + /** + * Indicates the business parameters. + * + * @type { RecordData } + * @syscap SystemCapability.Account.OsAccount + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + businessParams: RecordData; + /** * Indicates caller UID. * @@ -4075,11 +4088,33 @@ declare namespace osAccount { * @static * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ static getAccessToken(businessParams: Record, callback: AsyncCallback): void; + /** + * Gets the business access token of the current domain account. + * + * @param { RecordData } businessParams - Indicates the business parameters. + * @param { AsyncCallback } callback - Indicates the result callback. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid business parameters. + * @throws { BusinessError } 12300003 - Domain account not found. + * @throws { BusinessError } 12300013 - Network exception. + * @throws { BusinessError } 12300014 - The domain account is not authenticated. + * @throws { BusinessError } 12300111 - The operation time out. + * @throws { BusinessError } 12300114 - The authentication service works abnormally. + * @throws { BusinessError } 12300211 - Server unreachable. + * @static + * @syscap SystemCapability.Account.OsAccount + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + static getAccessToken(businessParams: RecordData, callback: AsyncCallback): void; + /** * Gets the business access token for the current domain account. * @@ -4100,11 +4135,33 @@ declare namespace osAccount { * @static * @syscap SystemCapability.Account.OsAccount * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ static getAccessToken(businessParams: Record): Promise; + /** + * Gets the business access token for the current domain account. + * + * @param { RecordData } businessParams - Indicates the business parameters. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid business parameters. + * @throws { BusinessError } 12300003 - Domain account not found. + * @throws { BusinessError } 12300013 - Network exception. + * @throws { BusinessError } 12300014 - The domain account is not authenticated. + * @throws { BusinessError } 12300111 - The operation time out. + * @throws { BusinessError } 12300114 - The authentication service works abnormally. + * @throws { BusinessError } 12300211 - Server unreachable. + * @static + * @syscap SystemCapability.Account.OsAccount + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + static getAccessToken(businessParams: RecordData): Promise; + /** * Checks whether the authentication of the target domain account is expired. * @@ -4141,11 +4198,20 @@ declare namespace osAccount { * * @type { Record } * @syscap SystemCapability.Account.OsAccount - * @since arkts {'1.1':'18', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ parameters: Record; + /** + * Indicates the detail config parameters. + * + * @type { RecordData } + * @syscap SystemCapability.Account.OsAccount + * @since 20 + * @arkts 1.2 + */ + parameters: RecordData; + /** * Indicates the config identifier. * @@ -4190,11 +4256,30 @@ declare namespace osAccount { * @throws { BusinessError } 12300215 - The number of server config reaches the upper limit. * @static * @syscap SystemCapability.Account.OsAccount - * @since arkts {'1.1':'18', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ static addServerConfig(parameters: Record): Promise; + /** + * Adds a domain server config. + * + * @permission ohos.permission.MANAGE_DOMAIN_ACCOUNT_SERVER_CONFIGS + * @param { RecordData } parameters - Indicates the server config parameters. + * @returns { Promise } Returns the added domain server config. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid server config parameters. + * @throws { BusinessError } 12300211 - Server unreachable. + * @throws { BusinessError } 12300213 - Server config already exists. + * @throws { BusinessError } 12300215 - The number of server config reaches the upper limit. + * @static + * @syscap SystemCapability.Account.OsAccount + * @since 20 + * @arkts 1.2 + */ + static addServerConfig(parameters: RecordData): Promise; + /** * Removes a domain server config. * @@ -4230,11 +4315,32 @@ declare namespace osAccount { * @throws { BusinessError } 12300214 - Server config has been associated with an account. * @static * @syscap SystemCapability.Account.OsAccount - * @since arkts {'1.1':'18', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ static updateServerConfig(configId: string, parameters: Record): Promise; + /** + * Updates the target server config with the specified parameters. + * + * @permission ohos.permission.MANAGE_DOMAIN_ACCOUNT_SERVER_CONFIGS + * @param { string } configId - Indicates the server config identifier. + * @param { RecordData } parameters - Indicates the server config parameters. + * @returns { Promise } Returns the updated domain server config. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 12300001 - The system service works abnormally. + * @throws { BusinessError } 12300002 - Invalid server config parameters. + * @throws { BusinessError } 12300211 - Server unreachable. + * @throws { BusinessError } 12300212 - Server config not found. + * @throws { BusinessError } 12300213 - Server config already exists. + * @throws { BusinessError } 12300214 - Server config has been associated with an account. + * @static + * @syscap SystemCapability.Account.OsAccount + * @since 20 + * @arkts 1.2 + */ + static updateServerConfig(configId: string, parameters: RecordData): Promise; + /** * Gets the specified server config by identifier. *