@omni-commerce/sdk 0.23.0 → 0.24.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 +2 -0
- package/dist/index.cjs +58 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +257 -29
- package/dist/index.d.ts +257 -29
- package/dist/index.js +58 -29
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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.
|
|
36
|
+
var SDK_VERSION = "0.24.0";
|
|
37
37
|
var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
|
|
38
38
|
|
|
39
39
|
// src/environments.ts
|
|
@@ -2938,9 +2938,9 @@ var OrdersClient = class {
|
|
|
2938
2938
|
/**
|
|
2939
2939
|
* Get Order Action Options
|
|
2940
2940
|
*
|
|
2941
|
-
*
|
|
2941
|
+
* Read marketplace choices for this order, including seller cancellation reasons for `action=cancel`. Eligible orders can include orders awaiting carrier collection. Requires `orders:write`.
|
|
2942
2942
|
|
|
2943
|
-
|
|
2943
|
+
Review the selected reason or fulfillment choice and send its exact `payload` with `POST /api/v1/orders/{orderId}/actions`.
|
|
2944
2944
|
*
|
|
2945
2945
|
* `GET /api/v1/orders/{orderId}/action-options`
|
|
2946
2946
|
*/
|
|
@@ -2959,7 +2959,7 @@ var OrdersClient = class {
|
|
|
2959
2959
|
*
|
|
2960
2960
|
* The order's 20 most recent action jobs, newest first, plus its latest successful label job. Requires `orders:read`.
|
|
2961
2961
|
|
|
2962
|
-
|
|
2962
|
+
After submission, find the returned job ID here. Read its status for the marketplace outcome and `errorMessage` for failures. A succeeded `labels` job lists its label files in `labels`.
|
|
2963
2963
|
*
|
|
2964
2964
|
* `GET /api/v1/orders/{orderId}/actions`
|
|
2965
2965
|
*/
|
|
@@ -2978,7 +2978,7 @@ var OrdersClient = class {
|
|
|
2978
2978
|
*
|
|
2979
2979
|
* Ship, cancel, generate shipping labels for, or update tracking on a marketplace order. Requires `orders:write`.
|
|
2980
2980
|
|
|
2981
|
-
The marketplace call runs in the background
|
|
2981
|
+
For `cancel`, send the exact payload of a reviewed cancellation reason from the action options endpoint. The marketplace call runs in the background. The `202` response provides a `jobId`. Poll `GET /api/v1/orders/{orderId}/actions` for its outcome. A repeated `idempotencyKey` with the same request returns `200` with the original job.
|
|
2982
2982
|
*
|
|
2983
2983
|
* `POST /api/v1/orders/{orderId}/actions`
|
|
2984
2984
|
*/
|
|
@@ -3001,7 +3001,7 @@ var OrdersClient = class {
|
|
|
3001
3001
|
|
|
3002
3002
|
### Choices
|
|
3003
3003
|
|
|
3004
|
-
Read
|
|
3004
|
+
Read marketplace choices for `ship`, `cancel`, `labels`, or `update_tracking` for 1–50 UUIDs using repeated `orderIds` parameters. Results preserve first-requested order and report any per-order eligibility or capability errors. For `cancel`, review an available reason for each order and use its exact `payload`. Orders awaiting collection can be eligible when the marketplace permits it. For other actions, supply any fields marked `requiresInput`.
|
|
3005
3005
|
*
|
|
3006
3006
|
* `GET /api/v1/orders/actions`
|
|
3007
3007
|
*/
|
|
@@ -3024,11 +3024,9 @@ var OrdersClient = class {
|
|
|
3024
3024
|
|
|
3025
3025
|
### Batch submission
|
|
3026
3026
|
|
|
3027
|
-
Queue 1–50 distinct
|
|
3027
|
+
Queue 1–50 distinct orders with a UUID `requestId` and one operation per order. Each operation carries an `orderId`, `action`, and any marketplace inputs in `payload`. For `cancel`, send the reviewed reason's exact payload from GET /api/v1/orders/actions. All targets are authorized before enqueue. Per-order results preserve request order and report acceptance or errors.
|
|
3028
3028
|
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
Retain requestId and unchanged operations for retr
|
|
3029
|
+
Retain `requestId` and unchanged operations for retries. Follow `links.poll` with every returned job ID to check the marketplace outcomes. The worker rechecks permissions before each marketplace write.
|
|
3032
3030
|
*
|
|
3033
3031
|
* `POST /api/v1/orders/actions`
|
|
3034
3032
|
*/
|
|
@@ -3051,7 +3049,7 @@ var OrdersClient = class {
|
|
|
3051
3049
|
|
|
3052
3050
|
### Outcomes and labels
|
|
3053
3051
|
|
|
3054
|
-
Read
|
|
3052
|
+
Read 1–50 jobs using repeated `jobIds` parameters. Results preserve first-requested order. `data.success` requires every job to succeed. `pendingCount` includes queued and running jobs. `failedCount` includes failed and unsupported jobs. Amazon cancellations can stay running while its feed is processed. Successful label jobs return download links. A missing or cross-organization job returns 404. Current store restrictions apply.
|
|
3055
3053
|
*
|
|
3056
3054
|
* `GET /api/v1/orders/actions/jobs`
|
|
3057
3055
|
*/
|
|
@@ -3649,12 +3647,14 @@ var ProductsClient = class {
|
|
|
3649
3647
|
});
|
|
3650
3648
|
}
|
|
3651
3649
|
/**
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3650
|
+
* Get Bulk Product Update Options
|
|
3651
|
+
*
|
|
3652
|
+
* List active stock-file sources used by Omni Bulk Update, including manual warehouses and supported CSV sources. Requires catalog:read and inventory.read.
|
|
3653
|
+
|
|
3654
|
+
Use an eligible sourceId before starting inventory updates. Ask the seller to choose when multiple sources are eligible.
|
|
3655
|
+
*
|
|
3656
|
+
* `GET /api/v1/products/bulk-update`
|
|
3657
|
+
*/
|
|
3658
3658
|
bulkUpdateOptions(request = {}, requestOptions) {
|
|
3659
3659
|
const { organizationId } = request ?? {};
|
|
3660
3660
|
return this._http.request({
|
|
@@ -3666,12 +3666,20 @@ var ProductsClient = class {
|
|
|
3666
3666
|
});
|
|
3667
3667
|
}
|
|
3668
3668
|
/**
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3669
|
+
* Bulk Update Product Prices and Stock
|
|
3670
|
+
*
|
|
3671
|
+
* Update existing catalog SKUs from 1–10 uploaded CSV or Excel documentIds, with up to 10,000 rows per file. Requires catalog:write and the corresponding product or inventory capabilities.
|
|
3672
|
+
|
|
3673
|
+
### File and source selection
|
|
3674
|
+
|
|
3675
|
+
Exact SKU matching preserves zero values and rejects duplicate, ambiguous, or unknown SKUs. Inventory needs an authorized manual or CSV sourceId or locationId. Explicit column names override detection. syncToMarketplaces defaults to true. Use marketplaces to limit which existing listings are synced.
|
|
3676
|
+
|
|
3677
|
+
### Track the results
|
|
3678
|
+
|
|
3679
|
+
Pass every saved import reference to products.bulkUpdateStatus. Results preserve document order. The workflow runs after the request returns. Applied inventory means source balances were saved and listing sync was queued.
|
|
3680
|
+
*
|
|
3681
|
+
* `POST /api/v1/products/bulk-update`
|
|
3682
|
+
*/
|
|
3675
3683
|
bulkUpdate(request, requestOptions) {
|
|
3676
3684
|
const { ...body } = request ?? {};
|
|
3677
3685
|
return this._http.request({
|
|
@@ -3683,12 +3691,14 @@ var ProductsClient = class {
|
|
|
3683
3691
|
});
|
|
3684
3692
|
}
|
|
3685
3693
|
/**
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3694
|
+
* Get Bulk Product Update Status
|
|
3695
|
+
*
|
|
3696
|
+
* Read up to 20 saved imports in request order. Requires catalog:read and the corresponding product or inventory read capabilities. Imports are deduplicated by kind and importId.
|
|
3697
|
+
|
|
3698
|
+
Pending imports are incomplete. Results report invalid or unknown rows and missing organization-scoped imports. Use includeRows with rowOffset and rowLimit for up to 100 rows per import. The result describes saved catalog stock.
|
|
3699
|
+
*
|
|
3700
|
+
* `POST /api/v1/products/bulk-update/status`
|
|
3701
|
+
*/
|
|
3692
3702
|
bulkUpdateStatus(request, requestOptions) {
|
|
3693
3703
|
const { ...body } = request ?? {};
|
|
3694
3704
|
return this._http.request({
|
|
@@ -4427,6 +4437,25 @@ var ReturnsClient = class {
|
|
|
4427
4437
|
...mergeRequestOptions(requestOptions)
|
|
4428
4438
|
});
|
|
4429
4439
|
}
|
|
4440
|
+
/**
|
|
4441
|
+
* Upload Return Rejection Evidence
|
|
4442
|
+
*
|
|
4443
|
+
* Requires `orders:write`. For a rejection choice with `input.evidenceUpload: true`, upload one JPEG or PNG image up to 5 MB.
|
|
4444
|
+
|
|
4445
|
+
Use the receipt and filename in `input.evidence` when submitting the reviewed rejection. A rejection can include up to six images. Each receipt is scoped to its return and expires after 24 hours.
|
|
4446
|
+
*
|
|
4447
|
+
* `POST /api/v1/returns/{returnId}/evidence`
|
|
4448
|
+
*/
|
|
4449
|
+
uploadEvidence(request, requestOptions) {
|
|
4450
|
+
const { returnId, organizationId, ...body } = request ?? {};
|
|
4451
|
+
return this._http.request({
|
|
4452
|
+
method: "POST",
|
|
4453
|
+
path: `/api/v1/returns/${encodePathParam("returnId", returnId)}/evidence`,
|
|
4454
|
+
query: { organizationId },
|
|
4455
|
+
body: toMultipartBody(body),
|
|
4456
|
+
...mergeRequestOptions(requestOptions)
|
|
4457
|
+
});
|
|
4458
|
+
}
|
|
4430
4459
|
/**
|
|
4431
4460
|
* Check Return Actions
|
|
4432
4461
|
*
|