@omni-commerce/sdk 0.24.0 → 0.26.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 +208 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1693 -24
- package/dist/index.d.ts +1693 -24
- package/dist/index.js +208 -12
- 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.26.0 adds normalized order attribution to `orders.list`, `orders.get`, and `analytics.getOrders`. Read `attribution.channels`, `creatorHandles`, and `storefront`; analytics includes creator/channel Net Revenue by exact store and currency.
|
|
4
|
+
|
|
5
|
+
SDK 0.25.0 supports marketplace-only bulk import and enrichment, later store assignment with `products.assignMarketplaceStores`, and publishing to those exact stores.
|
|
6
|
+
|
|
3
7
|
SDK 0.24.0 adds typed refund and rejection inputs, return evidence uploads, and separate order refund and physical receipt status.
|
|
4
8
|
|
|
5
9
|
SDK 0.23.0 adds `products.bulkUpdate` and `bulkUpdateStatus` for durable price and stock file updates using the same services as Omni Bulk Update. Up to 10 uploaded documents, 10,000 rows each; pass every returned import reference to the batch status method.
|
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.26.0";
|
|
39
39
|
var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
|
|
40
40
|
|
|
41
41
|
// src/environments.ts
|
|
@@ -929,7 +929,11 @@ var AnalyticsClient = class {
|
|
|
929
929
|
/**
|
|
930
930
|
* Get Order Analytics
|
|
931
931
|
*
|
|
932
|
-
* Order KPIs with their change against the previous period, a daily trend, sales by order status and by marketplace, and the top products by net sales. Repeat buyers are counted but not listed.
|
|
932
|
+
* Order KPIs with their change against the previous period, a daily trend, sales by order status and by marketplace, and the top products by net sales. Repeat buyers are counted but not listed.
|
|
933
|
+
|
|
934
|
+
### Order attribution
|
|
935
|
+
|
|
936
|
+
`attribution` contains normalized order channels and creator handles, Net Revenue rankings partitioned by currency and exact store, and evidence coverage. Joint creator/channel groups count each order once; missing evidence is explicit. Matches the Orders analysis page. Requires `analytics:read`.
|
|
933
937
|
|
|
934
938
|
Amounts are in `data.filters.currency`. Only orders in that currency are counted; nothing is converted. A range covers at most 366 days.
|
|
935
939
|
*
|
|
@@ -2264,7 +2268,7 @@ var DocumentsClient = class {
|
|
|
2264
2268
|
*
|
|
2265
2269
|
* Upload one file to the knowledge base as multipart/form-data. Requires `documents:write`.
|
|
2266
2270
|
|
|
2267
|
-
Accepted: PDF up to 20 MB, Word (.docx) and PowerPoint (.pptx) up to 20 MB, Excel (.xlsx/.xlsm) up to
|
|
2271
|
+
Accepted: PDF up to 20 MB, Word (.docx) and PowerPoint (.pptx) up to 20 MB, Excel (.xlsx/.xlsm) up to 20 MB, images up to 8 MB, CSV and Markdown up to 2 MB. PDFs, Word, PowerPoint, Markdown, and images are indexed in the background; poll `GET /api/v1/documents/{documentId}` until `status` is `completed`. CSV and Excel are stored for agents to read but are not indexed.
|
|
2268
2272
|
*
|
|
2269
2273
|
* `POST /api/v1/documents`
|
|
2270
2274
|
*/
|
|
@@ -2499,6 +2503,8 @@ var JobsClient = class {
|
|
|
2499
2503
|
*
|
|
2500
2504
|
* Fetch shared async status for developer-platform operations, including product workflow jobs, bulk CSV import jobs, Look generation jobs, import jobs, enrichment jobs, price comparison jobs, and sync jobs.
|
|
2501
2505
|
|
|
2506
|
+
Marketplace-only bulk imports expose data.deferStoreSelection: true. For imports with automatic publishing enabled, inspect data.publishing for per-store results.
|
|
2507
|
+
|
|
2502
2508
|
Price comparison jobs expose partial progress in data.results and their final batch result in data.result; completed means processing finished, so inspect data.result.success for comparison failures.
|
|
2503
2509
|
*
|
|
2504
2510
|
* `GET /api/v1/jobs/{jobId}`
|
|
@@ -3579,14 +3585,11 @@ var ProductsClient = class {
|
|
|
3579
3585
|
*
|
|
3580
3586
|
* Queue a bulk product import for the authenticated organization.
|
|
3581
3587
|
|
|
3582
|
-
|
|
3588
|
+
### Destinations
|
|
3583
3589
|
|
|
3584
|
-
|
|
3590
|
+
Supply targetMarketplaces and marketplaceStoreSelections to prepare for specific connected stores. Set deferStoreSelection=true to choose marketplaces only and assign stores later with POST /api/v1/products/marketplace-stores. Omit marketplaceStoreSelections and leave workflow.publish off when deferring. Automatic publishing requires catalog:sync in addition to catalog:write.
|
|
3585
3591
|
|
|
3586
|
-
|
|
3587
|
-
- Send JSON with a `products` array of 1–5,000 flat product objects (8 MiB request maximum).
|
|
3588
|
-
- Send JSON with inline `csvText`.
|
|
3589
|
-
- Send
|
|
3592
|
+
Supply explicit SKU options in each row's `variationAttributes` and native marketplace attributes in `marketplaceAttributes`. Enrichment never infers SKU options. At Zalora publish time, a missing required Size defaults to One Size only when valid for the selected category and supplied size system. Supplied sizes are preserved; missing
|
|
3590
3593
|
*
|
|
3591
3594
|
* `POST /api/v1/products/bulk-import`
|
|
3592
3595
|
*/
|
|
@@ -3930,9 +3933,7 @@ var ProductsClient = class {
|
|
|
3930
3933
|
|
|
3931
3934
|
### Enrichment options
|
|
3932
3935
|
|
|
3933
|
-
Fields, instructions and auto-apply settings use the canonical enrichment service. Exclude name from selectedFields to preserve titles. Weight and dimensions are always included; images are not queued here. Optional marketplaceStoreSelections maps each marketplace to an array of connected store IDs. Multiple stores on one marketplace get independent category and attribute reviews in the same review group. Set includeListingCopy=false for taxonomy only. Store countries come from the authenticated organization connections.
|
|
3934
|
-
|
|
3935
|
-
autoApplyHighConfidence defaults to false.
|
|
3936
|
+
Fields, instructions and auto-apply settings use the canonical enrichment service. Exclude name from selectedFields to preserve titles. Weight and dimensions are always included; images are not queued here. Optional marketplaceStoreSelections maps each marketplace to an array of connected store IDs. Multiple stores on one marketplace get independent category and attribute reviews in the same review group. Set includeListingCopy=false for taxonomy only. Store countries come from the authenticated organization connections. Use deferredMarketplaces to enrich product
|
|
3936
3937
|
*
|
|
3937
3938
|
* `POST /api/v1/products/enrich`
|
|
3938
3939
|
*/
|
|
@@ -3946,6 +3947,31 @@ var ProductsClient = class {
|
|
|
3946
3947
|
...mergeRequestOptions(requestOptions)
|
|
3947
3948
|
});
|
|
3948
3949
|
}
|
|
3950
|
+
/**
|
|
3951
|
+
* Assign Product Marketplace Stores
|
|
3952
|
+
*
|
|
3953
|
+
* Requires catalog:write. Assign one or more connected stores per marketplace to 1–100 products, including marketplace-only drafts. Get exact store IDs and countries from GET /api/v1/marketplaces/connected.
|
|
3954
|
+
|
|
3955
|
+
### Store selection
|
|
3956
|
+
|
|
3957
|
+
Each product family is updated independently. Existing listings keep their remote identities. Reusing a store ID across countries requires storeCountries to identify the connection. Each product can use only one country per store ID. Copy compatible taxonomy from an existing sourceStoreId when supplied.
|
|
3958
|
+
|
|
3959
|
+
### Publish assigned stores
|
|
3960
|
+
|
|
3961
|
+
The response includes exact data.storeTargets for publishing the successful products. HTTP 207 means at least one product failed. Inspect each result before passing those storeTargets to POST /api/v1/products/{productId}/publish.
|
|
3962
|
+
*
|
|
3963
|
+
* `POST /api/v1/products/marketplace-stores`
|
|
3964
|
+
*/
|
|
3965
|
+
assignMarketplaceStores(request, requestOptions) {
|
|
3966
|
+
const { ...body } = request ?? {};
|
|
3967
|
+
return this._http.request({
|
|
3968
|
+
method: "POST",
|
|
3969
|
+
path: "/api/v1/products/marketplace-stores",
|
|
3970
|
+
query: void 0,
|
|
3971
|
+
body,
|
|
3972
|
+
...mergeRequestOptions(requestOptions)
|
|
3973
|
+
});
|
|
3974
|
+
}
|
|
3949
3975
|
/** Read a bounded chunk without summary classification; persist progress to resume. */
|
|
3950
3976
|
scan(request = {}, options) {
|
|
3951
3977
|
return scanProducts(
|
|
@@ -5306,6 +5332,174 @@ var WebhooksClient = class {
|
|
|
5306
5332
|
});
|
|
5307
5333
|
}
|
|
5308
5334
|
};
|
|
5335
|
+
var WikiClient = class {
|
|
5336
|
+
constructor(_http) {
|
|
5337
|
+
__publicField(this, "_http", _http);
|
|
5338
|
+
}
|
|
5339
|
+
/**
|
|
5340
|
+
* Export Wiki
|
|
5341
|
+
*
|
|
5342
|
+
* Export every active General page as a markdown file with YAML front matter, and the glossary (titles, aliases, related pages) as SKOS in JSON-LD. Requires documents:read.
|
|
5343
|
+
*
|
|
5344
|
+
* `GET /api/v1/wiki/export`
|
|
5345
|
+
*/
|
|
5346
|
+
exportPages(request = {}, requestOptions) {
|
|
5347
|
+
const { organizationId } = request ?? {};
|
|
5348
|
+
return this._http.request({
|
|
5349
|
+
method: "GET",
|
|
5350
|
+
path: "/api/v1/wiki/export",
|
|
5351
|
+
query: { organizationId },
|
|
5352
|
+
body: void 0,
|
|
5353
|
+
...mergeRequestOptions(requestOptions)
|
|
5354
|
+
});
|
|
5355
|
+
}
|
|
5356
|
+
/**
|
|
5357
|
+
* Import Wiki
|
|
5358
|
+
*
|
|
5359
|
+
* Create or update General pages from markdown files. Requires documents:write. Front matter may set title, summary, aliases, hiddenLabels, appliesTo and reviewBy; without front matter the first # heading is the title.
|
|
5360
|
+
|
|
5361
|
+
Definitions from older exports are imported into the page body.
|
|
5362
|
+
|
|
5363
|
+
A file updates the page that already holds its title and otherwise creates one, so importing an export is idempotent. Each file is saved on its own and reported separately.
|
|
5364
|
+
*
|
|
5365
|
+
* `POST /api/v1/wiki/import`
|
|
5366
|
+
*/
|
|
5367
|
+
importPages(request, requestOptions) {
|
|
5368
|
+
const { ...body } = request ?? {};
|
|
5369
|
+
return this._http.request({
|
|
5370
|
+
method: "POST",
|
|
5371
|
+
path: "/api/v1/wiki/import",
|
|
5372
|
+
query: void 0,
|
|
5373
|
+
body,
|
|
5374
|
+
...mergeRequestOptions(requestOptions)
|
|
5375
|
+
});
|
|
5376
|
+
}
|
|
5377
|
+
/**
|
|
5378
|
+
* List Wiki Pages
|
|
5379
|
+
*
|
|
5380
|
+
* List the organization's wiki pages with title, aliases and an excerpt. Requires documents:read. Filter with q (title, alias, summary and fragment text) and status (active, stale, archived); sort by newest, title or most_used.
|
|
5381
|
+
*
|
|
5382
|
+
* `GET /api/v1/wiki/pages`
|
|
5383
|
+
*/
|
|
5384
|
+
listPages(request = {}, requestOptions) {
|
|
5385
|
+
const { organizationId, q, status, sort, limit, offset } = request ?? {};
|
|
5386
|
+
return this._http.request({
|
|
5387
|
+
method: "GET",
|
|
5388
|
+
path: "/api/v1/wiki/pages",
|
|
5389
|
+
query: { organizationId, q, status, sort, limit, offset },
|
|
5390
|
+
body: void 0,
|
|
5391
|
+
...mergeRequestOptions(requestOptions)
|
|
5392
|
+
});
|
|
5393
|
+
}
|
|
5394
|
+
/**
|
|
5395
|
+
* Create Wiki Page
|
|
5396
|
+
*
|
|
5397
|
+
* Create a wiki page. Requires documents:write. The page is saved directly; the approval card applies only to changes an agent proposes in chat.
|
|
5398
|
+
|
|
5399
|
+
Titles and aliases are unique within the organization. Link other pages in the body as [[Page title]]. The page is findable by name at once; fragment, meaning and graph search follow within about a minute.
|
|
5400
|
+
*
|
|
5401
|
+
* `POST /api/v1/wiki/pages`
|
|
5402
|
+
*/
|
|
5403
|
+
createPage(request, requestOptions) {
|
|
5404
|
+
const { ...body } = request ?? {};
|
|
5405
|
+
return this._http.request({
|
|
5406
|
+
method: "POST",
|
|
5407
|
+
path: "/api/v1/wiki/pages",
|
|
5408
|
+
query: void 0,
|
|
5409
|
+
body,
|
|
5410
|
+
...mergeRequestOptions(requestOptions)
|
|
5411
|
+
});
|
|
5412
|
+
}
|
|
5413
|
+
/**
|
|
5414
|
+
* Archive Wiki Page
|
|
5415
|
+
*
|
|
5416
|
+
* Archive the page. Requires documents:write. Agents stop using it and it leaves search; its history and names are kept, and PATCH with status active restores it.
|
|
5417
|
+
*
|
|
5418
|
+
* `DELETE /api/v1/wiki/pages/{pageId}`
|
|
5419
|
+
*/
|
|
5420
|
+
archivePage(request, requestOptions) {
|
|
5421
|
+
const { pageId, organizationId } = request ?? {};
|
|
5422
|
+
return this._http.request({
|
|
5423
|
+
method: "DELETE",
|
|
5424
|
+
path: `/api/v1/wiki/pages/${encodePathParam("pageId", pageId)}`,
|
|
5425
|
+
query: { organizationId },
|
|
5426
|
+
body: void 0,
|
|
5427
|
+
...mergeRequestOptions(requestOptions)
|
|
5428
|
+
});
|
|
5429
|
+
}
|
|
5430
|
+
/**
|
|
5431
|
+
* Get Wiki Page
|
|
5432
|
+
*
|
|
5433
|
+
* Read one page with its body, labels, linked pages and pages that link to it. Requires documents:read.
|
|
5434
|
+
*
|
|
5435
|
+
* `GET /api/v1/wiki/pages/{pageId}`
|
|
5436
|
+
*/
|
|
5437
|
+
getPage(request, requestOptions) {
|
|
5438
|
+
const { pageId, organizationId } = request ?? {};
|
|
5439
|
+
return this._http.request({
|
|
5440
|
+
method: "GET",
|
|
5441
|
+
path: `/api/v1/wiki/pages/${encodePathParam("pageId", pageId)}`,
|
|
5442
|
+
query: { organizationId },
|
|
5443
|
+
body: void 0,
|
|
5444
|
+
...mergeRequestOptions(requestOptions)
|
|
5445
|
+
});
|
|
5446
|
+
}
|
|
5447
|
+
/**
|
|
5448
|
+
* Update Wiki Page
|
|
5449
|
+
*
|
|
5450
|
+
* Save a new revision. Requires documents:write. Send only the fields that change; aliases and appliesTo replace the existing lists.
|
|
5451
|
+
|
|
5452
|
+
Pass baseRevisionNumber to refuse the update with 409 if the page changed since you read it. status archives or restores the page. restoreRevisionNumber brings back an earlier revision as the newest one and ignores other fields.
|
|
5453
|
+
*
|
|
5454
|
+
* `PATCH /api/v1/wiki/pages/{pageId}`
|
|
5455
|
+
*/
|
|
5456
|
+
updatePage(request, requestOptions) {
|
|
5457
|
+
const { pageId, ...body } = request ?? {};
|
|
5458
|
+
return this._http.request({
|
|
5459
|
+
method: "PATCH",
|
|
5460
|
+
path: `/api/v1/wiki/pages/${encodePathParam("pageId", pageId)}`,
|
|
5461
|
+
query: void 0,
|
|
5462
|
+
body,
|
|
5463
|
+
...mergeRequestOptions(requestOptions)
|
|
5464
|
+
});
|
|
5465
|
+
}
|
|
5466
|
+
/**
|
|
5467
|
+
* List Wiki Page Revisions
|
|
5468
|
+
*
|
|
5469
|
+
* Every saved revision of a page, newest first, with author, origin and change summary. Requires documents:read.
|
|
5470
|
+
*
|
|
5471
|
+
* `GET /api/v1/wiki/pages/{pageId}/revisions`
|
|
5472
|
+
*/
|
|
5473
|
+
listRevisions(request, requestOptions) {
|
|
5474
|
+
const { pageId, organizationId } = request ?? {};
|
|
5475
|
+
return this._http.request({
|
|
5476
|
+
method: "GET",
|
|
5477
|
+
path: `/api/v1/wiki/pages/${encodePathParam("pageId", pageId)}/revisions`,
|
|
5478
|
+
query: { organizationId },
|
|
5479
|
+
body: void 0,
|
|
5480
|
+
...mergeRequestOptions(requestOptions)
|
|
5481
|
+
});
|
|
5482
|
+
}
|
|
5483
|
+
/**
|
|
5484
|
+
* Search Wiki
|
|
5485
|
+
*
|
|
5486
|
+
* Search the wiki and return the best-matching fragments, the same search agents use. Requires documents:read.
|
|
5487
|
+
|
|
5488
|
+
Results fuse name matches, full text, meaning, graph relationships and page links. retrieval reports which signals were available; degraded is true when the graph or meaning search could not be used.
|
|
5489
|
+
*
|
|
5490
|
+
* `POST /api/v1/wiki/search`
|
|
5491
|
+
*/
|
|
5492
|
+
search(request, requestOptions) {
|
|
5493
|
+
const { ...body } = request ?? {};
|
|
5494
|
+
return this._http.request({
|
|
5495
|
+
method: "POST",
|
|
5496
|
+
path: "/api/v1/wiki/search",
|
|
5497
|
+
query: void 0,
|
|
5498
|
+
body,
|
|
5499
|
+
...mergeRequestOptions(requestOptions)
|
|
5500
|
+
});
|
|
5501
|
+
}
|
|
5502
|
+
};
|
|
5309
5503
|
var ZaloraClient = class {
|
|
5310
5504
|
constructor(_http) {
|
|
5311
5505
|
__publicField(this, "_http", _http);
|
|
@@ -5397,6 +5591,7 @@ var OmniGeneratedClient = class {
|
|
|
5397
5591
|
__publicField(this, "ucp");
|
|
5398
5592
|
__publicField(this, "webhookEvents");
|
|
5399
5593
|
__publicField(this, "webhooks");
|
|
5594
|
+
__publicField(this, "wiki");
|
|
5400
5595
|
__publicField(this, "zalora");
|
|
5401
5596
|
this.agents = new AgentsClient(this._http);
|
|
5402
5597
|
this.analytics = new AnalyticsClient(this._http);
|
|
@@ -5439,6 +5634,7 @@ var OmniGeneratedClient = class {
|
|
|
5439
5634
|
this.ucp = new UcpClient(this._http);
|
|
5440
5635
|
this.webhookEvents = new WebhookEventsClient(this._http);
|
|
5441
5636
|
this.webhooks = new WebhooksClient(this._http);
|
|
5637
|
+
this.wiki = new WikiClient(this._http);
|
|
5442
5638
|
this.zalora = new ZaloraClient(this._http);
|
|
5443
5639
|
}
|
|
5444
5640
|
};
|