updated plugin Jetpack Protect version 3.0.2

This commit is contained in:
2024-10-09 12:44:31 +00:00
committed by Gitium
parent a35dc419bc
commit f970470c59
283 changed files with 6970 additions and 2338 deletions

View File

@ -7,8 +7,65 @@ declare module '*.scss';
// These libraries don't have types, this suppresses the TypeScript errors
declare module '@wordpress/components';
declare module '@wordpress/compose';
declare module '@wordpress/i18n';
declare module '@wordpress/icons';
declare module '@automattic/jetpack-connection';
declare module '@wordpress/url';
type ProductStatus =
| 'active'
| 'inactive'
| 'module_disabled'
| 'site_connection_error'
| 'plugin_absent'
| 'plugin_absent_with_plan'
| 'needs_plan'
| 'needs_activation'
| 'needs_first_site_connection'
| 'user_connection_error'
| 'can_upgrade';
type JetpackModule =
| 'anti-spam'
| 'backup'
| 'boost'
| 'crm'
| 'creator'
| 'extras'
| 'ai'
| 'jetpack-ai'
| 'scan'
| 'search'
| 'social'
| 'security'
| 'protect'
| 'videopress'
| 'stats';
type ThreatItem = {
// Protect API properties (free plan)
id: string;
title: string;
fixed_in: string;
description: string | null;
source: string | null;
// Scan API properties (paid plan)
context: string | null;
filename: string | null;
first_detected: string | null;
fixable: boolean | null;
severity: number | null;
signature: string | null;
status: number | null;
};
type ScanItem = {
checked: boolean;
name: string;
slug: string;
threats: ThreatItem[];
type: string;
version: string;
};
interface Window {
myJetpackInitialState?: {
@ -43,9 +100,16 @@ interface Window {
videoPressStats: boolean;
};
lifecycleStats: {
historicallyActiveModules: JetpackModule[];
brokenModules: {
needs_site_connection: JetpackModule[];
needs_user_connection: JetpackModule[];
};
isSiteConnected: boolean;
isUserConnected: boolean;
jetpackPlugins: Array< string >;
ownedProducts: JetpackModule[];
unownedProducts: JetpackModule[];
modules: Array< string >;
purchases: Array< string >;
};
@ -77,10 +141,12 @@ interface Window {
description: string;
disclaimers: Array< string[] >;
features: string[];
has_free_offering: boolean;
has_paid_plan_for_product: boolean;
features_by_tier: Array< string >;
is_bundle: boolean;
is_plugin_active: boolean;
is_upgradable: boolean;
is_upgradable_by_bundle: string[];
long_description: string;
manage_url: string;
@ -91,6 +157,7 @@ interface Window {
pricing_for_ui?: {
available: boolean;
wpcom_product_slug: string;
wpcom_free_product_slug?: string;
product_term: string;
currency_code: string;
full_price: number;
@ -105,6 +172,26 @@ interface Window {
transition_after_renewal_count: number;
usage_limit?: number;
};
tiers?: {
[ key: string ]: {
available: boolean;
currencyCode: string;
discountPrice: number;
fullPrice: number;
introductoryOffer?: {
costPerInterval: number;
intervalCount: number;
intervalUnit: string;
shouldProrateWhenOfferEnds: boolean;
transitionAfterRenewalCount: number;
usageLimit?: number;
};
isIntroductoryOffer: boolean;
productTerm: string;
wpcomProductSlug: string;
quantity: number;
};
};
};
purchase_url?: string;
requires_user_connection: boolean;
@ -114,7 +201,7 @@ interface Window {
is_standalone_installed: boolean;
is_standalone_active: boolean;
};
status: string;
status: ProductStatus;
supported_products: string[];
tiers: string[];
title: string;
@ -122,6 +209,60 @@ interface Window {
};
};
};
protect: {
scanData: {
core: ScanItem;
current_progress?: string;
data_source: string;
database: string[];
error: boolean;
error_code?: string;
error_message?: string;
files: string[];
has_unchecked_items: boolean;
last_checked: string;
num_plugins_threats: number;
num_themes_threats: number;
num_threats: number;
plugins: ScanItem[];
status: string;
themes: ScanItem[];
};
wafConfig: {
automatic_rules_available: boolean;
blocked_logins: number;
bootstrap_path: string;
brute_force_protection: boolean;
jetpack_waf_automatic_rules: '1' | '';
jetpack_waf_ip_allow_list: '1' | '';
jetpack_waf_ip_block_list: boolean;
jetpack_waf_ip_list: boolean;
jetpack_waf_share_data: '1' | '';
jetpack_waf_share_debug_data: boolean;
standalone_mode: boolean;
};
};
videopress: {
featuredStats?: {
label: string;
period: 'day' | 'year';
data: {
views: {
current: number;
previous: number;
};
impressions: {
current: number;
previous: number;
};
watch_time: {
current: number;
previous: number;
};
};
};
videoCount: number;
};
purchases: {
items: Array< {
ID: string;
@ -195,7 +336,10 @@ interface Window {
} >;
};
redBubbleAlerts: {
'missing-site-connection'?: null;
'missing-connection'?: {
type: string;
is_error: boolean;
};
'welcome-banner-active'?: null;
[ key: `${ string }-bad-installation` ]: {
data: {
@ -203,7 +347,27 @@ interface Window {
};
};
};
recommendedModules: {
modules: JetpackModule[] | null;
dismissed: boolean;
};
themes: {
[ key: string ]: {
Author: string;
Name: string;
RequiresPHP: string;
RequiresWP: string;
Status: string;
Template: string;
TextDomain: string;
ThemeURI: string;
Version: string;
active: boolean;
is_block_theme: boolean;
};
};
topJetpackMenuItemUrl: string;
isAtomic: boolean;
userIsAdmin: string;
userIsNewToJetpack: string;
};