capacitor-record360sdk 7.24.0 → 7.25.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 +1 -1
- package/README.md +4 -4
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/record360/plugins/CapacitorRecord360SDKPlugin.kt +10 -11
- package/android/src/main/java/com/record360/plugins/SampleRecord360Activity.kt +7 -9
- package/dist/docs.json +2 -2
- package/dist/esm/definitions.d.ts +2 -2
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +2 -2
- package/dist/esm/web.js.map +1 -1
- package/ios/Sources/CapacitorRecord360SDKPlugin/CapacitorRecord360SDKPlugin.swift +10 -10
- package/package.json +3 -3
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;
|
|
43
|
+
launchReferenceCapture(options: { referenceNumber: string; department?: string; sequence?: string; identity?: Record360Identity; }) => Promise<void>
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
| Param | Type
|
|
47
|
-
| ------------- |
|
|
48
|
-
| **`options`** | <code>{ referenceNumber: string;
|
|
46
|
+
| Param | Type |
|
|
47
|
+
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
48
|
+
| **`options`** | <code>{ referenceNumber: string; department?: string; sequence?: string; identity?: <a href="#record360identity">Record360Identity</a>; }</code> |
|
|
49
49
|
|
|
50
50
|
--------------------
|
|
51
51
|
|
package/android/build.gradle
CHANGED
|
@@ -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.25.3'
|
|
105
105
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
|
|
106
106
|
}
|
|
@@ -8,12 +8,13 @@ import com.getcapacitor.Plugin
|
|
|
8
8
|
import com.getcapacitor.PluginCall
|
|
9
9
|
import com.getcapacitor.PluginMethod
|
|
10
10
|
import com.getcapacitor.annotation.CapacitorPlugin
|
|
11
|
+
import com.record360.plugins.SampleRecord360Activity.Companion.DEPARTMENT_INTENT
|
|
12
|
+
import com.record360.plugins.SampleRecord360Activity.Companion.REFERENCE_NUMBER_INTENT
|
|
13
|
+
import com.record360.plugins.SampleRecord360Activity.Companion.SEQUENCE_INTENT
|
|
11
14
|
import com.record360.plugins.SampleRecord360Activity.Companion.USER_ID_INTENT
|
|
12
15
|
import com.record360.plugins.SampleRecord360Activity.Companion.USER_NAME_INTENT
|
|
13
16
|
import com.record360.plugins.SampleRecord360Activity.Companion.USER_PASSWORD_INTENT
|
|
14
17
|
import com.record360.plugins.SampleRecord360Activity.Companion.USER_TOKEN_INTENT
|
|
15
|
-
import com.record360.plugins.SampleRecord360Activity.Companion.WORK_ORDER_ID_INTENT
|
|
16
|
-
import com.record360.plugins.SampleRecord360Activity.Companion.WORK_ORDER_LABEL_INTENT
|
|
17
18
|
import com.record360.sdk.IRecord360Interface
|
|
18
19
|
import com.record360.sdk.R360Identity
|
|
19
20
|
import com.record360.sdk.Record360SDK
|
|
@@ -42,10 +43,9 @@ open class CapacitorRecord360SDKPlugin : Plugin(), IRecord360Interface {
|
|
|
42
43
|
|
|
43
44
|
private fun startRefCap(referenceNumber: String, data: JSObject?) {
|
|
44
45
|
val intent = Intent(bridge.context, SampleRecord360Activity::class.java)
|
|
45
|
-
intent.putExtra(SampleRecord360Activity.REFERENCE_NUMBER_INTENT, referenceNumber)
|
|
46
46
|
val identity = checkForIdentity(data?.getJSObject("identity"))
|
|
47
47
|
identity?.let { intent.addIdentity(it) }
|
|
48
|
-
intent.
|
|
48
|
+
intent.refCapIntent(referenceNumber, data)
|
|
49
49
|
context.startActivity(intent)
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -62,14 +62,13 @@ open class CapacitorRecord360SDKPlugin : Plugin(), IRecord360Interface {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
private fun Intent.
|
|
65
|
+
private fun Intent.refCapIntent(referenceNumber: String, data: JSObject?) {
|
|
66
|
+
putExtra(REFERENCE_NUMBER_INTENT, referenceNumber)
|
|
66
67
|
data?.let { dataObj ->
|
|
67
|
-
val
|
|
68
|
-
val
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
workOrderLabel?.let { putExtra(WORK_ORDER_LABEL_INTENT, it) }
|
|
72
|
-
}
|
|
68
|
+
val department = dataObj.getString("department")
|
|
69
|
+
val sequence = dataObj.getString("sequence")
|
|
70
|
+
department?.let { putExtra(DEPARTMENT_INTENT, it) }
|
|
71
|
+
sequence?.let { putExtra(SEQUENCE_INTENT, it) }
|
|
73
72
|
}
|
|
74
73
|
}
|
|
75
74
|
|
|
@@ -13,10 +13,8 @@ class SampleRecord360Activity: Record360Activity() {
|
|
|
13
13
|
val userToken = if (intent.hasExtra(USER_TOKEN_INTENT)) intent.getStringExtra(USER_TOKEN_INTENT) else null
|
|
14
14
|
val userName = if (intent.hasExtra(USER_NAME_INTENT)) intent.getStringExtra(USER_NAME_INTENT) else null
|
|
15
15
|
val password = if (intent.hasExtra(USER_PASSWORD_INTENT)) intent.getStringExtra(USER_PASSWORD_INTENT) else null
|
|
16
|
-
val
|
|
17
|
-
|
|
18
|
-
val workOrderLabel = if (intent.hasExtra(WORK_ORDER_LABEL_INTENT)) intent.getStringExtra(
|
|
19
|
-
WORK_ORDER_LABEL_INTENT) else null
|
|
16
|
+
val department = if (intent.hasExtra(DEPARTMENT_INTENT)) intent.getStringExtra(DEPARTMENT_INTENT) else null
|
|
17
|
+
val sequence = if (intent.hasExtra(SEQUENCE_INTENT)) intent.getStringExtra(SEQUENCE_INTENT) else null
|
|
20
18
|
val referenceNumber = if (intent.hasExtra(REFERENCE_NUMBER_INTENT)) {
|
|
21
19
|
intent.getStringExtra(REFERENCE_NUMBER_INTENT)
|
|
22
20
|
} else null
|
|
@@ -24,20 +22,20 @@ class SampleRecord360Activity: Record360Activity() {
|
|
|
24
22
|
when {
|
|
25
23
|
userId != null && userToken != null -> {
|
|
26
24
|
val identity = R360Identity.UserTokenIdentity(userId, userToken)
|
|
27
|
-
startRecord360WithIdentity(this, identity, referenceNumber,
|
|
25
|
+
startRecord360WithIdentity(this, identity, referenceNumber, department, sequence)
|
|
28
26
|
}
|
|
29
27
|
userName != null && password != null -> {
|
|
30
28
|
val identity = R360Identity.PasswordIdentity(userName, password)
|
|
31
|
-
startRecord360WithIdentity(this, identity, referenceNumber,
|
|
29
|
+
startRecord360WithIdentity(this, identity, referenceNumber, department, sequence)
|
|
32
30
|
}
|
|
33
|
-
else -> startRecord360(this, referenceNumber,
|
|
31
|
+
else -> startRecord360(this, referenceNumber, department, sequence, null)
|
|
34
32
|
}
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
companion object {
|
|
38
36
|
var REFERENCE_NUMBER_INTENT = "SampleRecord360Activity.REF_NUM_INTENT"
|
|
39
|
-
var
|
|
40
|
-
var
|
|
37
|
+
var DEPARTMENT_INTENT = "SampleRecord360Activity.DEPARTMENT_INTENT"
|
|
38
|
+
var SEQUENCE_INTENT = "SampleRecord360Activity.SEQUENCE_INTENT"
|
|
41
39
|
var USER_ID_INTENT = "SampleRecord360Activity.USER_ID"
|
|
42
40
|
var USER_TOKEN_INTENT = "SampleRecord360Activity.USER_TOKEN"
|
|
43
41
|
var USER_NAME_INTENT = "SampleRecord360Activity.USER_NAME"
|
package/dist/docs.json
CHANGED
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"name": "launchReferenceCapture",
|
|
28
|
-
"signature": "(options: { referenceNumber: string;
|
|
28
|
+
"signature": "(options: { referenceNumber: string; department?: string; sequence?: string; identity?: Record360Identity; }) => Promise<void>",
|
|
29
29
|
"parameters": [
|
|
30
30
|
{
|
|
31
31
|
"name": "options",
|
|
32
32
|
"docs": "",
|
|
33
|
-
"type": "{ referenceNumber: string;
|
|
33
|
+
"type": "{ referenceNumber: string; department?: string | undefined; sequence?: string | undefined; identity?: Record360Identity | undefined; }"
|
|
34
34
|
}
|
|
35
35
|
],
|
|
36
36
|
"returns": "Promise<void>",
|
|
@@ -12,8 +12,8 @@ export interface CapacitorRecord360SDKPlugin {
|
|
|
12
12
|
launchRecord360(identity?: Record360Identity): Promise<void>;
|
|
13
13
|
launchReferenceCapture(options: {
|
|
14
14
|
referenceNumber: string;
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
department?: string;
|
|
16
|
+
sequence?: string;
|
|
17
17
|
identity?: Record360Identity;
|
|
18
18
|
}): Promise<void>;
|
|
19
19
|
addListener(eventName: 'Record360Event', listenerFunc: (data: {
|
|
@@ -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
|
|
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"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ export declare class CapacitorRecord360SDKWeb extends WebPlugin implements Capac
|
|
|
4
4
|
launchRecord360(_?: Record360Identity): Promise<void>;
|
|
5
5
|
launchReferenceCapture(_: {
|
|
6
6
|
referenceNumber: string;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
department?: string;
|
|
8
|
+
sequence?: string;
|
|
9
9
|
identity?: Record360Identity;
|
|
10
10
|
}): Promise<void>;
|
|
11
11
|
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,CAAqG;QACxH,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, 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; 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,
|
|
56
|
+
loadR360SDKLogin(referenceNumber: nil, department: nil, sequence: nil, presentingVC: presentingVC)
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -69,8 +69,8 @@ public class CapacitorRecord360SDKPlugin: CAPPlugin, CAPBridgedPlugin, Record360
|
|
|
69
69
|
call.reject("Reference number is required")
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
let
|
|
73
|
-
let
|
|
72
|
+
let department = call.getString("department")
|
|
73
|
+
let sequence = call.getString("sequence")
|
|
74
74
|
let identityObj = call.getObject("identity")
|
|
75
75
|
let username = identityObj?["username"] as? String
|
|
76
76
|
let password = identityObj?["password"] as? String
|
|
@@ -79,21 +79,21 @@ public class CapacitorRecord360SDKPlugin: CAPPlugin, CAPBridgedPlugin, Record360
|
|
|
79
79
|
|
|
80
80
|
if (username != nil && password != nil) {
|
|
81
81
|
let identity = Record360Identity(userName: username!, password: password!)
|
|
82
|
-
loadR360SDKForInspection(identity: identity, referenceNumber: referenceNumber!,
|
|
82
|
+
loadR360SDKForInspection(identity: identity, referenceNumber: referenceNumber!, department: department, sequence: sequence, presentingVC: presentingVC)
|
|
83
83
|
} else if (userId != nil && userToken != nil) {
|
|
84
84
|
let identity = Record360Identity(userID: userId!, userToken: userToken!)
|
|
85
|
-
loadR360SDKForInspection(identity: identity, referenceNumber: referenceNumber!,
|
|
85
|
+
loadR360SDKForInspection(identity: identity, referenceNumber: referenceNumber!, department: department, sequence: sequence, presentingVC: presentingVC)
|
|
86
86
|
} else {
|
|
87
|
-
loadR360SDKLogin(referenceNumber: referenceNumber,
|
|
87
|
+
loadR360SDKLogin(referenceNumber: referenceNumber, department: department, sequence: sequence, presentingVC: presentingVC)
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
private func loadR360SDKLogin(referenceNumber: String?,
|
|
91
|
+
private func loadR360SDKLogin(referenceNumber: String?, department: String?, sequence: String?, presentingVC: UIViewController) {
|
|
92
92
|
DispatchQueue.main.async {
|
|
93
93
|
self.hostSDKViewController {
|
|
94
94
|
let identity = Record360Identity(userName: "", password: nil)
|
|
95
95
|
if (referenceNumber != nil) {
|
|
96
|
-
self.record360?.launchReferenceCapture(referenceNumber,
|
|
96
|
+
self.record360?.launchReferenceCapture(referenceNumber, departmentReference: department, sequenceReference: sequence, identity: identity)
|
|
97
97
|
} else {
|
|
98
98
|
self.record360?.launch(identity)
|
|
99
99
|
}
|
|
@@ -111,10 +111,10 @@ public class CapacitorRecord360SDKPlugin: CAPPlugin, CAPBridgedPlugin, Record360
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
private func loadR360SDKForInspection(identity: Record360Identity, referenceNumber: String,
|
|
114
|
+
private func loadR360SDKForInspection(identity: Record360Identity, referenceNumber: String, department: String?, sequence: String?, presentingVC: UIViewController) {
|
|
115
115
|
DispatchQueue.main.async {
|
|
116
116
|
self.hostSDKViewController {
|
|
117
|
-
self.record360?.launchReferenceCapture(referenceNumber,
|
|
117
|
+
self.record360?.launchReferenceCapture(referenceNumber, departmentReference: department, sequenceReference: sequence, identity: identity)
|
|
118
118
|
self.applySettings()
|
|
119
119
|
}
|
|
120
120
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "capacitor-record360sdk",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.25.0",
|
|
4
4
|
"description": "Capacitor wrapper for Record360SDK",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"license": "Apache-2.0",
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
22
|
-
"url": "git+https://github.com/Record360/record360-capacitor-plugin.git
|
|
22
|
+
"url": "git+https://github.com/Record360/record360-capacitor-plugin.git"
|
|
23
23
|
},
|
|
24
24
|
"bugs": {
|
|
25
|
-
"url": "https://github.com/Record360/record360-capacitor-plugin
|
|
25
|
+
"url": "https://github.com/Record360/record360-capacitor-plugin/issues"
|
|
26
26
|
},
|
|
27
27
|
"keywords": [
|
|
28
28
|
"capacitor",
|