@omni-commerce/sdk 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.
package/dist/index.cjs CHANGED
@@ -26,7 +26,7 @@ function normalizeClientOptions(options = {}) {
26
26
  }
27
27
 
28
28
  // src/version.ts
29
- var SDK_VERSION = "0.3.0";
29
+ var SDK_VERSION = "0.4.0";
30
30
  var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
31
31
 
32
32
  // src/environments.ts
@@ -582,37 +582,415 @@ var AnalyticsClient = class {
582
582
  }
583
583
  _http;
584
584
  /**
585
- * Get Sales Analytics
585
+ * Get Ads Analytics
586
586
  *
587
- * Sales KPIs for a date range with the change against the previous period of equal length, a daily trend, sales by order status and by marketplace, and the top products by net sales. Matches the Orders analysis page. Requires `analytics:read`.
587
+ * Ad spend, attributed sales, ROAS, and ACOS over the last 28 days, and per-product sales and ad metrics for today, yesterday, 7-day and 28-day averages, and the same day one and four weeks ago. Matches the Ads page. Requires `analytics:read`.
588
+
589
+ Amounts are in `data.filters.currency`. The periods count back from the end of the range.
590
+ *
591
+ * `GET /api/v1/analytics/ads`
592
+ */
593
+ getAds(request = {}, requestOptions) {
594
+ const {
595
+ organizationId,
596
+ from,
597
+ to,
598
+ timeZone,
599
+ marketplace,
600
+ country,
601
+ store,
602
+ currency
603
+ } = request ?? {};
604
+ return this._http.request({
605
+ method: "GET",
606
+ path: "/api/v1/analytics/ads",
607
+ query: {
608
+ organizationId,
609
+ from,
610
+ to,
611
+ timeZone,
612
+ marketplace,
613
+ country,
614
+ store,
615
+ currency
616
+ },
617
+ body: void 0,
618
+ ...mergeRequestOptions(requestOptions)
619
+ });
620
+ }
621
+ /**
622
+ * Get AI Traffic Analytics
623
+ *
624
+ * Visits and crawls from AI assistants and search engines: totals, a daily trend, breakdowns by source, route, country, and product, and recent events. Matches the AI Traffic page. Requires `analytics:read`.
625
+
626
+ A range covers at most 365 days; a longer one is shortened to the last 365 days. Read the applied range from `data.filters`.
627
+ *
628
+ * `GET /api/v1/analytics/ai-traffic`
629
+ */
630
+ getAiTraffic(request = {}, requestOptions) {
631
+ const {
632
+ organizationId,
633
+ from,
634
+ to,
635
+ timeZone,
636
+ source,
637
+ trafficType,
638
+ route,
639
+ country
640
+ } = request ?? {};
641
+ return this._http.request({
642
+ method: "GET",
643
+ path: "/api/v1/analytics/ai-traffic",
644
+ query: {
645
+ organizationId,
646
+ from,
647
+ to,
648
+ timeZone,
649
+ source,
650
+ trafficType,
651
+ route,
652
+ country
653
+ },
654
+ body: void 0,
655
+ ...mergeRequestOptions(requestOptions)
656
+ });
657
+ }
658
+ /**
659
+ * Get Video and LIVE Analytics
660
+ *
661
+ * Views, product clicks, orders, and GMV from shoppable videos and LIVE streams, by day, by content type, and per video. Matches the Video / LIVE page. Requires `analytics:read`.
662
+
663
+ Amounts are in `data.filters.currency`. Only orders in that currency are counted; nothing is converted. A range covers at most 366 days.
664
+ *
665
+ * `GET /api/v1/analytics/content`
666
+ */
667
+ getContent(request = {}, requestOptions) {
668
+ const {
669
+ organizationId,
670
+ from,
671
+ to,
672
+ timeZone,
673
+ marketplace,
674
+ country,
675
+ store,
676
+ currency
677
+ } = request ?? {};
678
+ return this._http.request({
679
+ method: "GET",
680
+ path: "/api/v1/analytics/content",
681
+ query: {
682
+ organizationId,
683
+ from,
684
+ to,
685
+ timeZone,
686
+ marketplace,
687
+ country,
688
+ store,
689
+ currency
690
+ },
691
+ body: void 0,
692
+ ...mergeRequestOptions(requestOptions)
693
+ });
694
+ }
695
+ /**
696
+ * Get Order Analytics
697
+ *
698
+ * Order KPIs with their change against the previous period, a daily trend, sales by order status and by marketplace, and the top products by net sales. Repeat buyers are counted but not listed. Matches the Orders analysis page. Requires `analytics:read`.
699
+
700
+ Amounts are in `data.filters.currency`. Only orders in that currency are counted; nothing is converted. A range covers at most 366 days.
701
+ *
702
+ * `GET /api/v1/analytics/orders`
703
+ */
704
+ getOrders(request = {}, requestOptions) {
705
+ const {
706
+ organizationId,
707
+ from,
708
+ to,
709
+ timeZone,
710
+ marketplace,
711
+ country,
712
+ store,
713
+ currency
714
+ } = request ?? {};
715
+ return this._http.request({
716
+ method: "GET",
717
+ path: "/api/v1/analytics/orders",
718
+ query: {
719
+ organizationId,
720
+ from,
721
+ to,
722
+ timeZone,
723
+ marketplace,
724
+ country,
725
+ store,
726
+ currency
727
+ },
728
+ body: void 0,
729
+ ...mergeRequestOptions(requestOptions)
730
+ });
731
+ }
732
+ /**
733
+ * Get Growth Overview
734
+ *
735
+ * Sales, traffic, and profit KPIs with their change against the previous period, a daily trend, the traffic funnel, sales by channel, top and lagging products, and ranked next actions. Matches the Growth Intelligence overview page. Requires `analytics:read`.
588
736
 
589
737
  Amounts are in `data.filters.currency`. Only orders in that currency are counted; nothing is converted. A range covers at most 366 days.
590
738
  *
591
- * `GET /api/v1/analytics/sales`
739
+ * `GET /api/v1/analytics/overview`
592
740
  */
593
- getSales(request = {}, requestOptions) {
741
+ getOverview(request = {}, requestOptions) {
594
742
  const {
595
743
  organizationId,
596
744
  from,
597
745
  to,
746
+ timeZone,
747
+ marketplace,
748
+ country,
749
+ store,
750
+ currency
751
+ } = request ?? {};
752
+ return this._http.request({
753
+ method: "GET",
754
+ path: "/api/v1/analytics/overview",
755
+ query: {
756
+ organizationId,
757
+ from,
758
+ to,
759
+ timeZone,
760
+ marketplace,
761
+ country,
762
+ store,
763
+ currency
764
+ },
765
+ body: void 0,
766
+ ...mergeRequestOptions(requestOptions)
767
+ });
768
+ }
769
+ /**
770
+ * Get Pricing Analytics
771
+ *
772
+ * Selling products with their margin, velocity, stock cover, prices, competitor median, and a pricing recommendation. Matches the Pricing page. Requires `analytics:read`.
773
+
774
+ Amounts are in `data.filters.currency`. Only orders in that currency are counted; nothing is converted. A range covers at most 366 days.
775
+ *
776
+ * `GET /api/v1/analytics/pricing`
777
+ */
778
+ getPricing(request = {}, requestOptions) {
779
+ const {
780
+ organizationId,
781
+ from,
782
+ to,
783
+ timeZone,
784
+ marketplace,
785
+ country,
786
+ store,
787
+ currency
788
+ } = request ?? {};
789
+ return this._http.request({
790
+ method: "GET",
791
+ path: "/api/v1/analytics/pricing",
792
+ query: {
793
+ organizationId,
794
+ from,
795
+ to,
796
+ timeZone,
797
+ marketplace,
798
+ country,
799
+ store,
800
+ currency
801
+ },
802
+ body: void 0,
803
+ ...mergeRequestOptions(requestOptions)
804
+ });
805
+ }
806
+ /**
807
+ * Get Product Analytics
808
+ *
809
+ * Per-product sales, traffic, price, stock, profit, and ad performance, ranked by net sales, with ranked insights. Pass `productId` for specific products, for example on a product page. Matches the Products page. Requires `analytics:read`.
810
+
811
+ Amounts are in `data.filters.currency`. Only orders in that currency are counted; nothing is converted. A range covers at most 366 days.
812
+ *
813
+ * `GET /api/v1/analytics/products`
814
+ */
815
+ getProducts(request = {}, requestOptions) {
816
+ const {
817
+ organizationId,
818
+ from,
819
+ to,
820
+ timeZone,
598
821
  marketplace,
599
822
  country,
600
823
  store,
601
824
  currency,
602
- timeZone
825
+ q,
826
+ productId,
827
+ limit
603
828
  } = request ?? {};
604
829
  return this._http.request({
605
830
  method: "GET",
606
- path: "/api/v1/analytics/sales",
831
+ path: "/api/v1/analytics/products",
607
832
  query: {
608
833
  organizationId,
609
834
  from,
610
835
  to,
836
+ timeZone,
611
837
  marketplace,
612
838
  country,
613
839
  store,
614
840
  currency,
615
- timeZone
841
+ q,
842
+ productId,
843
+ limit
844
+ },
845
+ body: void 0,
846
+ ...mergeRequestOptions(requestOptions)
847
+ });
848
+ }
849
+ /**
850
+ * Get Profit Analytics
851
+ *
852
+ * Revenue, costs, fees, and profit with a waterfall, cost breakdowns, a daily trend, the most and least profitable products, and products missing a cost price. Session members also need finance access. Matches the P&L Analysis page. Requires `analytics:read`.
853
+
854
+ Amounts are in `data.filters.currency`. Only orders in that currency are counted; nothing is converted. A range covers at most 366 days.
855
+ *
856
+ * `GET /api/v1/analytics/profit`
857
+ */
858
+ getProfit(request = {}, requestOptions) {
859
+ const {
860
+ organizationId,
861
+ from,
862
+ to,
863
+ timeZone,
864
+ marketplace,
865
+ country,
866
+ store,
867
+ currency,
868
+ sku
869
+ } = request ?? {};
870
+ return this._http.request({
871
+ method: "GET",
872
+ path: "/api/v1/analytics/profit",
873
+ query: {
874
+ organizationId,
875
+ from,
876
+ to,
877
+ timeZone,
878
+ marketplace,
879
+ country,
880
+ store,
881
+ currency,
882
+ sku
883
+ },
884
+ body: void 0,
885
+ ...mergeRequestOptions(requestOptions)
886
+ });
887
+ }
888
+ /**
889
+ * Get Business Report
890
+ *
891
+ * The management summary: headline KPIs, top products, sales by marketplace, alerts, settlement totals, and data quality. Matches the Business Reports page. Requires `analytics:read`.
892
+
893
+ Amounts are in `data.filters.currency`. Only orders in that currency are counted; nothing is converted. A range covers at most 366 days.
894
+ *
895
+ * `GET /api/v1/analytics/reports`
896
+ */
897
+ getReports(request = {}, requestOptions) {
898
+ const {
899
+ organizationId,
900
+ from,
901
+ to,
902
+ timeZone,
903
+ marketplace,
904
+ country,
905
+ store,
906
+ currency
907
+ } = request ?? {};
908
+ return this._http.request({
909
+ method: "GET",
910
+ path: "/api/v1/analytics/reports",
911
+ query: {
912
+ organizationId,
913
+ from,
914
+ to,
915
+ timeZone,
916
+ marketplace,
917
+ country,
918
+ store,
919
+ currency
920
+ },
921
+ body: void 0,
922
+ ...mergeRequestOptions(requestOptions)
923
+ });
924
+ }
925
+ /**
926
+ * Get Store Analytics
927
+ *
928
+ * Seller Centre shop metrics: visitors, page views, followers, the placed, paid, and confirmed buyer funnel, a daily trend, and the app and web split. Matches the Analytics (Seller Centre) page. Requires `analytics:read`.
929
+
930
+ Amounts are in `data.filters.currency`. Only orders in that currency are counted; nothing is converted. A range covers at most 366 days.
931
+ *
932
+ * `GET /api/v1/analytics/stores`
933
+ */
934
+ getStores(request = {}, requestOptions) {
935
+ const {
936
+ organizationId,
937
+ from,
938
+ to,
939
+ timeZone,
940
+ marketplace,
941
+ country,
942
+ store,
943
+ currency
944
+ } = request ?? {};
945
+ return this._http.request({
946
+ method: "GET",
947
+ path: "/api/v1/analytics/stores",
948
+ query: {
949
+ organizationId,
950
+ from,
951
+ to,
952
+ timeZone,
953
+ marketplace,
954
+ country,
955
+ store,
956
+ currency
957
+ },
958
+ body: void 0,
959
+ ...mergeRequestOptions(requestOptions)
960
+ });
961
+ }
962
+ /**
963
+ * Get Traffic Analytics
964
+ *
965
+ * Impressions, page views, visitors, add-to-cart, and conversion, with the funnel, a daily trend, products ranked by lost conversion, diagnostics, and the videos that drive traffic. Matches the Traffic page. Requires `analytics:read`.
966
+
967
+ Amounts are in `data.filters.currency`. Only orders in that currency are counted; nothing is converted. A range covers at most 366 days.
968
+ *
969
+ * `GET /api/v1/analytics/traffic`
970
+ */
971
+ getTraffic(request = {}, requestOptions) {
972
+ const {
973
+ organizationId,
974
+ from,
975
+ to,
976
+ timeZone,
977
+ marketplace,
978
+ country,
979
+ store,
980
+ currency
981
+ } = request ?? {};
982
+ return this._http.request({
983
+ method: "GET",
984
+ path: "/api/v1/analytics/traffic",
985
+ query: {
986
+ organizationId,
987
+ from,
988
+ to,
989
+ timeZone,
990
+ marketplace,
991
+ country,
992
+ store,
993
+ currency
616
994
  },
617
995
  body: void 0,
618
996
  ...mergeRequestOptions(requestOptions)
@@ -710,44 +1088,6 @@ var AopClient = class {
710
1088
  });
711
1089
  }
712
1090
  };
713
- var ApiClient = class {
714
- constructor(_http) {
715
- this._http = _http;
716
- }
717
- _http;
718
- /**
719
- * API Root
720
- *
721
- * Public API discovery root. Merchant payments are handled by organization-scoped checkout session endpoints.
722
- *
723
- * `GET /api`
724
- */
725
- root(requestOptions) {
726
- return this._http.request({
727
- method: "GET",
728
- path: "/api",
729
- query: void 0,
730
- body: void 0,
731
- ...mergeRequestOptions(requestOptions)
732
- });
733
- }
734
- /**
735
- * API v1 Root
736
- *
737
- * Public API v1 discovery root. Merchant payments are handled by organization-scoped checkout session endpoints.
738
- *
739
- * `GET /api/v1`
740
- */
741
- v1(requestOptions) {
742
- return this._http.request({
743
- method: "GET",
744
- path: "/api/v1",
745
- query: void 0,
746
- body: void 0,
747
- ...mergeRequestOptions(requestOptions)
748
- });
749
- }
750
- };
751
1091
  var CampaignsClient = class {
752
1092
  constructor(_http) {
753
1093
  this._http = _http;
@@ -2974,7 +3314,6 @@ var OmniGeneratedClient = class {
2974
3314
  this.agents = new AgentsClient(this._http);
2975
3315
  this.analytics = new AnalyticsClient(this._http);
2976
3316
  this.aop = new AopClient(this._http);
2977
- this.api = new ApiClient(this._http);
2978
3317
  this.campaigns = new CampaignsClient(this._http);
2979
3318
  this.catalog = new CatalogClient(this._http);
2980
3319
  this.checkoutSessions = new CheckoutSessionsClient(this._http);
@@ -3010,7 +3349,6 @@ var OmniGeneratedClient = class {
3010
3349
  agents;
3011
3350
  analytics;
3012
3351
  aop;
3013
- api;
3014
3352
  campaigns;
3015
3353
  catalog;
3016
3354
  checkoutSessions;