@omni-commerce/sdk 0.25.0 → 0.27.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/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.25.0";
36
+ var SDK_VERSION = "0.27.0";
37
37
  var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
38
38
 
39
39
  // src/environments.ts
@@ -710,7 +710,7 @@ var AgentsGeneralClient = class {
710
710
  *
711
711
  * Run the general Omni agent and wait until it completes, pauses for approval, or fails. Requires `agents:invoke`.
712
712
 
713
- A waiting call can take several minutes; raise the client timeout. Send `decisions` with the same `thread_id` to approve or reject a paused run. Omit `config.enabled_tools` to use the organization's agent tools. Attach images on the latest user message as `{ type: "image", url }` HTTP(S) URLs.
713
+ A waiting call can take several minutes; raise the client timeout. Send `decisions` with the same `thread_id` to approve or reject a paused run. Omit `config.enabled_tools` to use the organization's agent tools. Send only new messages on each turn; thread_id continues the conversation stored in Omni sessions and checkpoints. Omit thread_id for a new conversation. Optional message IDs use native LangGraph replacement semantics, not run idempotency. audience=customer restricts tools to public storefront access without establishing a verified customer identity. Attach images on the latest user message as `{ type: "image", url }` HTTP(S) URLs.
714
714
  *
715
715
  * `POST /api/v1/agents/general/invoke`
716
716
  */
@@ -766,18 +766,36 @@ var AgentsClient = class {
766
766
  this.general = new AgentsGeneralClient(this._http);
767
767
  }
768
768
  /**
769
- * Send a message to an agent
769
+ * Invoke a saved agent
770
770
  *
771
- * Message the exact built-in or custom agent in the URL, using its saved model, instructions, tools, permissions and Programmatic starting mode.
771
+ * Invoke the exact built-in or custom agent in the URL using its saved configuration and Programmatic starting mode. Uses the same invocation request and run response as the general agent and MCP.
772
772
 
773
- ### Authentication
774
- Requires an API key with `agents:invoke`, or a sign-in session. Organization-owned keys use their recorded creator's current membership and agent access; keys without a valid owner are refused. API keys identify their organization; session requests include `organizationId`.
773
+ Requires agents:invoke and current organization membership and agent access. Organization-owned keys use their recorded creator; no alternate organization member is substituted. Session requests include organizationId.
775
774
 
776
- ### Conversation and execution
777
- - The same caller, agent and `clientThreadKey` continue one conversation. Different callers, agents and organizations are isolated.
778
- - No model, prompt or tool overrides are accepted.
779
- - `wait=false` queues durable work and returns 202; `wait=true` returns the final reply or pending approvals.
780
- - Send `decisions` with the same `cli
775
+ Send one or more new messages (at most 50 and 100000 text characters) ending with a user message. Omit thread_id to create a conversation, or reuse the returned thread_id to continue its stored history. An initial batch can import external history, including human replies. Do not resend history on subsequent turns. Optional message IDs follow native LangGraph replacement semantics,
776
+ *
777
+ * `POST /api/v1/agents/{agentId}/invoke`
778
+ */
779
+ invoke(request, requestOptions) {
780
+ const { agentId, ...body } = request ?? {};
781
+ return this._http.request({
782
+ method: "POST",
783
+ path: `/api/v1/agents/${encodePathParam("agentId", agentId)}/invoke`,
784
+ query: void 0,
785
+ body,
786
+ ...mergeRequestOptions(requestOptions)
787
+ });
788
+ }
789
+ /**
790
+ * Invoke a saved agent (alias)
791
+ *
792
+ * Alias of /agents/{agentId}/invoke with the identical request and response. Prefer /invoke.
793
+
794
+ Invoke the exact built-in or custom agent in the URL using its saved configuration and Programmatic starting mode. Uses the same invocation request and run response as the general agent and MCP.
795
+
796
+ Requires agents:invoke and current organization membership and agent access. Organization-owned keys use their recorded creator; no alternate organization member is substituted. Session requests include organizationId.
797
+
798
+ Send one or more new messages (at most 50 and 100000 text characters) ending with a user message. Omit thread_id to create a conversation, or reuse the returned thread_id to continue its stored history. An initial batch can import external history, including human replies. Do not resend hist
781
799
  *
782
800
  * `POST /api/v1/agents/{agentId}/messages`
783
801
  */
@@ -792,9 +810,32 @@ var AgentsClient = class {
792
810
  });
793
811
  }
794
812
  /**
795
- * Get an agent message run
813
+ * Start a saved agent run
814
+ *
815
+ * Queue durable execution using the identical invocation contract. Poll Location, honoring Retry-After.
816
+
817
+ Invoke the exact built-in or custom agent in the URL using its saved configuration and Programmatic starting mode. Uses the same invocation request and run response as the general agent and MCP.
818
+
819
+ Requires agents:invoke and current organization membership and agent access. Organization-owned keys use their recorded creator; no alternate organization member is substituted. Session requests include organizationId.
820
+
821
+ Send one or more new messages (at most 50 and 100000 text characters) ending with a user message. Omit thread_id to create a conversation, or reuse the returned thread_id to continue its stored history. An initial batch can import external history, including human replies. Do not
822
+ *
823
+ * `POST /api/v1/agents/{agentId}/runs`
824
+ */
825
+ runs(request, requestOptions) {
826
+ const { agentId, ...body } = request ?? {};
827
+ return this._http.request({
828
+ method: "POST",
829
+ path: `/api/v1/agents/${encodePathParam("agentId", agentId)}/runs`,
830
+ query: void 0,
831
+ body,
832
+ ...mergeRequestOptions(requestOptions)
833
+ });
834
+ }
835
+ /**
836
+ * Get a saved agent run
796
837
  *
797
- * Read an agent message run belonging to the authenticated caller and the exact agent in the URL. Current organization membership and agent sharing are checked again. Requires agents:invoke.
838
+ * Read the canonical run resource. Organization, caller, credential and exact agent access are checked again. Requires agents:invoke.
798
839
  *
799
840
  * `GET /api/v1/agents/{agentId}/runs/{runId}`
800
841
  */
@@ -927,7 +968,11 @@ var AnalyticsClient = class {
927
968
  /**
928
969
  * Get Order Analytics
929
970
  *
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. Matches the Orders analysis page. Requires `analytics:read`.
971
+ * 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.
972
+
973
+ ### Order attribution
974
+
975
+ `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
976
 
932
977
  Amounts are in `data.filters.currency`. Only orders in that currency are counted; nothing is converted. A range covers at most 366 days.
933
978
  *
@@ -2262,7 +2307,7 @@ var DocumentsClient = class {
2262
2307
  *
2263
2308
  * Upload one file to the knowledge base as multipart/form-data. Requires `documents:write`.
2264
2309
 
2265
- Accepted: PDF up to 20 MB, Word (.docx) and PowerPoint (.pptx) up to 20 MB, Excel (.xlsx/.xlsm) up to 10 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.
2310
+ 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
2311
  *
2267
2312
  * `POST /api/v1/documents`
2268
2313
  */
@@ -2296,6 +2341,113 @@ var DocumentsClient = class {
2296
2341
  });
2297
2342
  }
2298
2343
  };
2344
+ var EmailClient = class {
2345
+ constructor(_http) {
2346
+ __publicField(this, "_http", _http);
2347
+ }
2348
+ /**
2349
+ * List Email Accounts
2350
+ *
2351
+ * Your connected Gmail and Outlook accounts, default first. Pass an account's `connectionId` to the other email endpoints to choose it.
2352
+
2353
+ ### Authorization
2354
+
2355
+ 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.
2356
+ *
2357
+ * `GET /api/v1/email/accounts`
2358
+ */
2359
+ listAccounts(request = {}, requestOptions) {
2360
+ const { organizationId } = request ?? {};
2361
+ return this._http.request({
2362
+ method: "GET",
2363
+ path: "/api/v1/email/accounts",
2364
+ query: { organizationId },
2365
+ body: void 0,
2366
+ ...mergeRequestOptions(requestOptions)
2367
+ });
2368
+ }
2369
+ /**
2370
+ * Create Email Draft
2371
+ *
2372
+ * Save a draft in your mailbox; nothing is sent. Pass `replyToMessageId` (and `threadId`) from Search Emails to draft a reply in its conversation. Review and send it from Gmail or Outlook.
2373
+
2374
+ When the provider saved a draft whose threading could not be verified, the request fails with `unverifiedDraftId` in `data` so you can find or discard it.
2375
+
2376
+ ### Authorization
2377
+
2378
+ Requires `email:write` 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.
2379
+ *
2380
+ * `POST /api/v1/email/drafts`
2381
+ */
2382
+ createDraft(request, requestOptions) {
2383
+ const { ...body } = request ?? {};
2384
+ return this._http.request({
2385
+ method: "POST",
2386
+ path: "/api/v1/email/drafts",
2387
+ query: void 0,
2388
+ body,
2389
+ ...mergeRequestOptions(requestOptions)
2390
+ });
2391
+ }
2392
+ /**
2393
+ * Get Email Message
2394
+ *
2395
+ * One message from your mailbox: headers, plain-text body (at most 12,000 characters) and attachment metadata. Use a message `id` from Search Emails; encode it as one path segment.
2396
+
2397
+ ### Authorization
2398
+
2399
+ 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.
2400
+ *
2401
+ * `GET /api/v1/email/messages/{messageId}`
2402
+ */
2403
+ getMessage(request, requestOptions) {
2404
+ const { messageId, connectionId, organizationId } = request ?? {};
2405
+ return this._http.request({
2406
+ method: "GET",
2407
+ path: `/api/v1/email/messages/${encodePathParam("messageId", messageId)}`,
2408
+ query: { connectionId, organizationId },
2409
+ body: void 0,
2410
+ ...mergeRequestOptions(requestOptions)
2411
+ });
2412
+ }
2413
+ /**
2414
+ * Search Emails
2415
+ *
2416
+ * One page of message summaries (subject, from, to, date, snippet, read and draft state) from your mailbox. Gmail accepts its search operators (`from:`, `subject:`, `newer_than:`); Outlook takes free text.
2417
+
2418
+ Pass `nextPageToken` back as `pageToken` with the same mailbox, query, `readState` and `maxResults` until it is null; a token is refused with different search arguments. `readState=unread` filters unread messages, which is not the same as unreplied.
2419
+
2420
+ ### Authorization
2421
+
2422
+ 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.
2423
+ *
2424
+ * `GET /api/v1/email/search`
2425
+ */
2426
+ search(request = {}, requestOptions) {
2427
+ const {
2428
+ query,
2429
+ connectionId,
2430
+ maxResults,
2431
+ pageToken,
2432
+ readState,
2433
+ organizationId
2434
+ } = request ?? {};
2435
+ return this._http.request({
2436
+ method: "GET",
2437
+ path: "/api/v1/email/search",
2438
+ query: {
2439
+ query,
2440
+ connectionId,
2441
+ maxResults,
2442
+ pageToken,
2443
+ readState,
2444
+ organizationId
2445
+ },
2446
+ body: void 0,
2447
+ ...mergeRequestOptions(requestOptions)
2448
+ });
2449
+ }
2450
+ };
2299
2451
  var EvaluateClient = class {
2300
2452
  constructor(_http) {
2301
2453
  __publicField(this, "_http", _http);
@@ -5326,6 +5478,174 @@ var WebhooksClient = class {
5326
5478
  });
5327
5479
  }
5328
5480
  };
5481
+ var WikiClient = class {
5482
+ constructor(_http) {
5483
+ __publicField(this, "_http", _http);
5484
+ }
5485
+ /**
5486
+ * Export Wiki
5487
+ *
5488
+ * 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.
5489
+ *
5490
+ * `GET /api/v1/wiki/export`
5491
+ */
5492
+ exportPages(request = {}, requestOptions) {
5493
+ const { organizationId } = request ?? {};
5494
+ return this._http.request({
5495
+ method: "GET",
5496
+ path: "/api/v1/wiki/export",
5497
+ query: { organizationId },
5498
+ body: void 0,
5499
+ ...mergeRequestOptions(requestOptions)
5500
+ });
5501
+ }
5502
+ /**
5503
+ * Import Wiki
5504
+ *
5505
+ * 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.
5506
+
5507
+ Definitions from older exports are imported into the page body.
5508
+
5509
+ 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.
5510
+ *
5511
+ * `POST /api/v1/wiki/import`
5512
+ */
5513
+ importPages(request, requestOptions) {
5514
+ const { ...body } = request ?? {};
5515
+ return this._http.request({
5516
+ method: "POST",
5517
+ path: "/api/v1/wiki/import",
5518
+ query: void 0,
5519
+ body,
5520
+ ...mergeRequestOptions(requestOptions)
5521
+ });
5522
+ }
5523
+ /**
5524
+ * List Wiki Pages
5525
+ *
5526
+ * 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.
5527
+ *
5528
+ * `GET /api/v1/wiki/pages`
5529
+ */
5530
+ listPages(request = {}, requestOptions) {
5531
+ const { organizationId, q, status, sort, limit, offset } = request ?? {};
5532
+ return this._http.request({
5533
+ method: "GET",
5534
+ path: "/api/v1/wiki/pages",
5535
+ query: { organizationId, q, status, sort, limit, offset },
5536
+ body: void 0,
5537
+ ...mergeRequestOptions(requestOptions)
5538
+ });
5539
+ }
5540
+ /**
5541
+ * Create Wiki Page
5542
+ *
5543
+ * Create a wiki page. Requires documents:write. The page is saved directly; the approval card applies only to changes an agent proposes in chat.
5544
+
5545
+ 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.
5546
+ *
5547
+ * `POST /api/v1/wiki/pages`
5548
+ */
5549
+ createPage(request, requestOptions) {
5550
+ const { ...body } = request ?? {};
5551
+ return this._http.request({
5552
+ method: "POST",
5553
+ path: "/api/v1/wiki/pages",
5554
+ query: void 0,
5555
+ body,
5556
+ ...mergeRequestOptions(requestOptions)
5557
+ });
5558
+ }
5559
+ /**
5560
+ * Archive Wiki Page
5561
+ *
5562
+ * 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.
5563
+ *
5564
+ * `DELETE /api/v1/wiki/pages/{pageId}`
5565
+ */
5566
+ archivePage(request, requestOptions) {
5567
+ const { pageId, organizationId } = request ?? {};
5568
+ return this._http.request({
5569
+ method: "DELETE",
5570
+ path: `/api/v1/wiki/pages/${encodePathParam("pageId", pageId)}`,
5571
+ query: { organizationId },
5572
+ body: void 0,
5573
+ ...mergeRequestOptions(requestOptions)
5574
+ });
5575
+ }
5576
+ /**
5577
+ * Get Wiki Page
5578
+ *
5579
+ * Read one page with its body, labels, linked pages and pages that link to it. Requires documents:read.
5580
+ *
5581
+ * `GET /api/v1/wiki/pages/{pageId}`
5582
+ */
5583
+ getPage(request, requestOptions) {
5584
+ const { pageId, organizationId } = request ?? {};
5585
+ return this._http.request({
5586
+ method: "GET",
5587
+ path: `/api/v1/wiki/pages/${encodePathParam("pageId", pageId)}`,
5588
+ query: { organizationId },
5589
+ body: void 0,
5590
+ ...mergeRequestOptions(requestOptions)
5591
+ });
5592
+ }
5593
+ /**
5594
+ * Update Wiki Page
5595
+ *
5596
+ * Save a new revision. Requires documents:write. Send only the fields that change; aliases and appliesTo replace the existing lists.
5597
+
5598
+ 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.
5599
+ *
5600
+ * `PATCH /api/v1/wiki/pages/{pageId}`
5601
+ */
5602
+ updatePage(request, requestOptions) {
5603
+ const { pageId, ...body } = request ?? {};
5604
+ return this._http.request({
5605
+ method: "PATCH",
5606
+ path: `/api/v1/wiki/pages/${encodePathParam("pageId", pageId)}`,
5607
+ query: void 0,
5608
+ body,
5609
+ ...mergeRequestOptions(requestOptions)
5610
+ });
5611
+ }
5612
+ /**
5613
+ * List Wiki Page Revisions
5614
+ *
5615
+ * Every saved revision of a page, newest first, with author, origin and change summary. Requires documents:read.
5616
+ *
5617
+ * `GET /api/v1/wiki/pages/{pageId}/revisions`
5618
+ */
5619
+ listRevisions(request, requestOptions) {
5620
+ const { pageId, organizationId } = request ?? {};
5621
+ return this._http.request({
5622
+ method: "GET",
5623
+ path: `/api/v1/wiki/pages/${encodePathParam("pageId", pageId)}/revisions`,
5624
+ query: { organizationId },
5625
+ body: void 0,
5626
+ ...mergeRequestOptions(requestOptions)
5627
+ });
5628
+ }
5629
+ /**
5630
+ * Search Wiki
5631
+ *
5632
+ * Search the wiki and return the best-matching fragments, the same search agents use. Requires documents:read.
5633
+
5634
+ 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.
5635
+ *
5636
+ * `POST /api/v1/wiki/search`
5637
+ */
5638
+ search(request, requestOptions) {
5639
+ const { ...body } = request ?? {};
5640
+ return this._http.request({
5641
+ method: "POST",
5642
+ path: "/api/v1/wiki/search",
5643
+ query: void 0,
5644
+ body,
5645
+ ...mergeRequestOptions(requestOptions)
5646
+ });
5647
+ }
5648
+ };
5329
5649
  var ZaloraClient = class {
5330
5650
  constructor(_http) {
5331
5651
  __publicField(this, "_http", _http);
@@ -5390,6 +5710,7 @@ var OmniGeneratedClient = class {
5390
5710
  __publicField(this, "compare");
5391
5711
  __publicField(this, "directory");
5392
5712
  __publicField(this, "documents");
5713
+ __publicField(this, "email");
5393
5714
  __publicField(this, "evaluate");
5394
5715
  __publicField(this, "feed");
5395
5716
  __publicField(this, "followUps");
@@ -5417,6 +5738,7 @@ var OmniGeneratedClient = class {
5417
5738
  __publicField(this, "ucp");
5418
5739
  __publicField(this, "webhookEvents");
5419
5740
  __publicField(this, "webhooks");
5741
+ __publicField(this, "wiki");
5420
5742
  __publicField(this, "zalora");
5421
5743
  this.agents = new AgentsClient(this._http);
5422
5744
  this.analytics = new AnalyticsClient(this._http);
@@ -5432,6 +5754,7 @@ var OmniGeneratedClient = class {
5432
5754
  this.compare = new CompareClient(this._http);
5433
5755
  this.directory = new DirectoryClient(this._http);
5434
5756
  this.documents = new DocumentsClient(this._http);
5757
+ this.email = new EmailClient(this._http);
5435
5758
  this.evaluate = new EvaluateClient(this._http);
5436
5759
  this.feed = new FeedClient(this._http);
5437
5760
  this.followUps = new FollowUpsClient(this._http);
@@ -5459,6 +5782,7 @@ var OmniGeneratedClient = class {
5459
5782
  this.ucp = new UcpClient(this._http);
5460
5783
  this.webhookEvents = new WebhookEventsClient(this._http);
5461
5784
  this.webhooks = new WebhooksClient(this._http);
5785
+ this.wiki = new WikiClient(this._http);
5462
5786
  this.zalora = new ZaloraClient(this._http);
5463
5787
  }
5464
5788
  };