seven365-zyprinter 1.0.2 → 1.0.4

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 CHANGED
@@ -33,6 +33,7 @@ npx cap sync
33
33
  * [`disconnectFromPrinter(...)`](#disconnectfromprinter)
34
34
  * [`printText(...)`](#printtext)
35
35
  * [`printReceipt(...)`](#printreceipt)
36
+ * [`printTestReceipt(...)`](#printtestreceipt)
36
37
  * [`getPrinterStatus(...)`](#getprinterstatus)
37
38
  * [Interfaces](#interfaces)
38
39
  * [Type Aliases](#type-aliases)
@@ -165,6 +166,25 @@ printReceipt(options: { template: ReceiptTemplate; identifier: string; }) => Pro
165
166
  --------------------
166
167
 
167
168
 
169
+ ### printTestReceipt(...)
170
+
171
+ ```typescript
172
+ printTestReceipt(options: { template: ReceiptTemplate; identifier: string; }) => Promise<{ success: boolean; }>
173
+ ```
174
+
175
+ Test print method - isolated from production printReceipt
176
+ Use this for test prints to avoid affecting production printer setup
177
+ Includes additional logging with [TEST] prefix
178
+
179
+ | Param | Type |
180
+ | ------------- | ---------------------------------------------------------------------------------------------- |
181
+ | **`options`** | <code>{ template: <a href="#receipttemplate">ReceiptTemplate</a>; identifier: string; }</code> |
182
+
183
+ **Returns:** <code>Promise&lt;{ success: boolean; }&gt;</code>
184
+
185
+ --------------------
186
+
187
+
168
188
  ### getPrinterStatus(...)
169
189
 
170
190
  ```typescript
package/dist/docs.json CHANGED
@@ -141,6 +141,24 @@
141
141
  ],
142
142
  "slug": "printreceipt"
143
143
  },
144
+ {
145
+ "name": "printTestReceipt",
146
+ "signature": "(options: { template: ReceiptTemplate; identifier: string; }) => Promise<{ success: boolean; }>",
147
+ "parameters": [
148
+ {
149
+ "name": "options",
150
+ "docs": "",
151
+ "type": "{ template: ReceiptTemplate; identifier: string; }"
152
+ }
153
+ ],
154
+ "returns": "Promise<{ success: boolean; }>",
155
+ "tags": [],
156
+ "docs": "Test print method - isolated from production printReceipt\nUse this for test prints to avoid affecting production printer setup\nIncludes additional logging with [TEST] prefix",
157
+ "complexTypes": [
158
+ "ReceiptTemplate"
159
+ ],
160
+ "slug": "printtestreceipt"
161
+ },
144
162
  {
145
163
  "name": "getPrinterStatus",
146
164
  "signature": "(options: { identifier: string; }) => Promise<{ status: string; paperStatus: string; connected: boolean; }>",
@@ -119,6 +119,17 @@ export interface ZyprintPlugin {
119
119
  }): Promise<{
120
120
  success: boolean;
121
121
  }>;
122
+ /**
123
+ * Test print method - isolated from production printReceipt
124
+ * Use this for test prints to avoid affecting production printer setup
125
+ * Includes additional logging with [TEST] prefix
126
+ */
127
+ printTestReceipt(options: {
128
+ template: ReceiptTemplate;
129
+ identifier: string;
130
+ }): Promise<{
131
+ success: boolean;
132
+ }>;
122
133
  getPrinterStatus(options: {
123
134
  identifier: string;
124
135
  }): Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["// Enhanced printer interface with connection type details\nexport interface ZyPrinter {\n identifier: string;\n model: string;\n status: string;\n connectionType: 'bluetooth' | 'wifi' | 'usb';\n ipAddress?: string;\n port?: number;\n rssi?: number;\n}\n\nexport type TSize = '1' | '2' | '3' | '4' | 'normal' | 'large' | 'xlarge';\nexport type TModifierStyle = 'standard' | 'minimal' | 'bullet' | 'arrow' | 'detailed';\nexport type TModifierIndent = 'small' | 'medium' | 'large';\n\nexport interface HeaderConfig {\n restaurant_name?: string;\n sub_header?: string;\n prefix?: string;\n gst_number?: string;\n address?: string;\n phone_number?: string;\n size?: TSize;\n bold?: boolean;\n}\n\nexport interface ItemConfig {\n size?: TSize;\n bold?: boolean;\n}\n\nexport interface ModifierConfig {\n style?: TModifierStyle;\n indent?: TModifierIndent;\n size?: TSize;\n}\n\nexport interface TotalConfig {\n size?: TSize;\n bold?: boolean;\n}\n\nexport interface FooterConfig {\n message?: string;\n date_format?: string;\n time_format?: string;\n size?: TSize;\n bold?: boolean;\n}\n\nexport interface KitchenItem {\n // Simple format (edit.vue)\n qty?: number;\n name?: string;\n \n // Complex format (zyprint-test.vue - from API/backend)\n menu?: {\n _id?: string;\n name: string;\n price?: string;\n categoryName?: string;\n printer?: string;\n };\n quantity?: number;\n price?: number;\n total_price?: number;\n \n // Shared properties\n modifiers?: Array<{ \n modifier?: string;\n name: string; \n qty?: number;\n quantity?: number;\n price?: number;\n }>;\n}\n\nexport interface ReceiptTemplate {\n header?: HeaderConfig;\n kitchen?: KitchenItem[];\n items?: Array<{ name: string; price: string }>; // Legacy support\n total?: string;\n order_type?: string;\n table_name?: string;\n order_number?: string;\n footer?: FooterConfig;\n item?: ItemConfig;\n total_config?: TotalConfig;\n modifier?: ModifierConfig;\n}\n\nexport interface ZyprintPlugin {\n echo(options: { value: string }): Promise<{ value: string }>;\n \n // Enhanced Printer Discovery Methods\n discoverPrinters(): Promise<{ printers: ZyPrinter[] }>;\n discoverBluetoothPrinters(): Promise<{ printers: ZyPrinter[] }>;\n discoverWiFiPrinters(options?: { networkRange?: string }): Promise<{ printers: ZyPrinter[] }>;\n discoverUSBPrinters(): Promise<{ printers: ZyPrinter[] }>;\n \n // Connection Management\n connectToPrinter(options: { identifier: string }): Promise<{ connected: boolean }>;\n disconnectFromPrinter(options: { identifier: string }): Promise<{ disconnected: boolean }>;\n \n // Printing Methods\n printText(options: { text: string; identifier: string }): Promise<{ success: boolean }>;\n printReceipt(options: { template: ReceiptTemplate; identifier: string }): Promise<{ success: boolean }>;\n \n // Printer Status\n getPrinterStatus(options: { identifier: string }): Promise<{ status: string; paperStatus: string; connected: boolean }>;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["// Enhanced printer interface with connection type details\nexport interface ZyPrinter {\n identifier: string;\n model: string;\n status: string;\n connectionType: 'bluetooth' | 'wifi' | 'usb';\n ipAddress?: string;\n port?: number;\n rssi?: number;\n}\n\nexport type TSize = '1' | '2' | '3' | '4' | 'normal' | 'large' | 'xlarge';\nexport type TModifierStyle = 'standard' | 'minimal' | 'bullet' | 'arrow' | 'detailed';\nexport type TModifierIndent = 'small' | 'medium' | 'large';\n\nexport interface HeaderConfig {\n restaurant_name?: string;\n sub_header?: string;\n prefix?: string;\n gst_number?: string;\n address?: string;\n phone_number?: string;\n size?: TSize;\n bold?: boolean;\n}\n\nexport interface ItemConfig {\n size?: TSize;\n bold?: boolean;\n}\n\nexport interface ModifierConfig {\n style?: TModifierStyle;\n indent?: TModifierIndent;\n size?: TSize;\n}\n\nexport interface TotalConfig {\n size?: TSize;\n bold?: boolean;\n}\n\nexport interface FooterConfig {\n message?: string;\n date_format?: string;\n time_format?: string;\n size?: TSize;\n bold?: boolean;\n}\n\nexport interface KitchenItem {\n // Simple format (edit.vue)\n qty?: number;\n name?: string;\n \n // Complex format (zyprint-test.vue - from API/backend)\n menu?: {\n _id?: string;\n name: string;\n price?: string;\n categoryName?: string;\n printer?: string;\n };\n quantity?: number;\n price?: number;\n total_price?: number;\n \n // Shared properties\n modifiers?: Array<{ \n modifier?: string;\n name: string; \n qty?: number;\n quantity?: number;\n price?: number;\n }>;\n}\n\nexport interface ReceiptTemplate {\n header?: HeaderConfig;\n kitchen?: KitchenItem[];\n items?: Array<{ name: string; price: string }>; // Legacy support\n total?: string;\n order_type?: string;\n table_name?: string;\n order_number?: string;\n footer?: FooterConfig;\n item?: ItemConfig;\n total_config?: TotalConfig;\n modifier?: ModifierConfig;\n}\n\nexport interface ZyprintPlugin {\n echo(options: { value: string }): Promise<{ value: string }>;\n \n // Enhanced Printer Discovery Methods\n discoverPrinters(): Promise<{ printers: ZyPrinter[] }>;\n discoverBluetoothPrinters(): Promise<{ printers: ZyPrinter[] }>;\n discoverWiFiPrinters(options?: { networkRange?: string }): Promise<{ printers: ZyPrinter[] }>;\n discoverUSBPrinters(): Promise<{ printers: ZyPrinter[] }>;\n \n // Connection Management\n connectToPrinter(options: { identifier: string }): Promise<{ connected: boolean }>;\n disconnectFromPrinter(options: { identifier: string }): Promise<{ disconnected: boolean }>;\n \n // Printing Methods\n printText(options: { text: string; identifier: string }): Promise<{ success: boolean }>;\n printReceipt(options: { template: ReceiptTemplate; identifier: string }): Promise<{ success: boolean }>;\n \n /**\n * Test print method - isolated from production printReceipt\n * Use this for test prints to avoid affecting production printer setup\n * Includes additional logging with [TEST] prefix\n */\n printTestReceipt(options: { template: ReceiptTemplate; identifier: string }): Promise<{ success: boolean }>;\n \n // Printer Status\n getPrinterStatus(options: { identifier: string }): Promise<{ status: string; paperStatus: string; connected: boolean }>;\n}\n"]}
package/dist/esm/web.d.ts CHANGED
@@ -42,6 +42,12 @@ export declare class ZyprintWeb extends WebPlugin implements ZyprintPlugin {
42
42
  }): Promise<{
43
43
  success: boolean;
44
44
  }>;
45
+ printTestReceipt(_options: {
46
+ template: Record<string, any>;
47
+ identifier: string;
48
+ }): Promise<{
49
+ success: boolean;
50
+ }>;
45
51
  getPrinterStatus(_options: {
46
52
  identifier: string;
47
53
  }): Promise<{
package/dist/esm/web.js CHANGED
@@ -36,6 +36,10 @@ export class ZyprintWeb extends WebPlugin {
36
36
  console.warn('Zyprint receipt printing is not available on web platform');
37
37
  return { success: false };
38
38
  }
39
+ async printTestReceipt(_options) {
40
+ console.warn('[TEST] Zyprint test receipt printing is not available on web platform');
41
+ return { success: false };
42
+ }
39
43
  async getPrinterStatus(_options) {
40
44
  console.warn('Zyprint status check is not available on web platform');
41
45
  return { status: 'unknown', paperStatus: 'unknown', connected: false };
@@ -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,UAAW,SAAQ,SAAS;IACvC,KAAK,CAAC,IAAI,CAAC,OAA0B;QACnC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC;IAC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AC,IAAI,CAAC,uDAAuD,CAAC,CAAC;QACtE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IACzE,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { ZyprintPlugin, ZyPrinter } from './definitions';\n\nexport class ZyprintWeb extends WebPlugin implements ZyprintPlugin {\n async echo(options: { value: string }): Promise<{ value: string }> {\n console.log('ECHO', options);\n return options;\n }\n\n async discoverPrinters(): Promise<{ printers: ZyPrinter[] }> {\n console.warn('Zyprint discovery is not available on web platform');\n return { printers: [] };\n }\n\n async discoverBluetoothPrinters(): Promise<{ printers: ZyPrinter[] }> {\n console.warn('Zyprint Bluetooth discovery is not available on web platform');\n return { printers: [] };\n }\n\n async discoverWiFiPrinters(_options?: { networkRange?: string }): Promise<{ printers: ZyPrinter[] }> {\n console.warn('Zyprint WiFi discovery is not available on web platform');\n return { printers: [] };\n }\n\n async discoverUSBPrinters(): Promise<{ printers: ZyPrinter[] }> {\n console.warn('Zyprint USB discovery is not available on web platform');\n return { printers: [] };\n }\n\n async connectToPrinter(_options: { identifier: string }): Promise<{ connected: boolean }> {\n console.warn('Zyprint connection is not available on web platform');\n return { connected: false };\n }\n\n async disconnectFromPrinter(_options: { identifier: string }): Promise<{ disconnected: boolean }> {\n console.warn('Zyprint disconnection is not available on web platform');\n return { disconnected: false };\n }\n\n async printText(_options: { text: string; identifier: string }): Promise<{ success: boolean }> {\n console.warn('Zyprint printing is not available on web platform');\n return { success: false };\n }\n\n async printReceipt(_options: { template: Record<string, any>; identifier: string }): Promise<{ success: boolean }> {\n console.warn('Zyprint receipt printing is not available on web platform');\n return { success: false };\n }\n\n async getPrinterStatus(_options: { identifier: string }): Promise<{ status: string; paperStatus: string; connected: boolean }> {\n console.warn('Zyprint status check is not available on web platform');\n return { status: 'unknown', paperStatus: 'unknown', connected: false };\n }\n}\n"]}
1
+ {"version":3,"file":"web.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OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAA+D;QAChF,OAAO,CAAC,IAAI,CAAC,2DAA2D,CAAC,CAAC;QAC1E,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,QAA+D;QACpF,OAAO,CAAC,IAAI,CAAC,uEAAuE,CAAC,CAAC;QACtF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,QAAgC;QACrD,OAAO,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;QACtE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IACzE,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { ZyprintPlugin, ZyPrinter } from './definitions';\n\nexport class ZyprintWeb extends WebPlugin implements ZyprintPlugin {\n async echo(options: { value: string }): Promise<{ value: string }> {\n console.log('ECHO', options);\n return options;\n }\n\n async discoverPrinters(): Promise<{ printers: ZyPrinter[] }> {\n console.warn('Zyprint discovery is not available on web platform');\n return { printers: [] };\n }\n\n async discoverBluetoothPrinters(): Promise<{ printers: ZyPrinter[] }> {\n console.warn('Zyprint Bluetooth discovery is not available on web platform');\n return { printers: [] };\n }\n\n async discoverWiFiPrinters(_options?: { networkRange?: string }): Promise<{ printers: ZyPrinter[] }> {\n console.warn('Zyprint WiFi discovery is not available on web platform');\n return { printers: [] };\n }\n\n async discoverUSBPrinters(): Promise<{ printers: ZyPrinter[] }> {\n console.warn('Zyprint USB discovery is not available on web platform');\n return { printers: [] };\n }\n\n async connectToPrinter(_options: { identifier: string }): Promise<{ connected: boolean }> {\n console.warn('Zyprint connection is not available on web platform');\n return { connected: false };\n }\n\n async disconnectFromPrinter(_options: { identifier: string }): Promise<{ disconnected: boolean }> {\n console.warn('Zyprint disconnection is not available on web platform');\n return { disconnected: false };\n }\n\n async printText(_options: { text: string; identifier: string }): Promise<{ success: boolean }> {\n console.warn('Zyprint printing is not available on web platform');\n return { success: false };\n }\n\n async printReceipt(_options: { template: Record<string, any>; identifier: string }): Promise<{ success: boolean }> {\n console.warn('Zyprint receipt printing is not available on web platform');\n return { success: false };\n }\n\n async printTestReceipt(_options: { template: Record<string, any>; identifier: string }): Promise<{ success: boolean }> {\n console.warn('[TEST] Zyprint test receipt printing is not available on web platform');\n return { success: false };\n }\n\n async getPrinterStatus(_options: { identifier: string }): Promise<{ status: string; paperStatus: string; connected: boolean }> {\n console.warn('Zyprint status check is not available on web platform');\n return { status: 'unknown', paperStatus: 'unknown', connected: false };\n }\n}\n"]}
@@ -43,6 +43,10 @@ class ZyprintWeb extends core.WebPlugin {
43
43
  console.warn('Zyprint receipt printing is not available on web platform');
44
44
  return { success: false };
45
45
  }
46
+ async printTestReceipt(_options) {
47
+ console.warn('[TEST] Zyprint test receipt printing is not available on web platform');
48
+ return { success: false };
49
+ }
46
50
  async getPrinterStatus(_options) {
47
51
  console.warn('Zyprint status check is not available on web platform');
48
52
  return { status: 'unknown', paperStatus: 'unknown', connected: false };
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Zyprint = registerPlugin('Zyprint', {\n web: () => import('./web').then((m) => new m.ZyprintWeb()),\n});\nexport * from './definitions';\nexport { Zyprint };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class ZyprintWeb extends WebPlugin {\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async discoverPrinters() {\n console.warn('Zyprint discovery is not available on web platform');\n return { printers: [] };\n }\n async discoverBluetoothPrinters() {\n console.warn('Zyprint Bluetooth discovery is not available on web platform');\n return { printers: [] };\n }\n async discoverWiFiPrinters(_options) {\n console.warn('Zyprint WiFi discovery is not available on web platform');\n return { printers: [] };\n }\n async discoverUSBPrinters() {\n console.warn('Zyprint USB discovery is not available on web platform');\n return { printers: [] };\n }\n async connectToPrinter(_options) {\n console.warn('Zyprint connection is not available on web platform');\n return { connected: false };\n }\n async disconnectFromPrinter(_options) {\n console.warn('Zyprint disconnection is not available on web platform');\n return { disconnected: false };\n }\n async printText(_options) {\n console.warn('Zyprint printing is not available on web platform');\n return { success: false };\n }\n async printReceipt(_options) {\n console.warn('Zyprint receipt printing is not available on web platform');\n return { success: false };\n }\n async getPrinterStatus(_options) {\n console.warn('Zyprint status check is not available on web platform');\n return { status: 'unknown', paperStatus: 'unknown', connected: false };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;AAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;AAC9D,CAAC;;ACFM,MAAM,UAAU,SAASC,cAAS,CAAC;AAC1C,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;AACpC,QAAQ,OAAO,OAAO;AACtB,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,CAAC,IAAI,CAAC,oDAAoD,CAAC;AAC1E,QAAQ,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;AAC/B,IAAI;AACJ,IAAI,MAAM,yBAAyB,GAAG;AACtC,QAAQ,OAAO,CAAC,IAAI,CAAC,8DAA8D,CAAC;AACpF,QAAQ,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;AAC/B,IAAI;AACJ,IAAI,MAAM,oBAAoB,CAAC,QAAQ,EAAE;AACzC,QAAQ,OAAO,CAAC,IAAI,CAAC,yDAAyD,CAAC;AAC/E,QAAQ,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;AAC/B,IAAI;AACJ,IAAI,MAAM,mBAAmB,GAAG;AAChC,QAAQ,OAAO,CAAC,IAAI,CAAC,wDAAwD,CAAC;AAC9E,QAAQ,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;AAC/B,IAAI;AACJ,IAAI,MAAM,gBAAgB,CAAC,QAAQ,EAAE;AACrC,QAAQ,OAAO,CAAC,IAAI,CAAC,qDAAqD,CAAC;AAC3E,QAAQ,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE;AACnC,IAAI;AACJ,IAAI,MAAM,qBAAqB,CAAC,QAAQ,EAAE;AAC1C,QAAQ,OAAO,CAAC,IAAI,CAAC,wDAAwD,CAAC;AAC9E,QAAQ,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE;AACtC,IAAI;AACJ,IAAI,MAAM,SAAS,CAAC,QAAQ,EAAE;AAC9B,QAAQ,OAAO,CAAC,IAAI,CAAC,mDAAmD,CAAC;AACzE,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ,IAAI,MAAM,YAAY,CAAC,QAAQ,EAAE;AACjC,QAAQ,OAAO,CAAC,IAAI,CAAC,2DAA2D,CAAC;AACjF,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ,IAAI,MAAM,gBAAgB,CAAC,QAAQ,EAAE;AACrC,QAAQ,OAAO,CAAC,IAAI,CAAC,uDAAuD,CAAC;AAC7E,QAAQ,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE;AAC9E,IAAI;AACJ;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Zyprint = registerPlugin('Zyprint', {\n web: () => import('./web').then((m) => new m.ZyprintWeb()),\n});\nexport * from './definitions';\nexport { Zyprint };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class ZyprintWeb extends WebPlugin {\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async discoverPrinters() {\n console.warn('Zyprint discovery is not available on web platform');\n return { printers: [] };\n }\n async discoverBluetoothPrinters() {\n console.warn('Zyprint Bluetooth discovery is not available on web platform');\n return { printers: [] };\n }\n async discoverWiFiPrinters(_options) {\n console.warn('Zyprint WiFi discovery is not available on web platform');\n return { printers: [] };\n }\n async discoverUSBPrinters() {\n console.warn('Zyprint USB discovery is not available on web platform');\n return { printers: [] };\n }\n async connectToPrinter(_options) {\n console.warn('Zyprint connection is not available on web platform');\n return { connected: false };\n }\n async disconnectFromPrinter(_options) {\n console.warn('Zyprint disconnection is not available on web platform');\n return { disconnected: false };\n }\n async printText(_options) {\n console.warn('Zyprint printing is not available on web platform');\n return { success: false };\n }\n async printReceipt(_options) {\n console.warn('Zyprint receipt printing is not available on web platform');\n return { success: false };\n }\n async printTestReceipt(_options) {\n console.warn('[TEST] Zyprint test receipt printing is not available on web platform');\n return { success: false };\n }\n async getPrinterStatus(_options) {\n console.warn('Zyprint status check is not available on web platform');\n return { status: 'unknown', paperStatus: 'unknown', connected: false };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;AAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;AAC9D,CAAC;;ACFM,MAAM,UAAU,SAASC,cAAS,CAAC;AAC1C,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;AACpC,QAAQ,OAAO,OAAO;AACtB,IAAI;AACJ,IAAI,MAAM,gBAA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I,MAAM,gBAAgB,CAAC,QAAQ,EAAE;AACrC,QAAQ,OAAO,CAAC,IAAI,CAAC,uEAAuE,CAAC;AAC7F,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ,IAAI,MAAM,gBAAgB,CAAC,QAAQ,EAAE;AACrC,QAAQ,OAAO,CAAC,IAAI,CAAC,uDAAuD,CAAC;AAC7E,QAAQ,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE;AAC9E,IAAI;AACJ;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -42,6 +42,10 @@ var capacitorExample = (function (exports, core) {
42
42
  console.warn('Zyprint receipt printing is not available on web platform');
43
43
  return { success: false };
44
44
  }
45
+ async printTestReceipt(_options) {
46
+ console.warn('[TEST] Zyprint test receipt printing is not available on web platform');
47
+ return { success: false };
48
+ }
45
49
  async getPrinterStatus(_options) {
46
50
  console.warn('Zyprint status check is not available on web platform');
47
51
  return { status: 'unknown', paperStatus: 'unknown', connected: false };
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Zyprint = registerPlugin('Zyprint', {\n web: () => import('./web').then((m) => new m.ZyprintWeb()),\n});\nexport * from './definitions';\nexport { Zyprint };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class ZyprintWeb extends WebPlugin {\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async discoverPrinters() {\n console.warn('Zyprint discovery is not available on web platform');\n return { printers: [] };\n }\n async discoverBluetoothPrinters() {\n console.warn('Zyprint Bluetooth discovery is not available on web platform');\n return { printers: [] };\n }\n async discoverWiFiPrinters(_options) {\n console.warn('Zyprint WiFi discovery is not available on web platform');\n return { printers: [] };\n }\n async discoverUSBPrinters() {\n console.warn('Zyprint USB discovery is not available on web platform');\n return { printers: [] };\n }\n async connectToPrinter(_options) {\n console.warn('Zyprint connection is not available on web platform');\n return { connected: false };\n }\n async disconnectFromPrinter(_options) {\n console.warn('Zyprint disconnection is not available on web platform');\n return { disconnected: false };\n }\n async printText(_options) {\n console.warn('Zyprint printing is not available on web platform');\n return { success: false };\n }\n async printReceipt(_options) {\n console.warn('Zyprint receipt printing is not available on web platform');\n return { success: false };\n }\n async getPrinterStatus(_options) {\n console.warn('Zyprint status check is not available on web platform');\n return { status: 'unknown', paperStatus: 'unknown', connected: false };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;IAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IAC9D,CAAC;;ICFM,MAAM,UAAU,SAASC,cAAS,CAAC;IAC1C,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IACpC,QAAQ,OAAO,OAAO;IACtB,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,CAAC,IAAI,CAAC,oDAAoD,CAAC;IAC1E,QAAQ,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC/B,IAAI;IACJ,IAAI,MAAM,yBAAyB,GAAG;IACtC,QAAQ,OAAO,CAAC,IAAI,CAAC,8DAA8D,CAAC;IACpF,QAAQ,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC/B,IAAI;IACJ,IAAI,MAAM,oBAAoB,CAAC,QAAQ,EAAE;IACzC,QAAQ,OAAO,CAAC,IAAI,CAAC,yDAAyD,CAAC;IAC/E,QAAQ,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC/B,IAAI;IACJ,IAAI,MAAM,mBAAmB,GAAG;IAChC,QAAQ,OAAO,CAAC,IAAI,CAAC,wDAAwD,CAAC;IAC9E,QAAQ,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC/B,IAAI;IACJ,IAAI,MAAM,gBAAgB,CAAC,QAAQ,EAAE;IACrC,QAAQ,OAAO,CAAC,IAAI,CAAC,qDAAqD,CAAC;IAC3E,QAAQ,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE;IACnC,IAAI;IACJ,IAAI,MAAM,qBAAqB,CAAC,QAAQ,EAAE;IAC1C,QAAQ,OAAO,CAAC,IAAI,CAAC,wDAAwD,CAAC;IAC9E,QAAQ,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE;IACtC,IAAI;IACJ,IAAI,MAAM,SAAS,CAAC,QAAQ,EAAE;IAC9B,QAAQ,OAAO,CAAC,IAAI,CAAC,mDAAmD,CAAC;IACzE,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ,IAAI,MAAM,YAAY,CAAC,QAAQ,EAAE;IACjC,QAAQ,OAAO,CAAC,IAAI,CAAC,2DAA2D,CAAC;IACjF,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ,IAAI,MAAM,gBAAgB,CAAC,QAAQ,EAAE;IACrC,QAAQ,OAAO,CAAC,IAAI,CAAC,uDAAuD,CAAC;IAC7E,QAAQ,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE;IAC9E,IAAI;IACJ;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Zyprint = registerPlugin('Zyprint', {\n web: () => import('./web').then((m) => new m.ZyprintWeb()),\n});\nexport * from './definitions';\nexport { Zyprint };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class ZyprintWeb extends WebPlugin {\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async discoverPrinters() {\n console.warn('Zyprint discovery is not available on web platform');\n return { printers: [] };\n }\n async discoverBluetoothPrinters() {\n console.warn('Zyprint Bluetooth discovery is not available on web platform');\n return { printers: [] };\n }\n async discoverWiFiPrinters(_options) {\n console.warn('Zyprint WiFi discovery is not available on web platform');\n return { printers: [] };\n }\n async discoverUSBPrinters() {\n console.warn('Zyprint USB discovery is not available on web platform');\n return { printers: [] };\n }\n async connectToPrinter(_options) {\n console.warn('Zyprint connection is not available on web platform');\n return { connected: false };\n }\n async disconnectFromPrinter(_options) {\n console.warn('Zyprint disconnection is not available on web platform');\n return { disconnected: false };\n }\n async printText(_options) {\n console.warn('Zyprint printing is not available on web platform');\n return { success: false };\n }\n async printReceipt(_options) {\n console.warn('Zyprint receipt printing is not available on web platform');\n return { success: false };\n }\n async printTestReceipt(_options) {\n console.warn('[TEST] Zyprint test receipt printing is not available on web platform');\n return { success: false };\n }\n async getPrinterStatus(_options) {\n console.warn('Zyprint status check is not available on web platform');\n return { status: 'unknown', paperStatus: 'unknown', connected: false };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;IAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IAC9D,CAAC;;ICFM,MAAM,UAAU,SAASC,cAAS,CAAC;IAC1C,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IACpC,QAAQ,OAAO,OAAO;IACtB,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,CAAC,IAAI,CAAC,oDAAoD,CAAC;IAC1E,QAAQ,OAAO,EAAE,QAAQ,EAAE,EAAE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,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ,IAAI,MAAM,gBAAgB,CAAC,QAAQ,EAAE;IACrC,QAAQ,OAAO,CAAC,IAAI,CAAC,uDAAuD,CAAC;IAC7E,QAAQ,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE;IAC9E,IAAI;IACJ;;;;;;;;;;;;;;;"}
@@ -22,6 +22,7 @@ public class ZyprintPlugin: CAPPlugin, CAPBridgedPlugin {
22
22
  CAPPluginMethod(name: "disconnectFromPrinter", returnType: CAPPluginReturnPromise),
23
23
  CAPPluginMethod(name: "printText", returnType: CAPPluginReturnPromise),
24
24
  CAPPluginMethod(name: "printReceipt", returnType: CAPPluginReturnPromise),
25
+ CAPPluginMethod(name: "printTestReceipt", returnType: CAPPluginReturnPromise),
25
26
  CAPPluginMethod(name: "getPrinterStatus", returnType: CAPPluginReturnPromise)
26
27
  ]
27
28
 
@@ -153,6 +154,24 @@ public class ZyprintPlugin: CAPPlugin, CAPBridgedPlugin {
153
154
  }
154
155
  }
155
156
 
157
+ @objc func printTestReceipt(_ call: CAPPluginCall) {
158
+ guard let template = call.getObject("template"),
159
+ let identifier = call.getString("identifier") else {
160
+ call.reject("Missing required parameters")
161
+ return
162
+ }
163
+
164
+ implementation.printTestReceipt(template: template, identifier: identifier) { success, error in
165
+ if let error = error {
166
+ call.reject(error)
167
+ } else {
168
+ call.resolve([
169
+ "success": success
170
+ ])
171
+ }
172
+ }
173
+ }
174
+
156
175
  @objc func getPrinterStatus(_ call: CAPPluginCall) {
157
176
  guard let identifier = call.getString("identifier") else {
158
177
  call.reject("Missing identifier parameter")
@@ -307,6 +307,36 @@ import ExternalAccessory
307
307
  sendDataToPrinter(data: data, identifier: identifier, completion: completion)
308
308
  }
309
309
 
310
+ // MARK: - Test Print Method (Isolated from Production)
311
+
312
+ /**
313
+ * Dedicated test print method - isolates test functionality from production code
314
+ * This method wraps printReceipt with additional logging and test-specific handling
315
+ * Use this for test prints to avoid affecting production printer setup
316
+ */
317
+ @objc public func printTestReceipt(template: [String: Any], identifier: String, completion: @escaping (Bool, String?) -> Void) {
318
+ print("ZywellSDK [TEST]: Test print request received")
319
+ print("ZywellSDK [TEST]: Template: \(template)")
320
+ print("ZywellSDK [TEST]: Printer ID: \(identifier)")
321
+
322
+ guard let data = formatReceiptForPrinter(template: template) else {
323
+ print("ZywellSDK [TEST]: Failed to format test receipt")
324
+ completion(false, "Failed to format test receipt")
325
+ return
326
+ }
327
+
328
+ print("ZywellSDK [TEST]: Sending test print data to printer...")
329
+ sendDataToPrinter(data: data, identifier: identifier) { success, error in
330
+ if success {
331
+ print("ZywellSDK [TEST]: ✅ Test print completed successfully")
332
+ } else {
333
+ print("ZywellSDK [TEST]: ❌ Test print failed: \(error ?? "unknown error")")
334
+ }
335
+ completion(success, error)
336
+ }
337
+ }
338
+
339
+
310
340
  private func sendDataToPrinter(data: Data, identifier: String, completion: @escaping (Bool, String?) -> Void) {
311
341
  // Check if WiFi connection
312
342
  if let wifiManager = wifiManagers[identifier] {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seven365-zyprinter",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Capacitor plugin for Zywell/Zyprint thermal printer integration with Bluetooth and WiFi support",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",