diff --git a/api/@ohos.account.appAccount.d.ts b/api/@ohos.account.appAccount.d.ts
index d814c3546f1dac2d7251f74f572a4eebfa5d610f..4f0ae6f5fcf023e56cb016154e405531d2315d91 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.
@@ -1271,6 +1274,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.
*
@@ -2175,6 +2204,7 @@ declare namespace appAccount {
* @syscap SystemCapability.Account.AppAccount
* @since 8
* @deprecated since 9
+ * @useinstead appAccount.AuthTokenInfo.authType
*/
authType: string;
@@ -2185,6 +2215,7 @@ declare namespace appAccount {
* @syscap SystemCapability.Account.AppAccount
* @since 8
* @deprecated since 9
+ * @useinstead appAccount.AuthTokenInfo.token
*/
token: string;
}
@@ -2245,20 +2276,22 @@ declare namespace appAccount {
/**
* The icon id of an authenticator.
*
- * @type { number }
+ * @type { long }
* @syscap SystemCapability.Account.AppAccount
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
- iconId: number;
+ iconId: long;
/**
* The label id of an authenticator.
*
- * @type { number }
+ * @type { long }
* @syscap SystemCapability.Account.AppAccount
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
- labelId: number;
+ labelId: long;
}
/**
@@ -2344,6 +2377,19 @@ declare namespace appAccount {
* @since 9
*/
parameters?: Record
@@ -2974,4 +3072,4 @@ declare namespace appAccount {
}
}
-export default appAccount;
+export default appAccount;
\ No newline at end of file
diff --git a/api/@ohos.account.distributedAccount.d.ts b/api/@ohos.account.distributedAccount.d.ts
index f114ba51a95de44cc302c8b59ba7ea1ad3073844..6cfa6b7be135de119249b839a2d1859bb719a9b8 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.
@@ -99,12 +102,12 @@ declare namespace distributedAccount {
* Gets the distributed information of the specified OS account.
*
* @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
- * @param { number } localId - Indicates the local ID of the specified OS account.
+ * @param { int } localId - Indicates the local ID of the specified OS account.
* @param { AsyncCallback
2. Incorrect parameter types.
+ *
2. Incorrect parameter types.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300003 - Account not found.
* @syscap SystemCapability.Account.OsAccount
@@ -115,8 +118,8 @@ declare namespace distributedAccount {
* Gets the distributed information of the specified OS account.
*
* @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS or (ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and
- * ohos.permission.GET_DISTRIBUTED_ACCOUNTS)
- * @param { number } localId - Indicates the local ID of the specified OS account.
+ * ohos.permission.GET_DISTRIBUTED_ACCOUNTS)
+ * @param { int } localId - Indicates the local ID of the specified OS account.
* @param { AsyncCallback
2. Incorrect parameter types.
+ *
2. Incorrect parameter types.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300003 - Account not found.
* @syscap SystemCapability.Account.OsAccount
@@ -148,8 +152,8 @@ declare namespace distributedAccount {
* Gets the distributed information of the specified OS account.
*
* @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS or (ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and
- * ohos.permission.GET_DISTRIBUTED_ACCOUNTS)
- * @param { number } localId - Indicates the local ID of the specified OS account.
+ * ohos.permission.GET_DISTRIBUTED_ACCOUNTS)
+ * @param { int } localId - Indicates the local ID of the specified OS account.
* @returns { Promise
2. Incorrect parameter types.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid accountInfo.
@@ -227,7 +232,7 @@ declare namespace distributedAccount {
* Sets the distributed information of the specified OS account.
*
* @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS
- * @param { number } localId - Indicates the local ID of the OS account.
+ * @param { int } localId - Indicates the local ID of the OS account.
* @param { DistributedInfo } distributedInfo - Indicates the distributed information.
* @param { AsyncCallback
+ * Add user credential information, pass in credential addition method and credential information
+ * (credential type, subclass, if adding user's non password credentials, pass in password authentication token),
+ * and get the result / acquireInfo callback.
+ *
+ * @permission ohos.permission.MANAGE_USER_IDM
+ * @param { CredentialInfo } credentialInfo - Indicates the credential information.
+ * @param { IIdmCallback } callback - Indicates the callback to get results and acquireInfo.
+ * @throws { BusinessError } 201 - Permission denied.
+ * @throws { BusinessError } 202 - Not system application.
+ * @throws { BusinessError } 12300001 - The system service works abnormally.
+ * @throws { BusinessError } 12300002 - Invalid credentialInfo, i.e. authType or authSubType.
+ * @throws { BusinessError } 12300003 - Account not found.
+ * @throws { BusinessError } 12300008 - Restricted account.
+ * @throws { BusinessError } 12300020 - Device hardware abnormal.
+ * @throws { BusinessError } 12300090 - Cross-device capability not supported.
+ * @throws { BusinessError } 12300091 - Cross-device communication failed.
+ * @throws { BusinessError } 12300101 - The token is invalid.
+ * @throws { BusinessError } 12300106 - The authentication type is not supported.
+ * @throws { BusinessError } 12300109 - The authentication, enrollment, or update operation is canceled.
+ * @throws { BusinessError } 12300111 - The operation timeout.
+ * @throws { BusinessError } 12300115 - The number of credentials reaches the upper limit.
+ * @throws { BusinessError } 12300116 - Credential complexity verification failed.
+ * @syscap SystemCapability.Account.OsAccount
+ * @systemapi
+ * @since 20
+ * @arkts 1.1&1.2
+ */
addCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
/**
@@ -4091,7 +4602,7 @@ declare namespace osAccount {
* End an IDM operation.
*
* @permission ohos.permission.MANAGE_USER_IDM
- * @param { number } [accountId] - Indicates the local ID of the OS account.
+ * @param { int } [accountId] - Indicates the local ID of the OS account.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes: Incorrect parameter types.
@@ -4100,9 +4611,10 @@ declare namespace osAccount {
* @throws { BusinessError } 12300008 - Restricted account.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 12
+ * @since arkts {'1.1':'12', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
- closeSession(accountId?: number): void;
+ closeSession(accountId?: int): void;
/**
* Cancels entry with a challenge value.
@@ -4175,6 +4687,21 @@ declare namespace osAccount {
* @systemapi Hide this for inner system use.
* @since 8
*/
+ /**
+ * Gets authentication information.
+ *
+ * @permission ohos.permission.USE_USER_IDM
+ * @param { AsyncCallback
2. Incorrect parameter types.
* @throws { BusinessError } 12300001 - The system service works abnormally.
- * @throws { BusinessError } 12300002 - Invalid authType.
+ * @throws { BusinessError } 12300002 - Invalid options.
* @throws { BusinessError } 12300003 - Account not found.
- * @throws { BusinessError } 12300102 - The credential does not exist.
- * @throws { BusinessError } 12300106 - The authentication type is not supported.
+ * @throws { BusinessError } 12300020 - Device hardware abnormal.
* @syscap SystemCapability.Account.OsAccount
- * @systemapi Hide this for inner system use.
- * @since 12
+ * @systemapi
+ * @since 20
+ * @arkts 1.1&1.2
*/
- getEnrolledId(authType: AuthType, accountId?: number): Promise
2. Incorrect parameter types.
* @throws { BusinessError } 12300002 - Invalid pinSubType.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
- onSetData: (authSubType: AuthSubType, data: Uint8Array) => void;
+ onSetData(authSubType: AuthSubType, data: Uint8Array): void;
}
/**
@@ -4494,9 +5058,10 @@ declare namespace osAccount {
* @type { function }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
- onResult: (result: number, extraInfo: AuthResult) => void;
+ onResult: (result: int, extraInfo: AuthResult) => void;
/**
* During an authentication, the TipsCode is returned through the callback.
@@ -4504,9 +5069,10 @@ declare namespace osAccount {
* @type { ?function }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
- onAcquireInfo?: (module: number, acquire: number, extraInfo: Uint8Array) => void;
+ onAcquireInfo?: (module: int, acquire: int, extraInfo: Uint8Array) => void;
}
/**
@@ -4524,9 +5090,10 @@ declare namespace osAccount {
* @type { function }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
- onResult: (result: number, extraInfo: RequestResult) => void;
+ onResult: (result: int, extraInfo: RequestResult) => void;
/**
* During an authentication, the TipsCode is returned through the callback.
@@ -4534,9 +5101,10 @@ declare namespace osAccount {
* @type { ?function }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
- onAcquireInfo?: (module: number, acquire: number, extraInfo: Uint8Array) => void;
+ onAcquireInfo?: (module: int, acquire: int, extraInfo: Uint8Array) => void;
}
/**
@@ -4571,12 +5139,13 @@ declare namespace osAccount {
/**
* Indicates the OS account identifier.
*
- * @type { ?number }
+ * @type { ?int }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 12
+ * @since arkts {'1.1':'12', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
- accountId?: number;
+ accountId?: int;
}
/**
@@ -4631,12 +5200,13 @@ declare namespace osAccount {
/**
* Indicates the result.
*
- * @type { number }
+ * @type { int }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
- result: number;
+ result: int;
/**
* Indicates the authentication credential subtype.
@@ -4651,32 +5221,35 @@ declare namespace osAccount {
/**
* Indicates the remaining times.
*
- * @type { ?number }
+ * @type { ?int }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
- remainTimes?: number;
+ remainTimes?: int;
/**
* Indicates the freezing times.
*
- * @type { ?number }
+ * @type { ?int }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
- freezingTime?: number;
+ freezingTime?: int;
/**
* Indicates next phase freezing time.
*
- * @type { ?number }
+ * @type { ?int }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 12
+ * @since arkts {'1.1':'12', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
- nextPhaseFreezingTime?: number;
+ nextPhaseFreezingTime?: int;
/**
* Indicates the enrollment progress.
@@ -4697,16 +5270,6 @@ declare namespace osAccount {
* @since 10
*/
sensorInfo?: string;
-
- /**
- * Indicates the credential length.
- *
- * @type { ?number }
- * @syscap SystemCapability.Account.OsAccount
- * @systemapi
- * @since 20
- */
- credentialLength?: number;
}
/**
@@ -4731,32 +5294,35 @@ declare namespace osAccount {
/**
* Indicates the remaining times.
*
- * @type { ?number }
+ * @type { ?int }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
- remainTimes?: number;
+ remainTimes?: int;
/**
* Indicates the freezing times.
*
- * @type { ?number }
+ * @type { ?int }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
- freezingTime?: number;
+ freezingTime?: int;
/**
* Indicates next phase freezing time.
*
- * @type { ?number }
+ * @type { ?int }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 12
+ * @since arkts {'1.1':'12', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
- nextPhaseFreezingTime?: number;
+ nextPhaseFreezingTime?: int;
/**
* Indicates the credential ID.
@@ -4771,22 +5337,24 @@ declare namespace osAccount {
/**
* Indicates the local ID of the authenticated OS account.
*
- * @type { ?number }
+ * @type { ?int }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 12
+ * @since arkts {'1.1':'12', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
- accountId?: number;
+ accountId?: int;
/**
* Indicates the validity period after which the PIN will expire.
*
- * @type { ?number }
+ * @type { ?long }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 12
+ * @since arkts {'1.1':'12', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
- pinValidityPeriod?: number;
+ pinValidityPeriod?: long;
}
/**
@@ -4831,12 +5399,13 @@ declare namespace osAccount {
/**
* Indicates the local ID of the OS account to which the credential belongs.
*
- * @type { ?number }
+ * @type { ?int }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 12
+ * @since arkts {'1.1':'12', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
- accountId?: number;
+ accountId?: int;
}
/**
@@ -4914,27 +5483,19 @@ declare namespace osAccount {
* @syscap SystemCapability.Account.OsAccount
* @systemapi
* @since 20
+ * @arkts 1.1&1.2
*/
isAbandoned?: boolean;
-
- /**
- * Indicates the validity period.
- *
- * @type { ?number }
- * @syscap SystemCapability.Account.OsAccount
- * @systemapi
- * @since 20
- */
- validityPeriod?: number;
}
/**
* Indicates the property type to get.
*
- * @enum { number } GetPropertyType
+ * @enum { int } GetPropertyType
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
enum GetPropertyType {
/**
@@ -4997,6 +5558,7 @@ declare namespace osAccount {
* @syscap SystemCapability.Account.OsAccount
* @systemapi
* @since 20
+ * @arkts 1.1&1.2
*/
CREDENTIAL_LENGTH = 7
}
@@ -5004,10 +5566,11 @@ declare namespace osAccount {
/**
* Indicates the property type to set.
*
- * @enum { number } SetPropertyType
+ * @enum { int } SetPropertyType
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
enum SetPropertyType {
/**
@@ -5023,10 +5586,11 @@ declare namespace osAccount {
/**
* Indicates the credential type for authentication.
*
- * @enum { number } AuthType
+ * @enum { int } AuthType
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
enum AuthType {
/**
@@ -5081,16 +5645,17 @@ declare namespace osAccount {
* @systemapi Hide this for inner system use.
* @since 9
*/
- DOMAIN = 1024
+ DOMAIN = 1024,
}
/**
* Indicates the credential subtype for authentication.
*
- * @enum { number } AuthSubType
+ * @enum { int } AuthSubType
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
enum AuthSubType {
/**
@@ -5205,10 +5770,11 @@ declare namespace osAccount {
/**
* Indicates the trusted level of authentication results.
*
- * @enum { number } AuthTrustLevel
+ * @enum { int } AuthTrustLevel
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
enum AuthTrustLevel {
/**
@@ -5251,10 +5817,11 @@ declare namespace osAccount {
/**
* Indicates the module of acquired information.
*
- * @enum { number } Module
+ * @enum { int } Module
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
enum Module {
/**
@@ -5270,10 +5837,11 @@ declare namespace osAccount {
/**
* Indicates the enumeration of authentication result code.
*
- * @enum { number } ResultCode
+ * @enum { int } ResultCode
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
enum ResultCode {
/**
@@ -5379,10 +5947,11 @@ declare namespace osAccount {
/**
* Indicates the enumeration of prompt codes in the process of face authentication.
*
- * @enum { number } FaceTipsCode
+ * @enum { int } FaceTipsCode
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
enum FaceTipsCode {
/**
@@ -5488,10 +6057,11 @@ declare namespace osAccount {
/**
* Indicates the enumeration of prompt codes in the process of fingerprint authentication.
*
- * @enum { number } FingerprintTips
+ * @enum { int } FingerprintTips
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 8
+ * @since arkts {'1.1':'8', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
enum FingerprintTips {
/**
@@ -5570,10 +6140,11 @@ declare namespace osAccount {
/**
* Enumerates for constraint source types.
*
- * @enum { number } ConstraintSourceType
+ * @enum { int } ConstraintSourceType
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 9
+ * @since arkts {'1.1':'9', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
enum ConstraintSourceType {
/**
@@ -5626,12 +6197,13 @@ declare namespace osAccount {
* Indicates the id of an os account who set the constraint.
* When type is CONSTRAINT_NOT_EXIST or CONSTRAINT_TYPE_BASE, localId will be -1.
*
- * @type { number }
+ * @type { int }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
- * @since 9
+ * @since arkts {'1.1':'9', '1.2':'20'}
+ * @arkts 1.1&1.2
*/
- localId: number;
+ localId: int;
/**
* Indicates the source type of the constraint.
@@ -5643,6 +6215,29 @@ declare namespace osAccount {
*/
type: ConstraintSourceType;
}
+
+ /**
+ * Defines the created/removed event data structure for the OS account.
+ *
+ * @interface OsAccountEventData
+ * @syscap SystemCapability.Account.OsAccount
+ * @systemapi
+ * @since 20
+ * @arkts 1.1&1.2
+ */
+ interface OsAccountEventData {
+
+ /**
+ * Indicates the event type.
+ *
+ * @type { string }
+ * @syscap SystemCapability.Account.OsAccount
+ * @systemapi
+ * @since 20
+ * @arkts 1.1&1.2
+ */
+ event: string;
+ }
}
export default osAccount;
\ No newline at end of file