@liquid-js/qr-code-styling 5.5.0-0 → 5.5.0-2
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/lib/event-plugin.js +1 -1
- package/lib/event-plugin.js.map +1 -1
- package/lib/plugins/event.d.ts +2 -2
- package/lib/plugins/vcard.d.ts +31 -41
- package/lib/vcard-plugin.js +1 -1
- package/lib/vcard-plugin.js.map +1 -1
- package/lib/wifi-plugin.js +1 -1
- package/lib/wifi-plugin.js.map +1 -1
- package/package.json +2 -2
package/lib/wifi-plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wifi-plugin.js","sources":["../src/plugins/wifi.ts"],"sourcesContent":["import { Options, Plugin } from '../utils/options.js'\r\n\r\nexport enum EncryptionType {\r\n wep = 'WEP',\r\n wpa = 'WPA',\r\n wpaEap = 'WPA2-EAP'\r\n}\r\n\r\nexport type WiFiPluginOptions = {\r\n ssid: string\r\n hidden?: boolean\r\n} & ({\r\n encryption: `${EncryptionType.wep | EncryptionType.wpa}`\r\n password: string\r\n} | {}) & (({\r\n encryption: `${EncryptionType.wpaEap}`\r\n password?: string\r\n /** EAP method, like PEAP, TTLS or PWD */\r\n eapMethod?: string\r\n /** EAP identity */\r\n eapIdentity?: string\r\n /** EAP anonymous identity */\r\n eapAnonymousIdentity?: string\r\n /** EAP phase 2 method, like MSCHAPV2 or TLS */\r\n eapPhase2Method?: string\r\n} & {}) | {})\r\n\r\nexport default class WiFiPlugin implements Plugin {\r\n\r\n constructor(\r\n private readonly pluginOptions: WiFiPluginOptions\r\n ) { }\r\n\r\n configure(options: Options): Options | undefined | void {\r\n options.data = this.generateWiFi()\r\n return options\r\n }\r\n\r\n private generateWiFi() {\r\n // https://github.com/zxing/zxing/wiki/Barcode-Contents#wi-fi-network-config-android-ios-11\r\n\r\n const { ssid, hidden } = this.pluginOptions\r\n\r\n const parts = new Array<{ key: 'T' | 'S' | 'P' | 'H' | 'E' | 'A' | 'I' | 'PH2', value: string }>()\r\n parts.push({\r\n key: 'S',\r\n value: escape_string(ssid)\r\n })\r\n if ('encryption' in this.pluginOptions && this.pluginOptions.encryption) {\r\n parts.push({\r\n key: 'T',\r\n value: escape_string(this.pluginOptions.encryption)\r\n }, {\r\n key: 'P',\r\n value: escape_string(this.pluginOptions.password || '', true)\r\n })\r\n if (this.pluginOptions.encryption == EncryptionType.wpaEap) {\r\n if (this.pluginOptions.eapMethod)\r\n parts.push({\r\n key: 'E',\r\n value: escape_string(this.pluginOptions.eapMethod)\r\n })\r\n if (this.pluginOptions.eapIdentity)\r\n parts.push({\r\n key: 'I',\r\n value: escape_string(this.pluginOptions.eapIdentity)\r\n })\r\n if (this.pluginOptions.eapAnonymousIdentity)\r\n parts.push({\r\n key: 'A',\r\n value: escape_string(this.pluginOptions.eapAnonymousIdentity)\r\n })\r\n if (this.pluginOptions.eapPhase2Method)\r\n parts.push({\r\n key: 'PH2',\r\n value: escape_string(this.pluginOptions.eapPhase2Method)\r\n })\r\n }\r\n } else\r\n parts.push({\r\n key: 'T',\r\n value: 'nopass'\r\n })\r\n\r\n parts.push({\r\n key: 'H',\r\n value: hidden ? 'true' : 'false'\r\n })\r\n\r\n const content = parts.map(({ key, value }) => [key, value].join(':')).join(';')\r\n\r\n return `WIFI:${content};;`\r\n }\r\n\r\n}\r\n\r\nconst to_escape = new Set(['\\\\', ';', ',', ':', '\"'])\r\n\r\nfunction escape_string(val: string, quoteHex = false) {\r\n const value = val.split('').map(v => to_escape.has(v) ? '\\\\' + v : v).join('')\r\n if (quoteHex && value.match(/^[0-9a-f]+$/i))\r\n return `\"${value}\"`\r\n return value\r\n};\r\n"],"names":["EncryptionType","d","wep","wpa","wpaEap","to_escape","Set","escape_string","val","quoteHex","value","split","map","v","has","join","match","WiFiPlugin","pluginOptions","constructor","this","configure","options","data","generateWiFi","ssid","hidden","parts","push","key","encryption","password","eapMethod","eapIdentity","eapAnonymousIdentity","eapPhase2Method"],"mappings":"IAEYA,EAAAC,EAAAD,IAAc,CAAA,EACtBA,EAAAE,IAAA,MACAF,EAAAG,IAAA,QACAC,OAAA,
|
|
1
|
+
{"version":3,"file":"wifi-plugin.js","sources":["../src/plugins/wifi.ts"],"sourcesContent":["import { Options, Plugin } from '../utils/options.js'\r\n\r\nexport enum EncryptionType {\r\n wep = 'WEP',\r\n wpa = 'WPA',\r\n wpaEap = 'WPA2-EAP'\r\n}\r\n\r\nexport type WiFiPluginOptions = {\r\n ssid: string\r\n hidden?: boolean\r\n} & ({\r\n encryption: `${EncryptionType.wep | EncryptionType.wpa}`\r\n password: string\r\n} | {}) & (({\r\n encryption: `${EncryptionType.wpaEap}`\r\n password?: string\r\n /** EAP method, like PEAP, TTLS or PWD */\r\n eapMethod?: string\r\n /** EAP identity */\r\n eapIdentity?: string\r\n /** EAP anonymous identity */\r\n eapAnonymousIdentity?: string\r\n /** EAP phase 2 method, like MSCHAPV2 or TLS */\r\n eapPhase2Method?: string\r\n} & {}) | {})\r\n\r\nexport default class WiFiPlugin implements Plugin {\r\n\r\n constructor(\r\n private readonly pluginOptions: WiFiPluginOptions\r\n ) { }\r\n\r\n configure(options: Options): Options | undefined | void {\r\n options.data = this.generateWiFi()\r\n // Auto mode\r\n options.qrOptions.mode = undefined\r\n return options\r\n }\r\n\r\n private generateWiFi() {\r\n // https://github.com/zxing/zxing/wiki/Barcode-Contents#wi-fi-network-config-android-ios-11\r\n\r\n const { ssid, hidden } = this.pluginOptions\r\n\r\n const parts = new Array<{ key: 'T' | 'S' | 'P' | 'H' | 'E' | 'A' | 'I' | 'PH2', value: string }>()\r\n parts.push({\r\n key: 'S',\r\n value: escape_string(ssid)\r\n })\r\n if ('encryption' in this.pluginOptions && this.pluginOptions.encryption) {\r\n parts.push({\r\n key: 'T',\r\n value: escape_string(this.pluginOptions.encryption)\r\n }, {\r\n key: 'P',\r\n value: escape_string(this.pluginOptions.password || '', true)\r\n })\r\n if (this.pluginOptions.encryption == EncryptionType.wpaEap) {\r\n if (this.pluginOptions.eapMethod)\r\n parts.push({\r\n key: 'E',\r\n value: escape_string(this.pluginOptions.eapMethod)\r\n })\r\n if (this.pluginOptions.eapIdentity)\r\n parts.push({\r\n key: 'I',\r\n value: escape_string(this.pluginOptions.eapIdentity)\r\n })\r\n if (this.pluginOptions.eapAnonymousIdentity)\r\n parts.push({\r\n key: 'A',\r\n value: escape_string(this.pluginOptions.eapAnonymousIdentity)\r\n })\r\n if (this.pluginOptions.eapPhase2Method)\r\n parts.push({\r\n key: 'PH2',\r\n value: escape_string(this.pluginOptions.eapPhase2Method)\r\n })\r\n }\r\n } else\r\n parts.push({\r\n key: 'T',\r\n value: 'nopass'\r\n })\r\n\r\n parts.push({\r\n key: 'H',\r\n value: hidden ? 'true' : 'false'\r\n })\r\n\r\n const content = parts.map(({ key, value }) => [key, value].join(':')).join(';')\r\n\r\n return `WIFI:${content};;`\r\n }\r\n\r\n}\r\n\r\nconst to_escape = new Set(['\\\\', ';', ',', ':', '\"'])\r\n\r\nfunction escape_string(val: string, quoteHex = false) {\r\n const value = val.split('').map(v => to_escape.has(v) ? '\\\\' + v : v).join('')\r\n if (quoteHex && value.match(/^[0-9a-f]+$/i))\r\n return `\"${value}\"`\r\n return value\r\n};\r\n"],"names":["EncryptionType","d","wep","wpa","wpaEap","to_escape","Set","escape_string","val","quoteHex","value","split","map","v","has","join","match","WiFiPlugin","pluginOptions","constructor","this","configure","options","data","generateWiFi","qrOptions","mode","undefined","ssid","hidden","parts","push","key","encryption","password","eapMethod","eapIdentity","eapAnonymousIdentity","eapPhase2Method"],"mappings":"IAEYA,EAAAC,EAAAD,IAAc,CAAA,EACtBA,EAAAE,IAAA,MACAF,EAAAG,IAAA,QACAC,OAAA,WA6FJ,IAAAC,EAAe,IAAGC,IAAI,CAAG,KAAM,IAAK,IAAK,IAAK,MAErCC,SAAAA,EAAcC,EAAaC,GAAW,GAE3C,OADAC,EAAWF,EAAGG,MAAI,IAAQC,IAAEC,GAAKR,EAAIS,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
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liquid-js/qr-code-styling",
|
|
3
|
-
"version": "5.5.0-
|
|
3
|
+
"version": "5.5.0-2",
|
|
4
4
|
"description": "Generate styled QR codes on web or in Node",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/qr-code-styling-node.js",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"@liquid-js/qrcode-generator": "^1.1.0",
|
|
52
52
|
"@xmldom/xmldom": "^0.9.0",
|
|
53
53
|
"file-type": "^21.0.0 || ^22.0.0",
|
|
54
|
+
"ical-generator": "^10.2.0",
|
|
54
55
|
"sharp": ">0.32.1 <1.0.0",
|
|
55
|
-
"ts-ics": "^2.4.0",
|
|
56
56
|
"vcards-js": "^2.10.0",
|
|
57
57
|
"vcf": "^2.1.0"
|
|
58
58
|
},
|