@omni-commerce/sdk 0.20.0 → 0.21.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 +146 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +973 -46
- package/dist/index.d.ts +973 -46
- package/dist/index.js +146 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# @omni-commerce/sdk
|
|
2
2
|
|
|
3
|
+
SDK 0.21.0 adds server-side `catalog.query`, durable `bulk.start`/`status`/`results`, and asynchronous product verification. See [Catalog operations](https://docs.omnicommerce.sg/sdk/catalog-operations).
|
|
4
|
+
|
|
5
|
+
SDK 0.20.1 expands batch method documentation with submission limits, concurrency, partial-result handling and job verification guidance. Runtime API contracts are unchanged.
|
|
6
|
+
|
|
3
7
|
SDK 0.20.0 adds headless campaign import, validators, Full sync approval/run, lifecycle batches, and promotion publishing, modification, deletion and delivery checks. See [Campaign automation](https://docs.omnicommerce.sg/guides/campaign-automation). API clients can be explicitly named campaign approvers; browser cookies are unnecessary.
|
|
4
8
|
|
|
5
9
|
TypeScript / JavaScript client for the [OmniCommerce API](https://docs.omnicommerce.sg/api-reference).
|
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.21.0";
|
|
39
39
|
var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
|
|
40
40
|
|
|
41
41
|
// src/environments.ts
|
|
@@ -1480,6 +1480,79 @@ var BrandsgatewayClient = class {
|
|
|
1480
1480
|
});
|
|
1481
1481
|
}
|
|
1482
1482
|
};
|
|
1483
|
+
var BulkClient = class {
|
|
1484
|
+
constructor(_http) {
|
|
1485
|
+
__publicField(this, "_http", _http);
|
|
1486
|
+
}
|
|
1487
|
+
/**
|
|
1488
|
+
* List Catalog Operations for Session
|
|
1489
|
+
*
|
|
1490
|
+
* Read the latest 20 compact catalog-operation summaries linked to an authorized session. Requires catalog:read; product data scope is rechecked.
|
|
1491
|
+
*
|
|
1492
|
+
* `GET /api/v1/catalog/operations`
|
|
1493
|
+
*/
|
|
1494
|
+
listForSession(request, requestOptions) {
|
|
1495
|
+
const { organizationId, sessionId } = request ?? {};
|
|
1496
|
+
return this._http.request({
|
|
1497
|
+
method: "GET",
|
|
1498
|
+
path: "/api/v1/catalog/operations",
|
|
1499
|
+
query: { organizationId, sessionId },
|
|
1500
|
+
body: void 0,
|
|
1501
|
+
...mergeRequestOptions(requestOptions)
|
|
1502
|
+
});
|
|
1503
|
+
}
|
|
1504
|
+
/**
|
|
1505
|
+
* Start Catalog Operation
|
|
1506
|
+
*
|
|
1507
|
+
* Durable bulk price/cost updates for 1–2000 products or variants. Requires catalog:write. Identical duplicates collapse in requested order; conflicting duplicates fail. An idempotencyKey freezes the original targets and versions. Reusing it with changed input returns 409. expectedUpdatedAt guards reviewed values. Catalog cost never syncs to marketplaces. syncToMarketplaces queues existing canonical marketplace services for every applicable connected listing. A failed target does not stop other targets. The operation continues after the caller disconnects. Read aggregate status, then page failures through bulk.results. Optional sessionId links progress to the initiating user's existing session.
|
|
1508
|
+
*
|
|
1509
|
+
* `POST /api/v1/catalog/operations`
|
|
1510
|
+
*/
|
|
1511
|
+
start(request, requestOptions) {
|
|
1512
|
+
const { ...body } = request ?? {};
|
|
1513
|
+
return this._http.request({
|
|
1514
|
+
method: "POST",
|
|
1515
|
+
path: "/api/v1/catalog/operations",
|
|
1516
|
+
query: void 0,
|
|
1517
|
+
body,
|
|
1518
|
+
...mergeRequestOptions(requestOptions)
|
|
1519
|
+
});
|
|
1520
|
+
}
|
|
1521
|
+
/**
|
|
1522
|
+
* Get Catalog Operation Results
|
|
1523
|
+
*
|
|
1524
|
+
* 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.
|
|
1525
|
+
*
|
|
1526
|
+
* `POST /api/v1/catalog/operations/results`
|
|
1527
|
+
*/
|
|
1528
|
+
results(request, requestOptions) {
|
|
1529
|
+
const { ...body } = request ?? {};
|
|
1530
|
+
return this._http.request({
|
|
1531
|
+
method: "POST",
|
|
1532
|
+
path: "/api/v1/catalog/operations/results",
|
|
1533
|
+
query: void 0,
|
|
1534
|
+
body,
|
|
1535
|
+
...mergeRequestOptions(requestOptions)
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1538
|
+
/**
|
|
1539
|
+
* Get Catalog Operation Status
|
|
1540
|
+
*
|
|
1541
|
+
* 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.
|
|
1542
|
+
*
|
|
1543
|
+
* `POST /api/v1/catalog/operations/status`
|
|
1544
|
+
*/
|
|
1545
|
+
status(request, requestOptions) {
|
|
1546
|
+
const { ...body } = request ?? {};
|
|
1547
|
+
return this._http.request({
|
|
1548
|
+
method: "POST",
|
|
1549
|
+
path: "/api/v1/catalog/operations/status",
|
|
1550
|
+
query: void 0,
|
|
1551
|
+
body,
|
|
1552
|
+
...mergeRequestOptions(requestOptions)
|
|
1553
|
+
});
|
|
1554
|
+
}
|
|
1555
|
+
};
|
|
1483
1556
|
var CampaignsClient = class {
|
|
1484
1557
|
constructor(_http) {
|
|
1485
1558
|
__publicField(this, "_http", _http);
|
|
@@ -1835,6 +1908,23 @@ var CatalogClient = class {
|
|
|
1835
1908
|
...mergeRequestOptions(requestOptions)
|
|
1836
1909
|
});
|
|
1837
1910
|
}
|
|
1911
|
+
/**
|
|
1912
|
+
* Query Catalog
|
|
1913
|
+
*
|
|
1914
|
+
* Filter and project simple products and variants on the server. Requires catalog:read. Defaults to active sellable SKUs, excluding parent containers. costComparison=above_price compares known cost in each product's catalog currency using valid recorded conversions; unknown costs or unavailable conversions do not match. Fields bound the response. Maximum 500 rows per page. Omit counts after the first page with includeCount=false. No SQL input is accepted.
|
|
1915
|
+
*
|
|
1916
|
+
* `POST /api/v1/catalog/query`
|
|
1917
|
+
*/
|
|
1918
|
+
query(request, requestOptions) {
|
|
1919
|
+
const { ...body } = request ?? {};
|
|
1920
|
+
return this._http.request({
|
|
1921
|
+
method: "POST",
|
|
1922
|
+
path: "/api/v1/catalog/query",
|
|
1923
|
+
query: void 0,
|
|
1924
|
+
body,
|
|
1925
|
+
...mergeRequestOptions(requestOptions)
|
|
1926
|
+
});
|
|
1927
|
+
}
|
|
1838
1928
|
};
|
|
1839
1929
|
var CheckoutSessionsClient = class {
|
|
1840
1930
|
constructor(_http) {
|
|
@@ -1997,6 +2087,23 @@ var CommerceClient = class {
|
|
|
1997
2087
|
...mergeRequestOptions(requestOptions)
|
|
1998
2088
|
});
|
|
1999
2089
|
}
|
|
2090
|
+
/**
|
|
2091
|
+
* Start Commerce Verification
|
|
2092
|
+
*
|
|
2093
|
+
* Queue durable fresh verification for up to 2000 products in the existing verification contract, under verification. Requires catalog:read. Returns immediately with operationIds. Read bulk.status and bulk.results; a client timeout does not discard work. Fulfillment correlations continue to use commerce.verifyState.
|
|
2094
|
+
*
|
|
2095
|
+
* `POST /api/v1/commerce/state/verify/jobs`
|
|
2096
|
+
*/
|
|
2097
|
+
startVerification(request, requestOptions) {
|
|
2098
|
+
const { ...body } = request ?? {};
|
|
2099
|
+
return this._http.request({
|
|
2100
|
+
method: "POST",
|
|
2101
|
+
path: "/api/v1/commerce/state/verify/jobs",
|
|
2102
|
+
query: void 0,
|
|
2103
|
+
body,
|
|
2104
|
+
...mergeRequestOptions(requestOptions)
|
|
2105
|
+
});
|
|
2106
|
+
}
|
|
2000
2107
|
};
|
|
2001
2108
|
var CompareClient = class {
|
|
2002
2109
|
constructor(_http) {
|
|
@@ -3511,7 +3618,18 @@ var ProductsClient = class {
|
|
|
3511
3618
|
options
|
|
3512
3619
|
);
|
|
3513
3620
|
}
|
|
3514
|
-
/**
|
|
3621
|
+
/**
|
|
3622
|
+
* Publish saved products; updateFields limits writes to selected fields on existing listings.
|
|
3623
|
+
* Accepts 1–100 entries; concurrency is 1–10 (default 3).
|
|
3624
|
+
* productIds are trimmed and deduplicated in first-requested order.
|
|
3625
|
+
* Omit marketplaces for all eligible marketplaces, or preserve the requested targets.
|
|
3626
|
+
* Returns success, productIds, succeededCount, failedCount, ordered results and jobIds.
|
|
3627
|
+
* Results retain each response/error, even for partial failures. Success means submitted,
|
|
3628
|
+
* not marketplace-verified. Preserve typed correlations from the responses for commerce.awaitJobs.
|
|
3629
|
+
* These client-side requests are not atomic or a durable server batch. Keep this process
|
|
3630
|
+
* alive during submission and persist receipts before the next chunk. Request options
|
|
3631
|
+
* apply per product, not to the entire batch. An abortSignal stops unstarted submissions.
|
|
3632
|
+
*/
|
|
3515
3633
|
batchPublish(request, options) {
|
|
3516
3634
|
return batchPublishProducts(
|
|
3517
3635
|
(item, requestOptions) => this.publish(item, requestOptions),
|
|
@@ -3519,7 +3637,18 @@ var ProductsClient = class {
|
|
|
3519
3637
|
options
|
|
3520
3638
|
);
|
|
3521
3639
|
}
|
|
3522
|
-
/**
|
|
3640
|
+
/**
|
|
3641
|
+
* Delist products using their eligible or explicitly selected marketplaces.
|
|
3642
|
+
* Accepts 1–100 entries; concurrency is 1–10 (default 3).
|
|
3643
|
+
* productIds are trimmed and deduplicated in first-requested order.
|
|
3644
|
+
* Omit marketplaces for all eligible marketplaces, or preserve the requested targets.
|
|
3645
|
+
* Returns success, productIds, succeededCount, failedCount, ordered results and jobIds.
|
|
3646
|
+
* Results retain each response/error, even for partial failures. Success means submitted,
|
|
3647
|
+
* not marketplace-verified. Preserve typed correlations from the responses for commerce.awaitJobs.
|
|
3648
|
+
* These client-side requests are not atomic or a durable server batch. Keep this process
|
|
3649
|
+
* alive during submission and persist receipts before the next chunk. Request options
|
|
3650
|
+
* apply per product, not to the entire batch. An abortSignal stops unstarted submissions.
|
|
3651
|
+
*/
|
|
3523
3652
|
batchDelist(request, options) {
|
|
3524
3653
|
return batchDelistProducts(
|
|
3525
3654
|
(item, requestOptions) => this.delist(item, requestOptions),
|
|
@@ -3527,7 +3656,18 @@ var ProductsClient = class {
|
|
|
3527
3656
|
options
|
|
3528
3657
|
);
|
|
3529
3658
|
}
|
|
3530
|
-
/**
|
|
3659
|
+
/**
|
|
3660
|
+
* Save per-product catalog edits; publish saved fields separately when requested.
|
|
3661
|
+
* Accepts 1–100 entries; concurrency is 1–10 (default 3).
|
|
3662
|
+
* Each update uses productId and normal update fields; duplicate IDs are rejected.
|
|
3663
|
+
* Submit price/currency changes separately from other product fields.
|
|
3664
|
+
* Returns success, productIds, succeededCount, failedCount, ordered results and jobIds.
|
|
3665
|
+
* Results retain each response/error, even for partial failures. Success means submitted,
|
|
3666
|
+
* not marketplace-verified. Preserve typed correlations from the responses for commerce.awaitJobs.
|
|
3667
|
+
* These client-side requests are not atomic or a durable server batch. Keep this process
|
|
3668
|
+
* alive during submission and persist receipts before the next chunk. Request options
|
|
3669
|
+
* apply per product, not to the entire batch. An abortSignal stops unstarted submissions.
|
|
3670
|
+
*/
|
|
3531
3671
|
batchUpdate(request, options) {
|
|
3532
3672
|
return batchUpdateProducts(
|
|
3533
3673
|
(item, requestOptions) => this.update(item, requestOptions),
|
|
@@ -4847,6 +4987,7 @@ var OmniGeneratedClient = class {
|
|
|
4847
4987
|
__publicField(this, "api");
|
|
4848
4988
|
__publicField(this, "brandKits");
|
|
4849
4989
|
__publicField(this, "brandsgateway");
|
|
4990
|
+
__publicField(this, "bulk");
|
|
4850
4991
|
__publicField(this, "campaigns");
|
|
4851
4992
|
__publicField(this, "catalog");
|
|
4852
4993
|
__publicField(this, "checkoutSessions");
|
|
@@ -4887,6 +5028,7 @@ var OmniGeneratedClient = class {
|
|
|
4887
5028
|
this.api = new ApiClient(this._http);
|
|
4888
5029
|
this.brandKits = new BrandKitsClient(this._http);
|
|
4889
5030
|
this.brandsgateway = new BrandsgatewayClient(this._http);
|
|
5031
|
+
this.bulk = new BulkClient(this._http);
|
|
4890
5032
|
this.campaigns = new CampaignsClient(this._http);
|
|
4891
5033
|
this.catalog = new CatalogClient(this._http);
|
|
4892
5034
|
this.checkoutSessions = new CheckoutSessionsClient(this._http);
|