@omni-commerce/sdk 0.17.0 → 0.18.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.17.0";
36
+ var SDK_VERSION = "0.18.0";
37
37
  var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
38
38
 
39
39
  // src/environments.ts
@@ -1276,6 +1276,86 @@ var AopClient = class {
1276
1276
  });
1277
1277
  }
1278
1278
  };
1279
+ var ApiClient = class {
1280
+ constructor(_http) {
1281
+ __publicField(this, "_http", _http);
1282
+ }
1283
+ /**
1284
+ * Discover a published merchant agent
1285
+ *
1286
+ * A2A 1.0 Agent Card for any configured agent published to a customer deployment. Private model settings, prompts and publisher identity are excluded.
1287
+ *
1288
+ * `GET /api/embed/{deploymentId}/.well-known/agent-card.json`
1289
+ */
1290
+ getEmbedwellKnownagentCardJson(request, requestOptions) {
1291
+ const { deploymentId } = request ?? {};
1292
+ return this._http.request({
1293
+ method: "GET",
1294
+ path: `/api/embed/${encodePathParam("deploymentId", deploymentId)}/.well-known/agent-card.json`,
1295
+ query: void 0,
1296
+ body: void 0,
1297
+ ...mergeRequestOptions(requestOptions)
1298
+ });
1299
+ }
1300
+ /**
1301
+ * Call a merchant agent using A2A
1302
+ *
1303
+ * Official A2A 1.0 JSON-RPC SendMessage, GetTask and CancelTask.
1304
+
1305
+ ### Authentication
1306
+
1307
+ Uses the existing customer JWT from /api/embed/{deploymentId}/session; send the same Origin when creating and using the session.
1308
+
1309
+ ### Messages
1310
+
1311
+ SendMessage accepts text user messages with a UUID messageId and up to 4000 characters. For asynchronous execution set configuration.returnImmediately=true and retrieve the task. Every task is bound to the customer session.
1312
+
1313
+ Bot verification and storefront protection apply. Payment proofs belong in the checkout completion endpoint, outside model messages.
1314
+
1315
+ ### Signed offers and buyer agents
1316
+
1317
+ Payable offers in purchase-offers artifacts include checkoutJwt when the platform signing key is configured. Requests may carry a Web Bot Auth signature; the verified agent orig
1318
+ *
1319
+ * `POST /api/embed/{deploymentId}/a2a`
1320
+ */
1321
+ embeda2a(request, requestOptions) {
1322
+ const { deploymentId, ...body } = request ?? {};
1323
+ return this._http.request({
1324
+ method: "POST",
1325
+ path: `/api/embed/${encodePathParam("deploymentId", deploymentId)}/a2a`,
1326
+ query: void 0,
1327
+ body,
1328
+ ...mergeRequestOptions(requestOptions)
1329
+ });
1330
+ }
1331
+ /**
1332
+ * Manage customer-owned purchase offers
1333
+ *
1334
+ * ### Operations
1335
+
1336
+ create: offers[] (1–5), with stable requestId, exact purchasable product/variant IDs, quantities, shipping country and optional unitAmount proposals. get/cancel: sessionIds[] (1–20). complete: sessionId, paymentProof, and buyer approval of cartVersion, totalAmount and currency. pay: sessionId and the same exact approval; returns checkoutUrl for Stripe-hosted card entry.
1337
+
1338
+ ### Results and safeguards
1339
+
1340
+ Batches return ordered per-target results, succeededCount and failedCount. At most ten unpaid offers may be held per customer. Merchant-approved currency, countries, shipping and tax terms are required. Shopify-listed products return the supported Shopify checkout handoff.
1341
+
1342
+ ### Payment
1343
+
1344
+ Completion reuses the existing Stripe ACP or x402 rail. Hosted card checkout requires this org
1345
+ *
1346
+ * `POST /api/embed/{deploymentId}/checkout-sessions/{operation}`
1347
+ */
1348
+ embedcheckoutSessions(request, requestOptions) {
1349
+ const { deploymentId, operation, ...body } = request ?? {};
1350
+ return this._http.request({
1351
+ method: "POST",
1352
+ path: `/api/embed/${encodePathParam("deploymentId", deploymentId)}/checkout-sessions/${encodePathParam("operation", operation)}`,
1353
+ query: void 0,
1354
+ body,
1355
+ ...mergeRequestOptions(requestOptions)
1356
+ });
1357
+ }
1358
+ };
1279
1359
  var BrandKitsClient = class {
1280
1360
  constructor(_http) {
1281
1361
  __publicField(this, "_http", _http);
@@ -1655,7 +1735,7 @@ var CheckoutSessionsClient = class {
1655
1735
  /**
1656
1736
  * Complete Agentic Checkout Session
1657
1737
  *
1658
- * Settle the selected rail and create a native `agentic` order. Settlement failures return 402 and leave the session in `ready_for_payment`.
1738
+ * Settle the selected rail and create a native `agentic` order. Definitive settlement failures return 402. Pending confirmation locks the offer in `payment_pending`; durable recovery resumes the same attempt.
1659
1739
  *
1660
1740
  * `POST /api/v1/checkout-sessions/{sessionId}/complete`
1661
1741
  */
@@ -2374,6 +2454,104 @@ var OrdersClient = class {
2374
2454
  ...mergeRequestOptions(requestOptions)
2375
2455
  });
2376
2456
  }
2457
+ /**
2458
+ * Check Order Action Options
2459
+ *
2460
+ * ### Authorization
2461
+
2462
+ Requires orders:write.
2463
+
2464
+ ### Choices
2465
+
2466
+ Read current marketplace choices for ship, cancel, labels or update_tracking for 1–50 order UUIDs using repeated orderIds query parameters. The shared order service checks status, store connection and marketplace capability. Results preserve first-requested order, with explicit per-order errors. Use the exact choice payload and supply any fields marked requiresInput. An unsupported marketplace operation is an explicit failure, not a silently skipped order. Ship arranges shipment; labels generates printable files. Fulfillment behavior is identical to the existing single-order API and workspace UI.
2467
+ *
2468
+ * `GET /api/v1/orders/actions`
2469
+ */
2470
+ listBatchActionOptions(request, requestOptions) {
2471
+ const { orderIds, action, organizationId } = request ?? {};
2472
+ return this._http.request({
2473
+ method: "GET",
2474
+ path: "/api/v1/orders/actions",
2475
+ query: { orderIds, action, organizationId },
2476
+ body: void 0,
2477
+ ...mergeRequestOptions(requestOptions)
2478
+ });
2479
+ }
2480
+ /**
2481
+ * Process Order Actions
2482
+ *
2483
+ * ### Authorization
2484
+
2485
+ Requires orders:write.
2486
+
2487
+ ### Batch submission
2488
+
2489
+ Queue 1–50 distinct order operations with a UUID requestId. Each operation has orderId, action (ship, cancel, labels or update_tracking), and optional payload. Use exact marketplace choices from GET /api/v1/orders/actions and supply required carrier, tracking, pickup/drop-off or cancellation details. One operation per order is allowed in a batch; later stages such as labels after shipment require another submission. All targets are authorized before any enqueue. Per-order failures are isolated; results retain request order and include every accepted jobId. data.success means all submissions were accepted, not that marketplace processing finished.
2490
+
2491
+ ### Recovery and completion
2492
+
2493
+ Retain requestId and unchanged operations for retr
2494
+ *
2495
+ * `POST /api/v1/orders/actions`
2496
+ */
2497
+ processActions(request, requestOptions) {
2498
+ const { ...body } = request ?? {};
2499
+ return this._http.request({
2500
+ method: "POST",
2501
+ path: "/api/v1/orders/actions",
2502
+ query: void 0,
2503
+ body,
2504
+ ...mergeRequestOptions(requestOptions)
2505
+ });
2506
+ }
2507
+ /**
2508
+ * Get Order Action Jobs
2509
+ *
2510
+ * ### Authorization
2511
+
2512
+ Requires orders:read.
2513
+
2514
+ ### Outcomes and labels
2515
+
2516
+ Read every requested order action job in one batch of 1–50 UUIDs using repeated jobIds parameters. Results preserve first-requested order. data.success is true only when every requested job succeeded; failedCount includes failed and not_supported, while pendingCount includes queued and running. Successful label jobs contain downloadable files in labels[]. A missing or cross-organization job returns 404; current store restrictions apply to all targets. The top-level completed status describes the lookup, not job completion. No raw provider acknowledgements are exposed.
2517
+ *
2518
+ * `GET /api/v1/orders/actions/jobs`
2519
+ */
2520
+ getActionJobs(request, requestOptions) {
2521
+ const { jobIds, organizationId } = request ?? {};
2522
+ return this._http.request({
2523
+ method: "GET",
2524
+ path: "/api/v1/orders/actions/jobs",
2525
+ query: { jobIds, organizationId },
2526
+ body: void 0,
2527
+ ...mergeRequestOptions(requestOptions)
2528
+ });
2529
+ }
2530
+ /**
2531
+ * Create Picking List
2532
+ *
2533
+ * ### Authorization
2534
+
2535
+ Requires orders:read. API keys resolve organization scope from their credential; session callers include organizationId.
2536
+
2537
+ ### PDF output
2538
+
2539
+ Create a private PDF picking list for 1–500 order UUIDs, trimmed and deduplicated in first-requested order. Missing or inaccessible orders fail the complete selection without creating a partial document. The same grouping, product quantities, SKU/variation and currency-labeled prices as the workspace Orders page are used. timeZone accepts an IANA time zone; omitted API requests use UTC. This does not arrange shipment or change orders.
2540
+
2541
+ The result contains structured list data, every orderId, a saved documentId and a signed HTTPS downloadUrl valid until expiresAt (five minutes). Generate a fresh list for a new download URL. Download the
2542
+ *
2543
+ * `POST /api/v1/orders/picking-list`
2544
+ */
2545
+ createPickingList(request, requestOptions) {
2546
+ const { ...body } = request ?? {};
2547
+ return this._http.request({
2548
+ method: "POST",
2549
+ path: "/api/v1/orders/picking-list",
2550
+ query: void 0,
2551
+ body,
2552
+ ...mergeRequestOptions(requestOptions)
2553
+ });
2554
+ }
2377
2555
  };
2378
2556
  var OrganizationsClient = class {
2379
2557
  constructor(_http) {
@@ -3334,6 +3512,96 @@ var ReturnsClient = class {
3334
3512
  ...mergeRequestOptions(requestOptions)
3335
3513
  });
3336
3514
  }
3515
+ /**
3516
+ * Check Return Actions
3517
+ *
3518
+ * ### Authorization
3519
+
3520
+ Requires orders:write.
3521
+
3522
+ ### Eligibility
3523
+
3524
+ Read live marketplace decisions for 1–50 OmniCommerce return UUIDs using repeated returnIds query parameters. Refreshes the saved return state through the same service as the order UI. All targets are organization- and store-scoped before marketplace access. Results preserve first-requested order; one provider failure does not block another store. data.success describes eligibility checks, not whether an action is available. Completed, cancelled and other terminal returns have no actions. Check actions.length and limitation; never infer eligibility from status alone. Amazon and WhatsApp currently return explicit processing limitations. Other marketplaces expose only decisions supported by their current API state. No buyer remarks,
3525
+ *
3526
+ * `GET /api/v1/returns/actions`
3527
+ */
3528
+ listActions(request, requestOptions) {
3529
+ const { returnIds, organizationId } = request ?? {};
3530
+ return this._http.request({
3531
+ method: "GET",
3532
+ path: "/api/v1/returns/actions",
3533
+ query: { returnIds, organizationId },
3534
+ body: void 0,
3535
+ ...mergeRequestOptions(requestOptions)
3536
+ });
3537
+ }
3538
+ /**
3539
+ * Process Returns
3540
+ *
3541
+ * ### Authorization
3542
+
3543
+ Requires orders:write.
3544
+
3545
+ ### Submit decisions
3546
+
3547
+ Queue 1–50 selected return decisions, including a one-element batch for a single return. Use only actionId/version pairs from a fresh eligibility check. Identical duplicate return operations are deduplicated in first-requested order; conflicting duplicates are rejected. requestId is a UUID idempotency key: retry the same key and unchanged operations after a transport failure. An active matching decision is reused; conflicting active decisions return 409. Returns HTTP 202 with every returnId and jobId. The durable worker rechecks current permissions, store identity, eligibility and version immediately before writing, then verifies the marketplace result. Follow links.poll or GET /api/v1/returns/actions/jobs with every jobIds e
3548
+ *
3549
+ * `POST /api/v1/returns/actions`
3550
+ */
3551
+ process(request, requestOptions) {
3552
+ const { ...body } = request ?? {};
3553
+ return this._http.request({
3554
+ method: "POST",
3555
+ path: "/api/v1/returns/actions",
3556
+ query: void 0,
3557
+ body,
3558
+ ...mergeRequestOptions(requestOptions)
3559
+ });
3560
+ }
3561
+ /**
3562
+ * Get Return Action Jobs
3563
+ *
3564
+ * ### Authorization
3565
+
3566
+ Requires orders:read.
3567
+
3568
+ ### Job outcomes
3569
+
3570
+ Read the current state of 1–50 return-processing job UUIDs in one request using repeated jobIds parameters. Use every job ID returned by submission. Results preserve first-requested order. pendingCount counts queued, running and submitting; succeededCount counts succeeded; failedCount includes failed and needs_review. data.success is true only if every requested job succeeded. The top-level completed status refers to this lookup, not to the jobs. Missing or cross-organization jobs return 404; jobs outside assigned stores are forbidden. Evidence contains accepted/verified flags and before/after marketplace statuses, without raw provider payloads.
3571
+ *
3572
+ * `GET /api/v1/returns/actions/jobs`
3573
+ */
3574
+ getActionJobs(request, requestOptions) {
3575
+ const { jobIds, organizationId } = request ?? {};
3576
+ return this._http.request({
3577
+ method: "GET",
3578
+ path: "/api/v1/returns/actions/jobs",
3579
+ query: { jobIds, organizationId },
3580
+ body: void 0,
3581
+ ...mergeRequestOptions(requestOptions)
3582
+ });
3583
+ }
3584
+ /**
3585
+ * Get Order Returns
3586
+ *
3587
+ * Requires orders:read. Read stored return requests for 1–50 order UUIDs using repeated orderIds query parameters.
3588
+
3589
+ ### Return identity
3590
+
3591
+ Results preserve first-requested order and include distinct active and historical return requests. processingEligible is a local candidate flag, not live eligibility. Pass returnId values to GET /api/v1/returns/actions before choosing a decision. Every order is authorized before reading returns, including store restrictions; no buyer data is exposed.
3592
+ *
3593
+ * `GET /api/v1/returns/orders`
3594
+ */
3595
+ listForOrders(request, requestOptions) {
3596
+ const { orderIds, organizationId } = request ?? {};
3597
+ return this._http.request({
3598
+ method: "GET",
3599
+ path: "/api/v1/returns/orders",
3600
+ query: { orderIds, organizationId },
3601
+ body: void 0,
3602
+ ...mergeRequestOptions(requestOptions)
3603
+ });
3604
+ }
3337
3605
  };
3338
3606
  var ReviewsClient = class {
3339
3607
  constructor(_http) {
@@ -3928,6 +4196,7 @@ var OmniGeneratedClient = class {
3928
4196
  __publicField(this, "agents");
3929
4197
  __publicField(this, "analytics");
3930
4198
  __publicField(this, "aop");
4199
+ __publicField(this, "api");
3931
4200
  __publicField(this, "brandKits");
3932
4201
  __publicField(this, "brandsgateway");
3933
4202
  __publicField(this, "campaigns");
@@ -3965,6 +4234,7 @@ var OmniGeneratedClient = class {
3965
4234
  this.agents = new AgentsClient(this._http);
3966
4235
  this.analytics = new AnalyticsClient(this._http);
3967
4236
  this.aop = new AopClient(this._http);
4237
+ this.api = new ApiClient(this._http);
3968
4238
  this.brandKits = new BrandKitsClient(this._http);
3969
4239
  this.brandsgateway = new BrandsgatewayClient(this._http);
3970
4240
  this.campaigns = new CampaignsClient(this._http);