@simplymobile/capacitor-godex-printer 1.0.0 → 2.0.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/README.md +16 -16
- package/SimplymobileCapacitorGodexPrinter.podspec +17 -17
- package/android/build.gradle +57 -56
- package/android/src/main/AndroidManifest.xml +3 -3
- package/android/src/main/java/pl/simplymobile/plugins/godexprinter/GodexPrinterPlugin.java +122 -122
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.js.map +1 -1
- package/ios/Plugin/GodexPrinter.swift +8 -8
- package/ios/Plugin/GodexPrinterPlugin.h +10 -10
- package/ios/Plugin/GodexPrinterPlugin.m +8 -8
- package/ios/Plugin/GodexPrinterPlugin.swift +18 -18
- package/ios/Plugin/Info.plist +24 -24
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
# @simplymobile/capacitor-godex-printer
|
|
2
|
-
|
|
3
|
-
Capacitor GoDEX printer plugin
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @simplymobile/capacitor-godex-printer
|
|
9
|
-
npx cap sync
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
## API
|
|
13
|
-
|
|
1
|
+
# @simplymobile/capacitor-godex-printer
|
|
2
|
+
|
|
3
|
+
Capacitor GoDEX printer plugin
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @simplymobile/capacitor-godex-printer
|
|
9
|
+
npx cap sync
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## API
|
|
13
|
+
|
|
14
14
|
<docgen-index>
|
|
15
15
|
|
|
16
16
|
* [`getVersion()`](#getversion)
|
|
@@ -19,8 +19,8 @@ npx cap sync
|
|
|
19
19
|
* [`disconnect()`](#disconnect)
|
|
20
20
|
* [`getPrinterDPI()`](#getprinterdpi)
|
|
21
21
|
|
|
22
|
-
</docgen-index>
|
|
23
|
-
|
|
22
|
+
</docgen-index>
|
|
23
|
+
|
|
24
24
|
<docgen-api>
|
|
25
25
|
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
|
|
26
26
|
|
|
@@ -82,4 +82,4 @@ getPrinterDPI() => Promise<{ value: number; }>
|
|
|
82
82
|
|
|
83
83
|
--------------------
|
|
84
84
|
|
|
85
|
-
</docgen-api>
|
|
85
|
+
</docgen-api>
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
require 'json'
|
|
2
|
-
|
|
3
|
-
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
|
-
|
|
5
|
-
Pod::Spec.new do |s|
|
|
6
|
-
s.name = 'SimplymobileCapacitorGodexPrinter'
|
|
7
|
-
s.version = package['version']
|
|
8
|
-
s.summary = package['description']
|
|
9
|
-
s.license = package['license']
|
|
10
|
-
s.homepage = package['repository']['url']
|
|
11
|
-
s.author = package['author']
|
|
12
|
-
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
|
|
13
|
-
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
-
s.ios.deployment_target = '13.0'
|
|
15
|
-
s.dependency 'Capacitor'
|
|
16
|
-
s.swift_version = '5.1'
|
|
17
|
-
end
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = 'SimplymobileCapacitorGodexPrinter'
|
|
7
|
+
s.version = package['version']
|
|
8
|
+
s.summary = package['description']
|
|
9
|
+
s.license = package['license']
|
|
10
|
+
s.homepage = package['repository']['url']
|
|
11
|
+
s.author = package['author']
|
|
12
|
+
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
|
|
13
|
+
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
+
s.ios.deployment_target = '13.0'
|
|
15
|
+
s.dependency 'Capacitor'
|
|
16
|
+
s.swift_version = '5.1'
|
|
17
|
+
end
|
package/android/build.gradle
CHANGED
|
@@ -1,57 +1,58 @@
|
|
|
1
|
-
ext {
|
|
2
|
-
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.
|
|
4
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.
|
|
5
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
buildscript {
|
|
9
|
-
repositories {
|
|
10
|
-
google()
|
|
11
|
-
mavenCentral()
|
|
12
|
-
}
|
|
13
|
-
dependencies {
|
|
14
|
-
classpath 'com.android.tools.build:gradle:
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
apply plugin: 'com.android.library'
|
|
19
|
-
|
|
1
|
+
ext {
|
|
2
|
+
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
|
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
buildscript {
|
|
9
|
+
repositories {
|
|
10
|
+
google()
|
|
11
|
+
mavenCentral()
|
|
12
|
+
}
|
|
13
|
+
dependencies {
|
|
14
|
+
classpath 'com.android.tools.build:gradle:8.0.0'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
apply plugin: 'com.android.library'
|
|
19
|
+
|
|
20
20
|
android {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
implementation
|
|
53
|
-
implementation
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
androidTestImplementation "androidx.test.
|
|
57
|
-
|
|
21
|
+
namespace "pl.simplymobile.plugins.godexprinter"
|
|
22
|
+
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
|
|
23
|
+
defaultConfig {
|
|
24
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
|
|
25
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
|
|
26
|
+
versionCode 1
|
|
27
|
+
versionName "1.0"
|
|
28
|
+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
29
|
+
}
|
|
30
|
+
buildTypes {
|
|
31
|
+
release {
|
|
32
|
+
minifyEnabled false
|
|
33
|
+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
lintOptions {
|
|
37
|
+
abortOnError false
|
|
38
|
+
}
|
|
39
|
+
compileOptions {
|
|
40
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
41
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
repositories {
|
|
46
|
+
google()
|
|
47
|
+
mavenCentral()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
dependencies {
|
|
52
|
+
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
53
|
+
implementation project(':capacitor-android')
|
|
54
|
+
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
55
|
+
testImplementation "junit:junit:$junitVersion"
|
|
56
|
+
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
57
|
+
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
58
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
-
|
|
3
|
-
</manifest>
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
+
>
|
|
3
|
+
</manifest>
|
|
@@ -1,122 +1,122 @@
|
|
|
1
|
-
package pl.simplymobile.plugins.godexprinter;
|
|
2
|
-
|
|
3
|
-
import android.util.Log;
|
|
4
|
-
|
|
5
|
-
import com.getcapacitor.JSObject;
|
|
6
|
-
import com.getcapacitor.Plugin;
|
|
7
|
-
import com.getcapacitor.PluginCall;
|
|
8
|
-
import com.getcapacitor.PluginMethod;
|
|
9
|
-
import com.getcapacitor.annotation.CapacitorPlugin;
|
|
10
|
-
import com.godex.Godex;
|
|
11
|
-
|
|
12
|
-
import java.io.IOException;
|
|
13
|
-
|
|
14
|
-
@CapacitorPlugin(name = "GodexPrinter")
|
|
15
|
-
public class GodexPrinterPlugin extends Plugin {
|
|
16
|
-
|
|
17
|
-
private boolean connected = false;
|
|
18
|
-
|
|
19
|
-
@Override
|
|
20
|
-
public void load() {
|
|
21
|
-
Godex.debug(3);
|
|
22
|
-
var context = this.getActivity().getApplicationContext();
|
|
23
|
-
Godex.getMainContext(context);
|
|
24
|
-
try {
|
|
25
|
-
connected = Godex.openport(null, 3);
|
|
26
|
-
} catch (Exception e) {
|
|
27
|
-
Log.i("connectToUSB", e.getMessage());
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@PluginMethod
|
|
32
|
-
public void getVersion(PluginCall call) {
|
|
33
|
-
JSObject ret = new JSObject();
|
|
34
|
-
|
|
35
|
-
var value = Godex.getVersion();
|
|
36
|
-
Log.i("getVersion", value + "test");
|
|
37
|
-
|
|
38
|
-
ret.put("version", value);
|
|
39
|
-
call.resolve(ret);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
@PluginMethod
|
|
43
|
-
public void connectToUSB(PluginCall call) {
|
|
44
|
-
JSObject ret = new JSObject();
|
|
45
|
-
Log.i("connectToUSB", "connect started!");
|
|
46
|
-
|
|
47
|
-
try {
|
|
48
|
-
connected = Godex.openport(null, 3);
|
|
49
|
-
} catch (Exception e) {
|
|
50
|
-
Log.i("connectToUSB", e.getMessage());
|
|
51
|
-
ret.put("value", e.getMessage());
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
call.resolve(ret);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
@PluginMethod
|
|
58
|
-
public void printFromUSB(PluginCall call) {
|
|
59
|
-
String value = call.getString("value");
|
|
60
|
-
JSObject ret = new JSObject();
|
|
61
|
-
|
|
62
|
-
connected = Godex.openport(null, 3);
|
|
63
|
-
|
|
64
|
-
if (!connected) {
|
|
65
|
-
ret.put("value", "Błąd połączenia USB");
|
|
66
|
-
call.resolve(ret);
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
try {
|
|
71
|
-
var printResult = Godex.sendCommand(value);
|
|
72
|
-
if (!printResult) {
|
|
73
|
-
try {
|
|
74
|
-
Godex.close();
|
|
75
|
-
} catch (IOException e) {
|
|
76
|
-
Log.i("connectToUSB", e.getMessage());
|
|
77
|
-
}
|
|
78
|
-
ret.put("value", "Błąd wydruku! Spróbuj jeszcze raz.");
|
|
79
|
-
call.resolve(ret);
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
ret.put("value", "Wydruk udany!");
|
|
83
|
-
} catch (Exception e) {
|
|
84
|
-
ret.put("value", "Zezwól na dostęp do USB i uruchom wydruk jeszcze raz.");
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
call.resolve(ret);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
@PluginMethod
|
|
91
|
-
public void disconnectPrinter(PluginCall call) {
|
|
92
|
-
JSObject ret = new JSObject();
|
|
93
|
-
connected = false;
|
|
94
|
-
var result = false;
|
|
95
|
-
|
|
96
|
-
try {
|
|
97
|
-
result = Godex.close();
|
|
98
|
-
} catch (IOException e) {
|
|
99
|
-
Log.i("connectToUSB", e.getMessage());
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if (result) {
|
|
104
|
-
ret.put("value", "Disconnected");
|
|
105
|
-
} else {
|
|
106
|
-
ret.put("value", "Disconnect fail");
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
call.resolve(ret);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
@PluginMethod
|
|
113
|
-
public void getPrinterDPI(PluginCall call) {
|
|
114
|
-
JSObject ret = new JSObject();
|
|
115
|
-
Log.i("getPrinterDPI", "connect started!");
|
|
116
|
-
var value = Godex.getPrinterDPI();
|
|
117
|
-
|
|
118
|
-
ret.put("value", value);
|
|
119
|
-
|
|
120
|
-
call.resolve(ret);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
1
|
+
package pl.simplymobile.plugins.godexprinter;
|
|
2
|
+
|
|
3
|
+
import android.util.Log;
|
|
4
|
+
|
|
5
|
+
import com.getcapacitor.JSObject;
|
|
6
|
+
import com.getcapacitor.Plugin;
|
|
7
|
+
import com.getcapacitor.PluginCall;
|
|
8
|
+
import com.getcapacitor.PluginMethod;
|
|
9
|
+
import com.getcapacitor.annotation.CapacitorPlugin;
|
|
10
|
+
import com.godex.Godex;
|
|
11
|
+
|
|
12
|
+
import java.io.IOException;
|
|
13
|
+
|
|
14
|
+
@CapacitorPlugin(name = "GodexPrinter")
|
|
15
|
+
public class GodexPrinterPlugin extends Plugin {
|
|
16
|
+
|
|
17
|
+
private boolean connected = false;
|
|
18
|
+
|
|
19
|
+
@Override
|
|
20
|
+
public void load() {
|
|
21
|
+
Godex.debug(3);
|
|
22
|
+
var context = this.getActivity().getApplicationContext();
|
|
23
|
+
Godex.getMainContext(context);
|
|
24
|
+
try {
|
|
25
|
+
connected = Godex.openport(null, 3);
|
|
26
|
+
} catch (Exception e) {
|
|
27
|
+
Log.i("connectToUSB", e.getMessage());
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@PluginMethod
|
|
32
|
+
public void getVersion(PluginCall call) {
|
|
33
|
+
JSObject ret = new JSObject();
|
|
34
|
+
|
|
35
|
+
var value = Godex.getVersion();
|
|
36
|
+
Log.i("getVersion", value + "test");
|
|
37
|
+
|
|
38
|
+
ret.put("version", value);
|
|
39
|
+
call.resolve(ret);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@PluginMethod
|
|
43
|
+
public void connectToUSB(PluginCall call) {
|
|
44
|
+
JSObject ret = new JSObject();
|
|
45
|
+
Log.i("connectToUSB", "connect started!");
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
connected = Godex.openport(null, 3);
|
|
49
|
+
} catch (Exception e) {
|
|
50
|
+
Log.i("connectToUSB", e.getMessage());
|
|
51
|
+
ret.put("value", e.getMessage());
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
call.resolve(ret);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@PluginMethod
|
|
58
|
+
public void printFromUSB(PluginCall call) {
|
|
59
|
+
String value = call.getString("value");
|
|
60
|
+
JSObject ret = new JSObject();
|
|
61
|
+
|
|
62
|
+
connected = Godex.openport(null, 3);
|
|
63
|
+
|
|
64
|
+
if (!connected) {
|
|
65
|
+
ret.put("value", "Błąd połączenia USB");
|
|
66
|
+
call.resolve(ret);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
try {
|
|
71
|
+
var printResult = Godex.sendCommand(value);
|
|
72
|
+
if (!printResult) {
|
|
73
|
+
try {
|
|
74
|
+
Godex.close();
|
|
75
|
+
} catch (IOException e) {
|
|
76
|
+
Log.i("connectToUSB", e.getMessage());
|
|
77
|
+
}
|
|
78
|
+
ret.put("value", "Błąd wydruku! Spróbuj jeszcze raz.");
|
|
79
|
+
call.resolve(ret);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
ret.put("value", "Wydruk udany!");
|
|
83
|
+
} catch (Exception e) {
|
|
84
|
+
ret.put("value", "Zezwól na dostęp do USB i uruchom wydruk jeszcze raz.");
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
call.resolve(ret);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@PluginMethod
|
|
91
|
+
public void disconnectPrinter(PluginCall call) {
|
|
92
|
+
JSObject ret = new JSObject();
|
|
93
|
+
connected = false;
|
|
94
|
+
var result = false;
|
|
95
|
+
|
|
96
|
+
try {
|
|
97
|
+
result = Godex.close();
|
|
98
|
+
} catch (IOException e) {
|
|
99
|
+
Log.i("connectToUSB", e.getMessage());
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
if (result) {
|
|
104
|
+
ret.put("value", "Disconnected");
|
|
105
|
+
} else {
|
|
106
|
+
ret.put("value", "Disconnect fail");
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
call.resolve(ret);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@PluginMethod
|
|
113
|
+
public void getPrinterDPI(PluginCall call) {
|
|
114
|
+
JSObject ret = new JSObject();
|
|
115
|
+
Log.i("getPrinterDPI", "connect started!");
|
|
116
|
+
var value = Godex.getPrinterDPI();
|
|
117
|
+
|
|
118
|
+
ret.put("value", value);
|
|
119
|
+
|
|
120
|
+
call.resolve(ret);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface GodexPrinterPlugin {\n getVersion(): Promise<{ version: string }>;\n connectToUSB(): Promise<{ value: string }>;\n printFromUSB(options: { value: string }): Promise<{ value: boolean }>;\n disconnect(): Promise<{ value: string }>;\n getPrinterDPI(): Promise<{ value: number }>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface GodexPrinterPlugin {\r\n getVersion(): Promise<{ version: string }>;\r\n connectToUSB(): Promise<{ value: string }>;\r\n printFromUSB(options: { value: string }): Promise<{ value: boolean }>;\r\n disconnect(): Promise<{ value: string }>;\r\n getPrinterDPI(): Promise<{ value: number }>;\r\n}\r\n"]}
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,YAAY,GAAG,cAAc,CAAqB,cAAc,EAAE;IACtE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;CAC9D,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { GodexPrinterPlugin } from './definitions';\n\nconst GodexPrinter = registerPlugin<GodexPrinterPlugin>('GodexPrinter', {\n web: () => import('./web').then(m => new m.GodexPrinterWeb()),\n});\n\nexport * from './definitions';\nexport { GodexPrinter };\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,YAAY,GAAG,cAAc,CAAqB,cAAc,EAAE;IACtE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;CAC9D,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\r\n\r\nimport type { GodexPrinterPlugin } from './definitions';\r\n\r\nconst GodexPrinter = registerPlugin<GodexPrinterPlugin>('GodexPrinter', {\r\n web: () => import('./web').then(m => new m.GodexPrinterWeb()),\r\n});\r\n\r\nexport * from './definitions';\r\nexport { GodexPrinter };\r\n"]}
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C,KAAK,CAAC,UAAU;QACd,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAA0B;QAC3C,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAC9C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,UAAU;QACd,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IACtB,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { GodexPrinterPlugin } from './definitions';\n\nexport class GodexPrinterWeb extends WebPlugin implements GodexPrinterPlugin {\n async getVersion(): Promise<{ version: string }> {\n console.log('NOT IMPLEMENTED');\n return { version: 'NOT IMPLEMENTED' };\n }\n\n async connectToUSB(): Promise<{ value: string }> {\n console.log('NOT IMPLEMENTED');\n return { value: 'NOT IMPLEMENTED' };\n }\n\n async printFromUSB(options: { value: string }): Promise<{ value: boolean }> {\n console.log('NOT IMPLEMENTED', options.value);\n return { value: false };\n }\n\n async disconnect(): Promise<{ value: string }> {\n console.log('NOT IMPLEMENTED');\n return { value: 'NOT IMPLEMENTED' };\n }\n\n async getPrinterDPI(): Promise<{ value: number }> {\n console.log('NOT IMPLEMENTED');\n return { value: 0 };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C,KAAK,CAAC,UAAU;QACd,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAA0B;QAC3C,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAC9C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,UAAU;QACd,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IACtB,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\r\n\r\nimport type { GodexPrinterPlugin } from './definitions';\r\n\r\nexport class GodexPrinterWeb extends WebPlugin implements GodexPrinterPlugin {\r\n async getVersion(): Promise<{ version: string }> {\r\n console.log('NOT IMPLEMENTED');\r\n return { version: 'NOT IMPLEMENTED' };\r\n }\r\n\r\n async connectToUSB(): Promise<{ value: string }> {\r\n console.log('NOT IMPLEMENTED');\r\n return { value: 'NOT IMPLEMENTED' };\r\n }\r\n\r\n async printFromUSB(options: { value: string }): Promise<{ value: boolean }> {\r\n console.log('NOT IMPLEMENTED', options.value);\r\n return { value: false };\r\n }\r\n\r\n async disconnect(): Promise<{ value: string }> {\r\n console.log('NOT IMPLEMENTED');\r\n return { value: 'NOT IMPLEMENTED' };\r\n }\r\n\r\n async getPrinterDPI(): Promise<{ value: number }> {\r\n console.log('NOT IMPLEMENTED');\r\n return { value: 0 };\r\n }\r\n}\r\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import Foundation
|
|
2
|
-
|
|
3
|
-
@objc public class GodexPrinter: NSObject {
|
|
4
|
-
@objc public func echo(_ value: String) -> String {
|
|
5
|
-
print(value)
|
|
6
|
-
return value
|
|
7
|
-
}
|
|
8
|
-
}
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
@objc public class GodexPrinter: NSObject {
|
|
4
|
+
@objc public func echo(_ value: String) -> String {
|
|
5
|
+
print(value)
|
|
6
|
+
return value
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#import <UIKit/UIKit.h>
|
|
2
|
-
|
|
3
|
-
//! Project version number for Plugin.
|
|
4
|
-
FOUNDATION_EXPORT double PluginVersionNumber;
|
|
5
|
-
|
|
6
|
-
//! Project version string for Plugin.
|
|
7
|
-
FOUNDATION_EXPORT const unsigned char PluginVersionString[];
|
|
8
|
-
|
|
9
|
-
// In this header, you should import all the public headers of your framework using statements like #import <Plugin/PublicHeader.h>
|
|
10
|
-
|
|
1
|
+
#import <UIKit/UIKit.h>
|
|
2
|
+
|
|
3
|
+
//! Project version number for Plugin.
|
|
4
|
+
FOUNDATION_EXPORT double PluginVersionNumber;
|
|
5
|
+
|
|
6
|
+
//! Project version string for Plugin.
|
|
7
|
+
FOUNDATION_EXPORT const unsigned char PluginVersionString[];
|
|
8
|
+
|
|
9
|
+
// In this header, you should import all the public headers of your framework using statements like #import <Plugin/PublicHeader.h>
|
|
10
|
+
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
#import <Capacitor/Capacitor.h>
|
|
3
|
-
|
|
4
|
-
// Define the plugin using the CAP_PLUGIN Macro, and
|
|
5
|
-
// each method the plugin supports using the CAP_PLUGIN_METHOD macro.
|
|
6
|
-
CAP_PLUGIN(GodexPrinterPlugin, "GodexPrinter",
|
|
7
|
-
CAP_PLUGIN_METHOD(echo, CAPPluginReturnPromise);
|
|
8
|
-
)
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
#import <Capacitor/Capacitor.h>
|
|
3
|
+
|
|
4
|
+
// Define the plugin using the CAP_PLUGIN Macro, and
|
|
5
|
+
// each method the plugin supports using the CAP_PLUGIN_METHOD macro.
|
|
6
|
+
CAP_PLUGIN(GodexPrinterPlugin, "GodexPrinter",
|
|
7
|
+
CAP_PLUGIN_METHOD(echo, CAPPluginReturnPromise);
|
|
8
|
+
)
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import Foundation
|
|
2
|
-
import Capacitor
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Please read the Capacitor iOS Plugin Development Guide
|
|
6
|
-
* here: https://capacitorjs.com/docs/plugins/ios
|
|
7
|
-
*/
|
|
8
|
-
@objc(GodexPrinterPlugin)
|
|
9
|
-
public class GodexPrinterPlugin: CAPPlugin {
|
|
10
|
-
private let implementation = GodexPrinter()
|
|
11
|
-
|
|
12
|
-
@objc func echo(_ call: CAPPluginCall) {
|
|
13
|
-
let value = call.getString("value") ?? ""
|
|
14
|
-
call.resolve([
|
|
15
|
-
"value": implementation.echo(value)
|
|
16
|
-
])
|
|
17
|
-
}
|
|
18
|
-
}
|
|
1
|
+
import Foundation
|
|
2
|
+
import Capacitor
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Please read the Capacitor iOS Plugin Development Guide
|
|
6
|
+
* here: https://capacitorjs.com/docs/plugins/ios
|
|
7
|
+
*/
|
|
8
|
+
@objc(GodexPrinterPlugin)
|
|
9
|
+
public class GodexPrinterPlugin: CAPPlugin {
|
|
10
|
+
private let implementation = GodexPrinter()
|
|
11
|
+
|
|
12
|
+
@objc func echo(_ call: CAPPluginCall) {
|
|
13
|
+
let value = call.getString("value") ?? ""
|
|
14
|
+
call.resolve([
|
|
15
|
+
"value": implementation.echo(value)
|
|
16
|
+
])
|
|
17
|
+
}
|
|
18
|
+
}
|
package/ios/Plugin/Info.plist
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
-
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
7
|
-
<key>CFBundleExecutable</key>
|
|
8
|
-
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
-
<key>CFBundleIdentifier</key>
|
|
10
|
-
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
11
|
-
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
-
<string>6.0</string>
|
|
13
|
-
<key>CFBundleName</key>
|
|
14
|
-
<string>$(PRODUCT_NAME)</string>
|
|
15
|
-
<key>CFBundlePackageType</key>
|
|
16
|
-
<string>FMWK</string>
|
|
17
|
-
<key>CFBundleShortVersionString</key>
|
|
18
|
-
<string>1.0</string>
|
|
19
|
-
<key>CFBundleVersion</key>
|
|
20
|
-
<string>$(CURRENT_PROJECT_VERSION)</string>
|
|
21
|
-
<key>NSPrincipalClass</key>
|
|
22
|
-
<string></string>
|
|
23
|
-
</dict>
|
|
24
|
-
</plist>
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
+
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
7
|
+
<key>CFBundleExecutable</key>
|
|
8
|
+
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
+
<key>CFBundleIdentifier</key>
|
|
10
|
+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
11
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
+
<string>6.0</string>
|
|
13
|
+
<key>CFBundleName</key>
|
|
14
|
+
<string>$(PRODUCT_NAME)</string>
|
|
15
|
+
<key>CFBundlePackageType</key>
|
|
16
|
+
<string>FMWK</string>
|
|
17
|
+
<key>CFBundleShortVersionString</key>
|
|
18
|
+
<string>1.0</string>
|
|
19
|
+
<key>CFBundleVersion</key>
|
|
20
|
+
<string>$(CURRENT_PROJECT_VERSION)</string>
|
|
21
|
+
<key>NSPrincipalClass</key>
|
|
22
|
+
<string></string>
|
|
23
|
+
</dict>
|
|
24
|
+
</plist>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplymobile/capacitor-godex-printer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Capacitor GoDEX printer plugin",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -45,23 +45,23 @@
|
|
|
45
45
|
"prepublishOnly": "npm run build"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@capacitor/android": "^
|
|
49
|
-
"@capacitor/core": "^
|
|
50
|
-
"@capacitor/docgen": "^0.
|
|
51
|
-
"@capacitor/ios": "^
|
|
48
|
+
"@capacitor/android": "^5.0.0",
|
|
49
|
+
"@capacitor/core": "^5.0.0",
|
|
50
|
+
"@capacitor/docgen": "^0.2.1",
|
|
51
|
+
"@capacitor/ios": "^5.0.0",
|
|
52
52
|
"@ionic/eslint-config": "^0.3.0",
|
|
53
|
-
"@ionic/prettier-config": "^
|
|
53
|
+
"@ionic/prettier-config": "^3.0.0",
|
|
54
54
|
"@ionic/swiftlint-config": "^1.1.2",
|
|
55
55
|
"eslint": "^7.11.0",
|
|
56
|
-
"prettier": "~2.
|
|
57
|
-
"prettier-plugin-java": "~1.0
|
|
56
|
+
"prettier": "~2.8.8",
|
|
57
|
+
"prettier-plugin-java": "~2.1.0",
|
|
58
58
|
"rimraf": "^3.0.2",
|
|
59
59
|
"rollup": "^2.32.0",
|
|
60
60
|
"swiftlint": "^1.0.1",
|
|
61
61
|
"typescript": "~4.1.5"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@capacitor/core": "^
|
|
64
|
+
"@capacitor/core": "^5.0.0"
|
|
65
65
|
},
|
|
66
66
|
"prettier": "@ionic/prettier-config",
|
|
67
67
|
"swiftlint": "@ionic/swiftlint-config",
|