semrush-cli 0.2.0 → 0.4.0

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.
@@ -1,7 +1,7 @@
1
1
  import { Schema } from "effect";
2
2
 
3
3
  //#region package.json
4
- var version$1 = "0.2.0";
4
+ var version$1 = "0.4.0";
5
5
 
6
6
  //#endregion
7
7
  //#region src/report-catalog.json
@@ -2447,6 +2447,1354 @@ var report_catalog_default = {
2447
2447
  },
2448
2448
  "required": ["folder_id"]
2449
2449
  }
2450
+ },
2451
+ keyword_list_limits: {
2452
+ "method": "user.GetInfo",
2453
+ "description": "Read Keyword Strategy Builder list and clustering allowances.",
2454
+ "transport": "kwm",
2455
+ "total_method": "",
2456
+ "web_report": "",
2457
+ "mutation": false,
2458
+ "destructive": false,
2459
+ "http_method": "POST",
2460
+ "schema": {
2461
+ "type": "object",
2462
+ "additionalProperties": false,
2463
+ "properties": {},
2464
+ "required": []
2465
+ }
2466
+ },
2467
+ keyword_lists: {
2468
+ "method": "baskets.BasketsGetAll",
2469
+ "description": "Read regular and structured keyword lists with pagination and ownership filters.",
2470
+ "transport": "kwm",
2471
+ "total_method": "",
2472
+ "web_report": "",
2473
+ "mutation": false,
2474
+ "destructive": false,
2475
+ "http_method": "POST",
2476
+ "schema": {
2477
+ "type": "object",
2478
+ "additionalProperties": false,
2479
+ "properties": {
2480
+ "page": {
2481
+ "type": "integer",
2482
+ "minimum": 1,
2483
+ "default": 1
2484
+ },
2485
+ "page_size": {
2486
+ "type": "integer",
2487
+ "minimum": 1,
2488
+ "maximum": 1e3,
2489
+ "default": 100
2490
+ },
2491
+ "sort_field": {
2492
+ "type": "string",
2493
+ "minLength": 1,
2494
+ "default": "updated_at"
2495
+ },
2496
+ "descending": {
2497
+ "type": "boolean",
2498
+ "default": true
2499
+ },
2500
+ "name_filter": {
2501
+ "type": "string",
2502
+ "default": ""
2503
+ },
2504
+ "ownership": {
2505
+ "type": "integer",
2506
+ "minimum": 1,
2507
+ "maximum": 7,
2508
+ "default": 7,
2509
+ "description": "Web ownership bitmask. 7 includes owned and shared lists."
2510
+ }
2511
+ },
2512
+ "required": []
2513
+ }
2514
+ },
2515
+ keyword_list_create: {
2516
+ "method": "baskets.BasketCreate",
2517
+ "description": "Create an empty regular keyword list. Does not cluster or generate a strategy.",
2518
+ "transport": "kwm",
2519
+ "total_method": "",
2520
+ "web_report": "",
2521
+ "mutation": true,
2522
+ "destructive": false,
2523
+ "http_method": "POST",
2524
+ "schema": {
2525
+ "type": "object",
2526
+ "additionalProperties": false,
2527
+ "properties": {
2528
+ "name": {
2529
+ "type": "string",
2530
+ "minLength": 1,
2531
+ "maxLength": 255,
2532
+ "pattern": "\\S"
2533
+ },
2534
+ "confirm": {
2535
+ "type": "boolean",
2536
+ "default": false,
2537
+ "description": "Confirm this account mutation."
2538
+ },
2539
+ "dry_run": {
2540
+ "type": "boolean",
2541
+ "default": false,
2542
+ "description": "Preview without authentication or network access."
2543
+ }
2544
+ },
2545
+ "required": ["name"]
2546
+ }
2547
+ },
2548
+ keyword_list_get: {
2549
+ "method": "baskets.BasketsGetByShareID",
2550
+ "description": "Read one keyword list and its permissions.",
2551
+ "transport": "kwm",
2552
+ "total_method": "",
2553
+ "web_report": "",
2554
+ "mutation": false,
2555
+ "destructive": false,
2556
+ "http_method": "POST",
2557
+ "schema": {
2558
+ "type": "object",
2559
+ "additionalProperties": false,
2560
+ "properties": {
2561
+ "basket_id": {
2562
+ "type": "integer",
2563
+ "minimum": 1,
2564
+ "maximum": 9007199254740991,
2565
+ "description": "BasketID from keyword-lists."
2566
+ },
2567
+ "owner_id": {
2568
+ "type": "integer",
2569
+ "minimum": 1,
2570
+ "maximum": 9007199254740991,
2571
+ "description": "Owner.ID from keyword-lists, including shared lists."
2572
+ }
2573
+ },
2574
+ "required": ["basket_id", "owner_id"]
2575
+ }
2576
+ },
2577
+ keyword_list_rename: {
2578
+ "method": "baskets.BasketRename",
2579
+ "description": "Rename a keyword list.",
2580
+ "transport": "kwm",
2581
+ "total_method": "",
2582
+ "web_report": "",
2583
+ "mutation": true,
2584
+ "destructive": false,
2585
+ "http_method": "POST",
2586
+ "schema": {
2587
+ "type": "object",
2588
+ "additionalProperties": false,
2589
+ "properties": {
2590
+ "basket_id": {
2591
+ "type": "integer",
2592
+ "minimum": 1,
2593
+ "maximum": 9007199254740991,
2594
+ "description": "BasketID from keyword-lists."
2595
+ },
2596
+ "owner_id": {
2597
+ "type": "integer",
2598
+ "minimum": 1,
2599
+ "maximum": 9007199254740991,
2600
+ "description": "Owner.ID from keyword-lists, including shared lists."
2601
+ },
2602
+ "name": {
2603
+ "type": "string",
2604
+ "minLength": 1,
2605
+ "maxLength": 255,
2606
+ "pattern": "\\S"
2607
+ },
2608
+ "confirm": {
2609
+ "type": "boolean",
2610
+ "default": false,
2611
+ "description": "Confirm this account mutation."
2612
+ },
2613
+ "dry_run": {
2614
+ "type": "boolean",
2615
+ "default": false,
2616
+ "description": "Preview without authentication or network access."
2617
+ }
2618
+ },
2619
+ "required": [
2620
+ "basket_id",
2621
+ "owner_id",
2622
+ "name"
2623
+ ]
2624
+ }
2625
+ },
2626
+ keyword_list_delete: {
2627
+ "method": "baskets.BasketDelete",
2628
+ "description": "Permanently delete one of your keyword lists.",
2629
+ "transport": "kwm",
2630
+ "total_method": "",
2631
+ "web_report": "",
2632
+ "mutation": true,
2633
+ "destructive": true,
2634
+ "http_method": "POST",
2635
+ "schema": {
2636
+ "type": "object",
2637
+ "additionalProperties": false,
2638
+ "properties": {
2639
+ "basket_id": {
2640
+ "type": "integer",
2641
+ "minimum": 1,
2642
+ "maximum": 9007199254740991,
2643
+ "description": "BasketID from keyword-lists."
2644
+ },
2645
+ "confirm": {
2646
+ "type": "boolean",
2647
+ "default": false,
2648
+ "description": "Confirm this account mutation."
2649
+ },
2650
+ "dry_run": {
2651
+ "type": "boolean",
2652
+ "default": false,
2653
+ "description": "Preview without authentication or network access."
2654
+ }
2655
+ },
2656
+ "required": ["basket_id"]
2657
+ }
2658
+ },
2659
+ keyword_list_keywords: {
2660
+ "method": "baskets.KeywordsGetByFilter",
2661
+ "description": "Read filtered, paginated keyword-list metrics.",
2662
+ "transport": "kwm",
2663
+ "total_method": "",
2664
+ "web_report": "",
2665
+ "mutation": false,
2666
+ "destructive": false,
2667
+ "http_method": "POST",
2668
+ "schema": {
2669
+ "type": "object",
2670
+ "additionalProperties": false,
2671
+ "properties": {
2672
+ "basket_id": {
2673
+ "type": "integer",
2674
+ "minimum": 1,
2675
+ "maximum": 9007199254740991,
2676
+ "description": "BasketID from keyword-lists."
2677
+ },
2678
+ "owner_id": {
2679
+ "type": "integer",
2680
+ "minimum": 1,
2681
+ "maximum": 9007199254740991,
2682
+ "description": "Owner.ID from keyword-lists, including shared lists."
2683
+ },
2684
+ "page": {
2685
+ "type": "integer",
2686
+ "minimum": 1,
2687
+ "default": 1
2688
+ },
2689
+ "page_size": {
2690
+ "type": "integer",
2691
+ "minimum": 1,
2692
+ "maximum": 1e3,
2693
+ "default": 100
2694
+ },
2695
+ "sort_field": {
2696
+ "type": "string",
2697
+ "minLength": 1,
2698
+ "default": "phrase"
2699
+ },
2700
+ "descending": {
2701
+ "type": "boolean",
2702
+ "default": true
2703
+ },
2704
+ "filters": {
2705
+ "type": "object",
2706
+ "description": "Keyword Strategy Builder Filter object. Unspecified fields default to empty arrays.",
2707
+ "properties": {
2708
+ "ClusterIDs": { "type": "array" },
2709
+ "Databases": { "type": "array" },
2710
+ "Phrase": { "type": "array" },
2711
+ "CompetitionLevel": { "type": "array" },
2712
+ "Cpc": { "type": "array" },
2713
+ "Difficulty": { "type": "array" },
2714
+ "SERPFeatures": { "type": "array" },
2715
+ "Volume": { "type": "array" },
2716
+ "ClickPotential": { "type": "array" },
2717
+ "Tags": { "type": "array" },
2718
+ "Intents": { "type": "array" }
2719
+ },
2720
+ "additionalProperties": false,
2721
+ "default": {}
2722
+ }
2723
+ },
2724
+ "required": ["basket_id", "owner_id"]
2725
+ }
2726
+ },
2727
+ keyword_list_summary: {
2728
+ "method": "baskets.KeywordsGetSummary",
2729
+ "description": "Read keyword totals, volume and difficulty for the selected filters.",
2730
+ "transport": "kwm",
2731
+ "total_method": "",
2732
+ "web_report": "",
2733
+ "mutation": false,
2734
+ "destructive": false,
2735
+ "http_method": "POST",
2736
+ "schema": {
2737
+ "type": "object",
2738
+ "additionalProperties": false,
2739
+ "properties": {
2740
+ "basket_id": {
2741
+ "type": "integer",
2742
+ "minimum": 1,
2743
+ "maximum": 9007199254740991,
2744
+ "description": "BasketID from keyword-lists."
2745
+ },
2746
+ "owner_id": {
2747
+ "type": "integer",
2748
+ "minimum": 1,
2749
+ "maximum": 9007199254740991,
2750
+ "description": "Owner.ID from keyword-lists, including shared lists."
2751
+ },
2752
+ "filters": {
2753
+ "type": "object",
2754
+ "description": "Keyword Strategy Builder Filter object. Unspecified fields default to empty arrays.",
2755
+ "properties": {
2756
+ "ClusterIDs": { "type": "array" },
2757
+ "Databases": { "type": "array" },
2758
+ "Phrase": { "type": "array" },
2759
+ "CompetitionLevel": { "type": "array" },
2760
+ "Cpc": { "type": "array" },
2761
+ "Difficulty": { "type": "array" },
2762
+ "SERPFeatures": { "type": "array" },
2763
+ "Volume": { "type": "array" },
2764
+ "ClickPotential": { "type": "array" },
2765
+ "Tags": { "type": "array" },
2766
+ "Intents": { "type": "array" }
2767
+ },
2768
+ "additionalProperties": false,
2769
+ "default": {}
2770
+ }
2771
+ },
2772
+ "required": ["basket_id", "owner_id"]
2773
+ }
2774
+ },
2775
+ keyword_list_import: {
2776
+ "method": "baskets.KeywordsImport",
2777
+ "description": "Import phrases into a regular keyword list. Account keyword limits apply.",
2778
+ "transport": "kwm",
2779
+ "total_method": "",
2780
+ "web_report": "",
2781
+ "mutation": true,
2782
+ "destructive": false,
2783
+ "http_method": "POST",
2784
+ "schema": {
2785
+ "type": "object",
2786
+ "additionalProperties": false,
2787
+ "properties": {
2788
+ "basket_id": {
2789
+ "type": "integer",
2790
+ "minimum": 1,
2791
+ "maximum": 9007199254740991,
2792
+ "description": "BasketID from keyword-lists."
2793
+ },
2794
+ "owner_id": {
2795
+ "type": "integer",
2796
+ "minimum": 1,
2797
+ "maximum": 9007199254740991,
2798
+ "description": "Owner.ID from keyword-lists, including shared lists."
2799
+ },
2800
+ "keywords": {
2801
+ "type": "array",
2802
+ "items": {
2803
+ "type": "string",
2804
+ "minLength": 1,
2805
+ "pattern": "\\S"
2806
+ },
2807
+ "minItems": 1,
2808
+ "uniqueItems": true
2809
+ },
2810
+ "database": {
2811
+ "type": "string",
2812
+ "pattern": "^[a-z]{2}(?:-[a-z]{2})?$",
2813
+ "default": "us"
2814
+ },
2815
+ "tags": {
2816
+ "type": "array",
2817
+ "items": {
2818
+ "type": "string",
2819
+ "minLength": 1,
2820
+ "pattern": "\\S"
2821
+ },
2822
+ "uniqueItems": true,
2823
+ "default": []
2824
+ },
2825
+ "confirm": {
2826
+ "type": "boolean",
2827
+ "default": false,
2828
+ "description": "Confirm this account mutation."
2829
+ },
2830
+ "dry_run": {
2831
+ "type": "boolean",
2832
+ "default": false,
2833
+ "description": "Preview without authentication or network access."
2834
+ }
2835
+ },
2836
+ "required": [
2837
+ "basket_id",
2838
+ "owner_id",
2839
+ "keywords"
2840
+ ]
2841
+ }
2842
+ },
2843
+ keyword_list_delete_keywords: {
2844
+ "method": "baskets.KeywordsDeleteByIDs",
2845
+ "description": "Delete selected phrases from a keyword list. Returns an undo ID.",
2846
+ "transport": "kwm",
2847
+ "total_method": "",
2848
+ "web_report": "",
2849
+ "mutation": true,
2850
+ "destructive": true,
2851
+ "http_method": "POST",
2852
+ "schema": {
2853
+ "type": "object",
2854
+ "additionalProperties": false,
2855
+ "properties": {
2856
+ "basket_id": {
2857
+ "type": "integer",
2858
+ "minimum": 1,
2859
+ "maximum": 9007199254740991,
2860
+ "description": "BasketID from keyword-lists."
2861
+ },
2862
+ "owner_id": {
2863
+ "type": "integer",
2864
+ "minimum": 1,
2865
+ "maximum": 9007199254740991,
2866
+ "description": "Owner.ID from keyword-lists, including shared lists."
2867
+ },
2868
+ "keywords": {
2869
+ "type": "array",
2870
+ "items": {
2871
+ "type": "string",
2872
+ "minLength": 1,
2873
+ "pattern": "\\S"
2874
+ },
2875
+ "minItems": 1,
2876
+ "uniqueItems": true
2877
+ },
2878
+ "database": {
2879
+ "type": "string",
2880
+ "pattern": "^[a-z]{2}(?:-[a-z]{2})?$",
2881
+ "default": "us"
2882
+ },
2883
+ "confirm": {
2884
+ "type": "boolean",
2885
+ "default": false,
2886
+ "description": "Confirm this account mutation."
2887
+ },
2888
+ "dry_run": {
2889
+ "type": "boolean",
2890
+ "default": false,
2891
+ "description": "Preview without authentication or network access."
2892
+ }
2893
+ },
2894
+ "required": [
2895
+ "basket_id",
2896
+ "owner_id",
2897
+ "keywords"
2898
+ ]
2899
+ }
2900
+ },
2901
+ keyword_list_undo_delete: {
2902
+ "method": "baskets.KeywordsDeleteUndo",
2903
+ "description": "Restore a keyword deletion using its returned UndoID.",
2904
+ "transport": "kwm",
2905
+ "total_method": "",
2906
+ "web_report": "",
2907
+ "mutation": true,
2908
+ "destructive": false,
2909
+ "http_method": "POST",
2910
+ "schema": {
2911
+ "type": "object",
2912
+ "additionalProperties": false,
2913
+ "properties": {
2914
+ "undo_id": {
2915
+ "type": "string",
2916
+ "minLength": 1
2917
+ },
2918
+ "confirm": {
2919
+ "type": "boolean",
2920
+ "default": false,
2921
+ "description": "Confirm this account mutation."
2922
+ },
2923
+ "dry_run": {
2924
+ "type": "boolean",
2925
+ "default": false,
2926
+ "description": "Preview without authentication or network access."
2927
+ }
2928
+ },
2929
+ "required": ["undo_id"]
2930
+ }
2931
+ },
2932
+ keyword_list_update_metrics: {
2933
+ "method": "baskets.KeywordsRequestUpdateByIDs",
2934
+ "description": "Request fresh metrics for selected phrases. Consumes the update allowance.",
2935
+ "transport": "kwm",
2936
+ "total_method": "",
2937
+ "web_report": "",
2938
+ "mutation": true,
2939
+ "destructive": false,
2940
+ "http_method": "POST",
2941
+ "schema": {
2942
+ "type": "object",
2943
+ "additionalProperties": false,
2944
+ "properties": {
2945
+ "basket_id": {
2946
+ "type": "integer",
2947
+ "minimum": 1,
2948
+ "maximum": 9007199254740991,
2949
+ "description": "BasketID from keyword-lists."
2950
+ },
2951
+ "owner_id": {
2952
+ "type": "integer",
2953
+ "minimum": 1,
2954
+ "maximum": 9007199254740991,
2955
+ "description": "Owner.ID from keyword-lists, including shared lists."
2956
+ },
2957
+ "keywords": {
2958
+ "type": "array",
2959
+ "items": {
2960
+ "type": "string",
2961
+ "minLength": 1,
2962
+ "pattern": "\\S"
2963
+ },
2964
+ "minItems": 1,
2965
+ "uniqueItems": true
2966
+ },
2967
+ "database": {
2968
+ "type": "string",
2969
+ "pattern": "^[a-z]{2}(?:-[a-z]{2})?$",
2970
+ "default": "us"
2971
+ },
2972
+ "confirm": {
2973
+ "type": "boolean",
2974
+ "default": false,
2975
+ "description": "Confirm this account mutation."
2976
+ },
2977
+ "dry_run": {
2978
+ "type": "boolean",
2979
+ "default": false,
2980
+ "description": "Preview without authentication or network access."
2981
+ }
2982
+ },
2983
+ "required": [
2984
+ "basket_id",
2985
+ "owner_id",
2986
+ "keywords"
2987
+ ]
2988
+ }
2989
+ },
2990
+ keyword_list_tags: {
2991
+ "method": "baskets.GetBasketTags",
2992
+ "description": "Read keyword tags and their usage in a list.",
2993
+ "transport": "kwm",
2994
+ "total_method": "",
2995
+ "web_report": "",
2996
+ "mutation": false,
2997
+ "destructive": false,
2998
+ "http_method": "POST",
2999
+ "schema": {
3000
+ "type": "object",
3001
+ "additionalProperties": false,
3002
+ "properties": {
3003
+ "basket_id": {
3004
+ "type": "integer",
3005
+ "minimum": 1,
3006
+ "maximum": 9007199254740991,
3007
+ "description": "BasketID from keyword-lists."
3008
+ },
3009
+ "owner_id": {
3010
+ "type": "integer",
3011
+ "minimum": 1,
3012
+ "maximum": 9007199254740991,
3013
+ "description": "Owner.ID from keyword-lists, including shared lists."
3014
+ }
3015
+ },
3016
+ "required": ["basket_id", "owner_id"]
3017
+ }
3018
+ },
3019
+ keyword_list_add_tags: {
3020
+ "method": "baskets.KeywordsAddTags",
3021
+ "description": "Add tags to selected phrases.",
3022
+ "transport": "kwm",
3023
+ "total_method": "",
3024
+ "web_report": "",
3025
+ "mutation": true,
3026
+ "destructive": false,
3027
+ "http_method": "POST",
3028
+ "schema": {
3029
+ "type": "object",
3030
+ "additionalProperties": false,
3031
+ "properties": {
3032
+ "basket_id": {
3033
+ "type": "integer",
3034
+ "minimum": 1,
3035
+ "maximum": 9007199254740991,
3036
+ "description": "BasketID from keyword-lists."
3037
+ },
3038
+ "owner_id": {
3039
+ "type": "integer",
3040
+ "minimum": 1,
3041
+ "maximum": 9007199254740991,
3042
+ "description": "Owner.ID from keyword-lists, including shared lists."
3043
+ },
3044
+ "keywords": {
3045
+ "type": "array",
3046
+ "items": {
3047
+ "type": "string",
3048
+ "minLength": 1,
3049
+ "pattern": "\\S"
3050
+ },
3051
+ "minItems": 1,
3052
+ "uniqueItems": true
3053
+ },
3054
+ "database": {
3055
+ "type": "string",
3056
+ "pattern": "^[a-z]{2}(?:-[a-z]{2})?$",
3057
+ "default": "us"
3058
+ },
3059
+ "tags": {
3060
+ "type": "array",
3061
+ "items": {
3062
+ "type": "string",
3063
+ "minLength": 1,
3064
+ "pattern": "\\S"
3065
+ },
3066
+ "uniqueItems": true,
3067
+ "default": [],
3068
+ "minItems": 1
3069
+ },
3070
+ "confirm": {
3071
+ "type": "boolean",
3072
+ "default": false,
3073
+ "description": "Confirm this account mutation."
3074
+ },
3075
+ "dry_run": {
3076
+ "type": "boolean",
3077
+ "default": false,
3078
+ "description": "Preview without authentication or network access."
3079
+ }
3080
+ },
3081
+ "required": [
3082
+ "basket_id",
3083
+ "owner_id",
3084
+ "keywords",
3085
+ "tags"
3086
+ ]
3087
+ }
3088
+ },
3089
+ keyword_list_remove_tags: {
3090
+ "method": "baskets.KeywordsDeleteTags",
3091
+ "description": "Remove tags from selected phrases.",
3092
+ "transport": "kwm",
3093
+ "total_method": "",
3094
+ "web_report": "",
3095
+ "mutation": true,
3096
+ "destructive": true,
3097
+ "http_method": "POST",
3098
+ "schema": {
3099
+ "type": "object",
3100
+ "additionalProperties": false,
3101
+ "properties": {
3102
+ "basket_id": {
3103
+ "type": "integer",
3104
+ "minimum": 1,
3105
+ "maximum": 9007199254740991,
3106
+ "description": "BasketID from keyword-lists."
3107
+ },
3108
+ "owner_id": {
3109
+ "type": "integer",
3110
+ "minimum": 1,
3111
+ "maximum": 9007199254740991,
3112
+ "description": "Owner.ID from keyword-lists, including shared lists."
3113
+ },
3114
+ "keywords": {
3115
+ "type": "array",
3116
+ "items": {
3117
+ "type": "string",
3118
+ "minLength": 1,
3119
+ "pattern": "\\S"
3120
+ },
3121
+ "minItems": 1,
3122
+ "uniqueItems": true
3123
+ },
3124
+ "database": {
3125
+ "type": "string",
3126
+ "pattern": "^[a-z]{2}(?:-[a-z]{2})?$",
3127
+ "default": "us"
3128
+ },
3129
+ "tags": {
3130
+ "type": "array",
3131
+ "items": {
3132
+ "type": "string",
3133
+ "minLength": 1,
3134
+ "pattern": "\\S"
3135
+ },
3136
+ "uniqueItems": true,
3137
+ "default": [],
3138
+ "minItems": 1
3139
+ },
3140
+ "confirm": {
3141
+ "type": "boolean",
3142
+ "default": false,
3143
+ "description": "Confirm this account mutation."
3144
+ },
3145
+ "dry_run": {
3146
+ "type": "boolean",
3147
+ "default": false,
3148
+ "description": "Preview without authentication or network access."
3149
+ }
3150
+ },
3151
+ "required": [
3152
+ "basket_id",
3153
+ "owner_id",
3154
+ "keywords",
3155
+ "tags"
3156
+ ]
3157
+ }
3158
+ },
3159
+ keyword_list_cluster: {
3160
+ "method": "baskets.RunClusterization",
3161
+ "description": "Start clustering a keyword list. Consumes the clustering allowance.",
3162
+ "transport": "kwm",
3163
+ "total_method": "",
3164
+ "web_report": "",
3165
+ "mutation": true,
3166
+ "destructive": false,
3167
+ "http_method": "POST",
3168
+ "schema": {
3169
+ "type": "object",
3170
+ "additionalProperties": false,
3171
+ "properties": {
3172
+ "basket_id": {
3173
+ "type": "integer",
3174
+ "minimum": 1,
3175
+ "maximum": 9007199254740991,
3176
+ "description": "BasketID from keyword-lists."
3177
+ },
3178
+ "owner_id": {
3179
+ "type": "integer",
3180
+ "minimum": 1,
3181
+ "maximum": 9007199254740991,
3182
+ "description": "Owner.ID from keyword-lists, including shared lists."
3183
+ },
3184
+ "confirm": {
3185
+ "type": "boolean",
3186
+ "default": false,
3187
+ "description": "Confirm this account mutation."
3188
+ },
3189
+ "dry_run": {
3190
+ "type": "boolean",
3191
+ "default": false,
3192
+ "description": "Preview without authentication or network access."
3193
+ }
3194
+ },
3195
+ "required": ["basket_id", "owner_id"]
3196
+ }
3197
+ },
3198
+ keyword_list_cluster_forecast: {
3199
+ "method": "baskets.BasketGetClusterizationForecast",
3200
+ "description": "Read the clustering forecast for a keyword list.",
3201
+ "transport": "kwm",
3202
+ "total_method": "",
3203
+ "web_report": "",
3204
+ "mutation": false,
3205
+ "destructive": false,
3206
+ "http_method": "POST",
3207
+ "schema": {
3208
+ "type": "object",
3209
+ "additionalProperties": false,
3210
+ "properties": {
3211
+ "basket_id": {
3212
+ "type": "integer",
3213
+ "minimum": 1,
3214
+ "maximum": 9007199254740991,
3215
+ "description": "BasketID from keyword-lists."
3216
+ },
3217
+ "owner_id": {
3218
+ "type": "integer",
3219
+ "minimum": 1,
3220
+ "maximum": 9007199254740991,
3221
+ "description": "Owner.ID from keyword-lists, including shared lists."
3222
+ }
3223
+ },
3224
+ "required": ["basket_id", "owner_id"]
3225
+ }
3226
+ },
3227
+ keyword_list_cluster_status: {
3228
+ "method": "baskets.BasketGetClusterizationStatuses",
3229
+ "description": "Read the current clustering status for a keyword list.",
3230
+ "transport": "kwm",
3231
+ "total_method": "",
3232
+ "web_report": "",
3233
+ "mutation": false,
3234
+ "destructive": false,
3235
+ "http_method": "POST",
3236
+ "schema": {
3237
+ "type": "object",
3238
+ "additionalProperties": false,
3239
+ "properties": {
3240
+ "basket_id": {
3241
+ "type": "integer",
3242
+ "minimum": 1,
3243
+ "maximum": 9007199254740991,
3244
+ "description": "BasketID from keyword-lists."
3245
+ },
3246
+ "owner_id": {
3247
+ "type": "integer",
3248
+ "minimum": 1,
3249
+ "maximum": 9007199254740991,
3250
+ "description": "Owner.ID from keyword-lists, including shared lists."
3251
+ }
3252
+ },
3253
+ "required": ["basket_id", "owner_id"]
3254
+ }
3255
+ },
3256
+ keyword_strategy_create: {
3257
+ "method": "baskets.BasketCreate",
3258
+ "description": "Generate a structured keyword strategy from a domain or seed phrases. Consumes the clustering allowance.",
3259
+ "transport": "kwm",
3260
+ "total_method": "",
3261
+ "web_report": "",
3262
+ "mutation": true,
3263
+ "destructive": false,
3264
+ "http_method": "POST",
3265
+ "schema": {
3266
+ "type": "object",
3267
+ "additionalProperties": false,
3268
+ "properties": {
3269
+ "name": {
3270
+ "type": "string",
3271
+ "minLength": 1,
3272
+ "maxLength": 255,
3273
+ "pattern": "\\S"
3274
+ },
3275
+ "domain": {
3276
+ "type": "string",
3277
+ "minLength": 1,
3278
+ "maxLength": 253,
3279
+ "pattern": "^(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]{2,63}$",
3280
+ "description": "Domain or subdomain, without protocol or path."
3281
+ },
3282
+ "database": {
3283
+ "type": "string",
3284
+ "pattern": "^[a-z]{2}(?:-[a-z]{2})?$",
3285
+ "default": "us"
3286
+ },
3287
+ "seed_keywords": {
3288
+ "type": "array",
3289
+ "items": {
3290
+ "type": "string",
3291
+ "minLength": 1,
3292
+ "pattern": "\\S"
3293
+ },
3294
+ "default": [],
3295
+ "uniqueItems": true
3296
+ },
3297
+ "competitors": {
3298
+ "type": "array",
3299
+ "items": {
3300
+ "type": "string",
3301
+ "minLength": 1,
3302
+ "maxLength": 253,
3303
+ "pattern": "^(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]{2,63}$",
3304
+ "description": "Domain or subdomain, without protocol or path."
3305
+ },
3306
+ "default": [],
3307
+ "uniqueItems": true
3308
+ },
3309
+ "confirm": {
3310
+ "type": "boolean",
3311
+ "default": false,
3312
+ "description": "Confirm this account mutation."
3313
+ },
3314
+ "dry_run": {
3315
+ "type": "boolean",
3316
+ "default": false,
3317
+ "description": "Preview without authentication or network access."
3318
+ }
3319
+ },
3320
+ "required": ["name"],
3321
+ "anyOf": [{ "required": ["domain"] }, {
3322
+ "required": ["seed_keywords"],
3323
+ "properties": { "seed_keywords": { "minItems": 1 } }
3324
+ }]
3325
+ }
3326
+ },
3327
+ audit_limits: {
3328
+ "method": "/siteaudit/api/limits",
3329
+ "description": "Site Audit account crawl and project limits.",
3330
+ "transport": "audit_web",
3331
+ "total_method": "",
3332
+ "web_report": "",
3333
+ "mutation": false,
3334
+ "destructive": false,
3335
+ "http_method": "GET",
3336
+ "schema": {
3337
+ "type": "object",
3338
+ "additionalProperties": false,
3339
+ "properties": {},
3340
+ "required": []
3341
+ }
3342
+ },
3343
+ audit_info: {
3344
+ "method": "/siteaudit/api/campaigns/{campaign_id}/info",
3345
+ "description": "Current Site Audit configuration, status and latest summary.",
3346
+ "transport": "audit_web",
3347
+ "total_method": "",
3348
+ "web_report": "",
3349
+ "mutation": false,
3350
+ "destructive": false,
3351
+ "http_method": "GET",
3352
+ "schema": {
3353
+ "type": "object",
3354
+ "additionalProperties": false,
3355
+ "properties": { "campaign_id": {
3356
+ "type": "integer",
3357
+ "minimum": 1,
3358
+ "maximum": 9007199254740991,
3359
+ "description": "SEO project/campaign ID from project-enable-seo, not the folder ID."
3360
+ } },
3361
+ "required": ["campaign_id"]
3362
+ }
3363
+ },
3364
+ audit_status: {
3365
+ "method": "/siteaudit/api/campaigns/status/{campaign_id}",
3366
+ "description": "Current Site Audit execution status.",
3367
+ "transport": "audit_web",
3368
+ "total_method": "",
3369
+ "web_report": "",
3370
+ "mutation": false,
3371
+ "destructive": false,
3372
+ "http_method": "GET",
3373
+ "schema": {
3374
+ "type": "object",
3375
+ "additionalProperties": false,
3376
+ "properties": { "campaign_id": {
3377
+ "type": "integer",
3378
+ "minimum": 1,
3379
+ "maximum": 9007199254740991,
3380
+ "description": "SEO project/campaign ID from project-enable-seo, not the folder ID."
3381
+ } },
3382
+ "required": ["campaign_id"]
3383
+ }
3384
+ },
3385
+ audit_snapshots: {
3386
+ "method": "/siteaudit/api/campaigns/{campaign_id}/snapshots",
3387
+ "description": "Historical Site Audit crawl snapshots.",
3388
+ "transport": "audit_web",
3389
+ "total_method": "",
3390
+ "web_report": "",
3391
+ "mutation": false,
3392
+ "destructive": false,
3393
+ "http_method": "GET",
3394
+ "schema": {
3395
+ "type": "object",
3396
+ "additionalProperties": false,
3397
+ "properties": { "campaign_id": {
3398
+ "type": "integer",
3399
+ "minimum": 1,
3400
+ "maximum": 9007199254740991,
3401
+ "description": "SEO project/campaign ID from project-enable-seo, not the folder ID."
3402
+ } },
3403
+ "required": ["campaign_id"]
3404
+ }
3405
+ },
3406
+ audit_snapshot: {
3407
+ "method": "/siteaudit/api/campaigns/{campaign_id}/snapshot",
3408
+ "description": "Read a specific Site Audit snapshot.",
3409
+ "transport": "audit_web",
3410
+ "total_method": "",
3411
+ "web_report": "",
3412
+ "mutation": false,
3413
+ "destructive": false,
3414
+ "http_method": "GET",
3415
+ "schema": {
3416
+ "type": "object",
3417
+ "additionalProperties": false,
3418
+ "properties": {
3419
+ "campaign_id": {
3420
+ "type": "integer",
3421
+ "minimum": 1,
3422
+ "maximum": 9007199254740991,
3423
+ "description": "SEO project/campaign ID from project-enable-seo, not the folder ID."
3424
+ },
3425
+ "snapshot_id": {
3426
+ "type": "string",
3427
+ "minLength": 1,
3428
+ "description": "Opaque snapshot ID returned by audit-start or audit-snapshots."
3429
+ }
3430
+ },
3431
+ "required": ["campaign_id", "snapshot_id"]
3432
+ }
3433
+ },
3434
+ audit_start: {
3435
+ "method": "/siteaudit/api/campaigns/{campaign_id}/launch",
3436
+ "description": "Start a configured Site Audit. Consumes crawl allowance and uses its saved notification settings.",
3437
+ "transport": "audit_web",
3438
+ "total_method": "",
3439
+ "web_report": "",
3440
+ "mutation": true,
3441
+ "destructive": false,
3442
+ "http_method": "POST",
3443
+ "schema": {
3444
+ "type": "object",
3445
+ "additionalProperties": false,
3446
+ "properties": {
3447
+ "campaign_id": {
3448
+ "type": "integer",
3449
+ "minimum": 1,
3450
+ "maximum": 9007199254740991,
3451
+ "description": "SEO project/campaign ID from project-enable-seo, not the folder ID."
3452
+ },
3453
+ "confirm": {
3454
+ "type": "boolean",
3455
+ "default": false,
3456
+ "description": "Confirm this account mutation."
3457
+ },
3458
+ "dry_run": {
3459
+ "type": "boolean",
3460
+ "default": false,
3461
+ "description": "Print the request without sending it."
3462
+ }
3463
+ },
3464
+ "required": ["campaign_id"]
3465
+ }
3466
+ },
3467
+ audit_configure: {
3468
+ "method": "/siteaudit/api/campaigns/{campaign_id}/save",
3469
+ "description": "Replace public-site audit settings without starting a crawl. Defaults to manual scheduling and no email. Protected-site and Google Analytics settings require the web UI.",
3470
+ "transport": "audit_web",
3471
+ "total_method": "",
3472
+ "web_report": "",
3473
+ "mutation": true,
3474
+ "destructive": false,
3475
+ "http_method": "POST",
3476
+ "schema": {
3477
+ "type": "object",
3478
+ "additionalProperties": false,
3479
+ "properties": {
3480
+ "campaign_id": {
3481
+ "type": "integer",
3482
+ "minimum": 1,
3483
+ "maximum": 9007199254740991,
3484
+ "description": "SEO project/campaign ID from project-enable-seo, not the folder ID."
3485
+ },
3486
+ "name": {
3487
+ "type": "string",
3488
+ "minLength": 1,
3489
+ "maxLength": 255,
3490
+ "pattern": "\\S"
3491
+ },
3492
+ "domain": {
3493
+ "type": "string",
3494
+ "minLength": 1,
3495
+ "maxLength": 253,
3496
+ "pattern": "^(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]{2,63}$",
3497
+ "description": "Domain or subdomain, without protocol or path."
3498
+ },
3499
+ "page_limit": {
3500
+ "type": "integer",
3501
+ "minimum": 1,
3502
+ "description": "Maximum pages to crawl. Your plan limit still applies."
3503
+ },
3504
+ "schedule_day": {
3505
+ "type": "integer",
3506
+ "enum": [
3507
+ 0,
3508
+ 1,
3509
+ 2,
3510
+ 3,
3511
+ 4,
3512
+ 5,
3513
+ 6,
3514
+ 7,
3515
+ 8
3516
+ ],
3517
+ "default": 0,
3518
+ "description": "0 manual, 1-7 Monday-Sunday, 8 daily."
3519
+ },
3520
+ "notify": {
3521
+ "type": "boolean",
3522
+ "default": false
3523
+ },
3524
+ "user_agent_type": {
3525
+ "type": "integer",
3526
+ "enum": [
3527
+ 0,
3528
+ 1,
3529
+ 2,
3530
+ 3,
3531
+ 7,
3532
+ 8,
3533
+ 9
3534
+ ],
3535
+ "default": 8
3536
+ },
3537
+ "crawl_subdomains": {
3538
+ "type": "boolean",
3539
+ "default": false
3540
+ },
3541
+ "crawl_source_type": {
3542
+ "type": "integer",
3543
+ "enum": [
3544
+ 0,
3545
+ 1,
3546
+ 2
3547
+ ],
3548
+ "default": 0,
3549
+ "description": "0 website, 1 sitemap, 2 custom sitemap URL."
3550
+ },
3551
+ "crawl_source_url": {
3552
+ "type": "string",
3553
+ "default": ""
3554
+ },
3555
+ "crawl_delay": {
3556
+ "type": "integer",
3557
+ "enum": [
3558
+ 1,
3559
+ 2,
3560
+ 3
3561
+ ],
3562
+ "default": 1
3563
+ },
3564
+ "ignore_robots_disallow": {
3565
+ "type": "boolean",
3566
+ "default": false
3567
+ },
3568
+ "js_rendering": {
3569
+ "type": "string",
3570
+ "enum": ["DISABLED", "RENDER_ALL"],
3571
+ "default": "DISABLED"
3572
+ },
3573
+ "scheme": {
3574
+ "type": "string",
3575
+ "enum": ["http", "https"],
3576
+ "default": "https"
3577
+ },
3578
+ "allow": {
3579
+ "type": "array",
3580
+ "items": {
3581
+ "type": "string",
3582
+ "minLength": 1
3583
+ },
3584
+ "uniqueItems": true,
3585
+ "default": []
3586
+ },
3587
+ "disallow": {
3588
+ "type": "array",
3589
+ "items": {
3590
+ "type": "string",
3591
+ "minLength": 1
3592
+ },
3593
+ "uniqueItems": true,
3594
+ "default": []
3595
+ },
3596
+ "removed_parameters": {
3597
+ "type": "array",
3598
+ "items": {
3599
+ "type": "string",
3600
+ "minLength": 1
3601
+ },
3602
+ "uniqueItems": true,
3603
+ "default": []
3604
+ },
3605
+ "excluded_checks": {
3606
+ "type": "array",
3607
+ "items": {
3608
+ "type": "integer",
3609
+ "minimum": 1
3610
+ },
3611
+ "uniqueItems": true,
3612
+ "default": []
3613
+ },
3614
+ "confirm": {
3615
+ "type": "boolean",
3616
+ "default": false,
3617
+ "description": "Confirm this account mutation."
3618
+ },
3619
+ "dry_run": {
3620
+ "type": "boolean",
3621
+ "default": false,
3622
+ "description": "Print the request without sending it."
3623
+ }
3624
+ },
3625
+ "required": [
3626
+ "campaign_id",
3627
+ "name",
3628
+ "domain",
3629
+ "page_limit"
3630
+ ]
3631
+ }
3632
+ },
3633
+ audit_create: {
3634
+ "method": "/siteaudit/api/campaigns/{campaign_id}/save",
3635
+ "description": "Create Site Audit settings on an SEO project without starting a crawl. Refuses to replace an existing audit. Defaults to manual scheduling and no email.",
3636
+ "transport": "audit_web",
3637
+ "total_method": "",
3638
+ "web_report": "",
3639
+ "mutation": true,
3640
+ "destructive": false,
3641
+ "http_method": "POST",
3642
+ "schema": {
3643
+ "type": "object",
3644
+ "additionalProperties": false,
3645
+ "properties": {
3646
+ "campaign_id": {
3647
+ "type": "integer",
3648
+ "minimum": 1,
3649
+ "maximum": 9007199254740991,
3650
+ "description": "SEO project/campaign ID from project-enable-seo, not the folder ID."
3651
+ },
3652
+ "name": {
3653
+ "type": "string",
3654
+ "minLength": 1,
3655
+ "maxLength": 255,
3656
+ "pattern": "\\S"
3657
+ },
3658
+ "domain": {
3659
+ "type": "string",
3660
+ "minLength": 1,
3661
+ "maxLength": 253,
3662
+ "pattern": "^(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z]{2,63}$",
3663
+ "description": "Domain or subdomain, without protocol or path."
3664
+ },
3665
+ "page_limit": {
3666
+ "type": "integer",
3667
+ "minimum": 1,
3668
+ "description": "Maximum pages to crawl. Your plan limit still applies."
3669
+ },
3670
+ "schedule_day": {
3671
+ "type": "integer",
3672
+ "enum": [
3673
+ 0,
3674
+ 1,
3675
+ 2,
3676
+ 3,
3677
+ 4,
3678
+ 5,
3679
+ 6,
3680
+ 7,
3681
+ 8
3682
+ ],
3683
+ "default": 0,
3684
+ "description": "0 manual, 1-7 Monday-Sunday, 8 daily."
3685
+ },
3686
+ "notify": {
3687
+ "type": "boolean",
3688
+ "default": false
3689
+ },
3690
+ "user_agent_type": {
3691
+ "type": "integer",
3692
+ "enum": [
3693
+ 0,
3694
+ 1,
3695
+ 2,
3696
+ 3,
3697
+ 7,
3698
+ 8,
3699
+ 9
3700
+ ],
3701
+ "default": 8
3702
+ },
3703
+ "crawl_subdomains": {
3704
+ "type": "boolean",
3705
+ "default": false
3706
+ },
3707
+ "crawl_source_type": {
3708
+ "type": "integer",
3709
+ "enum": [
3710
+ 0,
3711
+ 1,
3712
+ 2
3713
+ ],
3714
+ "default": 0,
3715
+ "description": "0 website, 1 sitemap, 2 custom sitemap URL."
3716
+ },
3717
+ "crawl_source_url": {
3718
+ "type": "string",
3719
+ "default": ""
3720
+ },
3721
+ "crawl_delay": {
3722
+ "type": "integer",
3723
+ "enum": [
3724
+ 1,
3725
+ 2,
3726
+ 3
3727
+ ],
3728
+ "default": 1
3729
+ },
3730
+ "ignore_robots_disallow": {
3731
+ "type": "boolean",
3732
+ "default": false
3733
+ },
3734
+ "js_rendering": {
3735
+ "type": "string",
3736
+ "enum": ["DISABLED", "RENDER_ALL"],
3737
+ "default": "DISABLED"
3738
+ },
3739
+ "scheme": {
3740
+ "type": "string",
3741
+ "enum": ["http", "https"],
3742
+ "default": "https"
3743
+ },
3744
+ "allow": {
3745
+ "type": "array",
3746
+ "items": {
3747
+ "type": "string",
3748
+ "minLength": 1
3749
+ },
3750
+ "uniqueItems": true,
3751
+ "default": []
3752
+ },
3753
+ "disallow": {
3754
+ "type": "array",
3755
+ "items": {
3756
+ "type": "string",
3757
+ "minLength": 1
3758
+ },
3759
+ "uniqueItems": true,
3760
+ "default": []
3761
+ },
3762
+ "removed_parameters": {
3763
+ "type": "array",
3764
+ "items": {
3765
+ "type": "string",
3766
+ "minLength": 1
3767
+ },
3768
+ "uniqueItems": true,
3769
+ "default": []
3770
+ },
3771
+ "excluded_checks": {
3772
+ "type": "array",
3773
+ "items": {
3774
+ "type": "integer",
3775
+ "minimum": 1
3776
+ },
3777
+ "uniqueItems": true,
3778
+ "default": []
3779
+ },
3780
+ "confirm": {
3781
+ "type": "boolean",
3782
+ "default": false,
3783
+ "description": "Confirm this account mutation."
3784
+ },
3785
+ "dry_run": {
3786
+ "type": "boolean",
3787
+ "default": false,
3788
+ "description": "Print the request without sending it."
3789
+ }
3790
+ },
3791
+ "required": [
3792
+ "campaign_id",
3793
+ "name",
3794
+ "domain",
3795
+ "page_limit"
3796
+ ]
3797
+ }
2450
3798
  }
2451
3799
  };
2452
3800
 
@@ -2464,6 +3812,8 @@ const reports = report_catalog_default;
2464
3812
  /** Fixed request shapes observed in semrush-web-mcp. No arbitrary RPC or URL input. */
2465
3813
  function reportParameters(definition, q) {
2466
3814
  const family = definition.transport;
3815
+ if (family === "audit_web") return auditParameters(definition, q);
3816
+ if (family === "kwm") return keywordListParameters(definition, q);
2467
3817
  if (family === "project_web") return projectParameters(definition, q);
2468
3818
  if (family === "magic") return magicParameters(definition, q);
2469
3819
  if (family === "keyword") return keywordParameters(definition, q);
@@ -2720,21 +4070,167 @@ function projectParameters(definition, q) {
2720
4070
  if (definition.http_method === "DELETE") return {};
2721
4071
  return Object.fromEntries(Object.entries(q).filter(([key]) => key !== "confirm" && key !== "dry_run"));
2722
4072
  }
2723
- /** Paths come only from the catalog; folder IDs pass the decimal-string input schema. */
2724
- function projectRequest(definition, query) {
4073
+ /** Fixed public request plans. RPC credentials enter only inside the browser layer. */
4074
+ function webRequest(definition, query) {
4075
+ if (definition.transport === "kwm") return {
4076
+ method: "POST",
4077
+ path: "/kwm/rpc",
4078
+ body: rpcBody(definition.method, reportParameters(definition, query))
4079
+ };
2725
4080
  return {
2726
4081
  method: definition.http_method,
2727
- path: definition.method.replace("{folder_id}", String(query.folder_id)),
2728
- body: reportParameters(definition, query)
4082
+ path: definition.method.replace("{folder_id}", String(query.folder_id)).replace("{campaign_id}", String(query.campaign_id)),
4083
+ body: definition.transport === "audit_web" && definition.method.endsWith("/launch") ? null : reportParameters(definition, query)
2729
4084
  };
2730
4085
  }
2731
4086
  function previewMutation(name, definition, query) {
2732
4087
  return definition.mutation && query.dry_run === true ? {
2733
4088
  dry_run: true,
2734
4089
  report: name,
2735
- request: projectRequest(definition, query)
4090
+ request: webRequest(definition, query)
2736
4091
  } : void 0;
2737
4092
  }
4093
+ /** One JSON-RPC envelope for execution and credential-free previews. */
4094
+ function rpcBody(method, params) {
4095
+ return {
4096
+ id: 1,
4097
+ jsonrpc: "2.0",
4098
+ method,
4099
+ params
4100
+ };
4101
+ }
4102
+ /** Keyword Strategy Builder's casing differs from the keyword-research API. */
4103
+ function keywordListParameters(definition, q) {
4104
+ const method = definition.method;
4105
+ if (method === "user.GetInfo") return {};
4106
+ if (method === "baskets.BasketsGetAll") return {
4107
+ Order: {
4108
+ Direction: q.descending ? 1 : 0,
4109
+ Field: q.sort_field ?? null
4110
+ },
4111
+ Page: {
4112
+ Number: q.page ?? null,
4113
+ Size: q.page_size ?? null
4114
+ },
4115
+ Filter: {
4116
+ Name: q.name_filter ?? "",
4117
+ OwningType: q.ownership ?? 7
4118
+ }
4119
+ };
4120
+ if (method === "baskets.BasketCreate") return {
4121
+ Name: q.name ?? null,
4122
+ Clusterization: "seed_keywords" in q ? {
4123
+ Databases: [q.database ?? "us"],
4124
+ Domain: q.domain ?? "",
4125
+ Competitors: q.competitors ?? [],
4126
+ SeedPhrases: q.seed_keywords ?? []
4127
+ } : null
4128
+ };
4129
+ if (method === "baskets.BasketDelete") return { BasketIDs: [q.basket_id ?? null] };
4130
+ if (method === "baskets.KeywordsDeleteUndo") return { UndoID: q.undo_id ?? null };
4131
+ const shared = {
4132
+ BasketID: q.basket_id ?? null,
4133
+ OwnerID: q.owner_id ?? null
4134
+ };
4135
+ if (method === "baskets.BasketGetClusterizationStatuses") return { BasketIDs: [shared] };
4136
+ if (method === "baskets.BasketRename") return {
4137
+ ...shared,
4138
+ Name: q.name ?? null
4139
+ };
4140
+ if ("keywords" in q) {
4141
+ const phrases = Array.isArray(q.keywords) ? q.keywords : [];
4142
+ if (method === "baskets.KeywordsImport") return {
4143
+ ...shared,
4144
+ Keywords: phrases.map((Phrase) => ({
4145
+ Phrase,
4146
+ Database: q.database ?? "us",
4147
+ Tags: q.tags ?? []
4148
+ }))
4149
+ };
4150
+ const params = {
4151
+ ...shared,
4152
+ KeywordIDs: phrases.map((Phrase) => ({
4153
+ Phrase,
4154
+ Database: q.database ?? "us"
4155
+ }))
4156
+ };
4157
+ if ("tags" in q) params.Tags = q.tags ?? [];
4158
+ return params;
4159
+ }
4160
+ if ("filters" in q) {
4161
+ const filter = Object.fromEntries([
4162
+ "ClusterIDs",
4163
+ "Databases",
4164
+ "Phrase",
4165
+ "CompetitionLevel",
4166
+ "Cpc",
4167
+ "Difficulty",
4168
+ "SERPFeatures",
4169
+ "Volume",
4170
+ "ClickPotential",
4171
+ "Tags",
4172
+ "Intents"
4173
+ ].map((key) => [key, []]));
4174
+ Object.assign(filter, q.filters);
4175
+ if (method === "baskets.KeywordsGetSummary") return {
4176
+ ...shared,
4177
+ Filter: filter
4178
+ };
4179
+ return {
4180
+ ...shared,
4181
+ Filter: filter,
4182
+ Order: {
4183
+ Direction: q.descending ? 1 : 0,
4184
+ Field: q.sort_field ?? null
4185
+ },
4186
+ Page: {
4187
+ Number: q.page ?? null,
4188
+ Size: q.page_size ?? null
4189
+ }
4190
+ };
4191
+ }
4192
+ return shared;
4193
+ }
4194
+ /** Public-site settings use the wizard contract. Saving and launching are separate operations. */
4195
+ function auditParameters(definition, q) {
4196
+ if (!definition.method.endsWith("/save")) return Object.fromEntries(Object.entries(q).filter(([key]) => ![
4197
+ "campaign_id",
4198
+ "confirm",
4199
+ "dry_run"
4200
+ ].includes(key)));
4201
+ const paths = (value) => Array.isArray(value) ? [...new Set(value.map((path) => String(path).startsWith("/") ? String(path) : "/" + String(path)))] : [];
4202
+ return {
4203
+ name: q.name ?? null,
4204
+ domain: q.domain ?? null,
4205
+ rootDomain: q.domain ?? null,
4206
+ pageLimit: q.page_limit ?? null,
4207
+ scheduleDay: q.schedule_day ?? 0,
4208
+ notify: q.notify ?? false,
4209
+ userAgentType: q.user_agent_type ?? 8,
4210
+ crawlSubdomains: q.crawl_subdomains ?? false,
4211
+ crawlSourceType: q.crawl_source_type ?? 0,
4212
+ crawlSourceUrl: q.crawl_source_url ?? "",
4213
+ crawlDelaySettingTypeId: q.crawl_delay ?? 1,
4214
+ ignoreRobotsDisallow: q.ignore_robots_disallow ?? false,
4215
+ jsRendering: q.js_rendering ?? "DISABLED",
4216
+ scheme: q.scheme ?? "https",
4217
+ startCrawlUrl: null,
4218
+ allow: paths(q.allow),
4219
+ disallow: paths(q.disallow),
4220
+ withSubfolder: Array.isArray(q.allow) && q.allow.length === 1,
4221
+ removedParameters: q.removed_parameters ?? [],
4222
+ excludedChecks: q.excluded_checks ?? [],
4223
+ authEnabled: false,
4224
+ authUsername: "",
4225
+ authPassword: "",
4226
+ gaSettings: {},
4227
+ gaStatus: "",
4228
+ webBotAuthEnabled: false,
4229
+ webBotAuthSignatureAgent: "",
4230
+ webBotAuthSignatureInput: "",
4231
+ webBotAuthSignature: ""
4232
+ };
4233
+ }
2738
4234
 
2739
4235
  //#endregion
2740
4236
  //#region src/errors.ts
@@ -2747,5 +4243,5 @@ var ReportError = class extends Schema.TaggedError()("ReportError", { message: S
2747
4243
  var UsageError = class extends Schema.TaggedError()("UsageError", { message: Schema.String }) {};
2748
4244
 
2749
4245
  //#endregion
2750
- export { projectRequest as a, version as c, previewMutation as i, SessionError as n, reportParameters as o, UsageError as r, reports as s, ReportError as t };
2751
- //# sourceMappingURL=errors-CJuwKbEZ.js.map
4246
+ export { reportParameters as a, version as c, previewMutation as i, webRequest as l, SessionError as n, reports as o, UsageError as r, rpcBody as s, ReportError as t };
4247
+ //# sourceMappingURL=errors-BjuHkMt_.js.map