@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/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.26.0";
|
|
37
37
|
var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
|
|
38
38
|
|
|
39
39
|
// src/environments.ts
|
|
@@ -927,7 +927,11 @@ var AnalyticsClient = class {
|
|
|
927
927
|
/**
|
|
928
928
|
* Get Order Analytics
|
|
929
929
|
*
|
|
930
|
-
* 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.
|
|
930
|
+
* 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.
|
|
931
|
+
|
|
932
|
+
### Order attribution
|
|
933
|
+
|
|
934
|
+
`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`.
|
|
931
935
|
|
|
932
936
|
Amounts are in `data.filters.currency`. Only orders in that currency are counted; nothing is converted. A range covers at most 366 days.
|
|
933
937
|
*
|
|
@@ -2262,7 +2266,7 @@ var DocumentsClient = class {
|
|
|
2262
2266
|
*
|
|
2263
2267
|
* Upload one file to the knowledge base as multipart/form-data. Requires `documents:write`.
|
|
2264
2268
|
|
|
2265
|
-
Accepted: PDF up to 20 MB, Word (.docx) and PowerPoint (.pptx) up to 20 MB, Excel (.xlsx/.xlsm) up to
|
|
2269
|
+
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.
|
|
2266
2270
|
*
|
|
2267
2271
|
* `POST /api/v1/documents`
|
|
2268
2272
|
*/
|
|
@@ -2497,6 +2501,8 @@ var JobsClient = class {
|
|
|
2497
2501
|
*
|
|
2498
2502
|
* 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.
|
|
2499
2503
|
|
|
2504
|
+
Marketplace-only bulk imports expose data.deferStoreSelection: true. For imports with automatic publishing enabled, inspect data.publishing for per-store results.
|
|
2505
|
+
|
|
2500
2506
|
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.
|
|
2501
2507
|
*
|
|
2502
2508
|
* `GET /api/v1/jobs/{jobId}`
|
|
@@ -3577,14 +3583,11 @@ var ProductsClient = class {
|
|
|
3577
3583
|
*
|
|
3578
3584
|
* Queue a bulk product import for the authenticated organization.
|
|
3579
3585
|
|
|
3580
|
-
|
|
3586
|
+
### Destinations
|
|
3581
3587
|
|
|
3582
|
-
|
|
3588
|
+
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.
|
|
3583
3589
|
|
|
3584
|
-
|
|
3585
|
-
- Send JSON with a `products` array of 1–5,000 flat product objects (8 MiB request maximum).
|
|
3586
|
-
- Send JSON with inline `csvText`.
|
|
3587
|
-
- Send
|
|
3590
|
+
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
|
|
3588
3591
|
*
|
|
3589
3592
|
* `POST /api/v1/products/bulk-import`
|
|
3590
3593
|
*/
|
|
@@ -3928,9 +3931,7 @@ var ProductsClient = class {
|
|
|
3928
3931
|
|
|
3929
3932
|
### Enrichment options
|
|
3930
3933
|
|
|
3931
|
-
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.
|
|
3932
|
-
|
|
3933
|
-
autoApplyHighConfidence defaults to false.
|
|
3934
|
+
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
|
|
3934
3935
|
*
|
|
3935
3936
|
* `POST /api/v1/products/enrich`
|
|
3936
3937
|
*/
|
|
@@ -3944,6 +3945,31 @@ var ProductsClient = class {
|
|
|
3944
3945
|
...mergeRequestOptions(requestOptions)
|
|
3945
3946
|
});
|
|
3946
3947
|
}
|
|
3948
|
+
/**
|
|
3949
|
+
* Assign Product Marketplace Stores
|
|
3950
|
+
*
|
|
3951
|
+
* 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.
|
|
3952
|
+
|
|
3953
|
+
### Store selection
|
|
3954
|
+
|
|
3955
|
+
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.
|
|
3956
|
+
|
|
3957
|
+
### Publish assigned stores
|
|
3958
|
+
|
|
3959
|
+
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.
|
|
3960
|
+
*
|
|
3961
|
+
* `POST /api/v1/products/marketplace-stores`
|
|
3962
|
+
*/
|
|
3963
|
+
assignMarketplaceStores(request, requestOptions) {
|
|
3964
|
+
const { ...body } = request ?? {};
|
|
3965
|
+
return this._http.request({
|
|
3966
|
+
method: "POST",
|
|
3967
|
+
path: "/api/v1/products/marketplace-stores",
|
|
3968
|
+
query: void 0,
|
|
3969
|
+
body,
|
|
3970
|
+
...mergeRequestOptions(requestOptions)
|
|
3971
|
+
});
|
|
3972
|
+
}
|
|
3947
3973
|
/** Read a bounded chunk without summary classification; persist progress to resume. */
|
|
3948
3974
|
scan(request = {}, options) {
|
|
3949
3975
|
return scanProducts(
|
|
@@ -5304,6 +5330,174 @@ var WebhooksClient = class {
|
|
|
5304
5330
|
});
|
|
5305
5331
|
}
|
|
5306
5332
|
};
|
|
5333
|
+
var WikiClient = class {
|
|
5334
|
+
constructor(_http) {
|
|
5335
|
+
__publicField(this, "_http", _http);
|
|
5336
|
+
}
|
|
5337
|
+
/**
|
|
5338
|
+
* Export Wiki
|
|
5339
|
+
*
|
|
5340
|
+
* 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.
|
|
5341
|
+
*
|
|
5342
|
+
* `GET /api/v1/wiki/export`
|
|
5343
|
+
*/
|
|
5344
|
+
exportPages(request = {}, requestOptions) {
|
|
5345
|
+
const { organizationId } = request ?? {};
|
|
5346
|
+
return this._http.request({
|
|
5347
|
+
method: "GET",
|
|
5348
|
+
path: "/api/v1/wiki/export",
|
|
5349
|
+
query: { organizationId },
|
|
5350
|
+
body: void 0,
|
|
5351
|
+
...mergeRequestOptions(requestOptions)
|
|
5352
|
+
});
|
|
5353
|
+
}
|
|
5354
|
+
/**
|
|
5355
|
+
* Import Wiki
|
|
5356
|
+
*
|
|
5357
|
+
* 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.
|
|
5358
|
+
|
|
5359
|
+
Definitions from older exports are imported into the page body.
|
|
5360
|
+
|
|
5361
|
+
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.
|
|
5362
|
+
*
|
|
5363
|
+
* `POST /api/v1/wiki/import`
|
|
5364
|
+
*/
|
|
5365
|
+
importPages(request, requestOptions) {
|
|
5366
|
+
const { ...body } = request ?? {};
|
|
5367
|
+
return this._http.request({
|
|
5368
|
+
method: "POST",
|
|
5369
|
+
path: "/api/v1/wiki/import",
|
|
5370
|
+
query: void 0,
|
|
5371
|
+
body,
|
|
5372
|
+
...mergeRequestOptions(requestOptions)
|
|
5373
|
+
});
|
|
5374
|
+
}
|
|
5375
|
+
/**
|
|
5376
|
+
* List Wiki Pages
|
|
5377
|
+
*
|
|
5378
|
+
* 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.
|
|
5379
|
+
*
|
|
5380
|
+
* `GET /api/v1/wiki/pages`
|
|
5381
|
+
*/
|
|
5382
|
+
listPages(request = {}, requestOptions) {
|
|
5383
|
+
const { organizationId, q, status, sort, limit, offset } = request ?? {};
|
|
5384
|
+
return this._http.request({
|
|
5385
|
+
method: "GET",
|
|
5386
|
+
path: "/api/v1/wiki/pages",
|
|
5387
|
+
query: { organizationId, q, status, sort, limit, offset },
|
|
5388
|
+
body: void 0,
|
|
5389
|
+
...mergeRequestOptions(requestOptions)
|
|
5390
|
+
});
|
|
5391
|
+
}
|
|
5392
|
+
/**
|
|
5393
|
+
* Create Wiki Page
|
|
5394
|
+
*
|
|
5395
|
+
* Create a wiki page. Requires documents:write. The page is saved directly; the approval card applies only to changes an agent proposes in chat.
|
|
5396
|
+
|
|
5397
|
+
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.
|
|
5398
|
+
*
|
|
5399
|
+
* `POST /api/v1/wiki/pages`
|
|
5400
|
+
*/
|
|
5401
|
+
createPage(request, requestOptions) {
|
|
5402
|
+
const { ...body } = request ?? {};
|
|
5403
|
+
return this._http.request({
|
|
5404
|
+
method: "POST",
|
|
5405
|
+
path: "/api/v1/wiki/pages",
|
|
5406
|
+
query: void 0,
|
|
5407
|
+
body,
|
|
5408
|
+
...mergeRequestOptions(requestOptions)
|
|
5409
|
+
});
|
|
5410
|
+
}
|
|
5411
|
+
/**
|
|
5412
|
+
* Archive Wiki Page
|
|
5413
|
+
*
|
|
5414
|
+
* 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.
|
|
5415
|
+
*
|
|
5416
|
+
* `DELETE /api/v1/wiki/pages/{pageId}`
|
|
5417
|
+
*/
|
|
5418
|
+
archivePage(request, requestOptions) {
|
|
5419
|
+
const { pageId, organizationId } = request ?? {};
|
|
5420
|
+
return this._http.request({
|
|
5421
|
+
method: "DELETE",
|
|
5422
|
+
path: `/api/v1/wiki/pages/${encodePathParam("pageId", pageId)}`,
|
|
5423
|
+
query: { organizationId },
|
|
5424
|
+
body: void 0,
|
|
5425
|
+
...mergeRequestOptions(requestOptions)
|
|
5426
|
+
});
|
|
5427
|
+
}
|
|
5428
|
+
/**
|
|
5429
|
+
* Get Wiki Page
|
|
5430
|
+
*
|
|
5431
|
+
* Read one page with its body, labels, linked pages and pages that link to it. Requires documents:read.
|
|
5432
|
+
*
|
|
5433
|
+
* `GET /api/v1/wiki/pages/{pageId}`
|
|
5434
|
+
*/
|
|
5435
|
+
getPage(request, requestOptions) {
|
|
5436
|
+
const { pageId, organizationId } = request ?? {};
|
|
5437
|
+
return this._http.request({
|
|
5438
|
+
method: "GET",
|
|
5439
|
+
path: `/api/v1/wiki/pages/${encodePathParam("pageId", pageId)}`,
|
|
5440
|
+
query: { organizationId },
|
|
5441
|
+
body: void 0,
|
|
5442
|
+
...mergeRequestOptions(requestOptions)
|
|
5443
|
+
});
|
|
5444
|
+
}
|
|
5445
|
+
/**
|
|
5446
|
+
* Update Wiki Page
|
|
5447
|
+
*
|
|
5448
|
+
* Save a new revision. Requires documents:write. Send only the fields that change; aliases and appliesTo replace the existing lists.
|
|
5449
|
+
|
|
5450
|
+
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.
|
|
5451
|
+
*
|
|
5452
|
+
* `PATCH /api/v1/wiki/pages/{pageId}`
|
|
5453
|
+
*/
|
|
5454
|
+
updatePage(request, requestOptions) {
|
|
5455
|
+
const { pageId, ...body } = request ?? {};
|
|
5456
|
+
return this._http.request({
|
|
5457
|
+
method: "PATCH",
|
|
5458
|
+
path: `/api/v1/wiki/pages/${encodePathParam("pageId", pageId)}`,
|
|
5459
|
+
query: void 0,
|
|
5460
|
+
body,
|
|
5461
|
+
...mergeRequestOptions(requestOptions)
|
|
5462
|
+
});
|
|
5463
|
+
}
|
|
5464
|
+
/**
|
|
5465
|
+
* List Wiki Page Revisions
|
|
5466
|
+
*
|
|
5467
|
+
* Every saved revision of a page, newest first, with author, origin and change summary. Requires documents:read.
|
|
5468
|
+
*
|
|
5469
|
+
* `GET /api/v1/wiki/pages/{pageId}/revisions`
|
|
5470
|
+
*/
|
|
5471
|
+
listRevisions(request, requestOptions) {
|
|
5472
|
+
const { pageId, organizationId } = request ?? {};
|
|
5473
|
+
return this._http.request({
|
|
5474
|
+
method: "GET",
|
|
5475
|
+
path: `/api/v1/wiki/pages/${encodePathParam("pageId", pageId)}/revisions`,
|
|
5476
|
+
query: { organizationId },
|
|
5477
|
+
body: void 0,
|
|
5478
|
+
...mergeRequestOptions(requestOptions)
|
|
5479
|
+
});
|
|
5480
|
+
}
|
|
5481
|
+
/**
|
|
5482
|
+
* Search Wiki
|
|
5483
|
+
*
|
|
5484
|
+
* Search the wiki and return the best-matching fragments, the same search agents use. Requires documents:read.
|
|
5485
|
+
|
|
5486
|
+
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.
|
|
5487
|
+
*
|
|
5488
|
+
* `POST /api/v1/wiki/search`
|
|
5489
|
+
*/
|
|
5490
|
+
search(request, requestOptions) {
|
|
5491
|
+
const { ...body } = request ?? {};
|
|
5492
|
+
return this._http.request({
|
|
5493
|
+
method: "POST",
|
|
5494
|
+
path: "/api/v1/wiki/search",
|
|
5495
|
+
query: void 0,
|
|
5496
|
+
body,
|
|
5497
|
+
...mergeRequestOptions(requestOptions)
|
|
5498
|
+
});
|
|
5499
|
+
}
|
|
5500
|
+
};
|
|
5307
5501
|
var ZaloraClient = class {
|
|
5308
5502
|
constructor(_http) {
|
|
5309
5503
|
__publicField(this, "_http", _http);
|
|
@@ -5395,6 +5589,7 @@ var OmniGeneratedClient = class {
|
|
|
5395
5589
|
__publicField(this, "ucp");
|
|
5396
5590
|
__publicField(this, "webhookEvents");
|
|
5397
5591
|
__publicField(this, "webhooks");
|
|
5592
|
+
__publicField(this, "wiki");
|
|
5398
5593
|
__publicField(this, "zalora");
|
|
5399
5594
|
this.agents = new AgentsClient(this._http);
|
|
5400
5595
|
this.analytics = new AnalyticsClient(this._http);
|
|
@@ -5437,6 +5632,7 @@ var OmniGeneratedClient = class {
|
|
|
5437
5632
|
this.ucp = new UcpClient(this._http);
|
|
5438
5633
|
this.webhookEvents = new WebhookEventsClient(this._http);
|
|
5439
5634
|
this.webhooks = new WebhooksClient(this._http);
|
|
5635
|
+
this.wiki = new WikiClient(this._http);
|
|
5440
5636
|
this.zalora = new ZaloraClient(this._http);
|
|
5441
5637
|
}
|
|
5442
5638
|
};
|