@automattic/jetpack-scan 1.1.0 → 1.2.1

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/CHANGELOG.md CHANGED
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.2.1] - 2025-11-21
9
+ ### Changed
10
+ - Replace icons removed from @wordpress/icons with alternatives. [#45760]
11
+ - Update dependencies. [#45488]
12
+ - Update package dependencies. [#45551] [#45652] [#45735] [#45737] [#45915] [#45958] [#46022]
13
+
14
+ ## [1.2.0] - 2025-10-10
15
+ ### Added
16
+ - Add missing types. [#44787]
17
+
18
+ ### Changed
19
+ - Update @wordpress/dataviews package. [#44376] [#45012] [#45213]
20
+ - Update package dependencies. [#44677] [#44701] [#45027] [#45097] [#45229] [#45335] [#45428]
21
+
8
22
  ## [1.1.0] - 2025-07-30
9
23
  ### Added
10
24
  - Add UI confirmation via text box when deleting an extension via delete-fixer so that the user is fully aware that it may break their site. [#44521]
@@ -143,6 +157,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
143
157
  ### Removed
144
158
  - Updated dependencies. [#39754]
145
159
 
160
+ [1.2.1]: https://github.com/Automattic/jetpack-scan/compare/v1.2.0...v1.2.1
161
+ [1.2.0]: https://github.com/Automattic/jetpack-scan/compare/v1.1.0...v1.2.0
146
162
  [1.1.0]: https://github.com/Automattic/jetpack-scan/compare/v1.0.2...v1.1.0
147
163
  [1.0.2]: https://github.com/Automattic/jetpack-scan/compare/v1.0.1...v1.0.2
148
164
  [1.0.1]: https://github.com/Automattic/jetpack-scan/compare/v1.0.0...v1.0.1
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Text, Button } from '@automattic/jetpack-components';
3
3
  import { Notice, Spinner } from '@wordpress/components';
4
4
  import { __ } from '@wordpress/i18n';
5
- import { Icon, warning } from '@wordpress/icons';
5
+ import { Icon, cautionFilled as warning } from '@wordpress/icons';
6
6
  import { useContext } from 'react';
7
7
  import { ThreatModalContext } from "./index.js";
8
8
  import styles from './styles.module.scss';
@@ -3,16 +3,25 @@ export declare const THREAT_STATUSES: {
3
3
  label: string;
4
4
  variant?: 'success' | 'warning';
5
5
  }[];
6
- export declare const THREAT_TYPES: {
6
+ export declare const THREAT_TYPES: ({
7
7
  value: string;
8
- label: string;
9
- }[];
8
+ label: import("@wordpress/i18n").TranslatableText<"Plugin">;
9
+ } | {
10
+ value: string;
11
+ label: import("@wordpress/i18n").TranslatableText<"Theme">;
12
+ } | {
13
+ value: string;
14
+ label: import("@wordpress/i18n").TranslatableText<"WordPress">;
15
+ } | {
16
+ value: string;
17
+ label: import("@wordpress/i18n").TranslatableText<"File">;
18
+ })[];
10
19
  export declare const THREAT_ICONS: {
11
- plugins: import("react").JSX.Element;
12
- themes: import("react").JSX.Element;
13
- core: import("react").JSX.Element;
14
- file: import("react").JSX.Element;
15
- default: import("react").JSX.Element;
20
+ plugins: any;
21
+ themes: any;
22
+ core: any;
23
+ file: any;
24
+ default: any;
16
25
  };
17
26
  export declare const THREAT_FIELD_THREAT = "threat";
18
27
  export declare const THREAT_FIELD_TITLE = "title";
@@ -345,7 +345,6 @@ export default function ThreatsDataViews({ data, filters, onChangeSelection, isT
345
345
  id: THREAT_ACTION_IGNORE,
346
346
  label: __('Ignore', 'jetpack-scan'),
347
347
  isPrimary: true,
348
- isDestructive: true,
349
348
  callback: onIgnoreThreats,
350
349
  isEligible(item) {
351
350
  if (!onIgnoreThreats) {
@@ -363,7 +362,6 @@ export default function ThreatsDataViews({ data, filters, onChangeSelection, isT
363
362
  id: THREAT_ACTION_UNIGNORE,
364
363
  label: __('Unignore', 'jetpack-scan'),
365
364
  isPrimary: true,
366
- isDestructive: true,
367
365
  callback: onUnignoreThreats,
368
366
  isEligible(item) {
369
367
  if (!onUnignoreThreats) {
@@ -1,4 +1,18 @@
1
1
  import { Threat } from './threats.ts';
2
+ export type ExtensionStatus = {
3
+ /** The name of the extension. */
4
+ name: string;
5
+ /** The slug of the extension. */
6
+ slug: string;
7
+ /** The version of the extension. */
8
+ version: string;
9
+ /** The threats found in the extension. */
10
+ threats: Threat[];
11
+ /** The type of extension. */
12
+ type: 'plugins' | 'themes';
13
+ /** Whether the extension was checked in the latest scan. */
14
+ checked: boolean;
15
+ };
2
16
  export type ScanStatus = {
3
17
  /** The current status of the scanner. */
4
18
  status: 'unavailable' | 'provisioning' | 'idle' | 'scanning' | 'scheduled';
@@ -20,4 +34,9 @@ export type ScanStatus = {
20
34
  errorMessage: string | null;
21
35
  /** The detected threats. */
22
36
  threats: Threat[];
37
+ core: ExtensionStatus | ExtensionStatus[];
38
+ plugins: ExtensionStatus[];
39
+ themes: ExtensionStatus[];
40
+ files: Threat[];
41
+ database: Threat[];
23
42
  };
@@ -10,6 +10,6 @@ export declare const getFixerState: (fixerStatus: ThreatFixStatus) => {
10
10
  error: boolean;
11
11
  stale: boolean;
12
12
  };
13
- export declare const getFixerAction: (threat: Threat) => string;
14
- export declare const getDetailedFixerAction: (threat: Threat) => string;
13
+ export declare const getFixerAction: (threat: Threat) => import("@wordpress/i18n").TranslatableText<"Delete"> | import("@wordpress/i18n").TranslatableText<"Update"> | import("@wordpress/i18n").TranslatableText<"Replace"> | import("@wordpress/i18n").TranslatableText<"Auto-fix">;
14
+ export declare const getDetailedFixerAction: (threat: Threat) => import("@wordpress/i18n").TranslatableText<"Update"> | import("@wordpress/i18n").TranslatableText<"Auto-fix"> | import("@wordpress/i18n").TranslatableText<"Delete file"> | import("@wordpress/i18n").TranslatableText<"Delete plugin from site"> | import("@wordpress/i18n").TranslatableText<"Delete theme from site"> | import("@wordpress/i18n").TranslatableText<"Update plugin to newer version"> | import("@wordpress/i18n").TranslatableText<"Update theme to newer version"> | import("@wordpress/i18n").TranslatableText<"Replace from backup"> | import("@wordpress/i18n").TranslatableText<"Replace default salts">;
15
15
  export declare const getFixerDescription: (threat: Threat) => string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
- "private": false,
3
2
  "name": "@automattic/jetpack-scan",
4
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
+ "private": false,
5
5
  "description": "A JS client for consuming Jetpack Scan services",
6
6
  "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/scan/#readme",
7
7
  "bugs": {
@@ -14,27 +14,7 @@
14
14
  },
15
15
  "license": "GPL-2.0-or-later",
16
16
  "author": "Automattic",
17
- "scripts": {
18
- "build": "pnpm run clean && pnpm run compile-ts",
19
- "clean": "rm -rf build/",
20
- "compile-ts": "tsc --pretty",
21
- "test": "NODE_OPTIONS=--experimental-vm-modules jest",
22
- "test-coverage": "pnpm run test --coverage",
23
- "typecheck": "tsc --noEmit"
24
- },
25
17
  "type": "module",
26
- "devDependencies": {
27
- "@storybook/addon-docs": "9.0.15",
28
- "@storybook/react": "9.0.15",
29
- "@testing-library/dom": "10.4.0",
30
- "@testing-library/react": "16.3.0",
31
- "@types/jest": "30.0.0",
32
- "@types/react": "18.3.23",
33
- "jest": "30.0.4",
34
- "jest-environment-jsdom": "30.0.4",
35
- "storybook": "9.0.15",
36
- "typescript": "5.8.3"
37
- },
38
18
  "exports": {
39
19
  ".": {
40
20
  "types": "./build/index.d.ts",
@@ -43,24 +23,44 @@
43
23
  },
44
24
  "main": "./build/index.js",
45
25
  "types": "./build/index.d.ts",
26
+ "scripts": {
27
+ "build": "pnpm run clean && pnpm run compile-ts",
28
+ "clean": "rm -rf build/",
29
+ "compile-ts": "tsc --pretty",
30
+ "test": "NODE_OPTIONS=--experimental-vm-modules jest",
31
+ "test-coverage": "pnpm run test --coverage",
32
+ "typecheck": "tsc --noEmit"
33
+ },
46
34
  "dependencies": {
47
- "@automattic/jetpack-api": "^1.0.5",
48
- "@automattic/jetpack-base-styles": "^1.0.6",
49
- "@automattic/jetpack-components": "^1.1.16",
50
- "@wordpress/api-fetch": "7.26.0",
51
- "@wordpress/components": "29.12.0",
52
- "@wordpress/dataviews": "4.17.0",
53
- "@wordpress/date": "5.26.0",
54
- "@wordpress/element": "6.26.0",
55
- "@wordpress/i18n": "5.26.0",
56
- "@wordpress/icons": "10.26.0",
57
- "@wordpress/url": "4.26.0",
35
+ "@automattic/jetpack-api": "^1.0.11",
36
+ "@automattic/jetpack-base-styles": "^1.0.11",
37
+ "@automattic/jetpack-components": "^1.3.12",
38
+ "@wordpress/api-fetch": "7.35.0",
39
+ "@wordpress/components": "30.8.0",
40
+ "@wordpress/dataviews": "10.2.0",
41
+ "@wordpress/date": "5.35.0",
42
+ "@wordpress/element": "6.35.0",
43
+ "@wordpress/i18n": "6.8.0",
44
+ "@wordpress/icons": "11.2.0",
45
+ "@wordpress/url": "4.35.0",
58
46
  "debug": "4.4.1",
59
47
  "react": "^18.2.0",
60
48
  "react-dom": "^18.2.0"
61
49
  },
50
+ "devDependencies": {
51
+ "@storybook/addon-docs": "10.0.8",
52
+ "@storybook/react": "10.0.8",
53
+ "@testing-library/dom": "10.4.1",
54
+ "@testing-library/react": "16.3.0",
55
+ "@types/jest": "30.0.0",
56
+ "@types/react": "18.3.26",
57
+ "jest": "30.2.0",
58
+ "jest-environment-jsdom": "30.2.0",
59
+ "storybook": "10.0.8",
60
+ "typescript": "5.9.3"
61
+ },
62
62
  "peerDependencies": {
63
- "@wordpress/i18n": "5.26.0",
63
+ "@wordpress/i18n": "6.8.0",
64
64
  "react": "^18.2.0",
65
65
  "react-dom": "^18.2.0"
66
66
  }
@@ -1,7 +1,7 @@
1
1
  import { Text, Button } from '@automattic/jetpack-components';
2
2
  import { Notice, Spinner } from '@wordpress/components';
3
3
  import { __ } from '@wordpress/i18n';
4
- import { Icon, warning } from '@wordpress/icons';
4
+ import { Icon, cautionFilled as warning } from '@wordpress/icons';
5
5
  import { useContext } from 'react';
6
6
  import { ThreatModalContext } from './index.tsx';
7
7
  import styles from './styles.module.scss';
@@ -441,7 +441,6 @@ export default function ThreatsDataViews( {
441
441
  id: THREAT_ACTION_IGNORE,
442
442
  label: __( 'Ignore', 'jetpack-scan' ),
443
443
  isPrimary: true,
444
- isDestructive: true,
445
444
  callback: onIgnoreThreats,
446
445
  isEligible( item ) {
447
446
  if ( ! onIgnoreThreats ) {
@@ -460,7 +459,6 @@ export default function ThreatsDataViews( {
460
459
  id: THREAT_ACTION_UNIGNORE,
461
460
  label: __( 'Unignore', 'jetpack-scan' ),
462
461
  isPrimary: true,
463
- isDestructive: true,
464
462
  callback: onUnignoreThreats,
465
463
  isEligible( item ) {
466
464
  if ( ! onUnignoreThreats ) {
@@ -1,5 +1,25 @@
1
1
  import { Threat } from './threats.ts';
2
2
 
3
+ export type ExtensionStatus = {
4
+ /** The name of the extension. */
5
+ name: string;
6
+
7
+ /** The slug of the extension. */
8
+ slug: string;
9
+
10
+ /** The version of the extension. */
11
+ version: string;
12
+
13
+ /** The threats found in the extension. */
14
+ threats: Threat[];
15
+
16
+ /** The type of extension. */
17
+ type: 'plugins' | 'themes';
18
+
19
+ /** Whether the extension was checked in the latest scan. */
20
+ checked: boolean;
21
+ };
22
+
3
23
  export type ScanStatus = {
4
24
  /** The current status of the scanner. */
5
25
  status: 'unavailable' | 'provisioning' | 'idle' | 'scanning' | 'scheduled';
@@ -30,4 +50,10 @@ export type ScanStatus = {
30
50
 
31
51
  /** The detected threats. */
32
52
  threats: Threat[];
53
+
54
+ core: ExtensionStatus | ExtensionStatus[];
55
+ plugins: ExtensionStatus[];
56
+ themes: ExtensionStatus[];
57
+ files: Threat[];
58
+ database: Threat[];
33
59
  };