@omni-commerce/sdk 0.26.0 → 0.28.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 +164 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +915 -135
- package/dist/index.d.ts +915 -135
- package/dist/index.js +164 -21
- 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.28.0";
|
|
37
37
|
var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
|
|
38
38
|
|
|
39
39
|
// src/environments.ts
|
|
@@ -710,7 +710,13 @@ 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
|
-
|
|
713
|
+
### Waiting and approvals
|
|
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.
|
|
716
|
+
|
|
717
|
+
### Messages and tools
|
|
718
|
+
|
|
719
|
+
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 }`
|
|
714
720
|
*
|
|
715
721
|
* `POST /api/v1/agents/general/invoke`
|
|
716
722
|
*/
|
|
@@ -766,35 +772,61 @@ var AgentsClient = class {
|
|
|
766
772
|
this.general = new AgentsGeneralClient(this._http);
|
|
767
773
|
}
|
|
768
774
|
/**
|
|
769
|
-
*
|
|
775
|
+
* Invoke a saved agent
|
|
770
776
|
*
|
|
771
|
-
*
|
|
777
|
+
* 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
778
|
|
|
773
|
-
###
|
|
774
|
-
|
|
779
|
+
### Authorization
|
|
780
|
+
|
|
781
|
+
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.
|
|
782
|
+
|
|
783
|
+
### Messages and conversation history
|
|
784
|
+
|
|
785
|
+
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
|
|
786
|
+
*
|
|
787
|
+
* `POST /api/v1/agents/{agentId}/invoke`
|
|
788
|
+
*/
|
|
789
|
+
invoke(request, requestOptions) {
|
|
790
|
+
const { agentId, ...body } = request ?? {};
|
|
791
|
+
return this._http.request({
|
|
792
|
+
method: "POST",
|
|
793
|
+
path: `/api/v1/agents/${encodePathParam("agentId", agentId)}/invoke`,
|
|
794
|
+
query: void 0,
|
|
795
|
+
body,
|
|
796
|
+
...mergeRequestOptions(requestOptions)
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
/**
|
|
800
|
+
* Start a saved agent run
|
|
801
|
+
*
|
|
802
|
+
* Queue durable execution using the identical invocation contract. Poll Location, honoring Retry-After.
|
|
803
|
+
|
|
804
|
+
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.
|
|
805
|
+
|
|
806
|
+
### Authorization
|
|
807
|
+
|
|
808
|
+
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
809
|
|
|
776
|
-
###
|
|
777
|
-
|
|
778
|
-
|
|
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
|
|
810
|
+
### Messages and conversation history
|
|
811
|
+
|
|
812
|
+
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
|
|
781
813
|
*
|
|
782
|
-
* `POST /api/v1/agents/{agentId}/
|
|
814
|
+
* `POST /api/v1/agents/{agentId}/runs`
|
|
783
815
|
*/
|
|
784
|
-
|
|
816
|
+
runs(request, requestOptions) {
|
|
785
817
|
const { agentId, ...body } = request ?? {};
|
|
786
818
|
return this._http.request({
|
|
787
819
|
method: "POST",
|
|
788
|
-
path: `/api/v1/agents/${encodePathParam("agentId", agentId)}/
|
|
820
|
+
path: `/api/v1/agents/${encodePathParam("agentId", agentId)}/runs`,
|
|
789
821
|
query: void 0,
|
|
790
822
|
body,
|
|
791
823
|
...mergeRequestOptions(requestOptions)
|
|
792
824
|
});
|
|
793
825
|
}
|
|
794
826
|
/**
|
|
795
|
-
* Get
|
|
827
|
+
* Get a saved agent run
|
|
796
828
|
*
|
|
797
|
-
* Read
|
|
829
|
+
* Read the canonical run resource. Organization, caller, credential and exact agent access are checked again. Requires agents:invoke.
|
|
798
830
|
*
|
|
799
831
|
* `GET /api/v1/agents/{agentId}/runs/{runId}`
|
|
800
832
|
*/
|
|
@@ -2300,6 +2332,113 @@ var DocumentsClient = class {
|
|
|
2300
2332
|
});
|
|
2301
2333
|
}
|
|
2302
2334
|
};
|
|
2335
|
+
var EmailClient = class {
|
|
2336
|
+
constructor(_http) {
|
|
2337
|
+
__publicField(this, "_http", _http);
|
|
2338
|
+
}
|
|
2339
|
+
/**
|
|
2340
|
+
* List Email Accounts
|
|
2341
|
+
*
|
|
2342
|
+
* Your connected Gmail and Outlook accounts, default first. Pass an account's `connectionId` to the other email endpoints to choose it.
|
|
2343
|
+
|
|
2344
|
+
### Authorization
|
|
2345
|
+
|
|
2346
|
+
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.
|
|
2347
|
+
*
|
|
2348
|
+
* `GET /api/v1/email/accounts`
|
|
2349
|
+
*/
|
|
2350
|
+
listAccounts(request = {}, requestOptions) {
|
|
2351
|
+
const { organizationId } = request ?? {};
|
|
2352
|
+
return this._http.request({
|
|
2353
|
+
method: "GET",
|
|
2354
|
+
path: "/api/v1/email/accounts",
|
|
2355
|
+
query: { organizationId },
|
|
2356
|
+
body: void 0,
|
|
2357
|
+
...mergeRequestOptions(requestOptions)
|
|
2358
|
+
});
|
|
2359
|
+
}
|
|
2360
|
+
/**
|
|
2361
|
+
* Create Email Draft
|
|
2362
|
+
*
|
|
2363
|
+
* 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.
|
|
2364
|
+
|
|
2365
|
+
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.
|
|
2366
|
+
|
|
2367
|
+
### Authorization
|
|
2368
|
+
|
|
2369
|
+
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.
|
|
2370
|
+
*
|
|
2371
|
+
* `POST /api/v1/email/drafts`
|
|
2372
|
+
*/
|
|
2373
|
+
createDraft(request, requestOptions) {
|
|
2374
|
+
const { ...body } = request ?? {};
|
|
2375
|
+
return this._http.request({
|
|
2376
|
+
method: "POST",
|
|
2377
|
+
path: "/api/v1/email/drafts",
|
|
2378
|
+
query: void 0,
|
|
2379
|
+
body,
|
|
2380
|
+
...mergeRequestOptions(requestOptions)
|
|
2381
|
+
});
|
|
2382
|
+
}
|
|
2383
|
+
/**
|
|
2384
|
+
* Get Email Message
|
|
2385
|
+
*
|
|
2386
|
+
* 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.
|
|
2387
|
+
|
|
2388
|
+
### Authorization
|
|
2389
|
+
|
|
2390
|
+
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.
|
|
2391
|
+
*
|
|
2392
|
+
* `GET /api/v1/email/messages/{messageId}`
|
|
2393
|
+
*/
|
|
2394
|
+
getMessage(request, requestOptions) {
|
|
2395
|
+
const { messageId, connectionId, organizationId } = request ?? {};
|
|
2396
|
+
return this._http.request({
|
|
2397
|
+
method: "GET",
|
|
2398
|
+
path: `/api/v1/email/messages/${encodePathParam("messageId", messageId)}`,
|
|
2399
|
+
query: { connectionId, organizationId },
|
|
2400
|
+
body: void 0,
|
|
2401
|
+
...mergeRequestOptions(requestOptions)
|
|
2402
|
+
});
|
|
2403
|
+
}
|
|
2404
|
+
/**
|
|
2405
|
+
* Search Emails
|
|
2406
|
+
*
|
|
2407
|
+
* 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.
|
|
2408
|
+
|
|
2409
|
+
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.
|
|
2410
|
+
|
|
2411
|
+
### Authorization
|
|
2412
|
+
|
|
2413
|
+
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.
|
|
2414
|
+
*
|
|
2415
|
+
* `GET /api/v1/email/search`
|
|
2416
|
+
*/
|
|
2417
|
+
search(request = {}, requestOptions) {
|
|
2418
|
+
const {
|
|
2419
|
+
query,
|
|
2420
|
+
connectionId,
|
|
2421
|
+
maxResults,
|
|
2422
|
+
pageToken,
|
|
2423
|
+
readState,
|
|
2424
|
+
organizationId
|
|
2425
|
+
} = request ?? {};
|
|
2426
|
+
return this._http.request({
|
|
2427
|
+
method: "GET",
|
|
2428
|
+
path: "/api/v1/email/search",
|
|
2429
|
+
query: {
|
|
2430
|
+
query,
|
|
2431
|
+
connectionId,
|
|
2432
|
+
maxResults,
|
|
2433
|
+
pageToken,
|
|
2434
|
+
readState,
|
|
2435
|
+
organizationId
|
|
2436
|
+
},
|
|
2437
|
+
body: void 0,
|
|
2438
|
+
...mergeRequestOptions(requestOptions)
|
|
2439
|
+
});
|
|
2440
|
+
}
|
|
2441
|
+
};
|
|
2303
2442
|
var EvaluateClient = class {
|
|
2304
2443
|
constructor(_http) {
|
|
2305
2444
|
__publicField(this, "_http", _http);
|
|
@@ -2809,7 +2948,8 @@ var OrdersClient = class {
|
|
|
2809
2948
|
dateFrom,
|
|
2810
2949
|
dateTo,
|
|
2811
2950
|
limit,
|
|
2812
|
-
offset
|
|
2951
|
+
offset,
|
|
2952
|
+
includeSummary
|
|
2813
2953
|
} = request ?? {};
|
|
2814
2954
|
return this._http.request({
|
|
2815
2955
|
method: "GET",
|
|
@@ -2826,7 +2966,8 @@ var OrdersClient = class {
|
|
|
2826
2966
|
dateFrom,
|
|
2827
2967
|
dateTo,
|
|
2828
2968
|
limit,
|
|
2829
|
-
offset
|
|
2969
|
+
offset,
|
|
2970
|
+
includeSummary
|
|
2830
2971
|
},
|
|
2831
2972
|
body: void 0,
|
|
2832
2973
|
...mergeRequestOptions(requestOptions)
|
|
@@ -2849,9 +2990,9 @@ var OrdersClient = class {
|
|
|
2849
2990
|
|
|
2850
2991
|
### Pricing and catalog defaults
|
|
2851
2992
|
|
|
2852
|
-
- Each line can provide `
|
|
2993
|
+
- Each line can provide `unitPrice`, `paidPrice`, and `costPrice`.
|
|
2853
2994
|
- When `productId` is provided, missing price or currency values may resolve from the product catalog.
|
|
2854
|
-
- An explicit `costPrice` updates `product_data.costPrice` and is
|
|
2995
|
+
- An explicit `costPrice` updates `product_data.costPrice` and is snapshotted on
|
|
2855
2996
|
*
|
|
2856
2997
|
* `POST /api/v1/orders`
|
|
2857
2998
|
*/
|
|
@@ -3587,7 +3728,7 @@ var ProductsClient = class {
|
|
|
3587
3728
|
|
|
3588
3729
|
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.
|
|
3589
3730
|
|
|
3590
|
-
Supply explicit SKU options in each row's `variationAttributes` and native marketplace attributes in `marketplaceAttributes`.
|
|
3731
|
+
Supply explicit SKU options in each row's `variationAttributes` and native marketplace attributes in `marketplaceAttributes`. Taxonomy enrichment can propose missing required sale attributes in its existing attribute request when supported by product evidence. Supplied values take precedence. At Zalora publish time, a missing required
|
|
3591
3732
|
*
|
|
3592
3733
|
* `POST /api/v1/products/bulk-import`
|
|
3593
3734
|
*/
|
|
@@ -5562,6 +5703,7 @@ var OmniGeneratedClient = class {
|
|
|
5562
5703
|
__publicField(this, "compare");
|
|
5563
5704
|
__publicField(this, "directory");
|
|
5564
5705
|
__publicField(this, "documents");
|
|
5706
|
+
__publicField(this, "email");
|
|
5565
5707
|
__publicField(this, "evaluate");
|
|
5566
5708
|
__publicField(this, "feed");
|
|
5567
5709
|
__publicField(this, "followUps");
|
|
@@ -5605,6 +5747,7 @@ var OmniGeneratedClient = class {
|
|
|
5605
5747
|
this.compare = new CompareClient(this._http);
|
|
5606
5748
|
this.directory = new DirectoryClient(this._http);
|
|
5607
5749
|
this.documents = new DocumentsClient(this._http);
|
|
5750
|
+
this.email = new EmailClient(this._http);
|
|
5608
5751
|
this.evaluate = new EvaluateClient(this._http);
|
|
5609
5752
|
this.feed = new FeedClient(this._http);
|
|
5610
5753
|
this.followUps = new FollowUpsClient(this._http);
|