@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/README.md +4 -0
- package/dist/index.cjs +703 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4710 -459
- package/dist/index.d.ts +4710 -459
- package/dist/index.js +699 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -35,7 +35,7 @@ function normalizeClientOptions(options = {}) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
// src/version.ts
|
|
38
|
-
var SDK_VERSION = "0.
|
|
38
|
+
var SDK_VERSION = "0.33.0";
|
|
39
39
|
var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
|
|
40
40
|
|
|
41
41
|
// src/environments.ts
|
|
@@ -714,6 +714,235 @@ async function waitForJob(http, request, options) {
|
|
|
714
714
|
}
|
|
715
715
|
|
|
716
716
|
// src/generated/resources.ts
|
|
717
|
+
var AdsClient = class {
|
|
718
|
+
constructor(_http) {
|
|
719
|
+
__publicField(this, "_http", _http);
|
|
720
|
+
}
|
|
721
|
+
/**
|
|
722
|
+
* List Ads accounts and capabilities
|
|
723
|
+
*
|
|
724
|
+
* 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.
|
|
725
|
+
*
|
|
726
|
+
* `GET /api/v1/ads/accounts`
|
|
727
|
+
*/
|
|
728
|
+
listAccounts(request = {}, requestOptions) {
|
|
729
|
+
const { marketplaces, organizationId } = request ?? {};
|
|
730
|
+
return this._http.request({
|
|
731
|
+
method: "GET",
|
|
732
|
+
path: "/api/v1/ads/accounts",
|
|
733
|
+
query: { marketplaces, organizationId },
|
|
734
|
+
body: void 0,
|
|
735
|
+
...mergeRequestOptions(requestOptions)
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* List saved and synced ads
|
|
740
|
+
*
|
|
741
|
+
* 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.
|
|
742
|
+
*
|
|
743
|
+
* `GET /api/v1/ads/campaigns`
|
|
744
|
+
*/
|
|
745
|
+
listCampaigns(request = {}, requestOptions) {
|
|
746
|
+
const { status, q, marketplace, store, offset, organizationId } = request ?? {};
|
|
747
|
+
return this._http.request({
|
|
748
|
+
method: "GET",
|
|
749
|
+
path: "/api/v1/ads/campaigns",
|
|
750
|
+
query: { status, q, marketplace, store, offset, organizationId },
|
|
751
|
+
body: void 0,
|
|
752
|
+
...mergeRequestOptions(requestOptions)
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
/**
|
|
756
|
+
* Draft a multi-store Ads campaign
|
|
757
|
+
*
|
|
758
|
+
* 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.
|
|
759
|
+
*
|
|
760
|
+
* `POST /api/v1/ads/campaigns`
|
|
761
|
+
*/
|
|
762
|
+
createCampaign(request, requestOptions) {
|
|
763
|
+
const { ...body } = request ?? {};
|
|
764
|
+
return this._http.request({
|
|
765
|
+
method: "POST",
|
|
766
|
+
path: "/api/v1/ads/campaigns",
|
|
767
|
+
query: void 0,
|
|
768
|
+
body,
|
|
769
|
+
...mergeRequestOptions(requestOptions)
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
/**
|
|
773
|
+
* Approve, stop or retry Ads campaign groups
|
|
774
|
+
*
|
|
775
|
+
* 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.
|
|
776
|
+
*
|
|
777
|
+
* `POST /api/v1/ads/campaigns/actions`
|
|
778
|
+
*/
|
|
779
|
+
actOnCampaigns(request, requestOptions) {
|
|
780
|
+
const { ...body } = request ?? {};
|
|
781
|
+
return this._http.request({
|
|
782
|
+
method: "POST",
|
|
783
|
+
path: "/api/v1/ads/campaigns/actions",
|
|
784
|
+
query: void 0,
|
|
785
|
+
body,
|
|
786
|
+
...mergeRequestOptions(requestOptions)
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* Read live marketplace campaigns
|
|
791
|
+
*
|
|
792
|
+
* 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.
|
|
793
|
+
*
|
|
794
|
+
* `POST /api/v1/ads/campaigns/live`
|
|
795
|
+
*/
|
|
796
|
+
getLiveCampaigns(request, requestOptions) {
|
|
797
|
+
const { ...body } = request ?? {};
|
|
798
|
+
return this._http.request({
|
|
799
|
+
method: "POST",
|
|
800
|
+
path: "/api/v1/ads/campaigns/live",
|
|
801
|
+
query: void 0,
|
|
802
|
+
body,
|
|
803
|
+
...mergeRequestOptions(requestOptions)
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* Read saved Ads campaign groups
|
|
808
|
+
*
|
|
809
|
+
* 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.
|
|
810
|
+
*
|
|
811
|
+
* `POST /api/v1/ads/campaigns/read`
|
|
812
|
+
*/
|
|
813
|
+
getCampaigns(request, requestOptions) {
|
|
814
|
+
const { ...body } = request ?? {};
|
|
815
|
+
return this._http.request({
|
|
816
|
+
method: "POST",
|
|
817
|
+
path: "/api/v1/ads/campaigns/read",
|
|
818
|
+
query: void 0,
|
|
819
|
+
body,
|
|
820
|
+
...mergeRequestOptions(requestOptions)
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* Read live Ads performance
|
|
825
|
+
*
|
|
826
|
+
* 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.
|
|
827
|
+
*
|
|
828
|
+
* `POST /api/v1/ads/performance`
|
|
829
|
+
*/
|
|
830
|
+
getPerformance(request, requestOptions) {
|
|
831
|
+
const { ...body } = request ?? {};
|
|
832
|
+
return this._http.request({
|
|
833
|
+
method: "POST",
|
|
834
|
+
path: "/api/v1/ads/performance",
|
|
835
|
+
query: void 0,
|
|
836
|
+
body,
|
|
837
|
+
...mergeRequestOptions(requestOptions)
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* Approve, stop or retry legacy Ads plans
|
|
842
|
+
*
|
|
843
|
+
* 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.
|
|
844
|
+
*
|
|
845
|
+
* `POST /api/v1/ads/plans/actions`
|
|
846
|
+
*/
|
|
847
|
+
actOnPlans(request, requestOptions) {
|
|
848
|
+
const { ...body } = request ?? {};
|
|
849
|
+
return this._http.request({
|
|
850
|
+
method: "POST",
|
|
851
|
+
path: "/api/v1/ads/plans/actions",
|
|
852
|
+
query: void 0,
|
|
853
|
+
body,
|
|
854
|
+
...mergeRequestOptions(requestOptions)
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Read delivery and verification evidence
|
|
859
|
+
*
|
|
860
|
+
* 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.
|
|
861
|
+
*
|
|
862
|
+
* `POST /api/v1/ads/plans/status`
|
|
863
|
+
*/
|
|
864
|
+
getPlans(request, requestOptions) {
|
|
865
|
+
const { ...body } = request ?? {};
|
|
866
|
+
return this._http.request({
|
|
867
|
+
method: "POST",
|
|
868
|
+
path: "/api/v1/ads/plans/status",
|
|
869
|
+
query: void 0,
|
|
870
|
+
body,
|
|
871
|
+
...mergeRequestOptions(requestOptions)
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
/**
|
|
875
|
+
* Read persisted campaign reports
|
|
876
|
+
*
|
|
877
|
+
* 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.
|
|
878
|
+
*
|
|
879
|
+
* `GET /api/v1/ads/reports`
|
|
880
|
+
*/
|
|
881
|
+
getReports(request, requestOptions) {
|
|
882
|
+
const {
|
|
883
|
+
from,
|
|
884
|
+
to,
|
|
885
|
+
marketplace,
|
|
886
|
+
country,
|
|
887
|
+
store,
|
|
888
|
+
currency,
|
|
889
|
+
campaign,
|
|
890
|
+
offset,
|
|
891
|
+
organizationId
|
|
892
|
+
} = request ?? {};
|
|
893
|
+
return this._http.request({
|
|
894
|
+
method: "GET",
|
|
895
|
+
path: "/api/v1/ads/reports",
|
|
896
|
+
query: {
|
|
897
|
+
from,
|
|
898
|
+
to,
|
|
899
|
+
marketplace,
|
|
900
|
+
country,
|
|
901
|
+
store,
|
|
902
|
+
currency,
|
|
903
|
+
campaign,
|
|
904
|
+
offset,
|
|
905
|
+
organizationId
|
|
906
|
+
},
|
|
907
|
+
body: void 0,
|
|
908
|
+
...mergeRequestOptions(requestOptions)
|
|
909
|
+
});
|
|
910
|
+
}
|
|
911
|
+
/**
|
|
912
|
+
* Queue Ads report imports
|
|
913
|
+
*
|
|
914
|
+
* 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.
|
|
915
|
+
*
|
|
916
|
+
* `POST /api/v1/ads/sync`
|
|
917
|
+
*/
|
|
918
|
+
syncReports(request, requestOptions) {
|
|
919
|
+
const { ...body } = request ?? {};
|
|
920
|
+
return this._http.request({
|
|
921
|
+
method: "POST",
|
|
922
|
+
path: "/api/v1/ads/sync",
|
|
923
|
+
query: void 0,
|
|
924
|
+
body,
|
|
925
|
+
...mergeRequestOptions(requestOptions)
|
|
926
|
+
});
|
|
927
|
+
}
|
|
928
|
+
/**
|
|
929
|
+
* Read Ads import job status
|
|
930
|
+
*
|
|
931
|
+
* 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.
|
|
932
|
+
*
|
|
933
|
+
* `POST /api/v1/ads/sync/status`
|
|
934
|
+
*/
|
|
935
|
+
getSyncStatus(request, requestOptions) {
|
|
936
|
+
const { ...body } = request ?? {};
|
|
937
|
+
return this._http.request({
|
|
938
|
+
method: "POST",
|
|
939
|
+
path: "/api/v1/ads/sync/status",
|
|
940
|
+
query: void 0,
|
|
941
|
+
body,
|
|
942
|
+
...mergeRequestOptions(requestOptions)
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
};
|
|
717
946
|
var AgentsGeneralClient = class {
|
|
718
947
|
constructor(_http) {
|
|
719
948
|
__publicField(this, "_http", _http);
|
|
@@ -1448,6 +1677,136 @@ var ApiClient = class {
|
|
|
1448
1677
|
});
|
|
1449
1678
|
}
|
|
1450
1679
|
};
|
|
1680
|
+
var BotsClient = class {
|
|
1681
|
+
constructor(_http) {
|
|
1682
|
+
__publicField(this, "_http", _http);
|
|
1683
|
+
}
|
|
1684
|
+
/**
|
|
1685
|
+
* List personal Bots
|
|
1686
|
+
*
|
|
1687
|
+
* 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.
|
|
1688
|
+
*
|
|
1689
|
+
* `GET /api/v1/bots`
|
|
1690
|
+
*/
|
|
1691
|
+
list(request = {}, requestOptions) {
|
|
1692
|
+
const { organizationId, q, page, status } = request ?? {};
|
|
1693
|
+
return this._http.request({
|
|
1694
|
+
method: "GET",
|
|
1695
|
+
path: "/api/v1/bots",
|
|
1696
|
+
query: { organizationId, q, page, status },
|
|
1697
|
+
body: void 0,
|
|
1698
|
+
...mergeRequestOptions(requestOptions)
|
|
1699
|
+
});
|
|
1700
|
+
}
|
|
1701
|
+
/**
|
|
1702
|
+
* Create a personal Bot
|
|
1703
|
+
*
|
|
1704
|
+
* 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.
|
|
1705
|
+
*
|
|
1706
|
+
* `POST /api/v1/bots`
|
|
1707
|
+
*/
|
|
1708
|
+
create(request, requestOptions) {
|
|
1709
|
+
const { organizationId, ...body } = request ?? {};
|
|
1710
|
+
return this._http.request({
|
|
1711
|
+
method: "POST",
|
|
1712
|
+
path: "/api/v1/bots",
|
|
1713
|
+
query: { organizationId },
|
|
1714
|
+
body,
|
|
1715
|
+
...mergeRequestOptions(requestOptions)
|
|
1716
|
+
});
|
|
1717
|
+
}
|
|
1718
|
+
/**
|
|
1719
|
+
* List a Bot's routines
|
|
1720
|
+
*
|
|
1721
|
+
* 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.
|
|
1722
|
+
*
|
|
1723
|
+
* `GET /api/v1/bots/{botId}/routines`
|
|
1724
|
+
*/
|
|
1725
|
+
listRoutines(request, requestOptions) {
|
|
1726
|
+
const { botId, organizationId } = request ?? {};
|
|
1727
|
+
return this._http.request({
|
|
1728
|
+
method: "GET",
|
|
1729
|
+
path: `/api/v1/bots/${encodePathParam("botId", botId)}/routines`,
|
|
1730
|
+
query: { organizationId },
|
|
1731
|
+
body: void 0,
|
|
1732
|
+
...mergeRequestOptions(requestOptions)
|
|
1733
|
+
});
|
|
1734
|
+
}
|
|
1735
|
+
/**
|
|
1736
|
+
* Manage a Bot's routines
|
|
1737
|
+
*
|
|
1738
|
+
* 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.
|
|
1739
|
+
|
|
1740
|
+
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.
|
|
1741
|
+
*
|
|
1742
|
+
* `POST /api/v1/bots/{botId}/routines`
|
|
1743
|
+
*/
|
|
1744
|
+
mutateRoutines(request, requestOptions) {
|
|
1745
|
+
const { botId, organizationId, ...body } = request ?? {};
|
|
1746
|
+
return this._http.request({
|
|
1747
|
+
method: "POST",
|
|
1748
|
+
path: `/api/v1/bots/${encodePathParam("botId", botId)}/routines`,
|
|
1749
|
+
query: { organizationId },
|
|
1750
|
+
body,
|
|
1751
|
+
...mergeRequestOptions(requestOptions)
|
|
1752
|
+
});
|
|
1753
|
+
}
|
|
1754
|
+
/**
|
|
1755
|
+
* List a Bot's message runs
|
|
1756
|
+
*
|
|
1757
|
+
* 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.
|
|
1758
|
+
*
|
|
1759
|
+
* `GET /api/v1/bots/{botId}/runs`
|
|
1760
|
+
*/
|
|
1761
|
+
listRuns(request, requestOptions) {
|
|
1762
|
+
const { botId, organizationId } = request ?? {};
|
|
1763
|
+
return this._http.request({
|
|
1764
|
+
method: "GET",
|
|
1765
|
+
path: `/api/v1/bots/${encodePathParam("botId", botId)}/runs`,
|
|
1766
|
+
query: { organizationId },
|
|
1767
|
+
body: void 0,
|
|
1768
|
+
...mergeRequestOptions(requestOptions)
|
|
1769
|
+
});
|
|
1770
|
+
}
|
|
1771
|
+
/**
|
|
1772
|
+
* Send a message to a Bot
|
|
1773
|
+
*
|
|
1774
|
+
* 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.
|
|
1775
|
+
|
|
1776
|
+
Reuse the same requestId when retrying a submission. The response Location points to the run status.
|
|
1777
|
+
*
|
|
1778
|
+
* `POST /api/v1/bots/{botId}/runs`
|
|
1779
|
+
*/
|
|
1780
|
+
sendMessage(request, requestOptions) {
|
|
1781
|
+
const { botId, organizationId, ...body } = request ?? {};
|
|
1782
|
+
return this._http.request({
|
|
1783
|
+
method: "POST",
|
|
1784
|
+
path: `/api/v1/bots/${encodePathParam("botId", botId)}/runs`,
|
|
1785
|
+
query: { organizationId },
|
|
1786
|
+
body,
|
|
1787
|
+
...mergeRequestOptions(requestOptions)
|
|
1788
|
+
});
|
|
1789
|
+
}
|
|
1790
|
+
/**
|
|
1791
|
+
* Read a Bot message run
|
|
1792
|
+
*
|
|
1793
|
+
* 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.
|
|
1794
|
+
|
|
1795
|
+
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.
|
|
1796
|
+
*
|
|
1797
|
+
* `GET /api/v1/bots/{botId}/runs/{runId}`
|
|
1798
|
+
*/
|
|
1799
|
+
getRun(request, requestOptions) {
|
|
1800
|
+
const { botId, runId, organizationId } = request ?? {};
|
|
1801
|
+
return this._http.request({
|
|
1802
|
+
method: "GET",
|
|
1803
|
+
path: `/api/v1/bots/${encodePathParam("botId", botId)}/runs/${encodePathParam("runId", runId)}`,
|
|
1804
|
+
query: { organizationId },
|
|
1805
|
+
body: void 0,
|
|
1806
|
+
...mergeRequestOptions(requestOptions)
|
|
1807
|
+
});
|
|
1808
|
+
}
|
|
1809
|
+
};
|
|
1451
1810
|
var BrandKitsClient = class {
|
|
1452
1811
|
constructor(_http) {
|
|
1453
1812
|
__publicField(this, "_http", _http);
|
|
@@ -1614,10 +1973,95 @@ var BulkClient = class {
|
|
|
1614
1973
|
...mergeRequestOptions(requestOptions)
|
|
1615
1974
|
});
|
|
1616
1975
|
}
|
|
1976
|
+
/**
|
|
1977
|
+
* Create Catalog Operation Plan
|
|
1978
|
+
*
|
|
1979
|
+
* 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
|
|
1980
|
+
*
|
|
1981
|
+
* `POST /api/v1/catalog/operations/plan`
|
|
1982
|
+
*/
|
|
1983
|
+
plan(request, requestOptions) {
|
|
1984
|
+
const { organizationId, ...body } = request ?? {};
|
|
1985
|
+
return this._http.request({
|
|
1986
|
+
method: "POST",
|
|
1987
|
+
path: "/api/v1/catalog/operations/plan",
|
|
1988
|
+
query: { organizationId },
|
|
1989
|
+
body,
|
|
1990
|
+
...mergeRequestOptions(requestOptions)
|
|
1991
|
+
});
|
|
1992
|
+
}
|
|
1993
|
+
/**
|
|
1994
|
+
* Append Catalog Operation Chunk
|
|
1995
|
+
*
|
|
1996
|
+
* 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.
|
|
1997
|
+
*
|
|
1998
|
+
* `POST /api/v1/catalog/operations/plan/append`
|
|
1999
|
+
*/
|
|
2000
|
+
append(request, requestOptions) {
|
|
2001
|
+
const { organizationId, ...body } = request ?? {};
|
|
2002
|
+
return this._http.request({
|
|
2003
|
+
method: "POST",
|
|
2004
|
+
path: "/api/v1/catalog/operations/plan/append",
|
|
2005
|
+
query: { organizationId },
|
|
2006
|
+
body,
|
|
2007
|
+
...mergeRequestOptions(requestOptions)
|
|
2008
|
+
});
|
|
2009
|
+
}
|
|
2010
|
+
/**
|
|
2011
|
+
* Complete Catalog File
|
|
2012
|
+
*
|
|
2013
|
+
* 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.
|
|
2014
|
+
*
|
|
2015
|
+
* `POST /api/v1/catalog/operations/plan/file-complete`
|
|
2016
|
+
*/
|
|
2017
|
+
completeFile(request, requestOptions) {
|
|
2018
|
+
const { organizationId, ...body } = request ?? {};
|
|
2019
|
+
return this._http.request({
|
|
2020
|
+
method: "POST",
|
|
2021
|
+
path: "/api/v1/catalog/operations/plan/file-complete",
|
|
2022
|
+
query: { organizationId },
|
|
2023
|
+
body,
|
|
2024
|
+
...mergeRequestOptions(requestOptions)
|
|
2025
|
+
});
|
|
2026
|
+
}
|
|
2027
|
+
/**
|
|
2028
|
+
* Prepare Catalog File Parts
|
|
2029
|
+
*
|
|
2030
|
+
* 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.
|
|
2031
|
+
*
|
|
2032
|
+
* `POST /api/v1/catalog/operations/plan/file-parts`
|
|
2033
|
+
*/
|
|
2034
|
+
fileParts(request, requestOptions) {
|
|
2035
|
+
const { organizationId, ...body } = request ?? {};
|
|
2036
|
+
return this._http.request({
|
|
2037
|
+
method: "POST",
|
|
2038
|
+
path: "/api/v1/catalog/operations/plan/file-parts",
|
|
2039
|
+
query: { organizationId },
|
|
2040
|
+
body,
|
|
2041
|
+
...mergeRequestOptions(requestOptions)
|
|
2042
|
+
});
|
|
2043
|
+
}
|
|
2044
|
+
/**
|
|
2045
|
+
* Submit Catalog Operation Plan
|
|
2046
|
+
*
|
|
2047
|
+
* 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.
|
|
2048
|
+
*
|
|
2049
|
+
* `POST /api/v1/catalog/operations/plan/submit`
|
|
2050
|
+
*/
|
|
2051
|
+
submit(request, requestOptions) {
|
|
2052
|
+
const { organizationId, ...body } = request ?? {};
|
|
2053
|
+
return this._http.request({
|
|
2054
|
+
method: "POST",
|
|
2055
|
+
path: "/api/v1/catalog/operations/plan/submit",
|
|
2056
|
+
query: { organizationId },
|
|
2057
|
+
body,
|
|
2058
|
+
...mergeRequestOptions(requestOptions)
|
|
2059
|
+
});
|
|
2060
|
+
}
|
|
1617
2061
|
/**
|
|
1618
2062
|
* Get Catalog Operation Results
|
|
1619
2063
|
*
|
|
1620
|
-
* Read ordered per-product receipts and verification evidence for up to 50 operationIds. Filter status=failed to inspect failures directly.
|
|
2064
|
+
* 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.
|
|
1621
2065
|
*
|
|
1622
2066
|
* `POST /api/v1/catalog/operations/results`
|
|
1623
2067
|
*/
|
|
@@ -1634,7 +2078,7 @@ var BulkClient = class {
|
|
|
1634
2078
|
/**
|
|
1635
2079
|
* Get Catalog Operation Status
|
|
1636
2080
|
*
|
|
1637
|
-
* 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
|
|
2081
|
+
* 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.
|
|
1638
2082
|
*
|
|
1639
2083
|
* `POST /api/v1/catalog/operations/status`
|
|
1640
2084
|
*/
|
|
@@ -2393,6 +2837,27 @@ var EmailClient = class {
|
|
|
2393
2837
|
...mergeRequestOptions(requestOptions)
|
|
2394
2838
|
});
|
|
2395
2839
|
}
|
|
2840
|
+
/**
|
|
2841
|
+
* Get Email Drafts
|
|
2842
|
+
*
|
|
2843
|
+
* 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.
|
|
2844
|
+
|
|
2845
|
+
### Authorization
|
|
2846
|
+
|
|
2847
|
+
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.
|
|
2848
|
+
*
|
|
2849
|
+
* `POST /api/v1/email/drafts/query`
|
|
2850
|
+
*/
|
|
2851
|
+
getDrafts(request, requestOptions) {
|
|
2852
|
+
const { ...body } = request ?? {};
|
|
2853
|
+
return this._http.request({
|
|
2854
|
+
method: "POST",
|
|
2855
|
+
path: "/api/v1/email/drafts/query",
|
|
2856
|
+
query: void 0,
|
|
2857
|
+
body,
|
|
2858
|
+
...mergeRequestOptions(requestOptions)
|
|
2859
|
+
});
|
|
2860
|
+
}
|
|
2396
2861
|
/**
|
|
2397
2862
|
* Get Email Message
|
|
2398
2863
|
*
|
|
@@ -2451,6 +2916,27 @@ var EmailClient = class {
|
|
|
2451
2916
|
...mergeRequestOptions(requestOptions)
|
|
2452
2917
|
});
|
|
2453
2918
|
}
|
|
2919
|
+
/**
|
|
2920
|
+
* Get Email Thread
|
|
2921
|
+
*
|
|
2922
|
+
* 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.
|
|
2923
|
+
|
|
2924
|
+
### Authorization
|
|
2925
|
+
|
|
2926
|
+
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.
|
|
2927
|
+
*
|
|
2928
|
+
* `GET /api/v1/email/threads/{threadId}`
|
|
2929
|
+
*/
|
|
2930
|
+
getThread(request, requestOptions) {
|
|
2931
|
+
const { threadId, connectionId, organizationId } = request ?? {};
|
|
2932
|
+
return this._http.request({
|
|
2933
|
+
method: "GET",
|
|
2934
|
+
path: `/api/v1/email/threads/${encodePathParam("threadId", threadId)}`,
|
|
2935
|
+
query: { connectionId, organizationId },
|
|
2936
|
+
body: void 0,
|
|
2937
|
+
...mergeRequestOptions(requestOptions)
|
|
2938
|
+
});
|
|
2939
|
+
}
|
|
2454
2940
|
};
|
|
2455
2941
|
var EvaluateClient = class {
|
|
2456
2942
|
constructor(_http) {
|
|
@@ -5860,10 +6346,12 @@ var ZaloraClient = class {
|
|
|
5860
6346
|
var OmniGeneratedClient = class {
|
|
5861
6347
|
constructor(_http) {
|
|
5862
6348
|
__publicField(this, "_http", _http);
|
|
6349
|
+
__publicField(this, "ads");
|
|
5863
6350
|
__publicField(this, "agents");
|
|
5864
6351
|
__publicField(this, "analytics");
|
|
5865
6352
|
__publicField(this, "aop");
|
|
5866
6353
|
__publicField(this, "api");
|
|
6354
|
+
__publicField(this, "bots");
|
|
5867
6355
|
__publicField(this, "brandKits");
|
|
5868
6356
|
__publicField(this, "brandsgateway");
|
|
5869
6357
|
__publicField(this, "bulk");
|
|
@@ -5905,10 +6393,12 @@ var OmniGeneratedClient = class {
|
|
|
5905
6393
|
__publicField(this, "webhooks");
|
|
5906
6394
|
__publicField(this, "wiki");
|
|
5907
6395
|
__publicField(this, "zalora");
|
|
6396
|
+
this.ads = new AdsClient(this._http);
|
|
5908
6397
|
this.agents = new AgentsClient(this._http);
|
|
5909
6398
|
this.analytics = new AnalyticsClient(this._http);
|
|
5910
6399
|
this.aop = new AopClient(this._http);
|
|
5911
6400
|
this.api = new ApiClient(this._http);
|
|
6401
|
+
this.bots = new BotsClient(this._http);
|
|
5912
6402
|
this.brandKits = new BrandKitsClient(this._http);
|
|
5913
6403
|
this.brandsgateway = new BrandsgatewayClient(this._http);
|
|
5914
6404
|
this.bulk = new BulkClient(this._http);
|
|
@@ -5963,6 +6453,211 @@ var OmniClient = class extends OmniGeneratedClient {
|
|
|
5963
6453
|
}
|
|
5964
6454
|
};
|
|
5965
6455
|
|
|
6456
|
+
// src/catalog-file.ts
|
|
6457
|
+
var partSize = 8 * 1024 * 1024;
|
|
6458
|
+
var maxFileSize = 512 * 1024 * 1024;
|
|
6459
|
+
var parallelParts = 4;
|
|
6460
|
+
async function submitCatalogFile(client, request, file, options) {
|
|
6461
|
+
if (!file.size || file.size > maxFileSize)
|
|
6462
|
+
throw new Error("Provide a catalog file between 1 byte and 512 MiB.");
|
|
6463
|
+
if (!options?.digest && !globalThis.crypto?.subtle)
|
|
6464
|
+
throw new Error(
|
|
6465
|
+
"Catalog file uploads require Web Crypto or a SHA-256 digest implementation."
|
|
6466
|
+
);
|
|
6467
|
+
const chunk = (index) => file.slice(index * partSize, (index + 1) * partSize);
|
|
6468
|
+
const hashes = [];
|
|
6469
|
+
const digest = options?.digest ?? ((bytes) => globalThis.crypto.subtle.digest("SHA-256", bytes));
|
|
6470
|
+
const api = options?.signal ? { ...options.api, abortSignal: options.signal } : options?.api;
|
|
6471
|
+
const base64 = (bytes) => btoa(String.fromCharCode(...bytes));
|
|
6472
|
+
const count = Math.ceil(file.size / partSize);
|
|
6473
|
+
const combined = new Uint8Array(count * 32);
|
|
6474
|
+
for (let index = 0; index < count; index++) {
|
|
6475
|
+
options?.signal?.throwIfAborted();
|
|
6476
|
+
const hash = new Uint8Array(
|
|
6477
|
+
await digest(await (await chunk(index)).arrayBuffer())
|
|
6478
|
+
);
|
|
6479
|
+
hashes.push(hash);
|
|
6480
|
+
combined.set(hash, index * 32);
|
|
6481
|
+
}
|
|
6482
|
+
const {
|
|
6483
|
+
organizationId,
|
|
6484
|
+
idempotencyKey,
|
|
6485
|
+
format,
|
|
6486
|
+
title,
|
|
6487
|
+
sessionId,
|
|
6488
|
+
columnMapping,
|
|
6489
|
+
update,
|
|
6490
|
+
syncToMarketplaces
|
|
6491
|
+
} = request;
|
|
6492
|
+
const { data: plan } = await client.bulk.plan(
|
|
6493
|
+
{
|
|
6494
|
+
organizationId,
|
|
6495
|
+
idempotencyKey,
|
|
6496
|
+
sessionId,
|
|
6497
|
+
syncToMarketplaces,
|
|
6498
|
+
importRecords: {
|
|
6499
|
+
title,
|
|
6500
|
+
update,
|
|
6501
|
+
file: {
|
|
6502
|
+
sizeBytes: file.size,
|
|
6503
|
+
format,
|
|
6504
|
+
columnMapping,
|
|
6505
|
+
sha256: base64(new Uint8Array(await digest(combined)))
|
|
6506
|
+
}
|
|
6507
|
+
}
|
|
6508
|
+
},
|
|
6509
|
+
api
|
|
6510
|
+
);
|
|
6511
|
+
if (!plan?.operationId)
|
|
6512
|
+
throw new Error("The server did not return a catalog operation ID.");
|
|
6513
|
+
const target = { organizationId, operationId: plan.operationId };
|
|
6514
|
+
for (let start = 0; start < count; start += parallelParts) {
|
|
6515
|
+
options?.signal?.throwIfAborted();
|
|
6516
|
+
const parts = hashes.slice(start, start + parallelParts).map((hash, index) => ({
|
|
6517
|
+
partNumber: start + index + 1,
|
|
6518
|
+
sha256: base64(hash)
|
|
6519
|
+
}));
|
|
6520
|
+
const { data } = await client.bulk.fileParts({ ...target, parts }, api);
|
|
6521
|
+
if (!data || data.partSizeBytes !== partSize)
|
|
6522
|
+
throw new Error("Invalid catalog upload response.");
|
|
6523
|
+
if (data.accepted) break;
|
|
6524
|
+
if (data.parts.length !== parts.length)
|
|
6525
|
+
throw new Error("The upload response omitted file parts.");
|
|
6526
|
+
const results = await Promise.allSettled(
|
|
6527
|
+
data.parts.map(async (part, index) => {
|
|
6528
|
+
const expected = parts[index];
|
|
6529
|
+
const size = Math.min(
|
|
6530
|
+
partSize,
|
|
6531
|
+
file.size - (expected.partNumber - 1) * partSize
|
|
6532
|
+
);
|
|
6533
|
+
if (part.partNumber !== expected.partNumber || part.sizeBytes !== size)
|
|
6534
|
+
throw new Error("The upload response changed a file part.");
|
|
6535
|
+
if (part.uploaded) return;
|
|
6536
|
+
if (!part.uploadUrl || new URL(part.uploadUrl).protocol !== "https:")
|
|
6537
|
+
throw new Error("The server did not return a secure upload URL.");
|
|
6538
|
+
const body = await chunk(expected.partNumber - 1);
|
|
6539
|
+
if (body.size !== size)
|
|
6540
|
+
throw new Error("The catalog file changed during upload.");
|
|
6541
|
+
const response = await (options?.fetch ?? fetch)(part.uploadUrl, {
|
|
6542
|
+
method: "PUT",
|
|
6543
|
+
body,
|
|
6544
|
+
headers: { "x-amz-checksum-sha256": expected.sha256 },
|
|
6545
|
+
credentials: "omit",
|
|
6546
|
+
redirect: "error",
|
|
6547
|
+
signal: options?.signal
|
|
6548
|
+
});
|
|
6549
|
+
if (!response.ok)
|
|
6550
|
+
throw new Error(
|
|
6551
|
+
`Upload part ${expected.partNumber} returned HTTP ${response.status}. Reuse the same file and key to resume.`
|
|
6552
|
+
);
|
|
6553
|
+
})
|
|
6554
|
+
);
|
|
6555
|
+
for (const result of results)
|
|
6556
|
+
if (result.status === "rejected") throw result.reason;
|
|
6557
|
+
}
|
|
6558
|
+
return client.bulk.completeFile(target, api);
|
|
6559
|
+
}
|
|
6560
|
+
async function* readCatalogFileFailures(client, request, options) {
|
|
6561
|
+
const { organizationId } = request;
|
|
6562
|
+
const operationId = request.operationId.trim().toLowerCase();
|
|
6563
|
+
let after;
|
|
6564
|
+
for (; ; ) {
|
|
6565
|
+
const { data } = await client.bulk.results(
|
|
6566
|
+
{
|
|
6567
|
+
operationIds: [operationId],
|
|
6568
|
+
organizationId,
|
|
6569
|
+
after,
|
|
6570
|
+
status: "failed",
|
|
6571
|
+
limit: 100,
|
|
6572
|
+
includeRequest: false
|
|
6573
|
+
},
|
|
6574
|
+
options
|
|
6575
|
+
);
|
|
6576
|
+
if (!data)
|
|
6577
|
+
throw new Error("The server did not return catalog file results.");
|
|
6578
|
+
yield* data.results;
|
|
6579
|
+
if (!data.hasMore) return;
|
|
6580
|
+
if (!data.nextPageKey || data.nextPageKey.operationId !== operationId || after && data.nextPageKey.ordinal <= after.ordinal)
|
|
6581
|
+
throw new Error(
|
|
6582
|
+
"The server did not advance the catalog file results cursor."
|
|
6583
|
+
);
|
|
6584
|
+
after = data.nextPageKey;
|
|
6585
|
+
}
|
|
6586
|
+
}
|
|
6587
|
+
|
|
6588
|
+
// src/catalog-pricing.ts
|
|
6589
|
+
var CHUNK_SIZE = 500;
|
|
6590
|
+
var CHUNK_BYTES = 7 * 1024 * 1024;
|
|
6591
|
+
async function submitCatalogTargets(client, request, source, appendBody, identity, options) {
|
|
6592
|
+
const { organizationId } = request;
|
|
6593
|
+
const { data: plan } = await client.bulk.plan(request, options);
|
|
6594
|
+
if (!plan?.operationId)
|
|
6595
|
+
throw new Error("The server did not return a catalog plan ID.");
|
|
6596
|
+
const { operationId } = plan;
|
|
6597
|
+
const encoder2 = new TextEncoder();
|
|
6598
|
+
let chunk = [];
|
|
6599
|
+
let chunkSize = 0;
|
|
6600
|
+
let chunkIndex = 0;
|
|
6601
|
+
let expectedProductCount = 0;
|
|
6602
|
+
const append = async () => {
|
|
6603
|
+
await client.bulk.append(
|
|
6604
|
+
{ organizationId, operationId, chunkIndex, ...appendBody(chunk) },
|
|
6605
|
+
options
|
|
6606
|
+
);
|
|
6607
|
+
expectedProductCount += new Set(chunk.map(identity)).size;
|
|
6608
|
+
chunkIndex += 1;
|
|
6609
|
+
chunk = [];
|
|
6610
|
+
chunkSize = 0;
|
|
6611
|
+
};
|
|
6612
|
+
for await (const item of source) {
|
|
6613
|
+
const bytes = encoder2.encode(JSON.stringify(item)).byteLength + 1;
|
|
6614
|
+
if (bytes > CHUNK_BYTES)
|
|
6615
|
+
throw new Error("A catalog target exceeds the request size limit.");
|
|
6616
|
+
if (chunk.length && (chunk.length === CHUNK_SIZE || chunkSize + bytes > CHUNK_BYTES))
|
|
6617
|
+
await append();
|
|
6618
|
+
chunk.push(item);
|
|
6619
|
+
chunkSize += bytes;
|
|
6620
|
+
if (chunk.length === CHUNK_SIZE) await append();
|
|
6621
|
+
}
|
|
6622
|
+
if (chunk.length) await append();
|
|
6623
|
+
if (!expectedProductCount)
|
|
6624
|
+
throw new Error("Provide at least one catalog target.");
|
|
6625
|
+
return client.bulk.submit(
|
|
6626
|
+
{ organizationId, operationId, expectedProductCount },
|
|
6627
|
+
options
|
|
6628
|
+
);
|
|
6629
|
+
}
|
|
6630
|
+
function submitCatalogPricing(client, request, updates, options) {
|
|
6631
|
+
return submitCatalogTargets(
|
|
6632
|
+
client,
|
|
6633
|
+
request,
|
|
6634
|
+
updates,
|
|
6635
|
+
(rows) => ({ updates: rows }),
|
|
6636
|
+
({ productId }) => productId.trim().toLowerCase(),
|
|
6637
|
+
options
|
|
6638
|
+
);
|
|
6639
|
+
}
|
|
6640
|
+
function submitCatalogRecords(client, request, products, options) {
|
|
6641
|
+
return submitCatalogTargets(
|
|
6642
|
+
client,
|
|
6643
|
+
{ ...request, importRecords: request.importRecords ?? {} },
|
|
6644
|
+
products,
|
|
6645
|
+
(rows) => ({ products: rows }),
|
|
6646
|
+
({ sku }) => sku.trim(),
|
|
6647
|
+
options
|
|
6648
|
+
);
|
|
6649
|
+
}
|
|
6650
|
+
function submitCatalogEnrichment(client, request, productIds, options) {
|
|
6651
|
+
return submitCatalogTargets(
|
|
6652
|
+
client,
|
|
6653
|
+
request,
|
|
6654
|
+
productIds,
|
|
6655
|
+
(rows) => ({ productIds: rows }),
|
|
6656
|
+
(id) => id.trim().toLowerCase(),
|
|
6657
|
+
options
|
|
6658
|
+
);
|
|
6659
|
+
}
|
|
6660
|
+
|
|
5966
6661
|
// src/webhooks.ts
|
|
5967
6662
|
var encoder = new TextEncoder();
|
|
5968
6663
|
var WEBHOOK_SIGNATURE_HEADER = "x-omni-signature";
|
|
@@ -6085,7 +6780,12 @@ exports.WEBHOOK_EVENT_TYPE_HEADER = WEBHOOK_EVENT_TYPE_HEADER;
|
|
|
6085
6780
|
exports.WEBHOOK_SIGNATURE_HEADER = WEBHOOK_SIGNATURE_HEADER;
|
|
6086
6781
|
exports.WEBHOOK_TIMESTAMP_HEADER = WEBHOOK_TIMESTAMP_HEADER;
|
|
6087
6782
|
exports.constructEvent = constructEvent;
|
|
6783
|
+
exports.readCatalogFileFailures = readCatalogFileFailures;
|
|
6088
6784
|
exports.signWebhookPayload = signWebhookPayload;
|
|
6785
|
+
exports.submitCatalogEnrichment = submitCatalogEnrichment;
|
|
6786
|
+
exports.submitCatalogFile = submitCatalogFile;
|
|
6787
|
+
exports.submitCatalogPricing = submitCatalogPricing;
|
|
6788
|
+
exports.submitCatalogRecords = submitCatalogRecords;
|
|
6089
6789
|
exports.verifyWebhookSignature = verifyWebhookSignature;
|
|
6090
6790
|
//# sourceMappingURL=index.cjs.map
|
|
6091
6791
|
//# sourceMappingURL=index.cjs.map
|