capacitor-record360sdk 7.25.0 → 8.26.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/CapacitorRecord360sdk.podspec +2 -2
- package/README.md +14 -9
- package/android/build.gradle +3 -3
- package/android/src/main/java/com/record360/plugins/CapacitorRecord360SDKPlugin.kt +5 -0
- package/android/src/main/java/com/record360/plugins/SampleRecord360Activity.kt +18 -3
- package/dist/docs.json +16 -4
- package/dist/esm/definitions.d.ts +5 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +2 -1
- package/dist/esm/web.js.map +1 -1
- package/ios/Sources/CapacitorRecord360SDKPlugin/CapacitorRecord360SDKPlugin.swift +20 -11
- package/package.json +6 -6
|
@@ -11,8 +11,8 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
|
|
13
13
|
s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
-
s.ios.deployment_target = '
|
|
14
|
+
s.ios.deployment_target = '15.0'
|
|
15
15
|
s.dependency 'Capacitor'
|
|
16
|
-
s.dependency 'Record360SDK', '4.23.
|
|
16
|
+
s.dependency 'Record360SDK', '4.23.6'
|
|
17
17
|
s.swift_version = '5.1'
|
|
18
18
|
end
|
package/README.md
CHANGED
|
@@ -40,12 +40,12 @@ launchRecord360(identity?: Record360Identity | undefined) => Promise<void>
|
|
|
40
40
|
### launchReferenceCapture(...)
|
|
41
41
|
|
|
42
42
|
```typescript
|
|
43
|
-
launchReferenceCapture(options: { referenceNumber: string; department?: string; sequence?: string; identity?: Record360Identity; }) => Promise<void>
|
|
43
|
+
launchReferenceCapture(options: { referenceNumber: string; department?: string; sequence?: string; fieldData?: Record360FieldData; identity?: Record360Identity; }) => Promise<void>
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
| Param | Type
|
|
47
|
-
| ------------- |
|
|
48
|
-
| **`options`** | <code>{ referenceNumber: string; department?: string; sequence?: string; identity?: <a href="#record360identity">Record360Identity</a>; }</code> |
|
|
46
|
+
| Param | Type |
|
|
47
|
+
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
48
|
+
| **`options`** | <code>{ referenceNumber: string; department?: string; sequence?: string; fieldData?: <a href="#record360fielddata">Record360FieldData</a>; identity?: <a href="#record360identity">Record360Identity</a>; }</code> |
|
|
49
49
|
|
|
50
50
|
--------------------
|
|
51
51
|
|
|
@@ -53,13 +53,13 @@ launchReferenceCapture(options: { referenceNumber: string; department?: string;
|
|
|
53
53
|
### addListener('Record360Event', ...)
|
|
54
54
|
|
|
55
55
|
```typescript
|
|
56
|
-
addListener(eventName: 'Record360Event', listenerFunc: (data: { type: 'onFailedToAuthenticate' | 'onInspectionCancelled' | 'onInspectionComplete' | 'onInspectionUploadFailed' | 'onInspectionUploadProgress' | 'onInspectionUploaded' | 'onInspectionStarted' | 'onUserAuthenticated'; referenceNumber?: string; bytesComplete?: number; bytesTotal?: number; error?: string; userId?: string; username?: string; inspectionJSON?: string; }) => void) => Promise<PluginListenerHandle>
|
|
56
|
+
addListener(eventName: 'Record360Event', listenerFunc: (data: { type: 'onFailedToAuthenticate' | 'onInspectionCancelled' | 'onInspectionComplete' | 'onInspectionUploadFailed' | 'onInspectionUploadProgress' | 'onInspectionUploaded' | 'onInspectionStarted' | 'onUserAuthenticated'; referenceNumber?: string; bytesComplete?: number; bytesTotal?: number; percentComplete?: number; error?: string; userId?: string; username?: string; inspectionJSON?: string; }) => void) => Promise<PluginListenerHandle>
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
| Param | Type
|
|
60
|
-
| ------------------ |
|
|
61
|
-
| **`eventName`** | <code>'Record360Event'</code>
|
|
62
|
-
| **`listenerFunc`** | <code>(data: { type: 'onFailedToAuthenticate' \| 'onInspectionCancelled' \| 'onInspectionComplete' \| 'onInspectionUploadFailed' \| 'onInspectionUploadProgress' \| 'onInspectionUploaded' \| 'onInspectionStarted' \| 'onUserAuthenticated'; referenceNumber?: string; bytesComplete?: number; bytesTotal?: number; error?: string; userId?: string; username?: string; inspectionJSON?: string; }) => void</code> |
|
|
59
|
+
| Param | Type |
|
|
60
|
+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
61
|
+
| **`eventName`** | <code>'Record360Event'</code> |
|
|
62
|
+
| **`listenerFunc`** | <code>(data: { type: 'onFailedToAuthenticate' \| 'onInspectionCancelled' \| 'onInspectionComplete' \| 'onInspectionUploadFailed' \| 'onInspectionUploadProgress' \| 'onInspectionUploaded' \| 'onInspectionStarted' \| 'onUserAuthenticated'; referenceNumber?: string; bytesComplete?: number; bytesTotal?: number; percentComplete?: number; error?: string; userId?: string; username?: string; inspectionJSON?: string; }) => void</code> |
|
|
63
63
|
|
|
64
64
|
**Returns:** <code>Promise<<a href="#pluginlistenerhandle">PluginListenerHandle</a>></code>
|
|
65
65
|
|
|
@@ -99,4 +99,9 @@ addListener(eventName: 'Record360Event', listenerFunc: (data: { type: 'onFailedT
|
|
|
99
99
|
|
|
100
100
|
<code><a href="#r360passwordidentity">R360PasswordIdentity</a> | <a href="#r360usertokenidentity">R360UserTokenIdentity</a></code>
|
|
101
101
|
|
|
102
|
+
|
|
103
|
+
#### Record360FieldData
|
|
104
|
+
|
|
105
|
+
<code>{ [key: string]: unknown }</code>
|
|
106
|
+
|
|
102
107
|
</docgen-api>
|
package/android/build.gradle
CHANGED
|
@@ -5,9 +5,9 @@ buildscript {
|
|
|
5
5
|
androidxJunitVersion = '1.2.1'
|
|
6
6
|
androidxEspressoCoreVersion = '3.6.1'
|
|
7
7
|
androidXCore = '1.15.0'
|
|
8
|
-
compileSdk =
|
|
8
|
+
compileSdk = 36
|
|
9
9
|
minSdkVersion = 24
|
|
10
|
-
targetSdkVersion =
|
|
10
|
+
targetSdkVersion = 36
|
|
11
11
|
kotlinVersion = '2.0.21'
|
|
12
12
|
androidxCoreVersion = '1.15.0'
|
|
13
13
|
androidxActivityVersion = '1.9.2'
|
|
@@ -101,6 +101,6 @@ dependencies {
|
|
|
101
101
|
testImplementation "junit:junit:$junitVersion"
|
|
102
102
|
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
103
103
|
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
104
|
-
implementation 'com.record360.sdk:android-sdk:4.
|
|
104
|
+
implementation 'com.record360.sdk:android-sdk:4.26.1'
|
|
105
105
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
|
|
106
106
|
}
|
|
@@ -9,6 +9,7 @@ import com.getcapacitor.PluginCall
|
|
|
9
9
|
import com.getcapacitor.PluginMethod
|
|
10
10
|
import com.getcapacitor.annotation.CapacitorPlugin
|
|
11
11
|
import com.record360.plugins.SampleRecord360Activity.Companion.DEPARTMENT_INTENT
|
|
12
|
+
import com.record360.plugins.SampleRecord360Activity.Companion.FIELD_DATA_INTENT
|
|
12
13
|
import com.record360.plugins.SampleRecord360Activity.Companion.REFERENCE_NUMBER_INTENT
|
|
13
14
|
import com.record360.plugins.SampleRecord360Activity.Companion.SEQUENCE_INTENT
|
|
14
15
|
import com.record360.plugins.SampleRecord360Activity.Companion.USER_ID_INTENT
|
|
@@ -67,8 +68,10 @@ open class CapacitorRecord360SDKPlugin : Plugin(), IRecord360Interface {
|
|
|
67
68
|
data?.let { dataObj ->
|
|
68
69
|
val department = dataObj.getString("department")
|
|
69
70
|
val sequence = dataObj.getString("sequence")
|
|
71
|
+
val fieldData = dataObj.getJSObject("fieldData")
|
|
70
72
|
department?.let { putExtra(DEPARTMENT_INTENT, it) }
|
|
71
73
|
sequence?.let { putExtra(SEQUENCE_INTENT, it) }
|
|
74
|
+
fieldData?.let { putExtra(FIELD_DATA_INTENT, it.toString()) }
|
|
72
75
|
}
|
|
73
76
|
}
|
|
74
77
|
|
|
@@ -149,11 +152,13 @@ open class CapacitorRecord360SDKPlugin : Plugin(), IRecord360Interface {
|
|
|
149
152
|
|
|
150
153
|
override fun onInspectionUploadProgress(referenceNumber: String?, complete: Long, total: Long) {
|
|
151
154
|
Log.i(TAG, "onInspectionUploadProgress")
|
|
155
|
+
val percentComplete = if (total > 0) complete.toDouble() / total.toDouble() else 0.0
|
|
152
156
|
val data = JSObject().apply {
|
|
153
157
|
put("type", "onInspectionUploadProgress")
|
|
154
158
|
put("referenceNumber", referenceNumber)
|
|
155
159
|
put("bytesComplete", complete)
|
|
156
160
|
put("bytesTotal", total)
|
|
161
|
+
put("percentComplete", percentComplete)
|
|
157
162
|
}
|
|
158
163
|
notifyListeners(EVENT_NAME, data)
|
|
159
164
|
}
|
|
@@ -4,6 +4,7 @@ import android.os.Bundle
|
|
|
4
4
|
import com.record360.sdk.R360Identity
|
|
5
5
|
import com.record360.sdk.Record360Activity
|
|
6
6
|
import com.record360.sdk.ui.insets.EdgeToEdgeInitializer
|
|
7
|
+
import org.json.JSONObject
|
|
7
8
|
|
|
8
9
|
class SampleRecord360Activity: Record360Activity() {
|
|
9
10
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
@@ -15,6 +16,9 @@ class SampleRecord360Activity: Record360Activity() {
|
|
|
15
16
|
val password = if (intent.hasExtra(USER_PASSWORD_INTENT)) intent.getStringExtra(USER_PASSWORD_INTENT) else null
|
|
16
17
|
val department = if (intent.hasExtra(DEPARTMENT_INTENT)) intent.getStringExtra(DEPARTMENT_INTENT) else null
|
|
17
18
|
val sequence = if (intent.hasExtra(SEQUENCE_INTENT)) intent.getStringExtra(SEQUENCE_INTENT) else null
|
|
19
|
+
val fieldData = if (intent.hasExtra(FIELD_DATA_INTENT)) {
|
|
20
|
+
parseFieldData(intent.getStringExtra(FIELD_DATA_INTENT))
|
|
21
|
+
} else null
|
|
18
22
|
val referenceNumber = if (intent.hasExtra(REFERENCE_NUMBER_INTENT)) {
|
|
19
23
|
intent.getStringExtra(REFERENCE_NUMBER_INTENT)
|
|
20
24
|
} else null
|
|
@@ -22,13 +26,23 @@ class SampleRecord360Activity: Record360Activity() {
|
|
|
22
26
|
when {
|
|
23
27
|
userId != null && userToken != null -> {
|
|
24
28
|
val identity = R360Identity.UserTokenIdentity(userId, userToken)
|
|
25
|
-
startRecord360WithIdentity(this, identity, referenceNumber, department, sequence)
|
|
29
|
+
startRecord360WithIdentity(this, identity, referenceNumber, department, sequence, fieldData)
|
|
26
30
|
}
|
|
27
31
|
userName != null && password != null -> {
|
|
28
32
|
val identity = R360Identity.PasswordIdentity(userName, password)
|
|
29
|
-
startRecord360WithIdentity(this, identity, referenceNumber, department, sequence)
|
|
33
|
+
startRecord360WithIdentity(this, identity, referenceNumber, department, sequence, fieldData)
|
|
30
34
|
}
|
|
31
|
-
else -> startRecord360(this, referenceNumber, department, sequence, null)
|
|
35
|
+
else -> startRecord360(this, referenceNumber, department, sequence, null, fieldData)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
private fun parseFieldData(json: String?): Map<String, String>? {
|
|
40
|
+
if (json.isNullOrEmpty()) return null
|
|
41
|
+
return try {
|
|
42
|
+
val obj = JSONObject(json)
|
|
43
|
+
obj.keys().asSequence().associateWith { key -> obj.get(key).toString() }
|
|
44
|
+
} catch (e: Exception) {
|
|
45
|
+
null
|
|
32
46
|
}
|
|
33
47
|
}
|
|
34
48
|
|
|
@@ -36,6 +50,7 @@ class SampleRecord360Activity: Record360Activity() {
|
|
|
36
50
|
var REFERENCE_NUMBER_INTENT = "SampleRecord360Activity.REF_NUM_INTENT"
|
|
37
51
|
var DEPARTMENT_INTENT = "SampleRecord360Activity.DEPARTMENT_INTENT"
|
|
38
52
|
var SEQUENCE_INTENT = "SampleRecord360Activity.SEQUENCE_INTENT"
|
|
53
|
+
var FIELD_DATA_INTENT = "SampleRecord360Activity.FIELD_DATA_INTENT"
|
|
39
54
|
var USER_ID_INTENT = "SampleRecord360Activity.USER_ID"
|
|
40
55
|
var USER_TOKEN_INTENT = "SampleRecord360Activity.USER_TOKEN"
|
|
41
56
|
var USER_NAME_INTENT = "SampleRecord360Activity.USER_NAME"
|
package/dist/docs.json
CHANGED
|
@@ -25,25 +25,26 @@
|
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"name": "launchReferenceCapture",
|
|
28
|
-
"signature": "(options: { referenceNumber: string; department?: string; sequence?: string; identity?: Record360Identity; }) => Promise<void>",
|
|
28
|
+
"signature": "(options: { referenceNumber: string; department?: string; sequence?: string; fieldData?: Record360FieldData; identity?: Record360Identity; }) => Promise<void>",
|
|
29
29
|
"parameters": [
|
|
30
30
|
{
|
|
31
31
|
"name": "options",
|
|
32
32
|
"docs": "",
|
|
33
|
-
"type": "{ referenceNumber: string; department?: string | undefined; sequence?: string | undefined; identity?: Record360Identity | undefined; }"
|
|
33
|
+
"type": "{ referenceNumber: string; department?: string | undefined; sequence?: string | undefined; fieldData?: Record360FieldData | undefined; identity?: Record360Identity | undefined; }"
|
|
34
34
|
}
|
|
35
35
|
],
|
|
36
36
|
"returns": "Promise<void>",
|
|
37
37
|
"tags": [],
|
|
38
38
|
"docs": "",
|
|
39
39
|
"complexTypes": [
|
|
40
|
+
"Record360FieldData",
|
|
40
41
|
"Record360Identity"
|
|
41
42
|
],
|
|
42
43
|
"slug": "launchreferencecapture"
|
|
43
44
|
},
|
|
44
45
|
{
|
|
45
46
|
"name": "addListener",
|
|
46
|
-
"signature": "(eventName: 'Record360Event', listenerFunc: (data: { type: 'onFailedToAuthenticate' | 'onInspectionCancelled' | 'onInspectionComplete' | 'onInspectionUploadFailed' | 'onInspectionUploadProgress' | 'onInspectionUploaded' | 'onInspectionStarted' | 'onUserAuthenticated'; referenceNumber?: string; bytesComplete?: number; bytesTotal?: number; error?: string; userId?: string; username?: string; inspectionJSON?: string; }) => void) => Promise<PluginListenerHandle>",
|
|
47
|
+
"signature": "(eventName: 'Record360Event', listenerFunc: (data: { type: 'onFailedToAuthenticate' | 'onInspectionCancelled' | 'onInspectionComplete' | 'onInspectionUploadFailed' | 'onInspectionUploadProgress' | 'onInspectionUploaded' | 'onInspectionStarted' | 'onUserAuthenticated'; referenceNumber?: string; bytesComplete?: number; bytesTotal?: number; percentComplete?: number; error?: string; userId?: string; username?: string; inspectionJSON?: string; }) => void) => Promise<PluginListenerHandle>",
|
|
47
48
|
"parameters": [
|
|
48
49
|
{
|
|
49
50
|
"name": "eventName",
|
|
@@ -53,7 +54,7 @@
|
|
|
53
54
|
{
|
|
54
55
|
"name": "listenerFunc",
|
|
55
56
|
"docs": "",
|
|
56
|
-
"type": "(data: { type: 'onFailedToAuthenticate' | 'onInspectionCancelled' | 'onInspectionComplete' | 'onInspectionUploadFailed' | 'onInspectionUploadProgress' | 'onInspectionUploaded' | 'onInspectionStarted' | 'onUserAuthenticated'; referenceNumber?: string | undefined; bytesComplete?: number | undefined; bytesTotal?: number | undefined; error?: string | undefined; userId?: string | undefined; username?: string | undefined; inspectionJSON?: string | undefined; }) => void"
|
|
57
|
+
"type": "(data: { type: 'onFailedToAuthenticate' | 'onInspectionCancelled' | 'onInspectionComplete' | 'onInspectionUploadFailed' | 'onInspectionUploadProgress' | 'onInspectionUploaded' | 'onInspectionStarted' | 'onUserAuthenticated'; referenceNumber?: string | undefined; bytesComplete?: number | undefined; bytesTotal?: number | undefined; percentComplete?: number | undefined; error?: string | undefined; userId?: string | undefined; username?: string | undefined; inspectionJSON?: string | undefined; }) => void"
|
|
57
58
|
}
|
|
58
59
|
],
|
|
59
60
|
"returns": "Promise<PluginListenerHandle>",
|
|
@@ -151,6 +152,17 @@
|
|
|
151
152
|
]
|
|
152
153
|
}
|
|
153
154
|
]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"name": "Record360FieldData",
|
|
158
|
+
"slug": "record360fielddata",
|
|
159
|
+
"docs": "",
|
|
160
|
+
"types": [
|
|
161
|
+
{
|
|
162
|
+
"text": "{ [key: string]: unknown }",
|
|
163
|
+
"complexTypes": []
|
|
164
|
+
}
|
|
165
|
+
]
|
|
154
166
|
}
|
|
155
167
|
],
|
|
156
168
|
"pluginConfigs": []
|
|
@@ -8,12 +8,16 @@ export interface R360UserTokenIdentity {
|
|
|
8
8
|
userId: string;
|
|
9
9
|
userToken: string;
|
|
10
10
|
}
|
|
11
|
+
export declare type Record360FieldData = {
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
};
|
|
11
14
|
export interface CapacitorRecord360SDKPlugin {
|
|
12
15
|
launchRecord360(identity?: Record360Identity): Promise<void>;
|
|
13
16
|
launchReferenceCapture(options: {
|
|
14
17
|
referenceNumber: string;
|
|
15
18
|
department?: string;
|
|
16
19
|
sequence?: string;
|
|
20
|
+
fieldData?: Record360FieldData;
|
|
17
21
|
identity?: Record360Identity;
|
|
18
22
|
}): Promise<void>;
|
|
19
23
|
addListener(eventName: 'Record360Event', listenerFunc: (data: {
|
|
@@ -21,6 +25,7 @@ export interface CapacitorRecord360SDKPlugin {
|
|
|
21
25
|
referenceNumber?: string;
|
|
22
26
|
bytesComplete?: number;
|
|
23
27
|
bytesTotal?: number;
|
|
28
|
+
percentComplete?: number;
|
|
24
29
|
error?: string;
|
|
25
30
|
userId?: string;
|
|
26
31
|
username?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from \"@capacitor/core\"\nexport type Record360Identity = R360PasswordIdentity | R360UserTokenIdentity\n\nexport interface R360PasswordIdentity {\n username: string,\n password: string\n}\n\nexport interface R360UserTokenIdentity {\n userId: string,\n userToken: string\n}\n\nexport interface CapacitorRecord360SDKPlugin {\n launchRecord360(identity?: Record360Identity): Promise<void>\n\n launchReferenceCapture(options: {\n referenceNumber: string,\n department?: string,\n sequence?: string,\n identity?: Record360Identity\n }): Promise<void>\n\n addListener(\n eventName: 'Record360Event',\n listenerFunc: (\n data: { \n type: 'onFailedToAuthenticate' | 'onInspectionCancelled' | 'onInspectionComplete' | 'onInspectionUploadFailed' | 'onInspectionUploadProgress' | 'onInspectionUploaded' | 'onInspectionStarted' | 'onUserAuthenticated',\n referenceNumber?: string,\n bytesComplete?: number,\n bytesTotal?: number,\n error?: string,\n userId?: string,\n username?: string,\n inspectionJSON?: string\n }\n ) => void,\n ): Promise<PluginListenerHandle>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginListenerHandle } from \"@capacitor/core\"\nexport type Record360Identity = R360PasswordIdentity | R360UserTokenIdentity\n\nexport interface R360PasswordIdentity {\n username: string,\n password: string\n}\n\nexport interface R360UserTokenIdentity {\n userId: string,\n userToken: string\n}\n\nexport type Record360FieldData = { [key: string]: unknown }\n\nexport interface CapacitorRecord360SDKPlugin {\n launchRecord360(identity?: Record360Identity): Promise<void>\n\n launchReferenceCapture(options: {\n referenceNumber: string,\n department?: string,\n sequence?: string,\n fieldData?: Record360FieldData,\n identity?: Record360Identity\n }): Promise<void>\n\n addListener(\n eventName: 'Record360Event',\n listenerFunc: (\n data: { \n type: 'onFailedToAuthenticate' | 'onInspectionCancelled' | 'onInspectionComplete' | 'onInspectionUploadFailed' | 'onInspectionUploadProgress' | 'onInspectionUploaded' | 'onInspectionStarted' | 'onUserAuthenticated',\n referenceNumber?: string,\n bytesComplete?: number,\n bytesTotal?: number,\n percentComplete?: number,\n error?: string,\n userId?: string,\n username?: string,\n inspectionJSON?: string\n }\n ) => void,\n ): Promise<PluginListenerHandle>;\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ListenerCallback, PluginListenerHandle, WebPlugin } from '@capacitor/core';
|
|
2
|
-
import type { CapacitorRecord360SDKPlugin, Record360Identity } from './definitions';
|
|
2
|
+
import type { CapacitorRecord360SDKPlugin, Record360FieldData, Record360Identity } from './definitions';
|
|
3
3
|
export declare class CapacitorRecord360SDKWeb extends WebPlugin implements CapacitorRecord360SDKPlugin {
|
|
4
4
|
launchRecord360(_?: Record360Identity): Promise<void>;
|
|
5
5
|
launchReferenceCapture(_: {
|
|
6
6
|
referenceNumber: string;
|
|
7
7
|
department?: string;
|
|
8
8
|
sequence?: string;
|
|
9
|
+
fieldData?: Record360FieldData;
|
|
9
10
|
identity?: Record360Identity;
|
|
10
11
|
}): Promise<void>;
|
|
11
12
|
addListener(_eventName: string, _listenerFunc: ListenerCallback): Promise<PluginListenerHandle>;
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIpF,MAAM,OAAO,wBAAyB,SAAQ,SAAS;IACrD,eAAe,CAAC,CAAqB;QACnC,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,sBAAsB,CAAC,
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIpF,MAAM,OAAO,wBAAyB,SAAQ,SAAS;IACrD,eAAe,CAAC,CAAqB;QACnC,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,sBAAsB,CAAC,CAAqI;QACxJ,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC5C,CAAC;IAED,WAAW,CAAC,UAAkB,EAAE,aAA+B;QAC3D,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC5C,CAAC;CACF","sourcesContent":["import { ListenerCallback, PluginListenerHandle, WebPlugin } from '@capacitor/core';\n\nimport type { CapacitorRecord360SDKPlugin, Record360FieldData, Record360Identity } from './definitions';\n\nexport class CapacitorRecord360SDKWeb extends WebPlugin implements CapacitorRecord360SDKPlugin {\n launchRecord360(_?: Record360Identity): Promise<void> {\n throw new Error(\"Not available on web.\");\n }\n\n launchReferenceCapture(_: { referenceNumber: string; department?: string; sequence?: string; fieldData?: Record360FieldData; identity?: Record360Identity; }): Promise<void> {\n throw new Error(\"Not available on web\");\n }\n \n addListener(_eventName: string, _listenerFunc: ListenerCallback): Promise<PluginListenerHandle> {\n throw new Error(\"Not available on web\");\n }\n}"]}
|
|
@@ -53,7 +53,7 @@ public class CapacitorRecord360SDKPlugin: CAPPlugin, CAPBridgedPlugin, Record360
|
|
|
53
53
|
let identity = Record360Identity(userID: userId!, userToken: userToken!)
|
|
54
54
|
loadR360SDK(identity: identity, presentingVC: presentingVC)
|
|
55
55
|
} else {
|
|
56
|
-
loadR360SDKLogin(referenceNumber: nil, department: nil, sequence: nil, presentingVC: presentingVC)
|
|
56
|
+
loadR360SDKLogin(referenceNumber: nil, department: nil, sequence: nil, fieldData: nil, presentingVC: presentingVC)
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -71,6 +71,7 @@ public class CapacitorRecord360SDKPlugin: CAPPlugin, CAPBridgedPlugin, Record360
|
|
|
71
71
|
|
|
72
72
|
let department = call.getString("department")
|
|
73
73
|
let sequence = call.getString("sequence")
|
|
74
|
+
let fieldData = call.getObject("fieldData")
|
|
74
75
|
let identityObj = call.getObject("identity")
|
|
75
76
|
let username = identityObj?["username"] as? String
|
|
76
77
|
let password = identityObj?["password"] as? String
|
|
@@ -79,21 +80,21 @@ public class CapacitorRecord360SDKPlugin: CAPPlugin, CAPBridgedPlugin, Record360
|
|
|
79
80
|
|
|
80
81
|
if (username != nil && password != nil) {
|
|
81
82
|
let identity = Record360Identity(userName: username!, password: password!)
|
|
82
|
-
loadR360SDKForInspection(identity: identity, referenceNumber: referenceNumber!, department: department, sequence: sequence, presentingVC: presentingVC)
|
|
83
|
+
loadR360SDKForInspection(identity: identity, referenceNumber: referenceNumber!, department: department, sequence: sequence, fieldData: fieldData, presentingVC: presentingVC)
|
|
83
84
|
} else if (userId != nil && userToken != nil) {
|
|
84
85
|
let identity = Record360Identity(userID: userId!, userToken: userToken!)
|
|
85
|
-
loadR360SDKForInspection(identity: identity, referenceNumber: referenceNumber!, department: department, sequence: sequence, presentingVC: presentingVC)
|
|
86
|
+
loadR360SDKForInspection(identity: identity, referenceNumber: referenceNumber!, department: department, sequence: sequence, fieldData: fieldData, presentingVC: presentingVC)
|
|
86
87
|
} else {
|
|
87
|
-
loadR360SDKLogin(referenceNumber: referenceNumber, department: department, sequence: sequence, presentingVC: presentingVC)
|
|
88
|
+
loadR360SDKLogin(referenceNumber: referenceNumber, department: department, sequence: sequence, fieldData: fieldData, presentingVC: presentingVC)
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
|
|
91
|
-
private func loadR360SDKLogin(referenceNumber: String?, department: String?, sequence: String?, presentingVC: UIViewController) {
|
|
92
|
+
private func loadR360SDKLogin(referenceNumber: String?, department: String?, sequence: String?, fieldData: JSObject?, presentingVC: UIViewController) {
|
|
92
93
|
DispatchQueue.main.async {
|
|
93
94
|
self.hostSDKViewController {
|
|
94
95
|
let identity = Record360Identity(userName: "", password: nil)
|
|
95
96
|
if (referenceNumber != nil) {
|
|
96
|
-
self.record360?.launchReferenceCapture(referenceNumber, departmentReference: department, sequenceReference: sequence, identity: identity)
|
|
97
|
+
self.record360?.launchReferenceCapture(referenceNumber, departmentReference: department, sequenceReference: sequence, fieldData: fieldData, identity: identity)
|
|
97
98
|
} else {
|
|
98
99
|
self.record360?.launch(identity)
|
|
99
100
|
}
|
|
@@ -111,10 +112,10 @@ public class CapacitorRecord360SDKPlugin: CAPPlugin, CAPBridgedPlugin, Record360
|
|
|
111
112
|
}
|
|
112
113
|
}
|
|
113
114
|
|
|
114
|
-
private func loadR360SDKForInspection(identity: Record360Identity, referenceNumber: String, department: String?, sequence: String?, presentingVC: UIViewController) {
|
|
115
|
+
private func loadR360SDKForInspection(identity: Record360Identity, referenceNumber: String, department: String?, sequence: String?, fieldData: JSObject?, presentingVC: UIViewController) {
|
|
115
116
|
DispatchQueue.main.async {
|
|
116
117
|
self.hostSDKViewController {
|
|
117
|
-
self.record360?.launchReferenceCapture(referenceNumber, departmentReference: department, sequenceReference: sequence, identity: identity)
|
|
118
|
+
self.record360?.launchReferenceCapture(referenceNumber, departmentReference: department, sequenceReference: sequence, fieldData: fieldData, identity: identity)
|
|
118
119
|
self.applySettings()
|
|
119
120
|
}
|
|
120
121
|
}
|
|
@@ -158,8 +159,8 @@ public class CapacitorRecord360SDKPlugin: CAPPlugin, CAPBridgedPlugin, Record360
|
|
|
158
159
|
|
|
159
160
|
public func onInspectionUploaded(forReferenceNumber referenceNumber: String, inspectionJSON: [AnyHashable : Any]) {
|
|
160
161
|
var data = JSObject()
|
|
161
|
-
if let
|
|
162
|
-
data["inspectionJSON"] =
|
|
162
|
+
if let json = self.dictionaryToJSONString(inspectionJSON) {
|
|
163
|
+
data["inspectionJSON"] = json
|
|
163
164
|
}
|
|
164
165
|
data["type"] = "onInspectionUploaded"
|
|
165
166
|
data["referenceNumber"] = referenceNumber
|
|
@@ -172,7 +173,15 @@ public class CapacitorRecord360SDKPlugin: CAPPlugin, CAPBridgedPlugin, Record360
|
|
|
172
173
|
data["referenceNumber"] = referenceNumber
|
|
173
174
|
notifyListeners("Record360Event", data: data)
|
|
174
175
|
}
|
|
175
|
-
|
|
176
|
+
|
|
177
|
+
public func onInspectionUploadProgress(_ refNum: String, percentComplete: CGFloat) {
|
|
178
|
+
var data = JSObject()
|
|
179
|
+
data["type"] = "onInspectionUploadProgress"
|
|
180
|
+
data["referenceNumber"] = refNum
|
|
181
|
+
data["percentComplete"] = Double(percentComplete)
|
|
182
|
+
notifyListeners("Record360Event", data: data)
|
|
183
|
+
}
|
|
184
|
+
|
|
176
185
|
func dictionaryToJSONString(_ dict: [AnyHashable: Any]) -> String? {
|
|
177
186
|
do {
|
|
178
187
|
// Check if the dictionary is valid for JSON serialization
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "capacitor-record360sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.26.0",
|
|
4
4
|
"description": "Capacitor wrapper for Record360SDK",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"prepublishOnly": "npm run build"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@capacitor/android": "^
|
|
50
|
-
"@capacitor/cli": "^
|
|
51
|
-
"@capacitor/core": "^
|
|
49
|
+
"@capacitor/android": "^8.4.0",
|
|
50
|
+
"@capacitor/cli": "^8.4.0",
|
|
51
|
+
"@capacitor/core": "^8.4.0",
|
|
52
52
|
"@capacitor/docgen": "^0.2.2",
|
|
53
|
-
"@capacitor/ios": "^
|
|
53
|
+
"@capacitor/ios": "^8.4.0",
|
|
54
54
|
"@ionic/eslint-config": "^0.4.0",
|
|
55
55
|
"@ionic/prettier-config": "^4.0.0",
|
|
56
56
|
"@ionic/swiftlint-config": "^2.0.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"typescript": "~4.1.5"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@capacitor/core": "^
|
|
66
|
+
"@capacitor/core": "^8.4.0"
|
|
67
67
|
},
|
|
68
68
|
"prettier": "@ionic/prettier-config",
|
|
69
69
|
"swiftlint": "@ionic/swiftlint-config",
|