@omni-commerce/sdk 0.26.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/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @omni-commerce/sdk
2
2
 
3
+ SDK 0.27.0 adds `email.listAccounts`, `email.search`, `email.getMessage` and `email.createDraft` for your own connected Gmail or Outlook mailbox (`email:read`, drafts `email:write`). They need a credential that acts for you; nothing is sent.
4
+
3
5
  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
6
 
5
7
  SDK 0.25.0 supports marketplace-only bulk import and enrichment, later store assignment with `products.assignMarketplaceStores`, and publishing to those exact stores.
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.26.0";
38
+ var SDK_VERSION = "0.27.0";
39
39
  var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
40
40
 
41
41
  // src/environments.ts
@@ -712,7 +712,7 @@ var AgentsGeneralClient = class {
712
712
  *
713
713
  * Run the general Omni agent and wait until it completes, pauses for approval, or fails. Requires `agents:invoke`.
714
714
 
715
- 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.
715
+ 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.
716
716
  *
717
717
  * `POST /api/v1/agents/general/invoke`
718
718
  */
@@ -768,18 +768,36 @@ var AgentsClient = class {
768
768
  this.general = new AgentsGeneralClient(this._http);
769
769
  }
770
770
  /**
771
- * Send a message to an agent
771
+ * Invoke a saved agent
772
772
  *
773
- * Message the exact built-in or custom agent in the URL, using its saved model, instructions, tools, permissions and Programmatic starting mode.
773
+ * 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.
774
774
 
775
- ### Authentication
776
- 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`.
775
+ 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.
776
+
777
+ 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,
778
+ *
779
+ * `POST /api/v1/agents/{agentId}/invoke`
780
+ */
781
+ invoke(request, requestOptions) {
782
+ const { agentId, ...body } = request ?? {};
783
+ return this._http.request({
784
+ method: "POST",
785
+ path: `/api/v1/agents/${encodePathParam("agentId", agentId)}/invoke`,
786
+ query: void 0,
787
+ body,
788
+ ...mergeRequestOptions(requestOptions)
789
+ });
790
+ }
791
+ /**
792
+ * Invoke a saved agent (alias)
793
+ *
794
+ * Alias of /agents/{agentId}/invoke with the identical request and response. Prefer /invoke.
795
+
796
+ 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.
797
+
798
+ 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.
777
799
 
778
- ### Conversation and execution
779
- - The same caller, agent and `clientThreadKey` continue one conversation. Different callers, agents and organizations are isolated.
780
- - No model, prompt or tool overrides are accepted.
781
- - `wait=false` queues durable work and returns 202; `wait=true` returns the final reply or pending approvals.
782
- - Send `decisions` with the same `cli
800
+ 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
783
801
  *
784
802
  * `POST /api/v1/agents/{agentId}/messages`
785
803
  */
@@ -794,9 +812,32 @@ var AgentsClient = class {
794
812
  });
795
813
  }
796
814
  /**
797
- * Get an agent message run
815
+ * Start a saved agent run
816
+ *
817
+ * Queue durable execution using the identical invocation contract. Poll Location, honoring Retry-After.
818
+
819
+ 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.
820
+
821
+ 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.
822
+
823
+ 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
824
+ *
825
+ * `POST /api/v1/agents/{agentId}/runs`
826
+ */
827
+ runs(request, requestOptions) {
828
+ const { agentId, ...body } = request ?? {};
829
+ return this._http.request({
830
+ method: "POST",
831
+ path: `/api/v1/agents/${encodePathParam("agentId", agentId)}/runs`,
832
+ query: void 0,
833
+ body,
834
+ ...mergeRequestOptions(requestOptions)
835
+ });
836
+ }
837
+ /**
838
+ * Get a saved agent run
798
839
  *
799
- * 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.
840
+ * Read the canonical run resource. Organization, caller, credential and exact agent access are checked again. Requires agents:invoke.
800
841
  *
801
842
  * `GET /api/v1/agents/{agentId}/runs/{runId}`
802
843
  */
@@ -2302,6 +2343,113 @@ var DocumentsClient = class {
2302
2343
  });
2303
2344
  }
2304
2345
  };
2346
+ var EmailClient = class {
2347
+ constructor(_http) {
2348
+ __publicField(this, "_http", _http);
2349
+ }
2350
+ /**
2351
+ * List Email Accounts
2352
+ *
2353
+ * Your connected Gmail and Outlook accounts, default first. Pass an account's `connectionId` to the other email endpoints to choose it.
2354
+
2355
+ ### Authorization
2356
+
2357
+ 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.
2358
+ *
2359
+ * `GET /api/v1/email/accounts`
2360
+ */
2361
+ listAccounts(request = {}, requestOptions) {
2362
+ const { organizationId } = request ?? {};
2363
+ return this._http.request({
2364
+ method: "GET",
2365
+ path: "/api/v1/email/accounts",
2366
+ query: { organizationId },
2367
+ body: void 0,
2368
+ ...mergeRequestOptions(requestOptions)
2369
+ });
2370
+ }
2371
+ /**
2372
+ * Create Email Draft
2373
+ *
2374
+ * 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.
2375
+
2376
+ 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.
2377
+
2378
+ ### Authorization
2379
+
2380
+ 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.
2381
+ *
2382
+ * `POST /api/v1/email/drafts`
2383
+ */
2384
+ createDraft(request, requestOptions) {
2385
+ const { ...body } = request ?? {};
2386
+ return this._http.request({
2387
+ method: "POST",
2388
+ path: "/api/v1/email/drafts",
2389
+ query: void 0,
2390
+ body,
2391
+ ...mergeRequestOptions(requestOptions)
2392
+ });
2393
+ }
2394
+ /**
2395
+ * Get Email Message
2396
+ *
2397
+ * 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.
2398
+
2399
+ ### Authorization
2400
+
2401
+ 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.
2402
+ *
2403
+ * `GET /api/v1/email/messages/{messageId}`
2404
+ */
2405
+ getMessage(request, requestOptions) {
2406
+ const { messageId, connectionId, organizationId } = request ?? {};
2407
+ return this._http.request({
2408
+ method: "GET",
2409
+ path: `/api/v1/email/messages/${encodePathParam("messageId", messageId)}`,
2410
+ query: { connectionId, organizationId },
2411
+ body: void 0,
2412
+ ...mergeRequestOptions(requestOptions)
2413
+ });
2414
+ }
2415
+ /**
2416
+ * Search Emails
2417
+ *
2418
+ * 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.
2419
+
2420
+ 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.
2421
+
2422
+ ### Authorization
2423
+
2424
+ 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.
2425
+ *
2426
+ * `GET /api/v1/email/search`
2427
+ */
2428
+ search(request = {}, requestOptions) {
2429
+ const {
2430
+ query,
2431
+ connectionId,
2432
+ maxResults,
2433
+ pageToken,
2434
+ readState,
2435
+ organizationId
2436
+ } = request ?? {};
2437
+ return this._http.request({
2438
+ method: "GET",
2439
+ path: "/api/v1/email/search",
2440
+ query: {
2441
+ query,
2442
+ connectionId,
2443
+ maxResults,
2444
+ pageToken,
2445
+ readState,
2446
+ organizationId
2447
+ },
2448
+ body: void 0,
2449
+ ...mergeRequestOptions(requestOptions)
2450
+ });
2451
+ }
2452
+ };
2305
2453
  var EvaluateClient = class {
2306
2454
  constructor(_http) {
2307
2455
  __publicField(this, "_http", _http);
@@ -5564,6 +5712,7 @@ var OmniGeneratedClient = class {
5564
5712
  __publicField(this, "compare");
5565
5713
  __publicField(this, "directory");
5566
5714
  __publicField(this, "documents");
5715
+ __publicField(this, "email");
5567
5716
  __publicField(this, "evaluate");
5568
5717
  __publicField(this, "feed");
5569
5718
  __publicField(this, "followUps");
@@ -5607,6 +5756,7 @@ var OmniGeneratedClient = class {
5607
5756
  this.compare = new CompareClient(this._http);
5608
5757
  this.directory = new DirectoryClient(this._http);
5609
5758
  this.documents = new DocumentsClient(this._http);
5759
+ this.email = new EmailClient(this._http);
5610
5760
  this.evaluate = new EvaluateClient(this._http);
5611
5761
  this.feed = new FeedClient(this._http);
5612
5762
  this.followUps = new FollowUpsClient(this._http);