@wppconnect/wa-version 1.5.5217 → 1.5.5219

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wppconnect/wa-version",
3
- "version": "1.5.5217",
3
+ "version": "1.5.5219",
4
4
  "description": "List of WhatsApp Web HTML",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -27,7 +27,8 @@
27
27
  "release": "release-it",
28
28
  "wa-update": "ts-node ./src/tools/update.ts",
29
29
  "watch": "tsc -w --sourceMap",
30
- "test:minimatch": "node --test test/minimatch-compat.test.cjs"
30
+ "test:minimatch": "node --test test/minimatch-compat.test.cjs",
31
+ "test:workflows": "node --test test/workflow-boundaries.test.cjs"
31
32
  },
32
33
  "dependencies": {
33
34
  "node-fetch": "^2.7.0",
@@ -42,8 +43,8 @@
42
43
  "@types/node": "^24.19.2",
43
44
  "@types/node-fetch": "^2.6.13",
44
45
  "@types/semver": "^7.8.0",
45
- "@typescript-eslint/eslint-plugin": "^8.72.2",
46
- "@typescript-eslint/parser": "^8.72.2",
46
+ "@typescript-eslint/eslint-plugin": "^8.73.0",
47
+ "@typescript-eslint/parser": "^8.73.0",
47
48
  "commitizen": "^4.3.2",
48
49
  "conventional-changelog-angular": "^8.3.1",
49
50
  "conventional-changelog-cli": "^5.0.0",
@@ -52,6 +53,7 @@
52
53
  "eslint-plugin-prettier": "^5.5.7",
53
54
  "execa": "~5.1.1",
54
55
  "husky": "^9.1.7",
56
+ "js-yaml": "^5.5.0",
55
57
  "prettier": "^3.10.1",
56
58
  "pretty-quick": "^4.2.2",
57
59
  "release-it": "^21.1.2",
@@ -70,7 +72,7 @@
70
72
  },
71
73
  "minimatch@>=4.0.0 <11.0.1": "11.0.3",
72
74
  "glob@7.2.3": {
73
- "minimatch": "file:../../vendor/wppconnect-minimatch-legacy-compat-1.0.3.tgz"
75
+ "minimatch": "file:../../vendor/wppconnect-minimatch-legacy-compat-1.0.4.tgz"
74
76
  }
75
77
  }
76
78
  }
@@ -65,7 +65,10 @@ test('the installed facade is the reviewed source and delegates to a patched reg
65
65
  'minimatch-engine'
66
66
  ].replace(/^npm:minimatch@/, '')
67
67
  );
68
- assert.equal(require('minimatch/package.json').version, '11.0.3');
68
+ assert.equal(
69
+ require('minimatch/package.json').version,
70
+ require('../package-lock.json').packages['node_modules/minimatch'].version
71
+ );
69
72
  assert.equal(
70
73
  fs.readFileSync(owner.resolve('minimatch'), 'utf8').replace(/\r\n/g, '\n'),
71
74
  fs
@@ -93,9 +96,17 @@ test('both registry engines bound first-phase glob amplification', () => {
93
96
  return result;
94
97
  }
95
98
  }
96
- new Probe(Array.from({length:12}, (_, i) => 'p'+i+'/**/../q'+i).join('/'),
97
- { optimizationLevel: 2, braceExpandMax: 64 });
98
- assert(peak > 1 && peak <= 64, 'first-phase pattern budget exceeded: '+peak);
99
+ let rejected = false;
100
+ try {
101
+ new Probe(Array.from({length:12}, (_, i) => 'p'+i+'/**/../q'+i).join('/'),
102
+ { optimizationLevel: 2, braceExpandMax: 64 });
103
+ } catch (error) {
104
+ assert.equal(error.name, 'RangeError');
105
+ assert.equal(error.message, "optimizationLevel 2: too many patterns from '**/..'");
106
+ rejected = true;
107
+ }
108
+ if (!rejected)
109
+ assert(peak > 1 && peak <= 64, 'first-phase pattern budget exceeded: '+peak);
99
110
  `;
100
111
  const result = spawnSync(
101
112
  process.execPath,
@@ -157,6 +168,18 @@ test('the actual legacy development consumer still works', async () => {
157
168
  glob.sync('missing/*.{js,ts}', { cwd: scratch, nonull: true }),
158
169
  ['missing/*.js', 'missing/*.ts']
159
170
  );
171
+ assert.deepEqual(
172
+ glob.sync('missing/{1..3}.txt', { cwd: scratch, nonull: true }),
173
+ ['missing/1.txt', 'missing/2.txt', 'missing/3.txt']
174
+ );
175
+ for (const number of [1, 2, 3]) {
176
+ fs.writeFileSync(path.join(scratch, `number-${number}.txt`), '');
177
+ }
178
+ assert.deepEqual(glob.sync('number-{1..3}.txt', { cwd: scratch }), [
179
+ 'number-1.txt',
180
+ 'number-2.txt',
181
+ 'number-3.txt',
182
+ ]);
160
183
  assert.deepEqual(
161
184
  await new Promise((resolve, reject) =>
162
185
  glob('**/*.js', { cwd: scratch }, (error, files) =>
@@ -0,0 +1,207 @@
1
+ /*!
2
+ * Copyright 2026 WPPConnect Team
3
+ * Licensed under the Apache License, Version 2.0.
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ const assert = require('node:assert/strict');
7
+ const { spawnSync } = require('node:child_process');
8
+ const fs = require('node:fs');
9
+ const os = require('node:os');
10
+ const path = require('node:path');
11
+ const { test } = require('node:test');
12
+ const yaml = require('js-yaml');
13
+
14
+ const root = path.resolve(__dirname, '..');
15
+ const workflow = (name) =>
16
+ yaml.load(
17
+ fs.readFileSync(path.join(root, '.github/workflows', name), 'utf8')
18
+ );
19
+ const update = workflow('wa-update.yml');
20
+ const release = workflow('release.yml');
21
+ const publish = workflow('publish.yml');
22
+
23
+ // Evaluate only the bounded condition forms used by these workflows. Workflow
24
+ // expressions are data, never JavaScript or shell code to execute.
25
+ function enabled(condition, context) {
26
+ if (condition === undefined) return true;
27
+ if (typeof condition === 'boolean') return condition;
28
+ const expression = condition.replace(/^\s*\$\{\{\s*|\s*\}\}\s*$/g, '').trim();
29
+ return expression.split(/\s*\|\|\s*/).some((group) =>
30
+ group.split(/\s*&&\s*/).every((term) => {
31
+ if (term === 'true') return true;
32
+ if (term === 'false') return false;
33
+ let match = term.match(/^github\.event_name\s*(==|!=)\s*'([^']+)'$/);
34
+ if (match) return (context.event === match[2]) === (match[1] === '==');
35
+ match = term.match(/^steps\.update\.outputs\.(\w+)\s*==\s*'([^']+)'$/);
36
+ if (match) return context.outputs[match[1]] === match[2];
37
+ match = term.match(/^startsWith\(github\.ref,\s*'([^']+)'\)$/);
38
+ if (match) return context.ref.startsWith(match[1]);
39
+ throw new Error(`Unsupported workflow condition: ${term}`);
40
+ })
41
+ );
42
+ }
43
+
44
+ const context = (event, ref = 'refs/heads/main') => ({
45
+ event,
46
+ ref,
47
+ outputs: {
48
+ hasChanges: 'true',
49
+ shouldRelease: 'true',
50
+ hasNewVersion: 'true',
51
+ hasOutdated: 'true',
52
+ },
53
+ });
54
+ const activeJobs = (event) =>
55
+ Object.values(update.jobs).filter((job) => enabled(job.if, context(event)));
56
+ const activeSteps = (event) =>
57
+ activeJobs(event).flatMap((job) =>
58
+ job.steps.filter((step) => enabled(step.if, context(event)))
59
+ );
60
+
61
+ test('pull requests run validation with only read access and no persisted token', () => {
62
+ const jobs = activeJobs('pull_request');
63
+ assert.ok(jobs.length > 0, 'PR validation must remain enabled');
64
+ for (const job of jobs) {
65
+ const permissions = job.permissions || update.permissions;
66
+ assert.deepEqual(permissions, { contents: 'read' });
67
+ for (const step of job.steps) {
68
+ if (step.uses?.startsWith('actions/checkout@')) {
69
+ assert.equal(step.with?.['persist-credentials'], false);
70
+ }
71
+ }
72
+ }
73
+ });
74
+
75
+ test('PR catalog checks cannot commit, publish, dispatch or notify even for a new version', () => {
76
+ const steps = activeSteps('pull_request');
77
+ const check = steps.find((step) => step.run === 'npm run wa-update');
78
+ assert.ok(check, 'retain read-only updater validation');
79
+ assert.equal(check.env.WA_COMMIT, 'false');
80
+ assert.ok(steps.some((step) => step.run === 'npm run test:workflows'));
81
+ for (const step of steps) {
82
+ assert.doesNotMatch(JSON.stringify(step), /secrets\.|github\.token/);
83
+ assert.doesNotMatch(
84
+ step.run || '',
85
+ /(?:gh workflow run|npm (?:run )?release|npm publish|git push)/
86
+ );
87
+ assert.ok(!step.uses?.includes('actions-status-discord'));
88
+ }
89
+ });
90
+
91
+ for (const event of ['push', 'schedule', 'workflow_dispatch']) {
92
+ test(`${event} grants writes only to the updater after read-only validation`, () => {
93
+ const updater = activeJobs(event).find((job) =>
94
+ job.steps.some((step) => step.name === 'Trigger publish')
95
+ );
96
+ assert.ok(updater);
97
+ assert.deepEqual(updater.permissions, {
98
+ contents: 'write',
99
+ actions: 'write',
100
+ });
101
+ const validation = update.jobs[updater.needs];
102
+ assert.ok(validation, 'the updater must depend on validation');
103
+ assert.deepEqual(validation.permissions, { contents: 'read' });
104
+ assert.ok(
105
+ !validation.steps.some((step) => /secrets\./.test(JSON.stringify(step)))
106
+ );
107
+ const checkout = updater.steps.find((step) =>
108
+ step.uses?.startsWith('actions/checkout@')
109
+ );
110
+ assert.equal(checkout.with.ref, 'main');
111
+ const check = updater.steps.find(
112
+ (step) => step.run === 'npm run wa-update'
113
+ );
114
+ assert.equal(check.env.WA_COMMIT, 'true');
115
+ });
116
+ }
117
+
118
+ test('every notification is explicitly disabled for pull requests', () => {
119
+ const notifications = Object.values(update.jobs)
120
+ .flatMap((job) => job.steps)
121
+ .filter((step) => step.uses?.includes('actions-status-discord'));
122
+ assert.equal(notifications.length, 2);
123
+ for (const step of notifications) {
124
+ assert.equal(enabled(step.if, context('pull_request')), false);
125
+ assert.equal(enabled(step.if, context('schedule')), true);
126
+ }
127
+ });
128
+
129
+ test('manual publication accepts version tags and rejects branch refs', () => {
130
+ assert.ok(Object.hasOwn(publish.on, 'workflow_dispatch'));
131
+ assert.equal(
132
+ enabled(
133
+ publish.jobs.publish.if,
134
+ context('workflow_dispatch', 'refs/tags/v1.2.3')
135
+ ),
136
+ true
137
+ );
138
+ for (const ref of ['refs/heads/main', 'refs/heads/v1.2.3']) {
139
+ assert.equal(
140
+ enabled(publish.jobs.publish.if, context('workflow_dispatch', ref)),
141
+ false
142
+ );
143
+ }
144
+ });
145
+
146
+ test('release dispatch commands pass the computed tag without invoking a publisher', () => {
147
+ const directory = fs.mkdtempSync(
148
+ path.join(os.tmpdir(), 'wpp-workflow-contract-')
149
+ );
150
+ const bin = path.join(directory, 'bin');
151
+ fs.mkdirSync(bin);
152
+ const output = path.join(directory, 'arguments.txt');
153
+ fs.writeFileSync(path.join(bin, 'node'), '#!/bin/sh\nprintf "1.2.3\\n"\n', {
154
+ mode: 0o755,
155
+ });
156
+ fs.writeFileSync(
157
+ path.join(bin, 'gh'),
158
+ '#!/bin/sh\nprintf "%s\\n" "$@" > "$CAPTURE_FILE"\n',
159
+ { mode: 0o755 }
160
+ );
161
+ const shell =
162
+ process.platform === 'win32'
163
+ ? path.join(process.env.ProgramFiles, 'Git/bin/bash.exe')
164
+ : '/bin/bash';
165
+ try {
166
+ for (const source of [update, release]) {
167
+ const step = Object.values(source.jobs)
168
+ .flatMap((job) => job.steps)
169
+ .find((item) => item.name === 'Trigger publish');
170
+ assert.equal(step.env.GH_TOKEN, '${{ github.token }}');
171
+ // The whitelist makes it impossible to execute arbitrary edited workflow
172
+ // commands through this test. The commands run only against local stubs.
173
+ assert.equal(
174
+ step.run,
175
+ 'gh workflow run publish.yml --ref "v$(node -p "require(\'./package.json\').version")"'
176
+ );
177
+ const result = spawnSync(
178
+ shell,
179
+ ['--noprofile', '--norc', '-c', step.run],
180
+ {
181
+ cwd: directory,
182
+ encoding: 'utf8',
183
+ timeout: 5000,
184
+ env: {
185
+ PATH: bin.replace(/\\/g, '/'),
186
+ CAPTURE_FILE: output.replace(/\\/g, '/'),
187
+ GH_TOKEN: 'workflow-test-only',
188
+ SystemRoot: process.env.SystemRoot || '',
189
+ },
190
+ }
191
+ );
192
+ assert.equal(result.status, 0, result.stderr || result.error?.message);
193
+ assert.deepEqual(fs.readFileSync(output, 'utf8').trim().split(/\r?\n/), [
194
+ 'workflow',
195
+ 'run',
196
+ 'publish.yml',
197
+ '--ref',
198
+ 'v1.2.3',
199
+ ]);
200
+ }
201
+ } finally {
202
+ const resolved = fs.realpathSync(directory);
203
+ assert.equal(path.dirname(resolved), fs.realpathSync(os.tmpdir()));
204
+ assert.ok(path.basename(resolved).startsWith('wpp-workflow-contract-'));
205
+ fs.rmSync(resolved, { recursive: true, force: true });
206
+ }
207
+ });
@@ -1,6 +1,6 @@
1
1
  # Scoped legacy development-consumer facade
2
2
 
3
- All pattern compilation and matching use the unmodified upstream minimatch 11.0.4 engine, installed through the npm alias `minimatch-engine`. No version3 or version10 matching code is retained or relabelled. Modern namespace consumers receive upstream11.0.3 directly.
3
+ All pattern compilation and matching use the unmodified upstream minimatch 11.0.9 engine, installed through the npm alias `minimatch-engine`. No version3 or version10 matching code is retained or relabelled. Modern namespace consumers receive the upstream registry version selected in package-lock.json directly.
4
4
 
5
5
  This private facade supports only the contracts used by eslint-plugin-import and glob7: callable matching and helpers, the Minimatch constructor, glob traversal segment metadata and String.match. Legacy traversal disables row optimization/merging so globSet indices and nonull brace alternatives stay aligned. The removed makeRe API is represented by a test-only object because eslint-plugin-import calls only .test; it is not a RegExp and must not be used as a general regex serializer.
6
6
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@wppconnect/minimatch-legacy-compat",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "private": true,
5
5
  "description": "Callable CommonJS facade over the patched minimatch engine for legacy development consumers",
6
6
  "main": "index.cjs",
7
7
  "license": "Apache-2.0",
8
8
  "dependencies": {
9
- "minimatch-engine": "npm:minimatch@11.0.4"
9
+ "minimatch-engine": "npm:minimatch@11.0.9"
10
10
  },
11
11
  "files": [
12
12
  "index.cjs",
package/versions.json CHANGED
@@ -1,43 +1,7 @@
1
1
  {
2
2
  "currentBeta": null,
3
- "currentVersion": "2.3000.1054966512-alpha",
3
+ "currentVersion": "2.3000.1055099339-alpha",
4
4
  "versions": [
5
- {
6
- "version": "2.3000.1047780587-alpha",
7
- "beta": false,
8
- "released": "2026-09-17T15:17:17.940Z",
9
- "expire": "2026-11-17T15:17:17.940Z"
10
- },
11
- {
12
- "version": "2.3000.1047806989-alpha",
13
- "beta": false,
14
- "released": "2026-09-17T19:13:38.974Z",
15
- "expire": "2026-11-17T19:13:38.974Z"
16
- },
17
- {
18
- "version": "2.3000.1047787617-alpha",
19
- "beta": false,
20
- "released": "2026-09-17T19:14:56.181Z",
21
- "expire": "2026-11-17T19:14:56.181Z"
22
- },
23
- {
24
- "version": "2.3000.1047819263-alpha",
25
- "beta": false,
26
- "released": "2026-09-17T22:24:24.407Z",
27
- "expire": "2026-11-17T22:24:24.407Z"
28
- },
29
- {
30
- "version": "2.3000.1047835881-alpha",
31
- "beta": false,
32
- "released": "2026-09-18T00:44:16.810Z",
33
- "expire": "2026-11-18T00:44:16.810Z"
34
- },
35
- {
36
- "version": "2.3000.1047824257-alpha",
37
- "beta": false,
38
- "released": "2026-09-18T00:45:44.163Z",
39
- "expire": "2026-11-18T00:45:44.163Z"
40
- },
41
5
  {
42
6
  "version": "2.3000.1047859832-alpha",
43
7
  "beta": false,
@@ -2041,7 +2005,19 @@
2041
2005
  "beta": false,
2042
2006
  "released": "2026-11-17T13:24:51.881Z",
2043
2007
  "expire": "2027-01-17T13:24:51.881Z"
2008
+ },
2009
+ {
2010
+ "version": "2.3000.1055059001-alpha",
2011
+ "beta": false,
2012
+ "released": "2026-11-17T22:53:25.846Z",
2013
+ "expire": "2027-01-17T22:53:25.846Z"
2014
+ },
2015
+ {
2016
+ "version": "2.3000.1055099339-alpha",
2017
+ "beta": false,
2018
+ "released": "2026-11-18T04:12:57.039Z",
2019
+ "expire": "2027-01-18T04:12:57.039Z"
2044
2020
  }
2045
2021
  ],
2046
- "currentAlpha": "2.3000.1054966512-alpha"
2022
+ "currentAlpha": "2.3000.1055099339-alpha"
2047
2023
  }