@procivis/react-native-one-core 1.134079.0 → 1.136613.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/ch/procivis/one/core/DeserializeSpecific.kt +20 -1
- package/android/src/main/java/ch/procivis/one/core/ProcivisOneCoreModule.kt +7 -5
- package/core-sdk.json +6 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/src/core.d.ts +1 -1
- package/dist/src/core.js +1 -1
- package/dist/src/one-core-uniffi-intf.d.ts +23 -233
- package/dist/src/one-core-uniffi-intf.js +2 -18
- package/ios/Deserialize.swift +60 -5
- package/ios/ProcivisOneCoreModule.m +2 -1
- package/ios/ProcivisOneCoreModule.swift +10 -7
- package/package.json +1 -1
|
@@ -6,7 +6,10 @@ import kotlin.reflect.KClass
|
|
|
6
6
|
|
|
7
7
|
object DeserializeSpecific {
|
|
8
8
|
object Obj {
|
|
9
|
-
private val CustomConversionTypes = arrayOf(
|
|
9
|
+
private val CustomConversionTypes = arrayOf(
|
|
10
|
+
OptionalString::class,
|
|
11
|
+
HandleInvitationRequestData::class
|
|
12
|
+
)
|
|
10
13
|
|
|
11
14
|
fun isCustomConversionType(type: KClass<*>): Boolean {
|
|
12
15
|
return CustomConversionTypes.contains(type)
|
|
@@ -22,6 +25,22 @@ object DeserializeSpecific {
|
|
|
22
25
|
OptionalString.Some(value)
|
|
23
26
|
}
|
|
24
27
|
}
|
|
28
|
+
|
|
29
|
+
HandleInvitationRequestData::class -> {
|
|
30
|
+
val data = input.getMap(field)
|
|
31
|
+
?: throw IllegalArgumentException("Missing HandleInvitationRequestData data")
|
|
32
|
+
|
|
33
|
+
val type = data.getString("type_")
|
|
34
|
+
?: throw IllegalArgumentException("Missing HandleInvitationRequestData type")
|
|
35
|
+
if (type != "URL") {
|
|
36
|
+
throw IllegalArgumentException("Invalid HandleInvitationRequestData type: $type")
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
val url = data.getString("url")
|
|
40
|
+
?: throw IllegalArgumentException("Missing HandleInvitationRequestData url")
|
|
41
|
+
HandleInvitationRequestData.Url(url = url)
|
|
42
|
+
}
|
|
43
|
+
|
|
25
44
|
else -> {
|
|
26
45
|
throw IllegalArgumentException("Invalid map conversion: $input")
|
|
27
46
|
}
|
|
@@ -49,7 +49,7 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
@ReactMethod
|
|
52
|
-
fun initialize(configJson: String, promise: Promise) {
|
|
52
|
+
fun initialize(configJson: String, dataDirPath: String?, promise: Promise) {
|
|
53
53
|
syncCall(promise) {
|
|
54
54
|
val context = this.reactApplicationContext
|
|
55
55
|
ubiqu = ubiqu ?: UbiquKeyStorage(context)
|
|
@@ -63,8 +63,10 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
63
63
|
bleCentral = AndroidBLECentral(context),
|
|
64
64
|
blePeripheral = AndroidBLEPeripheral(context),
|
|
65
65
|
nfcHce = nfcHce,
|
|
66
|
-
nfcScanner = NfcScanner(context) { context.currentActivity }
|
|
67
|
-
|
|
66
|
+
nfcScanner = NfcScanner(context) { context.currentActivity },
|
|
67
|
+
credentialManager = null
|
|
68
|
+
),
|
|
69
|
+
dataDirPath = dataDirPath ?: context.filesDir.absolutePath,
|
|
68
70
|
)
|
|
69
71
|
return@syncCall null
|
|
70
72
|
}
|
|
@@ -125,9 +127,9 @@ class ProcivisOneCoreModule(reactContext: ReactApplicationContext) :
|
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
@ReactMethod
|
|
128
|
-
fun
|
|
130
|
+
fun updateOrganisation(request: ReadableMap, promise: Promise) {
|
|
129
131
|
asyncCall(promise, scope) {
|
|
130
|
-
getCore().
|
|
132
|
+
getCore().updateOrganisation(construct(request))
|
|
131
133
|
return@asyncCall null
|
|
132
134
|
}
|
|
133
135
|
}
|
package/core-sdk.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"android": {
|
|
3
3
|
"debug": {
|
|
4
|
-
"url": "https://onesdk.blob.core.windows.net/core-sdk/
|
|
5
|
-
"sha1": "
|
|
4
|
+
"url": "https://onesdk.blob.core.windows.net/core-sdk/136613/android/onecore-debug.aar",
|
|
5
|
+
"sha1": "3436665418529a9ff8d70e5efe946be06ae8710d"
|
|
6
6
|
},
|
|
7
7
|
"release": {
|
|
8
|
-
"url": "https://onesdk.blob.core.windows.net/core-sdk/
|
|
9
|
-
"sha1": "
|
|
8
|
+
"url": "https://onesdk.blob.core.windows.net/core-sdk/136613/android/onecore-release.aar",
|
|
9
|
+
"sha1": "6dccae0eabe767df217f317b891da0bdbc43d9c3"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"ios": {
|
|
13
|
-
"url": "https://onesdk.blob.core.windows.net/core-sdk/
|
|
14
|
-
"sha1": "
|
|
13
|
+
"url": "https://onesdk.blob.core.windows.net/core-sdk/136613/ios/deploy.zip",
|
|
14
|
+
"sha1": "55abee8b9c8447a23ccb010fbb975f26a1a35ed8"
|
|
15
15
|
}
|
|
16
16
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -17,4 +17,4 @@ export declare namespace Ubiqu {
|
|
|
17
17
|
* @param config one-core configuration
|
|
18
18
|
* @returns ONE Core instance
|
|
19
19
|
*/
|
|
20
|
-
export declare function initializeCore(config?: Record<string, unknown
|
|
20
|
+
export declare function initializeCore(config?: Record<string, unknown>, dataDirPath?: string): Promise<ONECore>;
|
package/dist/index.js
CHANGED
|
@@ -28,8 +28,8 @@ if (originalGetConfig) {
|
|
|
28
28
|
* @param config one-core configuration
|
|
29
29
|
* @returns ONE Core instance
|
|
30
30
|
*/
|
|
31
|
-
export async function initializeCore(config = {}) {
|
|
32
|
-
await wrapFn(ONE.initialize, "initializeCore")(JSON.stringify(config));
|
|
31
|
+
export async function initializeCore(config = {}, dataDirPath) {
|
|
32
|
+
await wrapFn(ONE.initialize, "initializeCore")(JSON.stringify(config), dataDirPath);
|
|
33
33
|
return wrapObj(ONE);
|
|
34
34
|
}
|
|
35
35
|
// UTILS
|
package/dist/src/core.d.ts
CHANGED
|
@@ -10,4 +10,4 @@ export interface ONECore extends Omit<OneCore, "version" | "getConfig"> {
|
|
|
10
10
|
* @hidden
|
|
11
11
|
* New Architecture bridgeless issue workaround: see https://github.com/facebook/react-native/issues/43221
|
|
12
12
|
*/
|
|
13
|
-
export declare const interfaceMethodNames: readonly ["getVersion", "getConfig", "createOrganisation", "
|
|
13
|
+
export declare const interfaceMethodNames: readonly ["getVersion", "getConfig", "createOrganisation", "updateOrganisation", "getOrganisation", "generateKey", "createDid", "listDids", "createIdentifier", "getIdentifier", "listIdentifiers", "deleteIdentifier", "handleInvitation", "holderAcceptCredential", "holderRejectCredential", "holderRefreshCredential", "initiateIssuance", "continueIssuance", "getPresentationDefinitionV2", "holderRejectProof", "holderSubmitProofV2", "listCredentials", "runTask", "deleteProofClaims", "getCredential", "getCredentialTrustInformation", "deleteCredential", "importCredentialSchema", "getCredentialSchema", "createCredentialSchema", "listCredentialSchemas", "deleteCredentialSchema", "createProof", "shareProof", "shareProofSchema", "shareCredentialSchema", "getProof", "getProofTrustInformation", "holderGetTransactionData", "listProofs", "deleteProof", "proposeProof", "qesAuthorize", "qesSign", "createProofSchema", "listProofSchemas", "getProofSchema", "deleteProofSchema", "importProofSchema", "checkRevocation", "listHistory", "getHistoryEntry", "createBackup", "backupInfo", "deleteCache", "unpackBackup", "finalizeImport", "rollbackImport", "resolveJsonldContext", "holderRegisterInstance", "holderActivateInstance", "holderInstanceStatus", "holderGetInstance", "nfcReadIsoMdlEngagement", "nfcStopIsoMdlEngagement", "uninitialize"];
|
package/dist/src/core.js
CHANGED
|
@@ -37,11 +37,6 @@ export interface CertificateX509Extension {
|
|
|
37
37
|
value: string;
|
|
38
38
|
critical: boolean;
|
|
39
39
|
}
|
|
40
|
-
export interface CharacteristicSettings {
|
|
41
|
-
uuid: string;
|
|
42
|
-
permissions: Array<CharacteristicPermission>;
|
|
43
|
-
properties: Array<CharacteristicProperty>;
|
|
44
|
-
}
|
|
45
40
|
export interface Claim {
|
|
46
41
|
path: string;
|
|
47
42
|
schema: ClaimSchemaInfo;
|
|
@@ -675,10 +670,6 @@ export interface CredentialSet {
|
|
|
675
670
|
*/
|
|
676
671
|
options: Array<Array<string>>;
|
|
677
672
|
}
|
|
678
|
-
export interface DeviceInfo {
|
|
679
|
-
address: string;
|
|
680
|
-
mtu: number;
|
|
681
|
-
}
|
|
682
673
|
export interface DidDetail {
|
|
683
674
|
id: string;
|
|
684
675
|
createdDate: string;
|
|
@@ -780,7 +771,7 @@ export interface EcosystemInfo {
|
|
|
780
771
|
}
|
|
781
772
|
export interface EcosystemOutcome {
|
|
782
773
|
result: EcosystemTrustResult;
|
|
783
|
-
/** Why the provider
|
|
774
|
+
/** Why the provider rejected the interaction. `None` when accepted. */
|
|
784
775
|
error?: HistoryErrorMetadata;
|
|
785
776
|
}
|
|
786
777
|
export interface ErrorData {
|
|
@@ -840,19 +831,11 @@ export interface GenerateKeyRequest {
|
|
|
840
831
|
storageType: string;
|
|
841
832
|
storageParams: Record<string, string>;
|
|
842
833
|
}
|
|
843
|
-
export interface GeneratedKey {
|
|
844
|
-
keyReference: number[];
|
|
845
|
-
publicKey: number[];
|
|
846
|
-
}
|
|
847
834
|
export interface GlobalSettings {
|
|
848
835
|
defaultLanguage: string;
|
|
849
836
|
}
|
|
850
837
|
export interface HandleInvitationRequest {
|
|
851
|
-
|
|
852
|
-
* Typically encoded as a QR code or deep link by the issuer or
|
|
853
|
-
* verifier. For example: "https://example.com/credential-offer".
|
|
854
|
-
*/
|
|
855
|
-
url: string;
|
|
838
|
+
data: HandleInvitationRequestData;
|
|
856
839
|
/** Specifies the organizational context for this operation. */
|
|
857
840
|
organisationId: string;
|
|
858
841
|
/**
|
|
@@ -1244,18 +1227,6 @@ export interface ImportProofSchemaRequest {
|
|
|
1244
1227
|
schema: ImportProofSchema;
|
|
1245
1228
|
organisationId: string;
|
|
1246
1229
|
}
|
|
1247
|
-
export interface InitParams {
|
|
1248
|
-
/** Pass a serialized JSON to override the default configuration. */
|
|
1249
|
-
configJson?: string;
|
|
1250
|
-
/** Create an instance of the native implementation of Secure Element and pass it here. */
|
|
1251
|
-
nativeSecureElement?: NativeKeyStorage;
|
|
1252
|
-
/** Create a custom implementation of HSM and pass it. */
|
|
1253
|
-
remoteSecureElement?: NativeKeyStorage;
|
|
1254
|
-
bleCentral?: BleCentral;
|
|
1255
|
-
blePeripheral?: BlePeripheral;
|
|
1256
|
-
nfcHce?: NfcHce;
|
|
1257
|
-
nfcScanner?: NfcScanner;
|
|
1258
|
-
}
|
|
1259
1230
|
export interface InitiateIssuanceAuthorizationDetail {
|
|
1260
1231
|
type: string;
|
|
1261
1232
|
credentialConfigurationId: string;
|
|
@@ -1398,12 +1369,6 @@ export interface OrganisationDetail {
|
|
|
1398
1369
|
*/
|
|
1399
1370
|
verifierInstance?: VerifierInstanceDetail;
|
|
1400
1371
|
}
|
|
1401
|
-
export interface PeripheralDiscoveryData {
|
|
1402
|
-
deviceAddress: string;
|
|
1403
|
-
localDeviceName?: string;
|
|
1404
|
-
advertisedServices: Array<string>;
|
|
1405
|
-
advertisedServiceData?: Record<string, number[]>;
|
|
1406
|
-
}
|
|
1407
1372
|
export interface PresentationDefinitionTransactionData {
|
|
1408
1373
|
id: string;
|
|
1409
1374
|
type: string;
|
|
@@ -1443,6 +1408,11 @@ export interface PresentationDefinitionV2Claim {
|
|
|
1443
1408
|
* `false` for `ISO_MDL` requests.
|
|
1444
1409
|
*/
|
|
1445
1410
|
required: boolean;
|
|
1411
|
+
/**
|
|
1412
|
+
* Whether the ecosystem requires user consent before this biometric
|
|
1413
|
+
* claim is shared.
|
|
1414
|
+
*/
|
|
1415
|
+
requireBiometricDataUserConsent: boolean;
|
|
1446
1416
|
}
|
|
1447
1417
|
export interface PresentationDefinitionV2Credential {
|
|
1448
1418
|
id: string;
|
|
@@ -1877,12 +1847,6 @@ export interface QesSignResponse {
|
|
|
1877
1847
|
export interface ResolvedJsonLdContext {
|
|
1878
1848
|
context: string;
|
|
1879
1849
|
}
|
|
1880
|
-
export interface ServiceDescription {
|
|
1881
|
-
uuid: string;
|
|
1882
|
-
advertise: boolean;
|
|
1883
|
-
advertisedServiceData?: number[];
|
|
1884
|
-
characteristics: Array<CharacteristicSettings>;
|
|
1885
|
-
}
|
|
1886
1850
|
export interface SetOrganisationConfiguration {
|
|
1887
1851
|
selectedEcosystems?: Array<string>;
|
|
1888
1852
|
/**
|
|
@@ -1961,7 +1925,7 @@ export interface UnexportableEntities {
|
|
|
1961
1925
|
totalDids: number;
|
|
1962
1926
|
totalIdentifiers: number;
|
|
1963
1927
|
}
|
|
1964
|
-
export interface
|
|
1928
|
+
export interface UpdateOrganisationRequest {
|
|
1965
1929
|
/** Unique identifier of the organization to create or update. */
|
|
1966
1930
|
id: string;
|
|
1967
1931
|
/** Set to `true` to deactivate the organization. */
|
|
@@ -1976,12 +1940,6 @@ export interface UpsertOrganisationRequest {
|
|
|
1976
1940
|
verifierProviderIssuer?: string | null;
|
|
1977
1941
|
/** Policy-level configuration for this organization. */
|
|
1978
1942
|
configuration?: SetOrganisationConfiguration;
|
|
1979
|
-
/**
|
|
1980
|
-
* The trust collections this organization's wallet subscribes to,
|
|
1981
|
-
* selected from those made available by the Wallet Provider. Omit to
|
|
1982
|
-
* leave the current selection unchanged.
|
|
1983
|
-
*/
|
|
1984
|
-
trustCollections?: Array<string>;
|
|
1985
1943
|
/**
|
|
1986
1944
|
* The parent organization this organization inherits policy-level
|
|
1987
1945
|
* configuration from, if any.
|
|
@@ -2034,6 +1992,7 @@ export interface WalletInstanceFeatureFlags {
|
|
|
2034
1992
|
ecosystemsEnforcementEnabled: boolean;
|
|
2035
1993
|
refreshCredentialBatchEnabled: boolean;
|
|
2036
1994
|
documentSigningEnabled: boolean;
|
|
1995
|
+
dcApiIntegrationEnabled: boolean;
|
|
2037
1996
|
}
|
|
2038
1997
|
export interface WalletProviderDetail {
|
|
2039
1998
|
/**
|
|
@@ -2059,50 +2018,6 @@ export type ApplicableCredentialOrFailureHint =
|
|
|
2059
2018
|
type_: "FAILURE_HINT";
|
|
2060
2019
|
failureHint: CredentialQueryFailureHint;
|
|
2061
2020
|
};
|
|
2062
|
-
export type BleError = {
|
|
2063
|
-
type_: "ADAPTER_NOT_ENABLED";
|
|
2064
|
-
} | {
|
|
2065
|
-
type_: "SCAN_ALREADY_STARTED";
|
|
2066
|
-
} | {
|
|
2067
|
-
type_: "SCAN_NOT_STARTED";
|
|
2068
|
-
} | {
|
|
2069
|
-
type_: "BROADCAST_ALREADY_STARTED";
|
|
2070
|
-
} | {
|
|
2071
|
-
type_: "BROADCAST_NOT_STARTED";
|
|
2072
|
-
} | {
|
|
2073
|
-
type_: "ANOTHER_OPERATION_IN_PROGRESS";
|
|
2074
|
-
} | {
|
|
2075
|
-
type_: "WRITE_DATA_TOO_LONG";
|
|
2076
|
-
} | {
|
|
2077
|
-
type_: "DEVICE_ADDRESS_NOT_FOUND";
|
|
2078
|
-
address: string;
|
|
2079
|
-
} | {
|
|
2080
|
-
type_: "SERVICE_NOT_FOUND";
|
|
2081
|
-
service: string;
|
|
2082
|
-
} | {
|
|
2083
|
-
type_: "CHARACTERISTIC_NOT_FOUND";
|
|
2084
|
-
characteristic: string;
|
|
2085
|
-
} | {
|
|
2086
|
-
type_: "INVALID_UUID";
|
|
2087
|
-
uuid: string;
|
|
2088
|
-
} | {
|
|
2089
|
-
type_: "DEVICE_NOT_CONNECTED";
|
|
2090
|
-
address: string;
|
|
2091
|
-
} | {
|
|
2092
|
-
type_: "INVALID_CHARACTERISTIC_OPERATION";
|
|
2093
|
-
service: string;
|
|
2094
|
-
characteristic: string;
|
|
2095
|
-
operation: string;
|
|
2096
|
-
} | {
|
|
2097
|
-
type_: "NOT_SUPPORTED";
|
|
2098
|
-
} | {
|
|
2099
|
-
type_: "NOT_AUTHORIZED";
|
|
2100
|
-
} | {
|
|
2101
|
-
type_: "SERVER_NOT_RUNNING";
|
|
2102
|
-
} | {
|
|
2103
|
-
type_: "UNKNOWN";
|
|
2104
|
-
reason: string;
|
|
2105
|
-
};
|
|
2106
2021
|
export declare enum CacheType {
|
|
2107
2022
|
DID_DOCUMENT = "DID_DOCUMENT",
|
|
2108
2023
|
JSON_LD_CONTEXT = "JSON_LD_CONTEXT",
|
|
@@ -2140,21 +2055,6 @@ export declare enum CertificateState {
|
|
|
2140
2055
|
REVOKED = "REVOKED",
|
|
2141
2056
|
EXPIRED = "EXPIRED"
|
|
2142
2057
|
}
|
|
2143
|
-
export declare enum CharacteristicPermission {
|
|
2144
|
-
READ = "READ",
|
|
2145
|
-
WRITE = "WRITE"
|
|
2146
|
-
}
|
|
2147
|
-
export declare enum CharacteristicProperty {
|
|
2148
|
-
READ = "READ",
|
|
2149
|
-
WRITE = "WRITE",
|
|
2150
|
-
NOTIFY = "NOTIFY",
|
|
2151
|
-
WRITE_WITHOUT_RESPONSE = "WRITE_WITHOUT_RESPONSE",
|
|
2152
|
-
INDICATE = "INDICATE"
|
|
2153
|
-
}
|
|
2154
|
-
export declare enum CharacteristicWriteType {
|
|
2155
|
-
WITH_RESPONSE = "WITH_RESPONSE",
|
|
2156
|
-
WITHOUT_RESPONSE = "WITHOUT_RESPONSE"
|
|
2157
|
-
}
|
|
2158
2058
|
export type ClaimValue = {
|
|
2159
2059
|
type_: "BOOLEAN";
|
|
2160
2060
|
value: boolean;
|
|
@@ -2177,13 +2077,6 @@ export declare enum ClientIdScheme {
|
|
|
2177
2077
|
DECENTRALIZED_IDENTIFIER = "DECENTRALIZED_IDENTIFIER",
|
|
2178
2078
|
X509_SAN_DNS = "X509_SAN_DNS"
|
|
2179
2079
|
}
|
|
2180
|
-
export type ConnectionEvent = {
|
|
2181
|
-
type_: "CONNECTED";
|
|
2182
|
-
deviceInfo: DeviceInfo;
|
|
2183
|
-
} | {
|
|
2184
|
-
type_: "DISCONNECTED";
|
|
2185
|
-
deviceAddress: string;
|
|
2186
|
-
};
|
|
2187
2080
|
export declare enum CreateSelfSignedCaRequestIssuerAlternativeNameType {
|
|
2188
2081
|
EMAIL = "EMAIL",
|
|
2189
2082
|
URI = "URI"
|
|
@@ -2268,8 +2161,19 @@ export declare enum EcosystemRole {
|
|
|
2268
2161
|
}
|
|
2269
2162
|
export declare enum EcosystemTrustResult {
|
|
2270
2163
|
TRUSTED = "TRUSTED",
|
|
2164
|
+
COMPLIANT = "COMPLIANT",
|
|
2271
2165
|
NOT_TRUSTED = "NOT_TRUSTED"
|
|
2272
2166
|
}
|
|
2167
|
+
export type HandleInvitationRequestData =
|
|
2168
|
+
/** OpenID4VCI, OpenID4VP */
|
|
2169
|
+
{
|
|
2170
|
+
type_: "URL";
|
|
2171
|
+
/**
|
|
2172
|
+
* Typically encoded as a QR code or deep link by the issuer or
|
|
2173
|
+
* verifier. For example: "https://example.com/credential-offer".
|
|
2174
|
+
*/
|
|
2175
|
+
url: string;
|
|
2176
|
+
};
|
|
2273
2177
|
export type HandleInvitationResponse = {
|
|
2274
2178
|
type_: "CREDENTIAL_ISSUANCE";
|
|
2275
2179
|
/** Use with `holderAcceptCredential` and `holderRejectCredential`. */
|
|
@@ -2475,34 +2379,6 @@ export declare enum KeyStorageSecurity {
|
|
|
2475
2379
|
ENHANCED_BASIC = "ENHANCED_BASIC",
|
|
2476
2380
|
BASIC = "BASIC"
|
|
2477
2381
|
}
|
|
2478
|
-
export type NativeKeyStorageError = {
|
|
2479
|
-
type_: "KEY_GENERATION_FAILURE";
|
|
2480
|
-
reason: string;
|
|
2481
|
-
} | {
|
|
2482
|
-
type_: "SIGNATURE_FAILURE";
|
|
2483
|
-
reason: string;
|
|
2484
|
-
} | {
|
|
2485
|
-
type_: "UNSUPPORTED";
|
|
2486
|
-
} | {
|
|
2487
|
-
type_: "UNKNOWN";
|
|
2488
|
-
reason: string;
|
|
2489
|
-
};
|
|
2490
|
-
export type NfcError = {
|
|
2491
|
-
type_: "NOT_ENABLED";
|
|
2492
|
-
} | {
|
|
2493
|
-
type_: "NOT_SUPPORTED";
|
|
2494
|
-
} | {
|
|
2495
|
-
type_: "ALREADY_STARTED";
|
|
2496
|
-
} | {
|
|
2497
|
-
type_: "NOT_STARTED";
|
|
2498
|
-
} | {
|
|
2499
|
-
type_: "CANCELLED";
|
|
2500
|
-
} | {
|
|
2501
|
-
type_: "SESSION_CLOSED";
|
|
2502
|
-
} | {
|
|
2503
|
-
type_: "UNKNOWN";
|
|
2504
|
-
reason: string;
|
|
2505
|
-
};
|
|
2506
2382
|
export type OneCoreError = {
|
|
2507
2383
|
type_: "RESPONSE";
|
|
2508
2384
|
data: ErrorResponse;
|
|
@@ -2653,93 +2529,10 @@ export type TrustInformationDetailInfo = {
|
|
|
2653
2529
|
};
|
|
2654
2530
|
export declare enum TrustResolutionResult {
|
|
2655
2531
|
TRUSTED = "TRUSTED",
|
|
2532
|
+
COMPLIANT = "COMPLIANT",
|
|
2656
2533
|
UNTRUSTED = "UNTRUSTED",
|
|
2657
2534
|
UNKNOWN = "UNKNOWN"
|
|
2658
2535
|
}
|
|
2659
|
-
export interface BleCentral {
|
|
2660
|
-
connect(peripheral: string): Promise<number>;
|
|
2661
|
-
disconnect(peripheral: string): Promise<void>;
|
|
2662
|
-
getDiscoveredDevices(): Promise<Array<PeripheralDiscoveryData>>;
|
|
2663
|
-
getNotifications(peripheral: string, service: string, characteristic: string): Promise<Array<number[]>>;
|
|
2664
|
-
isAdapterEnabled(): Promise<boolean>;
|
|
2665
|
-
isScanning(): Promise<boolean>;
|
|
2666
|
-
readData(peripheral: string, service: string, characteristic: string): Promise<number[]>;
|
|
2667
|
-
startScan(filterServices: Array<string> | undefined): Promise<void>;
|
|
2668
|
-
stopScan(): Promise<void>;
|
|
2669
|
-
subscribeToCharacteristicNotifications(peripheral: string, service: string, characteristic: string): Promise<void>;
|
|
2670
|
-
unsubscribeFromCharacteristicNotifications(peripheral: string, service: string, characteristic: string): Promise<void>;
|
|
2671
|
-
writeData(peripheral: string, service: string, characteristic: string, data: number[], writeType: CharacteristicWriteType): Promise<void>;
|
|
2672
|
-
}
|
|
2673
|
-
export interface BlePeripheral {
|
|
2674
|
-
getCharacteristicWrites(device: string, service: string, characteristic: string): Promise<Array<number[]>>;
|
|
2675
|
-
getConnectionChangeEvents(): Promise<Array<ConnectionEvent>>;
|
|
2676
|
-
isAdapterEnabled(): Promise<boolean>;
|
|
2677
|
-
isAdvertising(): Promise<boolean>;
|
|
2678
|
-
notifyCharacteristicData(deviceAddress: string, service: string, characteristic: string, data: number[]): Promise<void>;
|
|
2679
|
-
setCharacteristicData(service: string, characteristic: string, data: number[]): Promise<void>;
|
|
2680
|
-
startAdvertisement(deviceName: string | undefined, services: Array<ServiceDescription>): Promise<string | undefined>;
|
|
2681
|
-
stopAdvertisement(): Promise<void>;
|
|
2682
|
-
stopServer(): Promise<void>;
|
|
2683
|
-
waitForCharacteristicRead(device: string, service: string, characteristic: string): Promise<void>;
|
|
2684
|
-
}
|
|
2685
|
-
export interface NativeKeyStorage {
|
|
2686
|
-
generateAttestation(keyReference: number[], nonce: string | undefined): Promise<Array<string>>;
|
|
2687
|
-
generateAttestationKey(keyAlias: string, nonce: string | undefined): Promise<GeneratedKey>;
|
|
2688
|
-
generateKey(keyAlias: string): Promise<GeneratedKey>;
|
|
2689
|
-
sign(keyReference: number[], message: number[]): Promise<number[]>;
|
|
2690
|
-
signWithAttestationKey(keyReference: number[], message: number[]): Promise<number[]>;
|
|
2691
|
-
}
|
|
2692
|
-
/** Provider of NFC host-card emulation (HCE) */
|
|
2693
|
-
export interface NfcHce {
|
|
2694
|
-
isEnabled(): Promise<boolean>;
|
|
2695
|
-
isSupported(): Promise<boolean>;
|
|
2696
|
-
/**
|
|
2697
|
-
* Starts NFC host-card emulation (HCE)
|
|
2698
|
-
* * `handler` implementation for handling NFC events
|
|
2699
|
-
* * `message` UI message to be placed on the system overlay (iOS)
|
|
2700
|
-
*/
|
|
2701
|
-
startHosting(handler: NfcHceHandler, message: string | undefined): Promise<void>;
|
|
2702
|
-
/**
|
|
2703
|
-
* stops emulation started via `start_hosting`
|
|
2704
|
-
* * `success` true if hosting should be ended with a success or failure (iOS)
|
|
2705
|
-
*/
|
|
2706
|
-
stopHosting(success: boolean): Promise<void>;
|
|
2707
|
-
}
|
|
2708
|
-
export interface NfcHceHandler {
|
|
2709
|
-
/** Handle incoming APDU command, return response */
|
|
2710
|
-
handleCommand(apdu: number[]): number[];
|
|
2711
|
-
/** Called when NFC scanner disconnects */
|
|
2712
|
-
onScannerDisconnected(): Promise<void>;
|
|
2713
|
-
/** Called when NFC HCE hosting stops */
|
|
2714
|
-
onSessionStopped(reason: NfcError): Promise<void>;
|
|
2715
|
-
}
|
|
2716
|
-
/** Provider of NFC scanner functionality */
|
|
2717
|
-
export interface NfcScanner {
|
|
2718
|
-
/**
|
|
2719
|
-
* Stops scanning previously started via `scan`
|
|
2720
|
-
* or disconnects the established session
|
|
2721
|
-
* * `error_message` - error UI message to display on the system NFC overlay (iOS)
|
|
2722
|
-
*/
|
|
2723
|
-
cancelScan(errorMessage: string | undefined): Promise<void>;
|
|
2724
|
-
/** Check whether NFC adapter is enabled on the device (android only, iOS always enabled) */
|
|
2725
|
-
isEnabled(): Promise<boolean>;
|
|
2726
|
-
/** Check whether NFC scanning is supported on the device */
|
|
2727
|
-
isSupported(): Promise<boolean>;
|
|
2728
|
-
/**
|
|
2729
|
-
* Starts scanning for ISO 7816-4 NFC tag
|
|
2730
|
-
* * `message` - UI message to display on the system NFC overlay (iOS)
|
|
2731
|
-
*
|
|
2732
|
-
* This function returns when:
|
|
2733
|
-
* * an IsoDep tag is scanned and session established
|
|
2734
|
-
* * on cancellation (`cancel_scan`) - `NfcError::Cancelled`
|
|
2735
|
-
* * or on failure
|
|
2736
|
-
*/
|
|
2737
|
-
scan(message: string | undefined): Promise<void>;
|
|
2738
|
-
/** Update UI message on the system NFC scanner overlay (iOS) - previously set via `scan` */
|
|
2739
|
-
setMessage(message: string): Promise<void>;
|
|
2740
|
-
/** Send APDU request and wait for response APDU */
|
|
2741
|
-
transceive(commandApdu: number[]): Promise<number[]>;
|
|
2742
|
-
}
|
|
2743
2536
|
export interface OneCore {
|
|
2744
2537
|
/**
|
|
2745
2538
|
* Returns information about items that will be excluded from the
|
|
@@ -3018,11 +2811,8 @@ export interface OneCore {
|
|
|
3018
2811
|
* Follow by calling either `finalizeImport` or `rollbackImport`.
|
|
3019
2812
|
*/
|
|
3020
2813
|
unpackBackup(password: string, inputPath: string): Promise<Metadata>;
|
|
3021
|
-
/**
|
|
3022
|
-
|
|
3023
|
-
* creates a new organization using the provided UUID and name.
|
|
3024
|
-
*/
|
|
3025
|
-
upsertOrganisation(request: UpsertOrganisationRequest): Promise<void>;
|
|
2814
|
+
/** Updates or deactivates an organization */
|
|
2815
|
+
updateOrganisation(request: UpdateOrganisationRequest): Promise<void>;
|
|
3026
2816
|
/** Returns build information. */
|
|
3027
2817
|
version(): Version;
|
|
3028
2818
|
}
|
|
@@ -42,24 +42,6 @@ export var CertificateState;
|
|
|
42
42
|
CertificateState["REVOKED"] = "REVOKED";
|
|
43
43
|
CertificateState["EXPIRED"] = "EXPIRED";
|
|
44
44
|
})(CertificateState || (CertificateState = {}));
|
|
45
|
-
export var CharacteristicPermission;
|
|
46
|
-
(function (CharacteristicPermission) {
|
|
47
|
-
CharacteristicPermission["READ"] = "READ";
|
|
48
|
-
CharacteristicPermission["WRITE"] = "WRITE";
|
|
49
|
-
})(CharacteristicPermission || (CharacteristicPermission = {}));
|
|
50
|
-
export var CharacteristicProperty;
|
|
51
|
-
(function (CharacteristicProperty) {
|
|
52
|
-
CharacteristicProperty["READ"] = "READ";
|
|
53
|
-
CharacteristicProperty["WRITE"] = "WRITE";
|
|
54
|
-
CharacteristicProperty["NOTIFY"] = "NOTIFY";
|
|
55
|
-
CharacteristicProperty["WRITE_WITHOUT_RESPONSE"] = "WRITE_WITHOUT_RESPONSE";
|
|
56
|
-
CharacteristicProperty["INDICATE"] = "INDICATE";
|
|
57
|
-
})(CharacteristicProperty || (CharacteristicProperty = {}));
|
|
58
|
-
export var CharacteristicWriteType;
|
|
59
|
-
(function (CharacteristicWriteType) {
|
|
60
|
-
CharacteristicWriteType["WITH_RESPONSE"] = "WITH_RESPONSE";
|
|
61
|
-
CharacteristicWriteType["WITHOUT_RESPONSE"] = "WITHOUT_RESPONSE";
|
|
62
|
-
})(CharacteristicWriteType || (CharacteristicWriteType = {}));
|
|
63
45
|
export var ClientIdScheme;
|
|
64
46
|
(function (ClientIdScheme) {
|
|
65
47
|
ClientIdScheme["REDIRECT_URI"] = "REDIRECT_URI";
|
|
@@ -166,6 +148,7 @@ export var EcosystemRole;
|
|
|
166
148
|
export var EcosystemTrustResult;
|
|
167
149
|
(function (EcosystemTrustResult) {
|
|
168
150
|
EcosystemTrustResult["TRUSTED"] = "TRUSTED";
|
|
151
|
+
EcosystemTrustResult["COMPLIANT"] = "COMPLIANT";
|
|
169
152
|
EcosystemTrustResult["NOT_TRUSTED"] = "NOT_TRUSTED";
|
|
170
153
|
})(EcosystemTrustResult || (EcosystemTrustResult = {}));
|
|
171
154
|
export var HistoryAction;
|
|
@@ -443,6 +426,7 @@ export var TransactionCodeType;
|
|
|
443
426
|
export var TrustResolutionResult;
|
|
444
427
|
(function (TrustResolutionResult) {
|
|
445
428
|
TrustResolutionResult["TRUSTED"] = "TRUSTED";
|
|
429
|
+
TrustResolutionResult["COMPLIANT"] = "COMPLIANT";
|
|
446
430
|
TrustResolutionResult["UNTRUSTED"] = "UNTRUSTED";
|
|
447
431
|
TrustResolutionResult["UNKNOWN"] = "UNKNOWN";
|
|
448
432
|
})(TrustResolutionResult || (TrustResolutionResult = {}));
|
package/ios/Deserialize.swift
CHANGED
|
@@ -30,7 +30,10 @@ private func deserializeEnum<T: CaseIterable>(_ input: String) throws -> T {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
private func opt<F, T>(
|
|
33
|
+
private func opt<F, T>(
|
|
34
|
+
_ input: F?,
|
|
35
|
+
_ deserializeFn: @escaping (_ input: F) throws -> T
|
|
36
|
+
) throws
|
|
34
37
|
-> T?
|
|
35
38
|
{
|
|
36
39
|
if input != nil {
|
|
@@ -43,7 +46,8 @@ private func safeCast<T>(_ input: Any?) throws -> T {
|
|
|
43
46
|
if let result = input as? T {
|
|
44
47
|
return result
|
|
45
48
|
} else {
|
|
46
|
-
let description =
|
|
49
|
+
let description =
|
|
50
|
+
"Invalid input for type \(T.self): \(String(describing: input))"
|
|
47
51
|
throw DecodingError.typeMismatch(
|
|
48
52
|
T.self,
|
|
49
53
|
DecodingError.Context(codingPath: [], debugDescription: description)
|
|
@@ -65,7 +69,11 @@ func deserializeOpt<T: Decodable>(_ value: Any?) throws -> T? {
|
|
|
65
69
|
return try deserialize(value!)
|
|
66
70
|
}
|
|
67
71
|
|
|
68
|
-
private func deserializeSpecific(
|
|
72
|
+
private func deserializeSpecific(
|
|
73
|
+
_ value: Any,
|
|
74
|
+
_ type: Any.Type,
|
|
75
|
+
_ codingPath: [CodingKey]
|
|
76
|
+
) throws
|
|
69
77
|
-> Any?
|
|
70
78
|
{
|
|
71
79
|
if type == OptionalString.self {
|
|
@@ -74,10 +82,14 @@ private func deserializeSpecific(_ value: Any, _ type: Any.Type, _ codingPath: [
|
|
|
74
82
|
}
|
|
75
83
|
|
|
76
84
|
guard let data = value as? String else {
|
|
77
|
-
let description =
|
|
85
|
+
let description =
|
|
86
|
+
"Expected to decode \(type) but found '\(value)' instead."
|
|
78
87
|
throw DecodingError.typeMismatch(
|
|
79
88
|
type,
|
|
80
|
-
DecodingError.Context(
|
|
89
|
+
DecodingError.Context(
|
|
90
|
+
codingPath: codingPath,
|
|
91
|
+
debugDescription: description
|
|
92
|
+
)
|
|
81
93
|
)
|
|
82
94
|
}
|
|
83
95
|
return OptionalString.some(value: data)
|
|
@@ -85,3 +97,46 @@ private func deserializeSpecific(_ value: Any, _ type: Any.Type, _ codingPath: [
|
|
|
85
97
|
|
|
86
98
|
return nil
|
|
87
99
|
}
|
|
100
|
+
|
|
101
|
+
func deserializeHandleInvitationRequest(_ request: NSDictionary) throws
|
|
102
|
+
-> HandleInvitationRequest
|
|
103
|
+
{
|
|
104
|
+
let data = try deserializeHandleInvitationRequestData(
|
|
105
|
+
request["data"] as? NSDictionary
|
|
106
|
+
)
|
|
107
|
+
guard let organisationId = request["organisationId"] as? String else {
|
|
108
|
+
throw DecodingError.typeMismatch(
|
|
109
|
+
HandleInvitationRequest.self,
|
|
110
|
+
DecodingError.Context(
|
|
111
|
+
codingPath: [],
|
|
112
|
+
debugDescription: "missing organisationId"
|
|
113
|
+
)
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
return HandleInvitationRequest(
|
|
117
|
+
data: data,
|
|
118
|
+
organisationId: organisationId,
|
|
119
|
+
transport: try deserializeOpt(request["transport"]),
|
|
120
|
+
redirectUri: try deserializeOpt(request["redirectUri"]),
|
|
121
|
+
ecosystem: try deserializeOpt(request["ecosystem"])
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
func deserializeHandleInvitationRequestData(_ data: NSDictionary?) throws
|
|
126
|
+
-> HandleInvitationRequestData
|
|
127
|
+
{
|
|
128
|
+
guard let data = data,
|
|
129
|
+
let enum_type = data["type_"] as? String,
|
|
130
|
+
enum_type == "URL",
|
|
131
|
+
let url = data["url"] as? String
|
|
132
|
+
else {
|
|
133
|
+
throw DecodingError.typeMismatch(
|
|
134
|
+
HandleInvitationRequestData.self,
|
|
135
|
+
DecodingError.Context(
|
|
136
|
+
codingPath: [],
|
|
137
|
+
debugDescription: "Invalid HandleInvitationRequestData"
|
|
138
|
+
)
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
return HandleInvitationRequestData.url(url: url)
|
|
142
|
+
}
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
RCT_EXTERN_METHOD(supportedEvents)
|
|
19
19
|
|
|
20
20
|
RCT_EXTERN_METHOD(initialize:(NSString *)configJson
|
|
21
|
+
dataDirPath:(NSString *)dataDirPath
|
|
21
22
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
22
23
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
23
24
|
|
|
@@ -31,7 +32,7 @@ RCT_EXTERN_METHOD(createOrganisation:(NSDictionary *)request
|
|
|
31
32
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
32
33
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
33
34
|
|
|
34
|
-
RCT_EXTERN_METHOD(
|
|
35
|
+
RCT_EXTERN_METHOD(updateOrganisation:(NSDictionary *)request
|
|
35
36
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
36
37
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
37
38
|
|
|
@@ -22,9 +22,10 @@ class ProcivisOneCoreModule: RCTEventEmitter {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
@objc(initialize:resolver:rejecter:)
|
|
25
|
+
@objc(initialize:dataDirPath:resolver:rejecter:)
|
|
26
26
|
func initialize(
|
|
27
27
|
configJson: String,
|
|
28
|
+
dataDirPath: String?,
|
|
28
29
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
29
30
|
reject: @escaping RCTPromiseRejectBlock
|
|
30
31
|
) {
|
|
@@ -60,8 +61,10 @@ class ProcivisOneCoreModule: RCTEventEmitter {
|
|
|
60
61
|
bleCentral: IOSBLECentral(),
|
|
61
62
|
blePeripheral: IOSBLEPeripheral(),
|
|
62
63
|
nfcHce: nfcHce,
|
|
63
|
-
nfcScanner: NFCScanner()
|
|
64
|
-
|
|
64
|
+
nfcScanner: NFCScanner(),
|
|
65
|
+
credentialManager: nil,
|
|
66
|
+
),
|
|
67
|
+
dataDirPath: dataDirPath,
|
|
65
68
|
)
|
|
66
69
|
|
|
67
70
|
return nil as NSDictionary?
|
|
@@ -110,14 +113,14 @@ class ProcivisOneCoreModule: RCTEventEmitter {
|
|
|
110
113
|
}
|
|
111
114
|
}
|
|
112
115
|
|
|
113
|
-
@objc(
|
|
114
|
-
func
|
|
116
|
+
@objc(updateOrganisation:resolver:rejecter:)
|
|
117
|
+
func updateOrganisation(
|
|
115
118
|
request: NSDictionary,
|
|
116
119
|
resolve: @escaping RCTPromiseResolveBlock,
|
|
117
120
|
reject: @escaping RCTPromiseRejectBlock
|
|
118
121
|
) {
|
|
119
122
|
asyncCall(resolve, reject) {
|
|
120
|
-
try await self.getCore().
|
|
123
|
+
try await self.getCore().updateOrganisation(request: try deserialize(request))
|
|
121
124
|
return nil as NSDictionary?
|
|
122
125
|
}
|
|
123
126
|
}
|
|
@@ -222,7 +225,7 @@ class ProcivisOneCoreModule: RCTEventEmitter {
|
|
|
222
225
|
reject: @escaping RCTPromiseRejectBlock
|
|
223
226
|
) {
|
|
224
227
|
asyncCall(resolve, reject) {
|
|
225
|
-
let result = try await self.getCore().handleInvitation(request: try
|
|
228
|
+
let result = try await self.getCore().handleInvitation(request: try deserializeHandleInvitationRequest(request))
|
|
226
229
|
return try serializeAny(result)
|
|
227
230
|
}
|
|
228
231
|
}
|