@posx/core 5.5.308 → 5.5.310

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/jest.setup.js CHANGED
@@ -1,80 +1,80 @@
1
- // Jest setup file to polyfill File and Blob APIs
2
- // This ensures consistent behavior across different Node.js versions and test environments
3
-
4
- // Polyfill Blob.text() if not available
5
- if (typeof Blob !== 'undefined' && !Blob.prototype.text) {
6
- Blob.prototype.text = async function() {
7
- const reader = new FileReader();
8
- return new Promise((resolve, reject) => {
9
- reader.onload = () => resolve(reader.result);
10
- reader.onerror = reject;
11
- reader.readAsText(this);
12
- });
13
- };
14
- }
15
-
16
- // Polyfill FileReader if not available
17
- if (typeof FileReader === 'undefined') {
18
- global.FileReader = class FileReader {
19
- result = null;
20
- error = null;
21
- onload = null;
22
- onerror = null;
23
-
24
- readAsText(blob) {
25
- try {
26
- // For our polyfilled Blob
27
- if (blob.parts) {
28
- this.result = blob.parts.join('');
29
- } else if (typeof blob === 'string') {
30
- this.result = blob;
31
- } else {
32
- this.result = String(blob);
33
- }
34
-
35
- if (this.onload) {
36
- setTimeout(() => this.onload({ target: this }), 0);
37
- }
38
- } catch (err) {
39
- this.error = err;
40
- if (this.onerror) {
41
- setTimeout(() => this.onerror({ target: this }), 0);
42
- }
43
- }
44
- }
45
- };
46
- }
47
-
48
- // Polyfill Blob if not available (for Node.js < 18)
49
- if (typeof Blob === 'undefined') {
50
- global.Blob = class Blob {
51
- constructor(parts = [], options = {}) {
52
- this.parts = parts;
53
- this.type = options.type || '';
54
- this.size = parts.reduce((acc, part) => {
55
- return acc + (typeof part === 'string' ? part.length : part.length || 0);
56
- }, 0);
57
- }
58
-
59
- async text() {
60
- return this.parts.join('');
61
- }
62
-
63
- async arrayBuffer() {
64
- const text = await this.text();
65
- const buffer = Buffer.from(text);
66
- return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
67
- }
68
- };
69
- }
70
-
71
- // Polyfill File if not available (for Node.js < 18)
72
- if (typeof File === 'undefined') {
73
- global.File = class File extends global.Blob {
74
- constructor(bits, name, options = {}) {
75
- super(bits, options);
76
- this.name = name;
77
- this.lastModified = options.lastModified || Date.now();
78
- }
79
- };
80
- }
1
+ // Jest setup file to polyfill File and Blob APIs
2
+ // This ensures consistent behavior across different Node.js versions and test environments
3
+
4
+ // Polyfill Blob.text() if not available
5
+ if (typeof Blob !== 'undefined' && !Blob.prototype.text) {
6
+ Blob.prototype.text = async function() {
7
+ const reader = new FileReader();
8
+ return new Promise((resolve, reject) => {
9
+ reader.onload = () => resolve(reader.result);
10
+ reader.onerror = reject;
11
+ reader.readAsText(this);
12
+ });
13
+ };
14
+ }
15
+
16
+ // Polyfill FileReader if not available
17
+ if (typeof FileReader === 'undefined') {
18
+ global.FileReader = class FileReader {
19
+ result = null;
20
+ error = null;
21
+ onload = null;
22
+ onerror = null;
23
+
24
+ readAsText(blob) {
25
+ try {
26
+ // For our polyfilled Blob
27
+ if (blob.parts) {
28
+ this.result = blob.parts.join('');
29
+ } else if (typeof blob === 'string') {
30
+ this.result = blob;
31
+ } else {
32
+ this.result = String(blob);
33
+ }
34
+
35
+ if (this.onload) {
36
+ setTimeout(() => this.onload({ target: this }), 0);
37
+ }
38
+ } catch (err) {
39
+ this.error = err;
40
+ if (this.onerror) {
41
+ setTimeout(() => this.onerror({ target: this }), 0);
42
+ }
43
+ }
44
+ }
45
+ };
46
+ }
47
+
48
+ // Polyfill Blob if not available (for Node.js < 18)
49
+ if (typeof Blob === 'undefined') {
50
+ global.Blob = class Blob {
51
+ constructor(parts = [], options = {}) {
52
+ this.parts = parts;
53
+ this.type = options.type || '';
54
+ this.size = parts.reduce((acc, part) => {
55
+ return acc + (typeof part === 'string' ? part.length : part.length || 0);
56
+ }, 0);
57
+ }
58
+
59
+ async text() {
60
+ return this.parts.join('');
61
+ }
62
+
63
+ async arrayBuffer() {
64
+ const text = await this.text();
65
+ const buffer = Buffer.from(text);
66
+ return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
67
+ }
68
+ };
69
+ }
70
+
71
+ // Polyfill File if not available (for Node.js < 18)
72
+ if (typeof File === 'undefined') {
73
+ global.File = class File extends global.Blob {
74
+ constructor(bits, name, options = {}) {
75
+ super(bits, options);
76
+ this.name = name;
77
+ this.lastModified = options.lastModified || Date.now();
78
+ }
79
+ };
80
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posx/core",
3
- "version": "5.5.308",
3
+ "version": "5.5.310",
4
4
  "description": "POSX core libraries",
5
5
  "main": "build/index.js",
6
6
  "author": "Steven Lee",
@@ -1,117 +1,117 @@
1
- {
2
- "name": "@posx/core",
3
- "version": "5.5.308",
4
- "description": "POSX core libraries",
5
- "main": "build/index.js",
6
- "types": "build/index.d.ts",
7
- "scripts": {
8
- "up": "node ./scripts/upload-to-s3.js --trace-warnings",
9
- "start": "webpack serve --config webpack.config.demo.js",
10
- "build": "webpack && tsc",
11
- "build:dts": "npm-dts generate -o build/index.d.ts -L debug",
12
- "post:build": "node ./scripts/clean-build.js",
13
- "mvm": "mv build/*.map scripts/sourcemaps/ && mv build/**/*.map scripts/sourcemaps/ && find build -name '*.map' -type f -delete",
14
- "build:demo": "webpack --config webpack.config.demo.js",
15
- "test": "jest",
16
- "publish": "node ./scripts/publish.js",
17
- "p": "npm test && npm run up:p && npm run build && npm run build:dts && npm run post:build && npm run publish && rm -rf build",
18
- "debug": "npm run build && npm run build:dts && npm run post:build",
19
- "coverage": "npm run test --coverage",
20
- "trypublish": "npm publish || true",
21
- "gen:index": "node ./scriptswc/generateIndex.js",
22
- "up:p": "npm version patch && git push",
23
- "up:m": "npm version minor && git push",
24
- "docs": "typedoc --out docs src --excludePrivate --exclude '**/demo/**/*' --exclude '**/*+(interface|function|enum).ts'",
25
- "see": "node ./scripts/lookup-sm.js"
26
- },
27
- "repository": {
28
- "type": "git"
29
- },
30
- "author": "Steven Lee",
31
- "license": "UNLICENSED",
32
- "bugs": {
33
- "url": ""
34
- },
35
- "homepage": "",
36
- "keywords": [
37
- "library",
38
- "starter",
39
- "es6"
40
- ],
41
- "devDependencies": {
42
- "@babel/cli": "^7.22.15",
43
- "@babel/core": "^7.22.11",
44
- "@babel/plugin-proposal-decorators": "7.23.0",
45
- "@babel/plugin-transform-class-properties": "7.22.5",
46
- "@babel/plugin-transform-typescript": "^7.22.15",
47
- "@babel/polyfill": "^7.12.1",
48
- "@babel/preset-env": "^7.22.15",
49
- "@babel/preset-typescript": "^7.23.0",
50
- "@capacitor/core": "5.4.2",
51
- "@types/bcryptjs": "2.4.6",
52
- "@types/jest": "^29.5.4",
53
- "@types/lodash": "4.14.199",
54
- "@types/node": "20.8.2",
55
- "@types/uuid": "9.0.4",
56
- "@typescript-eslint/eslint-plugin": "^4.33.0",
57
- "@typescript-eslint/parser": "^4.33.0",
58
- "aws-sdk": "2.1550.0",
59
- "babel-eslint": "^10.1.0",
60
- "babel-loader": "^9.1.3",
61
- "babel-preset-minify": "^0.5.2",
62
- "clean-webpack-plugin": "4.0.0",
63
- "colors": "1.4.0",
64
- "copy-webpack-plugin": "12.0.2",
65
- "css-loader": "^6.8.1",
66
- "css-minimizer-webpack-plugin": "^5.0.1",
67
- "eslint": "^7.32.0",
68
- "file-loader": "^6.2.0",
69
- "fs-extra": "11.1.1",
70
- "glob": "10.3.10",
71
- "html-webpack-plugin": "^5.5.3",
72
- "jest": "^29.6.4",
73
- "jest-environment-jsdom": "29.7.0",
74
- "mini-css-extract-plugin": "^2.7.6",
75
- "npm-dts": "1.3.12",
76
- "path": "0.12.7",
77
- "prompt-sync": "4.2.0",
78
- "source-map": "0.5.3",
79
- "sqlite3": "5.1.6",
80
- "style-loader": "^3.3.2",
81
- "terser-webpack-plugin": "^5.3.9",
82
- "ts-jest": "29.1.1",
83
- "typedoc": "0.25.3",
84
- "typescript": "^4.9.5",
85
- "url-loader": "^4.1.1",
86
- "webpack": "^5.88.2",
87
- "webpack-cli": "^5.1.4",
88
- "webpack-dev-server": "4.13.3",
89
- "webpack-obfuscator": "3.5.1"
90
- },
91
- "dependencies": {
92
- "@awesome-cordova-plugins/core": "6.6.0",
93
- "@awesome-cordova-plugins/network-interface": "6.6.0",
94
- "@litepos/autoquery": "5.0.2",
95
- "@microsoft/signalr": "7.0.11",
96
- "axios": "1.5.1",
97
- "bcryptjs": "2.4.3",
98
- "buffer": "6.0.3",
99
- "crypto-browserify": "3.12.0",
100
- "crypto-js": "4.2.0",
101
- "dayjs": "1.11.10",
102
- "dexie": "3.2.4",
103
- "esc-pos-encoder-ionic": "1.1.3",
104
- "handlebars": "4.7.8",
105
- "lodash": "4.17.21",
106
- "mathjs": "12.3.2",
107
- "nanoid": "3.3.4",
108
- "save": "2.9.0",
109
- "selecttransform": "1.6.1",
110
- "sockets-for-cordova": "1.0.0",
111
- "stream-browserify": "3.0.0",
112
- "uuid": "9.0.1",
113
- "vm-browserify": "1.1.2",
114
- "wcwidth": "1.0.1",
115
- "zod": "3.23.8"
116
- }
117
- }
1
+ {
2
+ "name": "@posx/core",
3
+ "version": "5.5.310",
4
+ "description": "POSX core libraries",
5
+ "main": "build/index.js",
6
+ "types": "build/index.d.ts",
7
+ "scripts": {
8
+ "up": "node ./scripts/upload-to-s3.js --trace-warnings",
9
+ "start": "webpack serve --config webpack.config.demo.js",
10
+ "build": "webpack && tsc",
11
+ "build:dts": "npm-dts generate -o build/index.d.ts -L debug",
12
+ "post:build": "node ./scripts/clean-build.js",
13
+ "mvm": "mv build/*.map scripts/sourcemaps/ && mv build/**/*.map scripts/sourcemaps/ && find build -name '*.map' -type f -delete",
14
+ "build:demo": "webpack --config webpack.config.demo.js",
15
+ "test": "jest",
16
+ "publish": "node ./scripts/publish.js",
17
+ "p": "npm test && npm run up:p && npm run build && npm run build:dts && npm run post:build && npm run publish && rm -rf build",
18
+ "debug": "npm run build && npm run build:dts && npm run post:build",
19
+ "coverage": "npm run test --coverage",
20
+ "trypublish": "npm publish || true",
21
+ "gen:index": "node ./scriptswc/generateIndex.js",
22
+ "up:p": "npm version patch && git push",
23
+ "up:m": "npm version minor && git push",
24
+ "docs": "typedoc --out docs src --excludePrivate --exclude '**/demo/**/*' --exclude '**/*+(interface|function|enum).ts'",
25
+ "see": "node ./scripts/lookup-sm.js"
26
+ },
27
+ "repository": {
28
+ "type": "git"
29
+ },
30
+ "author": "Steven Lee",
31
+ "license": "UNLICENSED",
32
+ "bugs": {
33
+ "url": ""
34
+ },
35
+ "homepage": "",
36
+ "keywords": [
37
+ "library",
38
+ "starter",
39
+ "es6"
40
+ ],
41
+ "devDependencies": {
42
+ "@babel/cli": "^7.22.15",
43
+ "@babel/core": "^7.22.11",
44
+ "@babel/plugin-proposal-decorators": "7.23.0",
45
+ "@babel/plugin-transform-class-properties": "7.22.5",
46
+ "@babel/plugin-transform-typescript": "^7.22.15",
47
+ "@babel/polyfill": "^7.12.1",
48
+ "@babel/preset-env": "^7.22.15",
49
+ "@babel/preset-typescript": "^7.23.0",
50
+ "@capacitor/core": "5.4.2",
51
+ "@types/bcryptjs": "2.4.6",
52
+ "@types/jest": "^29.5.4",
53
+ "@types/lodash": "4.14.199",
54
+ "@types/node": "20.8.2",
55
+ "@types/uuid": "9.0.4",
56
+ "@typescript-eslint/eslint-plugin": "^4.33.0",
57
+ "@typescript-eslint/parser": "^4.33.0",
58
+ "aws-sdk": "2.1550.0",
59
+ "babel-eslint": "^10.1.0",
60
+ "babel-loader": "^9.1.3",
61
+ "babel-preset-minify": "^0.5.2",
62
+ "clean-webpack-plugin": "4.0.0",
63
+ "colors": "1.4.0",
64
+ "copy-webpack-plugin": "12.0.2",
65
+ "css-loader": "^6.8.1",
66
+ "css-minimizer-webpack-plugin": "^5.0.1",
67
+ "eslint": "^7.32.0",
68
+ "file-loader": "^6.2.0",
69
+ "fs-extra": "11.1.1",
70
+ "glob": "10.3.10",
71
+ "html-webpack-plugin": "^5.5.3",
72
+ "jest": "^29.6.4",
73
+ "jest-environment-jsdom": "29.7.0",
74
+ "mini-css-extract-plugin": "^2.7.6",
75
+ "npm-dts": "1.3.12",
76
+ "path": "0.12.7",
77
+ "prompt-sync": "4.2.0",
78
+ "source-map": "0.5.3",
79
+ "sqlite3": "5.1.6",
80
+ "style-loader": "^3.3.2",
81
+ "terser-webpack-plugin": "^5.3.9",
82
+ "ts-jest": "29.1.1",
83
+ "typedoc": "0.25.3",
84
+ "typescript": "^4.9.5",
85
+ "url-loader": "^4.1.1",
86
+ "webpack": "^5.88.2",
87
+ "webpack-cli": "^5.1.4",
88
+ "webpack-dev-server": "4.13.3",
89
+ "webpack-obfuscator": "3.5.1"
90
+ },
91
+ "dependencies": {
92
+ "@awesome-cordova-plugins/core": "6.6.0",
93
+ "@awesome-cordova-plugins/network-interface": "6.6.0",
94
+ "@litepos/autoquery": "5.0.2",
95
+ "@microsoft/signalr": "7.0.11",
96
+ "axios": "1.5.1",
97
+ "bcryptjs": "2.4.3",
98
+ "buffer": "6.0.3",
99
+ "crypto-browserify": "3.12.0",
100
+ "crypto-js": "4.2.0",
101
+ "dayjs": "1.11.10",
102
+ "dexie": "3.2.4",
103
+ "esc-pos-encoder-ionic": "1.1.3",
104
+ "handlebars": "4.7.8",
105
+ "lodash": "4.17.21",
106
+ "mathjs": "12.3.2",
107
+ "nanoid": "3.3.4",
108
+ "save": "2.9.0",
109
+ "selecttransform": "1.6.1",
110
+ "sockets-for-cordova": "1.0.0",
111
+ "stream-browserify": "3.0.0",
112
+ "uuid": "9.0.1",
113
+ "vm-browserify": "1.1.2",
114
+ "wcwidth": "1.0.1",
115
+ "zod": "3.23.8"
116
+ }
117
+ }