semrush-cli 0.3.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.3.0";
4
+ var version$1 = "0.4.0";
5
5
 
6
6
  //#endregion
7
7
  //#region src/report-catalog.json
@@ -3323,6 +3323,478 @@ var report_catalog_default = {
3323
3323
  "properties": { "seed_keywords": { "minItems": 1 } }
3324
3324
  }]
3325
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
+ }
3326
3798
  }
3327
3799
  };
3328
3800
 
@@ -3340,6 +3812,7 @@ const reports = report_catalog_default;
3340
3812
  /** Fixed request shapes observed in semrush-web-mcp. No arbitrary RPC or URL input. */
3341
3813
  function reportParameters(definition, q) {
3342
3814
  const family = definition.transport;
3815
+ if (family === "audit_web") return auditParameters(definition, q);
3343
3816
  if (family === "kwm") return keywordListParameters(definition, q);
3344
3817
  if (family === "project_web") return projectParameters(definition, q);
3345
3818
  if (family === "magic") return magicParameters(definition, q);
@@ -3606,8 +4079,8 @@ function webRequest(definition, query) {
3606
4079
  };
3607
4080
  return {
3608
4081
  method: definition.http_method,
3609
- path: definition.method.replace("{folder_id}", String(query.folder_id)),
3610
- 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)
3611
4084
  };
3612
4085
  }
3613
4086
  function previewMutation(name, definition, query) {
@@ -3718,6 +4191,46 @@ function keywordListParameters(definition, q) {
3718
4191
  }
3719
4192
  return shared;
3720
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
+ }
3721
4234
 
3722
4235
  //#endregion
3723
4236
  //#region src/errors.ts
@@ -3731,4 +4244,4 @@ var UsageError = class extends Schema.TaggedError()("UsageError", { message: Sch
3731
4244
 
3732
4245
  //#endregion
3733
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 };
3734
- //# sourceMappingURL=errors-CU9T4acd.js.map
4247
+ //# sourceMappingURL=errors-BjuHkMt_.js.map