webcake-storefront-mcp 1.15.0 → 1.16.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.
package/dist/api.js CHANGED
@@ -520,4 +520,469 @@ export class WebcakeCmsApi {
520
520
  sendMail(params) {
521
521
  return this.request("POST", `/api/v1/cms_function/${this.siteId}/application/automation/send_mail`, { body: params });
522
522
  }
523
+ // ── App lifecycle (applications/subcriptions) ──
524
+ /** Uninstall an app by its subscription id (the `id` from list_apps / get_app). */
525
+ uninstallApp(id) {
526
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/applications/subcriptions/uninstall_app`, { body: { id } });
527
+ }
528
+ /** Update an installed app's settings. `attrs` is merged onto the subscription (e.g. { settings: {...}, status }). */
529
+ updateApp(id, attrs) {
530
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/applications/subcriptions/update_app`, { body: { id, attrs } });
531
+ }
532
+ /** Update the product-review app's settings (shop_info, display options…). */
533
+ updateAppReview(id, settings) {
534
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/applications/subcriptions/update_app_review`, { body: { id, settings } });
535
+ }
536
+ // ── Product reviews (product_review app) ──
537
+ listReviews(query) {
538
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/applications/product_reviews/all_review_admin`, { query });
539
+ }
540
+ getReview(reviewId) {
541
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/applications/product_reviews/${reviewId}`);
542
+ }
543
+ getReviewProducts(reviewId) {
544
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/applications/product_reviews/products`, { query: { review_id: reviewId } });
545
+ }
546
+ /** Create or update a review/reply. `body` is the review payload (id, customer_info, rating, title,
547
+ * comment, images, parent_id, apply_to, categories, permission, is_shop, product_reviews…). */
548
+ createOrUpdateReview(body) {
549
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/applications/product_reviews/create_or_update`, { body });
550
+ }
551
+ removeReviews(ids) {
552
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/applications/product_reviews/remove`, { body: { ids } });
553
+ }
554
+ /** Approve/hide reviews. `payload` typically { ids, permission } (permission 0=approved, 1=pending…). */
555
+ updateReviewStatus(payload) {
556
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/applications/product_reviews/update_status`, { body: payload });
557
+ }
558
+ // ── Appointment app ──
559
+ listAppointmentCalendars(query) {
560
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/appointment/appointment_calendars`, { query });
561
+ }
562
+ createAppointmentCalendar(appointment_calendar) {
563
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/appointment/create_appointment_calendar`, { body: { appointment_calendar } });
564
+ }
565
+ updateAppointmentCalendar(appointment_calendar) {
566
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/appointment/update_appointment_calendar`, { body: { appointment_calendar } });
567
+ }
568
+ deleteAppointmentCalendars(ids) {
569
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/appointment/delete_appointment_calendars`, { body: { ids } });
570
+ }
571
+ duplicateAppointmentCalendars(ids) {
572
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/appointment/duplicate_appointment_calendars`, { body: { ids } });
573
+ }
574
+ listAppointments(query) {
575
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/appointment/appointments`, { query });
576
+ }
577
+ listAppointmentAddresses(query) {
578
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/appointment/appointment_addresses`, { query });
579
+ }
580
+ createAppointmentAddress(appointment_address) {
581
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/appointment/create_appointment_address`, { body: { appointment_address } });
582
+ }
583
+ updateAppointmentAddress(appointment_address) {
584
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/appointment/update_appointment_address`, { body: { appointment_address } });
585
+ }
586
+ deleteAppointmentAddresses(ids) {
587
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/appointment/delete_appointment_addresses`, { body: { ids } });
588
+ }
589
+ listAppointmentClassifies(query) {
590
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/appointment/appointment_classifies`, { query });
591
+ }
592
+ createAppointmentClassify(appointment_classify) {
593
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/appointment/create_appointment_classify`, { body: { appointment_classify } });
594
+ }
595
+ updateAppointmentClassify(appointment_classify) {
596
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/appointment/update_appointment_classify`, { body: { appointment_classify } });
597
+ }
598
+ deleteAppointmentClassifies(ids) {
599
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/appointment/delete_appointment_classifies`, { body: { ids } });
600
+ }
601
+ listAppointmentEmployees(query) {
602
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/appointment/appointment_employees`, { query });
603
+ }
604
+ createAppointmentEmployee(appointment_employee) {
605
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/appointment/create_appointment_employee`, { body: { appointment_employee } });
606
+ }
607
+ updateAppointmentEmployee(appointment_employee) {
608
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/appointment/update_appointment_employee`, { body: { appointment_employee } });
609
+ }
610
+ deleteAppointmentEmployees(ids) {
611
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/appointment/delete_appointment_employees`, { body: { ids } });
612
+ }
613
+ // ── Affiliate app ──
614
+ getProgramAffiliates() {
615
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/affiliate/program_affiliates`);
616
+ }
617
+ getProductAffiliates(query) {
618
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/affiliate/product_affiliates`, { query });
619
+ }
620
+ getOrderAffiliates(query) {
621
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/affiliate/order_affiliates`, { query });
622
+ }
623
+ getAccountAffiliates(query) {
624
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/affiliate/account_affiliates`, { query });
625
+ }
626
+ getPayoutAffiliates(query) {
627
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/affiliate/payout_affiliates`, { query });
628
+ }
629
+ getAffiliateStatistic() {
630
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/affiliate/statistic`);
631
+ }
632
+ upsertOrderProgramAffiliate(payload) {
633
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/affiliate/upsert_order_program_affiliate`, { body: payload });
634
+ }
635
+ upsertProductProgramAffiliate(payload) {
636
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/affiliate/upsert_product_program_affiliate`, { body: payload });
637
+ }
638
+ upsertProductAffiliate(payload) {
639
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/affiliate/upsert_product_affiliate`, { body: payload });
640
+ }
641
+ deleteProductAffiliates(payload) {
642
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/affiliate/delete_product_affiliates`, { body: payload });
643
+ }
644
+ updatePayoutAffiliateStatus(payload) {
645
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/affiliate/update_status_payout_affiliate`, { body: payload });
646
+ }
647
+ deleteAccountAffiliates(payload) {
648
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/affiliate/delete_account_affiliates`, { body: payload });
649
+ }
650
+ updateAccountAffiliate(payload) {
651
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/affiliate/update_account_affiliate`, { body: payload });
652
+ }
653
+ // ── Catalog extras (brands / suppliers / tags / ribbons / materials / variations) ──
654
+ listProductBrands() {
655
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/products/product_brands/all`);
656
+ }
657
+ upsertProductBrand(body) {
658
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/products/product_brands/create_or_update`, { body });
659
+ }
660
+ listProductSuppliers() {
661
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/products/product_suppliers/all`);
662
+ }
663
+ upsertProductSupplier(body) {
664
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/products/product_suppliers/create_or_update`, { body });
665
+ }
666
+ listProductTags(query) {
667
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/products/product_tags/all`, { query });
668
+ }
669
+ upsertProductTag(body) {
670
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/products/product_tags/create_or_update`, { body });
671
+ }
672
+ listRibbons() {
673
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/products/ribbons/all`);
674
+ }
675
+ upsertRibbon(body) {
676
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/products/ribbons/create_or_update`, { body });
677
+ }
678
+ listMaterials() {
679
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/products/materials/all`);
680
+ }
681
+ upsertMaterial(body) {
682
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/products/materials/create_or_update`, { body });
683
+ }
684
+ getVariation(variationId) {
685
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/products/variation/${variationId}`);
686
+ }
687
+ getProductMeasurement() {
688
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/settings/product_measurement`);
689
+ }
690
+ updateProductMeasurement(product_measurement) {
691
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/settings/product_measurement/update`, { body: { product_measurement } });
692
+ }
693
+ listBlockPhoneNumbers(query) {
694
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/settings/block_phone_number/all`, { query });
695
+ }
696
+ upsertBlockPhoneCustomers(phone_numbers) {
697
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/settings/block_phone_number/upsert_block_phone_customers`, { body: { phone_numbers } });
698
+ }
699
+ removeAllBlockPhoneCustomers() {
700
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/settings/block_phone_number/remove_all_block_phone_customers`, { body: {} });
701
+ }
702
+ getPriceContacts(type) {
703
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/settings/price_contact/get`, { query: { type } });
704
+ }
705
+ updatePriceContact(body) {
706
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/settings/price_contact/update`, { body });
707
+ }
708
+ getCategoryById(categoryId) {
709
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/categories/${categoryId}`);
710
+ }
711
+ // ── Site config (domains / redirects / shipping / utms / logs / filters / settings / fonts) ──
712
+ listDomains(query) {
713
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/domains/all`, { query });
714
+ }
715
+ createDomain(body) {
716
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/domains/create`, { body });
717
+ }
718
+ updateDomain(body) {
719
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/domains/update`, { body });
720
+ }
721
+ verifyDomain(domain_id) {
722
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/domains/verify`, { body: { domain_id } });
723
+ }
724
+ deleteDomain(domain_id) {
725
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/domains/delete`, { body: { domain_id } });
726
+ }
727
+ checkDomain(domain) {
728
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/domains/check_domain`, { body: { domain } });
729
+ }
730
+ listRedirectUrls(query) {
731
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/seos/redirect_urls/all`, { query });
732
+ }
733
+ createRedirectUrl(redirect_url) {
734
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/seos/redirect_urls/create`, { body: { redirect_url } });
735
+ }
736
+ updateRedirectUrl(redirect_url) {
737
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/seos/redirect_urls/update`, { body: { redirect_url } });
738
+ }
739
+ deleteRedirectUrls(redirect_url_ids) {
740
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/seos/redirect_urls/delete`, { body: { redirect_url_ids } });
741
+ }
742
+ getShipping() {
743
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/settings/shipping`);
744
+ }
745
+ updateShipping(body) {
746
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/settings/shipping/update`, { body });
747
+ }
748
+ listSiteUtms(query) {
749
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/site_utms/all`, { query });
750
+ }
751
+ createSiteUtm(site_utm) {
752
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/site_utms/create`, { body: { site_utm } });
753
+ }
754
+ updateSiteUtm(site_utm) {
755
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/site_utms/update`, { body: { site_utm } });
756
+ }
757
+ deleteSiteUtms(ids) {
758
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/site_utms/delete`, { body: { ids } });
759
+ }
760
+ listSystemLogs(query) {
761
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/system_logs/all`, { query });
762
+ }
763
+ listSavedFilters(table_key) {
764
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/saved_filters/`, { query: { table_key } });
765
+ }
766
+ createSavedFilter(saved_filter) {
767
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/saved_filters/create`, { body: { saved_filter } });
768
+ }
769
+ updateSavedFilter(id, saved_filter) {
770
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/saved_filters/${id}/update`, { body: { saved_filter } });
771
+ }
772
+ deleteSavedFilter(id) {
773
+ return this.request("DELETE", `/api/v1/dashboard/site/${this.siteId}/saved_filters/${id}`);
774
+ }
775
+ /** Raw /update_site call. `body` top-level keys replace; a nested `settings` key is merged server-side. */
776
+ updateSiteRaw(body) {
777
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/update_site`, { body });
778
+ }
779
+ updateSiteName(name) {
780
+ return this.request("POST", `/api/v1/site/${this.siteId}/update_site_name`, { body: { name } });
781
+ }
782
+ updateSiteSlug(slug) {
783
+ return this.request("POST", `/api/v1/site/${this.siteId}/update_slug_name`, { body: { slug } });
784
+ }
785
+ loadFonts() {
786
+ return this.request("GET", `/api/v1/site/${this.siteId}/load_fonts`);
787
+ }
788
+ removeFont(id) {
789
+ return this.request("DELETE", `/api/v1/site/${this.siteId}/remove_font`, { body: { id } });
790
+ }
791
+ loadFontGroups() {
792
+ return this.request("GET", `/api/v1/site/${this.siteId}/load_font_groups`);
793
+ }
794
+ createFontGroup(body) {
795
+ return this.request("POST", `/api/v1/site/${this.siteId}/create_font_group`, { body: { ...body, site_id: this.siteId } });
796
+ }
797
+ removeFontGroup(id) {
798
+ return this.request("DELETE", `/api/v1/site/${this.siteId}/remove_font_groups`, { body: { id, site_id: this.siteId } });
799
+ }
800
+ listApiKeys(query) {
801
+ return this.request("GET", `/api/v1/site/${this.siteId}/api_keys/all`, { query });
802
+ }
803
+ listPublishHistories(query) {
804
+ return this.request("GET", `/api/v1/site/${this.siteId}/publish_histories`, { query });
805
+ }
806
+ // ── Marketing / CRM / team ──
807
+ getSendEmail() {
808
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/send_email/all`);
809
+ }
810
+ saveSendEmail(body) {
811
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/send_email/save`, { body });
812
+ }
813
+ listContacts(query) {
814
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/contact/all`, { query });
815
+ }
816
+ createContact(body) {
817
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/contact/create`, { body: { ...body, site_id: this.siteId } });
818
+ }
819
+ deleteContacts(ids) {
820
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/contact/delete`, { body: { ids } });
821
+ }
822
+ listSubscribers(query) {
823
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/subscriber/all`, { query });
824
+ }
825
+ createSubscriber(body) {
826
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/subscriber/create`, { body });
827
+ }
828
+ deleteSubscribers(ids) {
829
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/subscriber/delete`, { body: { ids } });
830
+ }
831
+ listEmployees() {
832
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/settings/employee/all`);
833
+ }
834
+ inviteEmployee(email) {
835
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/settings/employee/invite`, { body: { email } });
836
+ }
837
+ updateEmployeePermissions(site_permission) {
838
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/settings/employee/change_permissions`, { body: { site_permission } });
839
+ }
840
+ deleteEmployees(site_permission_ids) {
841
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/settings/employee/delete_employees`, { body: { site_permission_ids } });
842
+ }
843
+ listInvitations() {
844
+ return this.request("GET", `/api/v1/dashboard/site/invitations/all`);
845
+ }
846
+ acceptInvitation(invitation_id) {
847
+ return this.request("POST", `/api/v1/dashboard/site/invitations/accept`, { body: { invitation_id } });
848
+ }
849
+ refuseInvitation(invitation_id) {
850
+ return this.request("POST", `/api/v1/dashboard/site/invitations/refuse`, { body: { invitation_id } });
851
+ }
852
+ listCustomerTags() {
853
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/customer/customer_tags`);
854
+ }
855
+ upsertCustomerTag(body) {
856
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/customer/upsert_customer_tag`, { body: { ...body, site_id: this.siteId } });
857
+ }
858
+ assignCustomerTags(body) {
859
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/customer/update_tags_for_multiple_customers`, { body: { ...body, site_id: this.siteId } });
860
+ }
861
+ getInsightToday() {
862
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/insight/today`);
863
+ }
864
+ getInsight(query) {
865
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/insight/all`, { query });
866
+ }
867
+ listNotifications() {
868
+ return this.request("GET", `/api/v1/dashboard/site/notifications/all`);
869
+ }
870
+ markNotificationRead(notification_id) {
871
+ return this.request("POST", `/api/v1/dashboard/site/notifications/mark_as_read`, { body: { notification_id } });
872
+ }
873
+ // ── Multilingual / translations ──
874
+ mlAddLanguages(languages) {
875
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/multilingual/add_multiple_language`, { body: { languages } });
876
+ }
877
+ mlChangeDefault(language_code) {
878
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/multilingual/change_language_default`, { body: { language_code } });
879
+ }
880
+ mlGetTranslations(resource, query) {
881
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/multilingual/${resource}`, { query });
882
+ }
883
+ mlSaveTranslations(action, body) {
884
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/multilingual/${action}`, { body });
885
+ }
886
+ mlTranslateJson(body) {
887
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/multilingual/translate_json`, { body });
888
+ }
889
+ // ── Media library + PWA ──
890
+ listMediaFolders(query) {
891
+ return this.request("GET", `/api/v1/site/${this.siteId}/media/folder`, { query });
892
+ }
893
+ listMediaContent(query) {
894
+ return this.request("GET", `/api/v1/site/${this.siteId}/media/content`, { query });
895
+ }
896
+ listMediaAll(query) {
897
+ return this.request("GET", `/api/v1/site/${this.siteId}/media/all`, { query });
898
+ }
899
+ getMediaCapacity() {
900
+ return this.request("GET", `/api/v1/site/${this.siteId}/media/capacity`);
901
+ }
902
+ emptyMediaTrash() {
903
+ return this.request("POST", `/api/v1/site/${this.siteId}/media/empty_trash`, { body: {} });
904
+ }
905
+ uploadBase64Media(base64) {
906
+ return this.request("POST", `/api/v1/site/${this.siteId}/media/content/b64`, { body: { base64 }, timeout: 60000 });
907
+ }
908
+ updateMediaFolder(body) {
909
+ return this.request("POST", `/api/v1/site/${this.siteId}/media/folder/update`, { body });
910
+ }
911
+ updateMediaContent(body) {
912
+ return this.request("POST", `/api/v1/site/${this.siteId}/media/content/update`, { body });
913
+ }
914
+ getPwa() {
915
+ return this.request("GET", `/api/v1/site/${this.siteId}/pwa`);
916
+ }
917
+ upsertPwa(body) {
918
+ return this.request("POST", `/api/v1/site/${this.siteId}/pwa/upsert`, { body });
919
+ }
920
+ // ── Apps: product design / personal product design / course ──
921
+ getDeviceTemplates() {
922
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/applications/product_design/get_group_device_tempalte`);
923
+ }
924
+ createProductsByDeviceTemplate(groups) {
925
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/applications/product_design/create_product_by_device_template`, { body: { groups, site_id: this.siteId } });
926
+ }
927
+ getAllPpd(query) {
928
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/applications/personal_product_design/get_all_ppd`, { query });
929
+ }
930
+ upsertPpd(ppds) {
931
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/applications/personal_product_design/upsert_ppd`, { body: { ppds, site_id: this.siteId } });
932
+ }
933
+ removePpd(ids) {
934
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/applications/personal_product_design/remove_ppd`, { body: { ids, site_id: this.siteId } });
935
+ }
936
+ getProductVariationTemplate(product_id) {
937
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/applications/personal_product_design/get_product_variation_template`, { query: { product_id } });
938
+ }
939
+ listCourses(query) {
940
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/course-app`, { query });
941
+ }
942
+ getCourse(id) {
943
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/course-app/${id}`);
944
+ }
945
+ createCourse(body) {
946
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/course-app`, { body: { ...body, site_id: this.siteId } });
947
+ }
948
+ updateCourse(id, body) {
949
+ return this.request("PATCH", `/api/v1/dashboard/site/${this.siteId}/course-app/${id}`, { body });
950
+ }
951
+ deleteCourse(id) {
952
+ return this.request("DELETE", `/api/v1/dashboard/site/${this.siteId}/course-app/${id}`);
953
+ }
954
+ deleteManyCourses(ids) {
955
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/course-app/delete_many`, { body: { ids, site_id: this.siteId } });
956
+ }
957
+ getCourseMembers(query) {
958
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/course-app/members`, { query });
959
+ }
960
+ // ── Sale channels: sitemap + partner feeds + catalogs ──
961
+ sitemapSync(kind) {
962
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/sale_channels/sitemap/sync_${kind}`, { body: {} });
963
+ }
964
+ sitemapRebuild(type) {
965
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/sale_channels/sitemap/rebuild`, { body: { type } });
966
+ }
967
+ listPartnerFeeds(query) {
968
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/sale_channels/partner_feeds/all`, { query });
969
+ }
970
+ createPartnerFeed(body) {
971
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/sale_channels/partner_feeds/create`, { body });
972
+ }
973
+ updatePartnerFeed(partnerFeedId, body) {
974
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/sale_channels/partner_feeds/${partnerFeedId}/update`, { body });
975
+ }
976
+ deletePartnerFeeds(partner_feed_ids) {
977
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/sale_channels/partner_feeds/delete`, { body: { partner_feed_ids } });
978
+ }
979
+ listPartnerFeedProducts(partnerFeedId, query) {
980
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/sale_channels/partner_feeds/${partnerFeedId}/products/all`, { query });
981
+ }
982
+ syncPartnerFeed(partnerFeedId) {
983
+ return this.request("POST", `/api/v1/dashboard/site/${this.siteId}/sale_channels/partner_feeds/${partnerFeedId}/products/sync`, { body: { partner_feed_id: partnerFeedId } });
984
+ }
985
+ listGoogleMerchants(query) {
986
+ return this.request("GET", `/api/v1/dashboard/site/${this.siteId}/sale_channels/google/merchants`, { query });
987
+ }
523
988
  }
@@ -202,6 +202,8 @@ export function normalizeBindings(bindings) {
202
202
  if (!Array.isArray(bindings))
203
203
  return bindings;
204
204
  return bindings.map((b) => {
205
+ if (typeof b === "string")
206
+ return makeBinding(b); // bare "name::field" target
205
207
  if (!b || typeof b !== "object")
206
208
  return b;
207
209
  if (b.id && b.name)
@@ -166,7 +166,7 @@ export function buildElement(type, opts = {}) {
166
166
  if (Array.isArray(node.bindings) && node.bindings.length)
167
167
  node.bindings = normalizeBindings(node.bindings);
168
168
  if (Array.isArray(node.events) && node.events.length)
169
- node.events = normalizeEvents(node.events);
169
+ node.events = normalizeEvents(node.events, node.type);
170
170
  return node;
171
171
  }
172
172
  export function isKnownType(type) {
@@ -80,25 +80,45 @@ export function isKnownTrigger(name) {
80
80
  export function getEventAction(action) {
81
81
  return ACTION_BY_NAME[action];
82
82
  }
83
+ // Element types whose events only fire on a specific trigger — mirrors builderx_spa
84
+ // components/editor/traits/Events.vue `addEvent()`. For these the element-type trigger
85
+ // is the right default (a click handler on a form never fires); for everything else the
86
+ // action's usual trigger (or "click") wins.
87
+ const SPECIAL_EVENT_TRIGGER = {
88
+ form: "success",
89
+ swiper: "tab",
90
+ popup: "hide",
91
+ "input-search": "onenter",
92
+ "submit-button": "hover",
93
+ };
94
+ /** The trigger the builder defaults to for a given element type, if it is a special one. */
95
+ export function defaultTriggerForType(type) {
96
+ return type ? SPECIAL_EVENT_TRIGGER[type] : undefined;
97
+ }
83
98
  /**
84
99
  * Mint a structurally-valid event object. Pass at least `action`; extra action-specific
85
100
  * fields are merged verbatim. The id and a sensible eventName are filled in.
101
+ * eventName precedence (mirrors the editor): explicit > element-type default
102
+ * (form→success, swiper→tab, popup→hide, input-search→onenter, submit-button→hover) >
103
+ * the action's usual trigger > "click".
86
104
  * makeEvent({ action: "scroll_to", scroll_to_id: "SECTION-x" })
87
- * makeEvent({ action: "open_link", eventName: "click", link_target: "https://…" })
105
+ * makeEvent({ action: "open_page", open_page_id: "" }, "form") // eventName → "success"
88
106
  */
89
- export function makeEvent(spec) {
107
+ export function makeEvent(spec, elementType) {
90
108
  if (!spec || typeof spec !== "object")
91
109
  throw new Error("Event spec must be an object with at least an `action`.");
92
110
  const def = spec.action ? ACTION_BY_NAME[spec.action] : undefined;
93
- const eventName = spec.eventName || (def ? def.trigger : "click");
111
+ const eventName = spec.eventName || defaultTriggerForType(elementType) || (def ? def.trigger : "click");
94
112
  const { eventName: _e, action: _a, id: _id, ...rest } = spec;
95
113
  return { id: spec.id || `EVENT-${randomString(6)}`, eventName, ...(spec.action ? { action: spec.action } : {}), ...rest };
96
114
  }
97
- /** Ensure every event in an array has an id + an eventName (mint where missing). */
98
- export function normalizeEvents(events) {
115
+ /** Ensure every event in an array has an id + an eventName (mint where missing).
116
+ * Pass the owning element's type so special types get the right default trigger.
117
+ * Round-trip safe: events that already carry id/eventName are preserved verbatim. */
118
+ export function normalizeEvents(events, elementType) {
99
119
  if (!Array.isArray(events))
100
120
  return events;
101
- return events.map((e) => (e && typeof e === "object" ? makeEvent(e) : e));
121
+ return events.map((e) => (e && typeof e === "object" ? makeEvent(e, elementType) : e));
102
122
  }
103
123
  /** Validate one element's events against the catalog + the set of ids present in the page. */
104
124
  export function validateEvents(node, allIds) {
@@ -1,4 +1,18 @@
1
1
  [
2
+ {
3
+ "v": "1.16.0",
4
+ "d": "24/06/2026",
5
+ "type": "Added",
6
+ "en": "New uninstall_app, update_app, and update_app_review tools complete the app lifecycle: uninstall an installed app by subscription id, patch an app's…",
7
+ "vi": "Tool mới uninstall_app, update_app và update_app_review hoàn thiện vòng đời ứng dụng: gỡ cài đặt theo subscription id, cập nhật config/status của…"
8
+ },
9
+ {
10
+ "v": "1.15.1",
11
+ "d": "24/06/2026",
12
+ "type": "Fixed",
13
+ "en": "update_page_element, update_page_elements, update_global_source_element, and update_global_source_elements now normalize events and bindings arrays…",
14
+ "vi": "update_page_element, update_page_elements, update_global_source_element và update_global_source_elements nay chuẩn hóa mảng events và bindings khi…"
15
+ },
2
16
  {
3
17
  "v": "1.15.0",
4
18
  "d": "24/06/2026",
@@ -26,19 +40,5 @@
26
40
  "type": "Fixed",
27
41
  "en": "save_file_version and get_file_versions both sent the parameter as cms_file_id, but the backend reads file_id; versions were saved unlinked to any…",
28
42
  "vi": "save_file_version và get_file_versions đều gửi tham số dưới key cms_file_id, trong khi backend đọc file_id; các phiên bản được lưu mà không liên kết…"
29
- },
30
- {
31
- "v": "1.12.0",
32
- "d": "24/06/2026",
33
- "type": "Added",
34
- "en": "New update_product tool updates an existing product's name, description, images, category_ids, is_published flag, or variations (price/stock/SKU per…",
35
- "vi": "Tool mới update_product cập nhật name, description, images, category_ids, cờ is_published hoặc variations (giá/tồn kho/SKU theo từng biến thể) của…"
36
- },
37
- {
38
- "v": "1.11.1",
39
- "d": "24/06/2026",
40
- "type": "Fixed",
41
- "en": "create_site_from_template now calls the dedicated import_store_to_theme API instead of the generic site-duplicate endpoint, correctly cloning the…",
42
- "vi": "create_site_from_template nay gọi đúng API import_store_to_theme thay vì endpoint nhân bản site thông thường, giúp clone đầy đủ các trang, global…"
43
43
  }
44
44
  ]
package/dist/http.js CHANGED
@@ -36,6 +36,7 @@ const QUERY_TO_HEADER = {
36
36
  api_url: "x-webcake-api-url",
37
37
  session_id: "x-webcake-session-id",
38
38
  env: "x-webcake-env",
39
+ tools: "x-webcake-tools",
39
40
  };
40
41
  function header(req, name) {
41
42
  const v = req.headers[name];
@@ -385,7 +386,7 @@ export async function startHttpServer(port) {
385
386
  transports.delete(transport.sessionId);
386
387
  };
387
388
  const api = apiFromRequest(req);
388
- const server = createServer(api, { allowLocalFiles: false }); // remote: never read server-side files
389
+ const server = createServer(api, { allowLocalFiles: false, tools: header(req, "x-webcake-tools") }); // remote: never read server-side files
389
390
  await server.connect(transport);
390
391
  await transport.handleRequest(req, res, body);
391
392
  return;