@carrierllc/mcp 0.13.81 → 0.13.83

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/dist/cli.js CHANGED
@@ -45,7 +45,7 @@ import {
45
45
  verifyStorefront,
46
46
  walletScreen,
47
47
  which
48
- } from "./chunk-QOEAUPWD.js";
48
+ } from "./chunk-MIGP6YJH.js";
49
49
  import {
50
50
  copyTree,
51
51
  exists,
@@ -2368,16 +2368,17 @@ async function publishHostedStorefront(input) {
2368
2368
  }
2369
2369
  const filled = completePlanInput(planInput(input), existing?.plans ?? []);
2370
2370
  const plan = storefrontPlanBody(filled);
2371
- if (isStorefrontPlanError(plan)) return { ok: false, text: plan.error };
2371
+ const planError = isStorefrontPlanError(plan) ? plan.error : null;
2372
2372
  const brand = storefrontBrandPatch(input, existing ?? void 0);
2373
2373
  const record2 = { slug: input.slug, name: input.name, status: input.status, ...brand };
2374
2374
  const saved = existing ? await callRestEndpoint("PATCH", "/v1/storefronts/{id}", { id: existing.id, ...record2 }) : await callRestEndpoint("POST", "/v1/storefronts", record2, { idempotencyKey: `site-publish:${input.slug}` });
2375
2375
  if (!saved.ok) return saved;
2376
+ if (planError) return withPlanError(withShopAddress(saved, input.slug), planError);
2376
2377
  if (!plan) return withShopAddress(saved, input.slug);
2377
2378
  const id = existing?.id ?? readId(saved.text);
2378
2379
  if (!id) return { ok: false, text: "The store was saved but its id was missing, so the plan was not written." };
2379
2380
  const planned = await callRestEndpoint("POST", "/v1/storefronts/{id}/plans", { id, ...plan });
2380
- return planned.ok ? withShopAddress(planned, input.slug) : planned;
2381
+ return planned.ok ? withShopAddress(planned, input.slug) : withPlanError(withShopAddress(saved, input.slug), planned.text);
2381
2382
  }
2382
2383
  function firstPublishCopy(input) {
2383
2384
  const hero = input.hero?.trim() ?? "";
@@ -2391,6 +2392,10 @@ function firstPublishCopy(input) {
2391
2392
  if (legalName === "" || legalName === "Lifecycle Innovations Limited") return "Enter a legal name.";
2392
2393
  return null;
2393
2394
  }
2395
+ function withPlanError(result, message) {
2396
+ return { ok: true, text: `${result.text}
2397
+ Plan not added: ${message}` };
2398
+ }
2394
2399
  function withShopAddress(result, slug2) {
2395
2400
  const address = hostedStorefrontUrl(slug2);
2396
2401
  if (result.text.includes(address)) return result;
@@ -5112,7 +5117,7 @@ var CLI_DOMAINS = [
5112
5117
  },
5113
5118
  {
5114
5119
  flags: "--entitlement-token <token>",
5115
- description: "The right issued for this external_ref by create_benefit_entitlement, 1 to 200 characters. Required when the campaign requires a right.",
5120
+ description: "The right issued for this external_ref by create_benefit_entitlement, 1 to 200 characters.",
5116
5121
  arg: "entitlement_token",
5117
5122
  type: "string"
5118
5123
  }
@@ -6483,6 +6488,475 @@ var CLI_DOMAINS = [
6483
6488
  ]
6484
6489
  }
6485
6490
  ]
6491
+ },
6492
+ {
6493
+ name: "storefronts",
6494
+ summary: "Hosted storefronts: create, plans, domains, orders and readiness (CAR-455)",
6495
+ commands: [
6496
+ {
6497
+ name: "list",
6498
+ tool: "list_storefronts",
6499
+ summary: "Call the caller's storefront operation: GET /v1/storefronts.",
6500
+ options: []
6501
+ },
6502
+ {
6503
+ name: "get",
6504
+ tool: "get_storefront",
6505
+ summary: "Call the caller's storefront operation: GET /v1/storefronts/{storefront_id}.",
6506
+ options: [
6507
+ {
6508
+ flags: "--storefront-id <id>",
6509
+ description: "storefront id (string).",
6510
+ arg: "storefront_id",
6511
+ type: "string",
6512
+ required: true
6513
+ }
6514
+ ]
6515
+ },
6516
+ {
6517
+ name: "create",
6518
+ tool: "create_storefront",
6519
+ summary: "Call the caller's storefront operation: POST /v1/storefronts.",
6520
+ requireConfirm: true,
6521
+ options: [
6522
+ {
6523
+ flags: "--input <input>",
6524
+ description: "input (json).",
6525
+ arg: "input",
6526
+ type: "json"
6527
+ },
6528
+ {
6529
+ flags: "--confirm-token <token>",
6530
+ description: "confirm token (string).",
6531
+ arg: "confirm_token",
6532
+ type: "string"
6533
+ },
6534
+ {
6535
+ flags: "--idempotency-key <key>",
6536
+ description: "idempotency key (string).",
6537
+ arg: "idempotency_key",
6538
+ type: "string",
6539
+ required: true
6540
+ }
6541
+ ]
6542
+ },
6543
+ {
6544
+ name: "update",
6545
+ tool: "update_storefront",
6546
+ summary: "Call the caller's storefront operation: PATCH /v1/storefronts/{storefront_id}.",
6547
+ requireConfirm: true,
6548
+ options: [
6549
+ {
6550
+ flags: "--storefront-id <id>",
6551
+ description: "storefront id (string).",
6552
+ arg: "storefront_id",
6553
+ type: "string",
6554
+ required: true
6555
+ },
6556
+ {
6557
+ flags: "--input <input>",
6558
+ description: "input (json).",
6559
+ arg: "input",
6560
+ type: "json"
6561
+ },
6562
+ {
6563
+ flags: "--confirm-token <token>",
6564
+ description: "confirm token (string).",
6565
+ arg: "confirm_token",
6566
+ type: "string"
6567
+ },
6568
+ {
6569
+ flags: "--idempotency-key <key>",
6570
+ description: "idempotency key (string).",
6571
+ arg: "idempotency_key",
6572
+ type: "string"
6573
+ }
6574
+ ]
6575
+ },
6576
+ {
6577
+ name: "unpublish",
6578
+ tool: "unpublish_storefront",
6579
+ summary: "Call the caller's storefront operation: POST /v1/storefronts/{storefront_id}/unpublish.",
6580
+ requireConfirm: true,
6581
+ options: [
6582
+ {
6583
+ flags: "--storefront-id <id>",
6584
+ description: "storefront id (string).",
6585
+ arg: "storefront_id",
6586
+ type: "string",
6587
+ required: true
6588
+ },
6589
+ {
6590
+ flags: "--input <input>",
6591
+ description: "input (json).",
6592
+ arg: "input",
6593
+ type: "json"
6594
+ },
6595
+ {
6596
+ flags: "--confirm-token <token>",
6597
+ description: "confirm token (string).",
6598
+ arg: "confirm_token",
6599
+ type: "string"
6600
+ },
6601
+ {
6602
+ flags: "--idempotency-key <key>",
6603
+ description: "idempotency key (string).",
6604
+ arg: "idempotency_key",
6605
+ type: "string"
6606
+ }
6607
+ ]
6608
+ },
6609
+ {
6610
+ name: "plan upsert",
6611
+ tool: "upsert_storefront_plan",
6612
+ summary: "Call the caller's storefront operation: POST /v1/storefronts/{storefront_id}/plans.",
6613
+ requireConfirm: true,
6614
+ options: [
6615
+ {
6616
+ flags: "--storefront-id <id>",
6617
+ description: "storefront id (string).",
6618
+ arg: "storefront_id",
6619
+ type: "string",
6620
+ required: true
6621
+ },
6622
+ {
6623
+ flags: "--input <input>",
6624
+ description: "input (json).",
6625
+ arg: "input",
6626
+ type: "json"
6627
+ },
6628
+ {
6629
+ flags: "--confirm-token <token>",
6630
+ description: "confirm token (string).",
6631
+ arg: "confirm_token",
6632
+ type: "string"
6633
+ },
6634
+ {
6635
+ flags: "--idempotency-key <key>",
6636
+ description: "idempotency key (string).",
6637
+ arg: "idempotency_key",
6638
+ type: "string"
6639
+ }
6640
+ ]
6641
+ },
6642
+ {
6643
+ name: "plan update",
6644
+ tool: "update_storefront_plan",
6645
+ summary: "Call the caller's storefront operation: PATCH /v1/storefronts/{storefront_id}/plans/{slug}.",
6646
+ requireConfirm: true,
6647
+ options: [
6648
+ {
6649
+ flags: "--storefront-id <id>",
6650
+ description: "storefront id (string).",
6651
+ arg: "storefront_id",
6652
+ type: "string",
6653
+ required: true
6654
+ },
6655
+ {
6656
+ flags: "--slug <slug>",
6657
+ description: "slug (string).",
6658
+ arg: "slug",
6659
+ type: "string",
6660
+ required: true
6661
+ },
6662
+ {
6663
+ flags: "--input <input>",
6664
+ description: "input (json).",
6665
+ arg: "input",
6666
+ type: "json"
6667
+ },
6668
+ {
6669
+ flags: "--confirm-token <token>",
6670
+ description: "confirm token (string).",
6671
+ arg: "confirm_token",
6672
+ type: "string"
6673
+ },
6674
+ {
6675
+ flags: "--idempotency-key <key>",
6676
+ description: "idempotency key (string).",
6677
+ arg: "idempotency_key",
6678
+ type: "string"
6679
+ }
6680
+ ]
6681
+ },
6682
+ {
6683
+ name: "orders",
6684
+ tool: "list_storefront_orders",
6685
+ summary: "Call the caller's storefront operation: GET /v1/storefronts/orders.",
6686
+ options: [
6687
+ {
6688
+ flags: "--storefront-id <id>",
6689
+ description: "storefront id (string).",
6690
+ arg: "storefront_id",
6691
+ type: "string"
6692
+ },
6693
+ {
6694
+ flags: "--status <status>",
6695
+ description: "status (string). One of: pending, provisioning, ready, failed.",
6696
+ arg: "status",
6697
+ type: "string"
6698
+ },
6699
+ {
6700
+ flags: "--limit <n>",
6701
+ description: "limit (number).",
6702
+ arg: "limit",
6703
+ type: "number"
6704
+ }
6705
+ ]
6706
+ },
6707
+ {
6708
+ name: "publish-plan",
6709
+ tool: "plan_storefront_publish",
6710
+ summary: "Call the caller's storefront operation: POST /v1/storefronts/{storefront_id}/publish-plan.",
6711
+ options: [
6712
+ {
6713
+ flags: "--storefront-id <id>",
6714
+ description: "storefront id (string).",
6715
+ arg: "storefront_id",
6716
+ type: "string",
6717
+ required: true
6718
+ },
6719
+ {
6720
+ flags: "--input <input>",
6721
+ description: "input (json).",
6722
+ arg: "input",
6723
+ type: "json"
6724
+ },
6725
+ {
6726
+ flags: "--confirm-token <token>",
6727
+ description: "confirm token (string).",
6728
+ arg: "confirm_token",
6729
+ type: "string"
6730
+ },
6731
+ {
6732
+ flags: "--idempotency-key <key>",
6733
+ description: "idempotency key (string).",
6734
+ arg: "idempotency_key",
6735
+ type: "string"
6736
+ }
6737
+ ]
6738
+ },
6739
+ {
6740
+ name: "readiness",
6741
+ tool: "verify_storefront",
6742
+ summary: "Call the caller's storefront operation: GET /v1/storefronts/{storefront_id}/readiness.",
6743
+ options: [
6744
+ {
6745
+ flags: "--storefront-id <id>",
6746
+ description: "storefront id (string).",
6747
+ arg: "storefront_id",
6748
+ type: "string",
6749
+ required: true
6750
+ }
6751
+ ]
6752
+ },
6753
+ {
6754
+ name: "domain list",
6755
+ tool: "list_storefront_domains",
6756
+ summary: "Call the caller's storefront operation: GET /v1/storefronts/{storefront_id}/domains.",
6757
+ options: [
6758
+ {
6759
+ flags: "--storefront-id <id>",
6760
+ description: "storefront id (string).",
6761
+ arg: "storefront_id",
6762
+ type: "string",
6763
+ required: true
6764
+ }
6765
+ ]
6766
+ },
6767
+ {
6768
+ name: "domain plan",
6769
+ tool: "plan_storefront_domain",
6770
+ summary: "Call the caller's storefront operation: POST /v1/storefronts/{storefront_id}/domains/plan.",
6771
+ options: [
6772
+ {
6773
+ flags: "--storefront-id <id>",
6774
+ description: "storefront id (string).",
6775
+ arg: "storefront_id",
6776
+ type: "string",
6777
+ required: true
6778
+ },
6779
+ {
6780
+ flags: "--hostname <hostname>",
6781
+ description: "hostname (string).",
6782
+ arg: "hostname",
6783
+ type: "string",
6784
+ required: true
6785
+ },
6786
+ {
6787
+ flags: "--input <input>",
6788
+ description: "input (json).",
6789
+ arg: "input",
6790
+ type: "json"
6791
+ },
6792
+ {
6793
+ flags: "--confirm-token <token>",
6794
+ description: "confirm token (string).",
6795
+ arg: "confirm_token",
6796
+ type: "string"
6797
+ },
6798
+ {
6799
+ flags: "--idempotency-key <key>",
6800
+ description: "idempotency key (string).",
6801
+ arg: "idempotency_key",
6802
+ type: "string"
6803
+ }
6804
+ ]
6805
+ },
6806
+ {
6807
+ name: "domain attach",
6808
+ tool: "attach_storefront_domain",
6809
+ summary: "Call the caller's storefront operation: POST /v1/storefronts/{storefront_id}/domains.",
6810
+ requireConfirm: true,
6811
+ options: [
6812
+ {
6813
+ flags: "--storefront-id <id>",
6814
+ description: "storefront id (string).",
6815
+ arg: "storefront_id",
6816
+ type: "string",
6817
+ required: true
6818
+ },
6819
+ {
6820
+ flags: "--hostname <hostname>",
6821
+ description: "hostname (string).",
6822
+ arg: "hostname",
6823
+ type: "string",
6824
+ required: true
6825
+ },
6826
+ {
6827
+ flags: "--input <input>",
6828
+ description: "input (json).",
6829
+ arg: "input",
6830
+ type: "json"
6831
+ },
6832
+ {
6833
+ flags: "--confirm-token <token>",
6834
+ description: "confirm token (string).",
6835
+ arg: "confirm_token",
6836
+ type: "string"
6837
+ },
6838
+ {
6839
+ flags: "--idempotency-key <key>",
6840
+ description: "idempotency key (string).",
6841
+ arg: "idempotency_key",
6842
+ type: "string",
6843
+ required: true
6844
+ }
6845
+ ]
6846
+ },
6847
+ {
6848
+ name: "domain verify",
6849
+ tool: "verify_storefront_domain",
6850
+ summary: "Call the caller's storefront operation: POST /v1/storefronts/{storefront_id}/domains/{hostname}/verify.",
6851
+ options: [
6852
+ {
6853
+ flags: "--storefront-id <id>",
6854
+ description: "storefront id (string).",
6855
+ arg: "storefront_id",
6856
+ type: "string",
6857
+ required: true
6858
+ },
6859
+ {
6860
+ flags: "--hostname <hostname>",
6861
+ description: "hostname (string).",
6862
+ arg: "hostname",
6863
+ type: "string",
6864
+ required: true
6865
+ },
6866
+ {
6867
+ flags: "--input <input>",
6868
+ description: "input (json).",
6869
+ arg: "input",
6870
+ type: "json"
6871
+ },
6872
+ {
6873
+ flags: "--confirm-token <token>",
6874
+ description: "confirm token (string).",
6875
+ arg: "confirm_token",
6876
+ type: "string"
6877
+ },
6878
+ {
6879
+ flags: "--idempotency-key <key>",
6880
+ description: "idempotency key (string).",
6881
+ arg: "idempotency_key",
6882
+ type: "string"
6883
+ }
6884
+ ]
6885
+ },
6886
+ {
6887
+ name: "domain detach",
6888
+ tool: "detach_storefront_domain",
6889
+ summary: "Call the caller's storefront operation: DELETE /v1/storefronts/{storefront_id}/domains/{hostname}.",
6890
+ requireConfirm: true,
6891
+ options: [
6892
+ {
6893
+ flags: "--storefront-id <id>",
6894
+ description: "storefront id (string).",
6895
+ arg: "storefront_id",
6896
+ type: "string",
6897
+ required: true
6898
+ },
6899
+ {
6900
+ flags: "--hostname <hostname>",
6901
+ description: "hostname (string).",
6902
+ arg: "hostname",
6903
+ type: "string",
6904
+ required: true
6905
+ },
6906
+ {
6907
+ flags: "--input <input>",
6908
+ description: "input (json).",
6909
+ arg: "input",
6910
+ type: "json"
6911
+ },
6912
+ {
6913
+ flags: "--confirm-token <token>",
6914
+ description: "confirm token (string).",
6915
+ arg: "confirm_token",
6916
+ type: "string"
6917
+ }
6918
+ ]
6919
+ },
6920
+ {
6921
+ name: "domain dns-plan",
6922
+ tool: "plan_storefront_dns",
6923
+ summary: "Call the caller's storefront operation: POST /v1/storefronts/{storefront_id}/domains/{hostname}/dns-plan.",
6924
+ options: [
6925
+ {
6926
+ flags: "--storefront-id <id>",
6927
+ description: "storefront id (string).",
6928
+ arg: "storefront_id",
6929
+ type: "string",
6930
+ required: true
6931
+ },
6932
+ {
6933
+ flags: "--hostname <hostname>",
6934
+ description: "hostname (string).",
6935
+ arg: "hostname",
6936
+ type: "string",
6937
+ required: true
6938
+ },
6939
+ {
6940
+ flags: "--input <input>",
6941
+ description: "input (json).",
6942
+ arg: "input",
6943
+ type: "json"
6944
+ },
6945
+ {
6946
+ flags: "--confirm-token <token>",
6947
+ description: "confirm token (string).",
6948
+ arg: "confirm_token",
6949
+ type: "string"
6950
+ },
6951
+ {
6952
+ flags: "--idempotency-key <key>",
6953
+ description: "idempotency key (string).",
6954
+ arg: "idempotency_key",
6955
+ type: "string"
6956
+ }
6957
+ ]
6958
+ }
6959
+ ]
6486
6960
  }
6487
6961
  // </generated:catalog-domains>
6488
6962
  ];
@@ -6522,6 +6996,18 @@ function coerce(opt, raw) {
6522
6996
  if (!Number.isFinite(n)) return { error: `${opt.flags} expects a number, got "${String(raw)}"` };
6523
6997
  return { value: n };
6524
6998
  }
6999
+ if (opt.type === "json") {
7000
+ let parsed;
7001
+ try {
7002
+ parsed = JSON.parse(String(raw));
7003
+ } catch {
7004
+ return { error: `${opt.flags} expects a JSON object, got "${String(raw)}"` };
7005
+ }
7006
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
7007
+ return { error: `${opt.flags} expects a JSON object, got "${String(raw)}"` };
7008
+ }
7009
+ return { value: parsed };
7010
+ }
6525
7011
  if (opt.type === "string[]" || opt.type === "number[]") {
6526
7012
  const items = String(raw).split(",").map((s) => s.trim()).filter((s) => s.length > 0);
6527
7013
  if (!items.length) return { error: `${opt.flags} expects a comma-separated list, got "${String(raw)}"` };