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