@omni-commerce/sdk 0.31.1 → 0.33.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
@@ -33,7 +33,7 @@ function normalizeClientOptions(options = {}) {
33
33
  }
34
34
 
35
35
  // src/version.ts
36
- var SDK_VERSION = "0.31.1";
36
+ var SDK_VERSION = "0.33.0";
37
37
  var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
38
38
 
39
39
  // src/environments.ts
@@ -712,6 +712,235 @@ async function waitForJob(http, request, options) {
712
712
  }
713
713
 
714
714
  // src/generated/resources.ts
715
+ var AdsClient = class {
716
+ constructor(_http) {
717
+ __publicField(this, "_http", _http);
718
+ }
719
+ /**
720
+ * List Ads accounts and capabilities
721
+ *
722
+ * Requires ads:read. Every target is organization/store scoped. Partial failures are explicit in data.success and ordered results. Shopee and Lazada support only the formats returned by accounts. Other marketplaces report a concrete limitation. External campaign IDs differ from saved campaign group UUIDs.
723
+ *
724
+ * `GET /api/v1/ads/accounts`
725
+ */
726
+ listAccounts(request = {}, requestOptions) {
727
+ const { marketplaces, organizationId } = request ?? {};
728
+ return this._http.request({
729
+ method: "GET",
730
+ path: "/api/v1/ads/accounts",
731
+ query: { marketplaces, organizationId },
732
+ body: void 0,
733
+ ...mergeRequestOptions(requestOptions)
734
+ });
735
+ }
736
+ /**
737
+ * List saved and synced ads
738
+ *
739
+ * Requires ads:read. Every target is organization/store scoped. Partial failures are explicit in data.success and ordered results. Shopee and Lazada support only the formats returned by accounts. Other marketplaces report a concrete limitation. External campaign IDs differ from saved campaign group UUIDs.
740
+ *
741
+ * `GET /api/v1/ads/campaigns`
742
+ */
743
+ listCampaigns(request = {}, requestOptions) {
744
+ const { status, q, marketplace, store, offset, organizationId } = request ?? {};
745
+ return this._http.request({
746
+ method: "GET",
747
+ path: "/api/v1/ads/campaigns",
748
+ query: { status, q, marketplace, store, offset, organizationId },
749
+ body: void 0,
750
+ ...mergeRequestOptions(requestOptions)
751
+ });
752
+ }
753
+ /**
754
+ * Draft a multi-store Ads campaign
755
+ *
756
+ * Requires ads:write. Every target is organization/store scoped. Partial failures are explicit in data.success and ordered results. Shopee and Lazada support only the formats returned by accounts. Other marketplaces report a concrete limitation. External campaign IDs differ from saved campaign group UUIDs.
757
+ *
758
+ * `POST /api/v1/ads/campaigns`
759
+ */
760
+ createCampaign(request, requestOptions) {
761
+ const { ...body } = request ?? {};
762
+ return this._http.request({
763
+ method: "POST",
764
+ path: "/api/v1/ads/campaigns",
765
+ query: void 0,
766
+ body,
767
+ ...mergeRequestOptions(requestOptions)
768
+ });
769
+ }
770
+ /**
771
+ * Approve, stop or retry Ads campaign groups
772
+ *
773
+ * Requires ads:approve. Every target is organization/store scoped. Accepted work runs durably; inspect per-target outcomes and returned planIds/jobIds until verified. Approval uses saved immutable seller budgets and schedules. Shopee and Lazada support only the formats returned by accounts. Other marketplaces report a concrete limitation. External campaign IDs differ from saved campaign group UUIDs.
774
+ *
775
+ * `POST /api/v1/ads/campaigns/actions`
776
+ */
777
+ actOnCampaigns(request, requestOptions) {
778
+ const { ...body } = request ?? {};
779
+ return this._http.request({
780
+ method: "POST",
781
+ path: "/api/v1/ads/campaigns/actions",
782
+ query: void 0,
783
+ body,
784
+ ...mergeRequestOptions(requestOptions)
785
+ });
786
+ }
787
+ /**
788
+ * Read live marketplace campaigns
789
+ *
790
+ * Requires ads:read. Every target is organization/store scoped. Partial failures are explicit in data.success and ordered results. Shopee and Lazada support only the formats returned by accounts. Other marketplaces report a concrete limitation. External campaign IDs differ from saved campaign group UUIDs.
791
+ *
792
+ * `POST /api/v1/ads/campaigns/live`
793
+ */
794
+ getLiveCampaigns(request, requestOptions) {
795
+ const { ...body } = request ?? {};
796
+ return this._http.request({
797
+ method: "POST",
798
+ path: "/api/v1/ads/campaigns/live",
799
+ query: void 0,
800
+ body,
801
+ ...mergeRequestOptions(requestOptions)
802
+ });
803
+ }
804
+ /**
805
+ * Read saved Ads campaign groups
806
+ *
807
+ * Requires ads:read. Every target is organization/store scoped. Partial failures are explicit in data.success and ordered results. Shopee and Lazada support only the formats returned by accounts. Other marketplaces report a concrete limitation. External campaign IDs differ from saved campaign group UUIDs.
808
+ *
809
+ * `POST /api/v1/ads/campaigns/read`
810
+ */
811
+ getCampaigns(request, requestOptions) {
812
+ const { ...body } = request ?? {};
813
+ return this._http.request({
814
+ method: "POST",
815
+ path: "/api/v1/ads/campaigns/read",
816
+ query: void 0,
817
+ body,
818
+ ...mergeRequestOptions(requestOptions)
819
+ });
820
+ }
821
+ /**
822
+ * Read live Ads performance
823
+ *
824
+ * Requires ads:read. Every target is organization/store scoped. Partial failures are explicit in data.success and ordered results. Shopee and Lazada support only the formats returned by accounts. Other marketplaces report a concrete limitation. External campaign IDs differ from saved campaign group UUIDs.
825
+ *
826
+ * `POST /api/v1/ads/performance`
827
+ */
828
+ getPerformance(request, requestOptions) {
829
+ const { ...body } = request ?? {};
830
+ return this._http.request({
831
+ method: "POST",
832
+ path: "/api/v1/ads/performance",
833
+ query: void 0,
834
+ body,
835
+ ...mergeRequestOptions(requestOptions)
836
+ });
837
+ }
838
+ /**
839
+ * Approve, stop or retry legacy Ads plans
840
+ *
841
+ * Requires ads:approve. Every target is organization/store scoped. Accepted work runs durably; inspect per-target outcomes and returned planIds/jobIds until verified. Approval uses saved immutable seller budgets and schedules. Shopee and Lazada support only the formats returned by accounts. Other marketplaces report a concrete limitation. External campaign IDs differ from saved campaign group UUIDs.
842
+ *
843
+ * `POST /api/v1/ads/plans/actions`
844
+ */
845
+ actOnPlans(request, requestOptions) {
846
+ const { ...body } = request ?? {};
847
+ return this._http.request({
848
+ method: "POST",
849
+ path: "/api/v1/ads/plans/actions",
850
+ query: void 0,
851
+ body,
852
+ ...mergeRequestOptions(requestOptions)
853
+ });
854
+ }
855
+ /**
856
+ * Read delivery and verification evidence
857
+ *
858
+ * Requires ads:read. Every target is organization/store scoped. Partial failures are explicit in data.success and ordered results. Shopee and Lazada support only the formats returned by accounts. Other marketplaces report a concrete limitation. External campaign IDs differ from saved campaign group UUIDs.
859
+ *
860
+ * `POST /api/v1/ads/plans/status`
861
+ */
862
+ getPlans(request, requestOptions) {
863
+ const { ...body } = request ?? {};
864
+ return this._http.request({
865
+ method: "POST",
866
+ path: "/api/v1/ads/plans/status",
867
+ query: void 0,
868
+ body,
869
+ ...mergeRequestOptions(requestOptions)
870
+ });
871
+ }
872
+ /**
873
+ * Read persisted campaign reports
874
+ *
875
+ * Requires ads:read. Every target is organization/store scoped. Partial failures are explicit in data.success and ordered results. Shopee and Lazada support only the formats returned by accounts. Other marketplaces report a concrete limitation. External campaign IDs differ from saved campaign group UUIDs.
876
+ *
877
+ * `GET /api/v1/ads/reports`
878
+ */
879
+ getReports(request, requestOptions) {
880
+ const {
881
+ from,
882
+ to,
883
+ marketplace,
884
+ country,
885
+ store,
886
+ currency,
887
+ campaign,
888
+ offset,
889
+ organizationId
890
+ } = request ?? {};
891
+ return this._http.request({
892
+ method: "GET",
893
+ path: "/api/v1/ads/reports",
894
+ query: {
895
+ from,
896
+ to,
897
+ marketplace,
898
+ country,
899
+ store,
900
+ currency,
901
+ campaign,
902
+ offset,
903
+ organizationId
904
+ },
905
+ body: void 0,
906
+ ...mergeRequestOptions(requestOptions)
907
+ });
908
+ }
909
+ /**
910
+ * Queue Ads report imports
911
+ *
912
+ * Requires ads:read. Every target is organization/store scoped. Accepted work runs durably; inspect per-target outcomes and returned planIds/jobIds until verified. Approval uses saved immutable seller budgets and schedules. Shopee and Lazada support only the formats returned by accounts. Other marketplaces report a concrete limitation. External campaign IDs differ from saved campaign group UUIDs.
913
+ *
914
+ * `POST /api/v1/ads/sync`
915
+ */
916
+ syncReports(request, requestOptions) {
917
+ const { ...body } = request ?? {};
918
+ return this._http.request({
919
+ method: "POST",
920
+ path: "/api/v1/ads/sync",
921
+ query: void 0,
922
+ body,
923
+ ...mergeRequestOptions(requestOptions)
924
+ });
925
+ }
926
+ /**
927
+ * Read Ads import job status
928
+ *
929
+ * Requires ads:read. Every target is organization/store scoped. Partial failures are explicit in data.success and ordered results. Shopee and Lazada support only the formats returned by accounts. Other marketplaces report a concrete limitation. External campaign IDs differ from saved campaign group UUIDs.
930
+ *
931
+ * `POST /api/v1/ads/sync/status`
932
+ */
933
+ getSyncStatus(request, requestOptions) {
934
+ const { ...body } = request ?? {};
935
+ return this._http.request({
936
+ method: "POST",
937
+ path: "/api/v1/ads/sync/status",
938
+ query: void 0,
939
+ body,
940
+ ...mergeRequestOptions(requestOptions)
941
+ });
942
+ }
943
+ };
715
944
  var AgentsGeneralClient = class {
716
945
  constructor(_http) {
717
946
  __publicField(this, "_http", _http);
@@ -1446,6 +1675,136 @@ var ApiClient = class {
1446
1675
  });
1447
1676
  }
1448
1677
  };
1678
+ var BotsClient = class {
1679
+ constructor(_http) {
1680
+ __publicField(this, "_http", _http);
1681
+ }
1682
+ /**
1683
+ * List personal Bots
1684
+ *
1685
+ * Requires agents:invoke and assistant.use. Use a signed-in member session or a member's CLI token. Organization OAuth and Computer credentials cannot access personal Bots.
1686
+ *
1687
+ * `GET /api/v1/bots`
1688
+ */
1689
+ list(request = {}, requestOptions) {
1690
+ const { organizationId, q, page, status } = request ?? {};
1691
+ return this._http.request({
1692
+ method: "GET",
1693
+ path: "/api/v1/bots",
1694
+ query: { organizationId, q, page, status },
1695
+ body: void 0,
1696
+ ...mergeRequestOptions(requestOptions)
1697
+ });
1698
+ }
1699
+ /**
1700
+ * Create a personal Bot
1701
+ *
1702
+ * Requires agents:invoke and assistant.use. Use a signed-in member session or a member's CLI token. Organization OAuth and Computer credentials cannot access personal Bots.
1703
+ *
1704
+ * `POST /api/v1/bots`
1705
+ */
1706
+ create(request, requestOptions) {
1707
+ const { organizationId, ...body } = request ?? {};
1708
+ return this._http.request({
1709
+ method: "POST",
1710
+ path: "/api/v1/bots",
1711
+ query: { organizationId },
1712
+ body,
1713
+ ...mergeRequestOptions(requestOptions)
1714
+ });
1715
+ }
1716
+ /**
1717
+ * List a Bot's routines
1718
+ *
1719
+ * Requires agents:invoke and assistant.use. Use a signed-in member session or a member's CLI token. Organization OAuth and Computer credentials cannot access personal Bots.
1720
+ *
1721
+ * `GET /api/v1/bots/{botId}/routines`
1722
+ */
1723
+ listRoutines(request, requestOptions) {
1724
+ const { botId, organizationId } = request ?? {};
1725
+ return this._http.request({
1726
+ method: "GET",
1727
+ path: `/api/v1/bots/${encodePathParam("botId", botId)}/routines`,
1728
+ query: { organizationId },
1729
+ body: void 0,
1730
+ ...mergeRequestOptions(requestOptions)
1731
+ });
1732
+ }
1733
+ /**
1734
+ * Manage a Bot's routines
1735
+ *
1736
+ * Requires agents:invoke and assistant.use. Use a signed-in member session or a member's CLI token. Organization OAuth and Computer credentials cannot access personal Bots.
1737
+
1738
+ Create, edit, link, pause, resume, delete, test, or run a batch of routines. New personal routines start paused. Reuse the same requestId only when retrying the same request. Inspect every ordered result before retrying failed targets.
1739
+ *
1740
+ * `POST /api/v1/bots/{botId}/routines`
1741
+ */
1742
+ mutateRoutines(request, requestOptions) {
1743
+ const { botId, organizationId, ...body } = request ?? {};
1744
+ return this._http.request({
1745
+ method: "POST",
1746
+ path: `/api/v1/bots/${encodePathParam("botId", botId)}/routines`,
1747
+ query: { organizationId },
1748
+ body,
1749
+ ...mergeRequestOptions(requestOptions)
1750
+ });
1751
+ }
1752
+ /**
1753
+ * List a Bot's message runs
1754
+ *
1755
+ * Requires agents:invoke and assistant.use. Use a signed-in member session or a member's CLI token. Organization OAuth and Computer credentials cannot access personal Bots.
1756
+ *
1757
+ * `GET /api/v1/bots/{botId}/runs`
1758
+ */
1759
+ listRuns(request, requestOptions) {
1760
+ const { botId, organizationId } = request ?? {};
1761
+ return this._http.request({
1762
+ method: "GET",
1763
+ path: `/api/v1/bots/${encodePathParam("botId", botId)}/runs`,
1764
+ query: { organizationId },
1765
+ body: void 0,
1766
+ ...mergeRequestOptions(requestOptions)
1767
+ });
1768
+ }
1769
+ /**
1770
+ * Send a message to a Bot
1771
+ *
1772
+ * Requires agents:invoke and assistant.use. Use a signed-in member session or a member's CLI token. Organization OAuth and Computer credentials cannot access personal Bots.
1773
+
1774
+ Reuse the same requestId when retrying a submission. The response Location points to the run status.
1775
+ *
1776
+ * `POST /api/v1/bots/{botId}/runs`
1777
+ */
1778
+ sendMessage(request, requestOptions) {
1779
+ const { botId, organizationId, ...body } = request ?? {};
1780
+ return this._http.request({
1781
+ method: "POST",
1782
+ path: `/api/v1/bots/${encodePathParam("botId", botId)}/runs`,
1783
+ query: { organizationId },
1784
+ body,
1785
+ ...mergeRequestOptions(requestOptions)
1786
+ });
1787
+ }
1788
+ /**
1789
+ * Read a Bot message run
1790
+ *
1791
+ * Requires agents:invoke and assistant.use. Use a signed-in member session or a member's CLI token. Organization OAuth and Computer credentials cannot access personal Bots.
1792
+
1793
+ Returns the run's status, visible reply, and approval URL when available. Archived runs retain their status. Reopen their conversation to read the reply after the active run journal expires.
1794
+ *
1795
+ * `GET /api/v1/bots/{botId}/runs/{runId}`
1796
+ */
1797
+ getRun(request, requestOptions) {
1798
+ const { botId, runId, organizationId } = request ?? {};
1799
+ return this._http.request({
1800
+ method: "GET",
1801
+ path: `/api/v1/bots/${encodePathParam("botId", botId)}/runs/${encodePathParam("runId", runId)}`,
1802
+ query: { organizationId },
1803
+ body: void 0,
1804
+ ...mergeRequestOptions(requestOptions)
1805
+ });
1806
+ }
1807
+ };
1449
1808
  var BrandKitsClient = class {
1450
1809
  constructor(_http) {
1451
1810
  __publicField(this, "_http", _http);
@@ -1612,10 +1971,95 @@ var BulkClient = class {
1612
1971
  ...mergeRequestOptions(requestOptions)
1613
1972
  });
1614
1973
  }
1974
+ /**
1975
+ * Create Catalog Operation Plan
1976
+ *
1977
+ * Create a staged pricing, catalog record import, or reviewable enrichment plan for up to one million targets. Add enrichment options for listing copy, images, or store taxonomy, or importRecords for new catalog records. Set importRecords.update on a file plan to prepare exact-SKU price or warehouse stock updates for review. An optional selection filter prepares an enrichment plan server-side. Poll status until draft, review the total, and explicitly submit. Repeat the original create request after an interruption. If the selection exceeds the limit, narrow the filters and create a new plan. The initiating identity can upload ordered chunks and submit the plan when complete. Reusing the same idempotency key and options resumes that plan. Requires catalog:write and catalog:read. Enrichment al
1978
+ *
1979
+ * `POST /api/v1/catalog/operations/plan`
1980
+ */
1981
+ plan(request, requestOptions) {
1982
+ const { organizationId, ...body } = request ?? {};
1983
+ return this._http.request({
1984
+ method: "POST",
1985
+ path: "/api/v1/catalog/operations/plan",
1986
+ query: { organizationId },
1987
+ body,
1988
+ ...mergeRequestOptions(requestOptions)
1989
+ });
1990
+ }
1991
+ /**
1992
+ * Append Catalog Operation Chunk
1993
+ *
1994
+ * Upload up to 500 distinct targets at the next chunkIndex, starting at zero. Provide updates for pricing, productIds for enrichment, or products for record imports. Each product belongs to one chunk. Replaying the same chunk index and content is safe and returns the latest upload progress. Pricing captures product versions when targets are appended. Enrichment receipts identify the linked review and report when generation reaches review. Requires catalog:write.
1995
+ *
1996
+ * `POST /api/v1/catalog/operations/plan/append`
1997
+ */
1998
+ append(request, requestOptions) {
1999
+ const { organizationId, ...body } = request ?? {};
2000
+ return this._http.request({
2001
+ method: "POST",
2002
+ path: "/api/v1/catalog/operations/plan/append",
2003
+ query: { organizationId },
2004
+ body,
2005
+ ...mergeRequestOptions(requestOptions)
2006
+ });
2007
+ }
2008
+ /**
2009
+ * Complete Catalog File
2010
+ *
2011
+ * Queue validation and import after all file parts are uploaded. For importRecords.update, validation ends at ready_for_review. Read the ordered preview with bulk.results and submit explicitly with expectedProductCount. For create-only file imports, validation queues the import automatically. Then follow the same operation in bulk.status and bulk.results. Repeat this request after a retryable interruption. Requires catalog:read and catalog:write.
2012
+ *
2013
+ * `POST /api/v1/catalog/operations/plan/file-complete`
2014
+ */
2015
+ completeFile(request, requestOptions) {
2016
+ const { organizationId, ...body } = request ?? {};
2017
+ return this._http.request({
2018
+ method: "POST",
2019
+ path: "/api/v1/catalog/operations/plan/file-complete",
2020
+ query: { organizationId },
2021
+ body,
2022
+ ...mergeRequestOptions(requestOptions)
2023
+ });
2024
+ }
2025
+ /**
2026
+ * Prepare Catalog File Parts
2027
+ *
2028
+ * Request signed PUT URLs for up to eight file parts. Each is 8 MiB except the final part. Send the exact bytes and x-amz-checksum-sha256 header to the signed URL. Previously uploaded matching parts are skipped. Requires catalog:read and catalog:write.
2029
+ *
2030
+ * `POST /api/v1/catalog/operations/plan/file-parts`
2031
+ */
2032
+ fileParts(request, requestOptions) {
2033
+ const { organizationId, ...body } = request ?? {};
2034
+ return this._http.request({
2035
+ method: "POST",
2036
+ path: "/api/v1/catalog/operations/plan/file-parts",
2037
+ query: { organizationId },
2038
+ body,
2039
+ ...mergeRequestOptions(requestOptions)
2040
+ });
2041
+ }
2042
+ /**
2043
+ * Submit Catalog Operation Plan
2044
+ *
2045
+ * Seal and queue the uploaded plan if its product count matches expectedProductCount. Retry the same request if admission is interrupted. Use bulk.status and bulk.results for progress and receipts. Requires the same scopes as plan creation.
2046
+ *
2047
+ * `POST /api/v1/catalog/operations/plan/submit`
2048
+ */
2049
+ submit(request, requestOptions) {
2050
+ const { organizationId, ...body } = request ?? {};
2051
+ return this._http.request({
2052
+ method: "POST",
2053
+ path: "/api/v1/catalog/operations/plan/submit",
2054
+ query: { organizationId },
2055
+ body,
2056
+ ...mergeRequestOptions(requestOptions)
2057
+ });
2058
+ }
1615
2059
  /**
1616
2060
  * Get Catalog Operation Results
1617
2061
  *
1618
- * Read ordered per-product receipts and verification evidence for up to 50 operationIds. Filter status=failed to inspect failures directly. At most 100 rows across the requested operations per page. Requires catalog:read.
2062
+ * Read ordered per-product receipts and verification evidence for up to 50 operationIds. Filter status=failed to inspect failures directly. Pass nextPageKey as after on the next request, keeping the operation order and status filter the same. At most 100 rows per page. Requires catalog:read.
1619
2063
  *
1620
2064
  * `POST /api/v1/catalog/operations/results`
1621
2065
  */
@@ -1632,7 +2076,7 @@ var BulkClient = class {
1632
2076
  /**
1633
2077
  * Get Catalog Operation Status
1634
2078
  *
1635
- * Read compact progress for up to 50 operationIds in first-requested order. Pending is incomplete, and partial failures remain explicit. Requires catalog:read. Detailed receipts are returned only by the paginated report API.
2079
+ * Read compact progress for up to 50 operationIds in first-requested order. Draft plans are still accepting input. A file update at ready_for_review requires approval via bulk.submit. Pending is incomplete, and partial failures remain explicit. Requires catalog:read. Detailed receipts are returned by the paginated results API.
1636
2080
  *
1637
2081
  * `POST /api/v1/catalog/operations/status`
1638
2082
  */
@@ -2391,6 +2835,27 @@ var EmailClient = class {
2391
2835
  ...mergeRequestOptions(requestOptions)
2392
2836
  });
2393
2837
  }
2838
+ /**
2839
+ * Get Email Drafts
2840
+ *
2841
+ * Read exact unsent drafts in one connected mailbox. Pass one to twenty draft resource IDs, in request order. Duplicate IDs are read once. The result includes a per-draft outcome for every distinct ID.
2842
+
2843
+ ### Authorization
2844
+
2845
+ Requires `email:read` and the integration permission the matching chat tool needs, with a person's credential: a CLI login, a signed-in session, or the SDK key inside your own chat sandbox. Only your own connected mailboxes are reachable; another account's `connectionId` is refused.
2846
+ *
2847
+ * `POST /api/v1/email/drafts/query`
2848
+ */
2849
+ getDrafts(request, requestOptions) {
2850
+ const { ...body } = request ?? {};
2851
+ return this._http.request({
2852
+ method: "POST",
2853
+ path: "/api/v1/email/drafts/query",
2854
+ query: void 0,
2855
+ body,
2856
+ ...mergeRequestOptions(requestOptions)
2857
+ });
2858
+ }
2394
2859
  /**
2395
2860
  * Get Email Message
2396
2861
  *
@@ -2449,6 +2914,27 @@ var EmailClient = class {
2449
2914
  ...mergeRequestOptions(requestOptions)
2450
2915
  });
2451
2916
  }
2917
+ /**
2918
+ * Get Email Thread
2919
+ *
2920
+ * Read the Gmail or Outlook conversation for a `threadId` from Search Emails. Each message includes headers, up to 8,000 characters of plain text, and read and draft state.
2921
+
2922
+ ### Authorization
2923
+
2924
+ Requires `email:read` and the integration permission the matching chat tool needs, with a person's credential: a CLI login, a signed-in session, or the SDK key inside your own chat sandbox. Only your own connected mailboxes are reachable; another account's `connectionId` is refused.
2925
+ *
2926
+ * `GET /api/v1/email/threads/{threadId}`
2927
+ */
2928
+ getThread(request, requestOptions) {
2929
+ const { threadId, connectionId, organizationId } = request ?? {};
2930
+ return this._http.request({
2931
+ method: "GET",
2932
+ path: `/api/v1/email/threads/${encodePathParam("threadId", threadId)}`,
2933
+ query: { connectionId, organizationId },
2934
+ body: void 0,
2935
+ ...mergeRequestOptions(requestOptions)
2936
+ });
2937
+ }
2452
2938
  };
2453
2939
  var EvaluateClient = class {
2454
2940
  constructor(_http) {
@@ -5858,10 +6344,12 @@ var ZaloraClient = class {
5858
6344
  var OmniGeneratedClient = class {
5859
6345
  constructor(_http) {
5860
6346
  __publicField(this, "_http", _http);
6347
+ __publicField(this, "ads");
5861
6348
  __publicField(this, "agents");
5862
6349
  __publicField(this, "analytics");
5863
6350
  __publicField(this, "aop");
5864
6351
  __publicField(this, "api");
6352
+ __publicField(this, "bots");
5865
6353
  __publicField(this, "brandKits");
5866
6354
  __publicField(this, "brandsgateway");
5867
6355
  __publicField(this, "bulk");
@@ -5903,10 +6391,12 @@ var OmniGeneratedClient = class {
5903
6391
  __publicField(this, "webhooks");
5904
6392
  __publicField(this, "wiki");
5905
6393
  __publicField(this, "zalora");
6394
+ this.ads = new AdsClient(this._http);
5906
6395
  this.agents = new AgentsClient(this._http);
5907
6396
  this.analytics = new AnalyticsClient(this._http);
5908
6397
  this.aop = new AopClient(this._http);
5909
6398
  this.api = new ApiClient(this._http);
6399
+ this.bots = new BotsClient(this._http);
5910
6400
  this.brandKits = new BrandKitsClient(this._http);
5911
6401
  this.brandsgateway = new BrandsgatewayClient(this._http);
5912
6402
  this.bulk = new BulkClient(this._http);
@@ -5961,6 +6451,211 @@ var OmniClient = class extends OmniGeneratedClient {
5961
6451
  }
5962
6452
  };
5963
6453
 
6454
+ // src/catalog-file.ts
6455
+ var partSize = 8 * 1024 * 1024;
6456
+ var maxFileSize = 512 * 1024 * 1024;
6457
+ var parallelParts = 4;
6458
+ async function submitCatalogFile(client, request, file, options) {
6459
+ if (!file.size || file.size > maxFileSize)
6460
+ throw new Error("Provide a catalog file between 1 byte and 512 MiB.");
6461
+ if (!options?.digest && !globalThis.crypto?.subtle)
6462
+ throw new Error(
6463
+ "Catalog file uploads require Web Crypto or a SHA-256 digest implementation."
6464
+ );
6465
+ const chunk = (index) => file.slice(index * partSize, (index + 1) * partSize);
6466
+ const hashes = [];
6467
+ const digest = options?.digest ?? ((bytes) => globalThis.crypto.subtle.digest("SHA-256", bytes));
6468
+ const api = options?.signal ? { ...options.api, abortSignal: options.signal } : options?.api;
6469
+ const base64 = (bytes) => btoa(String.fromCharCode(...bytes));
6470
+ const count = Math.ceil(file.size / partSize);
6471
+ const combined = new Uint8Array(count * 32);
6472
+ for (let index = 0; index < count; index++) {
6473
+ options?.signal?.throwIfAborted();
6474
+ const hash = new Uint8Array(
6475
+ await digest(await (await chunk(index)).arrayBuffer())
6476
+ );
6477
+ hashes.push(hash);
6478
+ combined.set(hash, index * 32);
6479
+ }
6480
+ const {
6481
+ organizationId,
6482
+ idempotencyKey,
6483
+ format,
6484
+ title,
6485
+ sessionId,
6486
+ columnMapping,
6487
+ update,
6488
+ syncToMarketplaces
6489
+ } = request;
6490
+ const { data: plan } = await client.bulk.plan(
6491
+ {
6492
+ organizationId,
6493
+ idempotencyKey,
6494
+ sessionId,
6495
+ syncToMarketplaces,
6496
+ importRecords: {
6497
+ title,
6498
+ update,
6499
+ file: {
6500
+ sizeBytes: file.size,
6501
+ format,
6502
+ columnMapping,
6503
+ sha256: base64(new Uint8Array(await digest(combined)))
6504
+ }
6505
+ }
6506
+ },
6507
+ api
6508
+ );
6509
+ if (!plan?.operationId)
6510
+ throw new Error("The server did not return a catalog operation ID.");
6511
+ const target = { organizationId, operationId: plan.operationId };
6512
+ for (let start = 0; start < count; start += parallelParts) {
6513
+ options?.signal?.throwIfAborted();
6514
+ const parts = hashes.slice(start, start + parallelParts).map((hash, index) => ({
6515
+ partNumber: start + index + 1,
6516
+ sha256: base64(hash)
6517
+ }));
6518
+ const { data } = await client.bulk.fileParts({ ...target, parts }, api);
6519
+ if (!data || data.partSizeBytes !== partSize)
6520
+ throw new Error("Invalid catalog upload response.");
6521
+ if (data.accepted) break;
6522
+ if (data.parts.length !== parts.length)
6523
+ throw new Error("The upload response omitted file parts.");
6524
+ const results = await Promise.allSettled(
6525
+ data.parts.map(async (part, index) => {
6526
+ const expected = parts[index];
6527
+ const size = Math.min(
6528
+ partSize,
6529
+ file.size - (expected.partNumber - 1) * partSize
6530
+ );
6531
+ if (part.partNumber !== expected.partNumber || part.sizeBytes !== size)
6532
+ throw new Error("The upload response changed a file part.");
6533
+ if (part.uploaded) return;
6534
+ if (!part.uploadUrl || new URL(part.uploadUrl).protocol !== "https:")
6535
+ throw new Error("The server did not return a secure upload URL.");
6536
+ const body = await chunk(expected.partNumber - 1);
6537
+ if (body.size !== size)
6538
+ throw new Error("The catalog file changed during upload.");
6539
+ const response = await (options?.fetch ?? fetch)(part.uploadUrl, {
6540
+ method: "PUT",
6541
+ body,
6542
+ headers: { "x-amz-checksum-sha256": expected.sha256 },
6543
+ credentials: "omit",
6544
+ redirect: "error",
6545
+ signal: options?.signal
6546
+ });
6547
+ if (!response.ok)
6548
+ throw new Error(
6549
+ `Upload part ${expected.partNumber} returned HTTP ${response.status}. Reuse the same file and key to resume.`
6550
+ );
6551
+ })
6552
+ );
6553
+ for (const result of results)
6554
+ if (result.status === "rejected") throw result.reason;
6555
+ }
6556
+ return client.bulk.completeFile(target, api);
6557
+ }
6558
+ async function* readCatalogFileFailures(client, request, options) {
6559
+ const { organizationId } = request;
6560
+ const operationId = request.operationId.trim().toLowerCase();
6561
+ let after;
6562
+ for (; ; ) {
6563
+ const { data } = await client.bulk.results(
6564
+ {
6565
+ operationIds: [operationId],
6566
+ organizationId,
6567
+ after,
6568
+ status: "failed",
6569
+ limit: 100,
6570
+ includeRequest: false
6571
+ },
6572
+ options
6573
+ );
6574
+ if (!data)
6575
+ throw new Error("The server did not return catalog file results.");
6576
+ yield* data.results;
6577
+ if (!data.hasMore) return;
6578
+ if (!data.nextPageKey || data.nextPageKey.operationId !== operationId || after && data.nextPageKey.ordinal <= after.ordinal)
6579
+ throw new Error(
6580
+ "The server did not advance the catalog file results cursor."
6581
+ );
6582
+ after = data.nextPageKey;
6583
+ }
6584
+ }
6585
+
6586
+ // src/catalog-pricing.ts
6587
+ var CHUNK_SIZE = 500;
6588
+ var CHUNK_BYTES = 7 * 1024 * 1024;
6589
+ async function submitCatalogTargets(client, request, source, appendBody, identity, options) {
6590
+ const { organizationId } = request;
6591
+ const { data: plan } = await client.bulk.plan(request, options);
6592
+ if (!plan?.operationId)
6593
+ throw new Error("The server did not return a catalog plan ID.");
6594
+ const { operationId } = plan;
6595
+ const encoder2 = new TextEncoder();
6596
+ let chunk = [];
6597
+ let chunkSize = 0;
6598
+ let chunkIndex = 0;
6599
+ let expectedProductCount = 0;
6600
+ const append = async () => {
6601
+ await client.bulk.append(
6602
+ { organizationId, operationId, chunkIndex, ...appendBody(chunk) },
6603
+ options
6604
+ );
6605
+ expectedProductCount += new Set(chunk.map(identity)).size;
6606
+ chunkIndex += 1;
6607
+ chunk = [];
6608
+ chunkSize = 0;
6609
+ };
6610
+ for await (const item of source) {
6611
+ const bytes = encoder2.encode(JSON.stringify(item)).byteLength + 1;
6612
+ if (bytes > CHUNK_BYTES)
6613
+ throw new Error("A catalog target exceeds the request size limit.");
6614
+ if (chunk.length && (chunk.length === CHUNK_SIZE || chunkSize + bytes > CHUNK_BYTES))
6615
+ await append();
6616
+ chunk.push(item);
6617
+ chunkSize += bytes;
6618
+ if (chunk.length === CHUNK_SIZE) await append();
6619
+ }
6620
+ if (chunk.length) await append();
6621
+ if (!expectedProductCount)
6622
+ throw new Error("Provide at least one catalog target.");
6623
+ return client.bulk.submit(
6624
+ { organizationId, operationId, expectedProductCount },
6625
+ options
6626
+ );
6627
+ }
6628
+ function submitCatalogPricing(client, request, updates, options) {
6629
+ return submitCatalogTargets(
6630
+ client,
6631
+ request,
6632
+ updates,
6633
+ (rows) => ({ updates: rows }),
6634
+ ({ productId }) => productId.trim().toLowerCase(),
6635
+ options
6636
+ );
6637
+ }
6638
+ function submitCatalogRecords(client, request, products, options) {
6639
+ return submitCatalogTargets(
6640
+ client,
6641
+ { ...request, importRecords: request.importRecords ?? {} },
6642
+ products,
6643
+ (rows) => ({ products: rows }),
6644
+ ({ sku }) => sku.trim(),
6645
+ options
6646
+ );
6647
+ }
6648
+ function submitCatalogEnrichment(client, request, productIds, options) {
6649
+ return submitCatalogTargets(
6650
+ client,
6651
+ request,
6652
+ productIds,
6653
+ (rows) => ({ productIds: rows }),
6654
+ (id) => id.trim().toLowerCase(),
6655
+ options
6656
+ );
6657
+ }
6658
+
5964
6659
  // src/webhooks.ts
5965
6660
  var encoder = new TextEncoder();
5966
6661
  var WEBHOOK_SIGNATURE_HEADER = "x-omni-signature";
@@ -6060,6 +6755,6 @@ __export(api_exports, {
6060
6755
  OmniGeneratedClient: () => OmniGeneratedClient
6061
6756
  });
6062
6757
 
6063
- export { BadGatewayError, BadRequestError, ForbiddenError, HttpResponsePromise, InternalServerError, JobFailedError, NotFoundError, api_exports as Omni, OmniClient, OmniEnvironment, OmniError, OmniTimeoutError, ProductScanError, SDK_VERSION, ServiceUnavailableError, TooManyRequestsError, UnauthorizedError, UnprocessableEntityError, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_EVENT_TYPE_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TIMESTAMP_HEADER, constructEvent, signWebhookPayload, verifyWebhookSignature };
6758
+ export { BadGatewayError, BadRequestError, ForbiddenError, HttpResponsePromise, InternalServerError, JobFailedError, NotFoundError, api_exports as Omni, OmniClient, OmniEnvironment, OmniError, OmniTimeoutError, ProductScanError, SDK_VERSION, ServiceUnavailableError, TooManyRequestsError, UnauthorizedError, UnprocessableEntityError, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_EVENT_TYPE_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TIMESTAMP_HEADER, constructEvent, readCatalogFileFailures, signWebhookPayload, submitCatalogEnrichment, submitCatalogFile, submitCatalogPricing, submitCatalogRecords, verifyWebhookSignature };
6064
6759
  //# sourceMappingURL=index.js.map
6065
6760
  //# sourceMappingURL=index.js.map