@omni-commerce/sdk 0.1.1 → 0.2.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.cjs CHANGED
@@ -26,7 +26,7 @@ function normalizeClientOptions(options = {}) {
26
26
  }
27
27
 
28
28
  // src/version.ts
29
- var SDK_VERSION = "0.1.1";
29
+ var SDK_VERSION = "0.2.0";
30
30
  var SDK_USER_AGENT = `omnicommerce-js/${SDK_VERSION}`;
31
31
 
32
32
  // src/environments.ts
@@ -509,6 +509,73 @@ async function waitForJob(http, request, options) {
509
509
  }
510
510
 
511
511
  // src/generated/resources.ts
512
+ var AgentsGeneralClient = class {
513
+ constructor(_http) {
514
+ this._http = _http;
515
+ }
516
+ _http;
517
+ /**
518
+ * Invoke the Omni agent
519
+ *
520
+ * Run the general Omni agent and wait until it completes, pauses for approval, or fails. Requires `agents:invoke`.
521
+
522
+ 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.
523
+ *
524
+ * `POST /api/v1/agents/general/invoke`
525
+ */
526
+ invoke(request, requestOptions) {
527
+ const { ...body } = request ?? {};
528
+ return this._http.request({
529
+ method: "POST",
530
+ path: "/api/v1/agents/general/invoke",
531
+ query: void 0,
532
+ body,
533
+ ...mergeRequestOptions(requestOptions)
534
+ });
535
+ }
536
+ /**
537
+ * Start an Omni agent run
538
+ *
539
+ * Queue the general Omni agent and return immediately with the run in `queued` state. Poll the URL in the `Location` header (`GET /api/v1/agents/general/runs/{runId}`), honoring `Retry-After`. Requires `agents:invoke`. The request body matches invoke.
540
+ *
541
+ * `POST /api/v1/agents/general/runs`
542
+ */
543
+ start(request, requestOptions) {
544
+ const { ...body } = request ?? {};
545
+ return this._http.request({
546
+ method: "POST",
547
+ path: "/api/v1/agents/general/runs",
548
+ query: void 0,
549
+ body,
550
+ ...mergeRequestOptions(requestOptions)
551
+ });
552
+ }
553
+ /**
554
+ * Get an Omni agent run
555
+ *
556
+ * Read a queued, running, completed, paused, or failed Omni agent run. Requires `agents:invoke`.
557
+ *
558
+ * `GET /api/v1/agents/general/runs/{runId}`
559
+ */
560
+ getRun(request, requestOptions) {
561
+ const { runId, organizationId } = request ?? {};
562
+ return this._http.request({
563
+ method: "GET",
564
+ path: `/api/v1/agents/general/runs/${encodePathParam("runId", runId)}`,
565
+ query: { organizationId },
566
+ body: void 0,
567
+ ...mergeRequestOptions(requestOptions)
568
+ });
569
+ }
570
+ };
571
+ var AgentsClient = class {
572
+ constructor(_http) {
573
+ this._http = _http;
574
+ this.general = new AgentsGeneralClient(this._http);
575
+ }
576
+ _http;
577
+ general;
578
+ };
512
579
  var AopClient = class {
513
580
  constructor(_http) {
514
581
  this._http = _http;
@@ -638,6 +705,148 @@ var ApiClient = class {
638
705
  });
639
706
  }
640
707
  };
708
+ var CampaignsClient = class {
709
+ constructor(_http) {
710
+ this._http = _http;
711
+ }
712
+ _http;
713
+ /**
714
+ * List Campaigns
715
+ *
716
+ * List campaigns for the authenticated organization. `stage=all` is the workspace working set: draft and running. Requires `promotions:read`.
717
+ *
718
+ * `GET /api/v1/campaigns`
719
+ */
720
+ list(request = {}, requestOptions) {
721
+ const { organizationId, q, stage, offset, limit } = request ?? {};
722
+ return this._http.request({
723
+ method: "GET",
724
+ path: "/api/v1/campaigns",
725
+ query: { organizationId, q, stage, offset, limit },
726
+ body: void 0,
727
+ ...mergeRequestOptions(requestOptions)
728
+ });
729
+ }
730
+ /**
731
+ * Create Campaign
732
+ *
733
+ * Create a draft campaign. `ownerId` and `approverId` must be members of the organization, and every store must already be connected. Requires `promotions:write`.
734
+ *
735
+ * `POST /api/v1/campaigns`
736
+ */
737
+ create(request, requestOptions) {
738
+ const { ...body } = request ?? {};
739
+ return this._http.request({
740
+ method: "POST",
741
+ path: "/api/v1/campaigns",
742
+ query: void 0,
743
+ body,
744
+ ...mergeRequestOptions(requestOptions)
745
+ });
746
+ }
747
+ /**
748
+ * Get Campaign
749
+ *
750
+ * Read one campaign, including its plan, executions, audit, schedule, and progress. Requires `promotions:read`.
751
+ *
752
+ * `GET /api/v1/campaigns/{campaignId}`
753
+ */
754
+ get(request, requestOptions) {
755
+ const { campaignId, organizationId } = request ?? {};
756
+ return this._http.request({
757
+ method: "GET",
758
+ path: `/api/v1/campaigns/${encodePathParam("campaignId", campaignId)}`,
759
+ query: { organizationId },
760
+ body: void 0,
761
+ ...mergeRequestOptions(requestOptions)
762
+ });
763
+ }
764
+ /**
765
+ * Update Campaign
766
+ *
767
+ * Replace a draft or approved plan, or propose one change to a running plan. Send `expectedRevision` from the last read. Requires `promotions:write`.
768
+ *
769
+ * `PUT /api/v1/campaigns/{campaignId}`
770
+ */
771
+ replace(request, requestOptions) {
772
+ const { campaignId, ...body } = request ?? {};
773
+ return this._http.request({
774
+ method: "PUT",
775
+ path: `/api/v1/campaigns/${encodePathParam("campaignId", campaignId)}`,
776
+ query: void 0,
777
+ body,
778
+ ...mergeRequestOptions(requestOptions)
779
+ });
780
+ }
781
+ /**
782
+ * Act on Campaign
783
+ *
784
+ * Approve, start, end, resume, retry, or decide a proposed live change. Approve, run, resume, and approving a change must be called by the named approver. Requires `promotions:write`.
785
+ *
786
+ * `POST /api/v1/campaigns/{campaignId}/actions`
787
+ */
788
+ actions(request, requestOptions) {
789
+ const { campaignId, ...body } = request ?? {};
790
+ return this._http.request({
791
+ method: "POST",
792
+ path: `/api/v1/campaigns/${encodePathParam("campaignId", campaignId)}/actions`,
793
+ query: void 0,
794
+ body,
795
+ ...mergeRequestOptions(requestOptions)
796
+ });
797
+ }
798
+ /**
799
+ * Archive Campaigns
800
+ *
801
+ * Archive campaigns, or restore archived campaigns by id or by the current archived list filters. Requires `promotions:write`.
802
+ *
803
+ * `POST /api/v1/campaigns/archive`
804
+ */
805
+ archive(request, requestOptions) {
806
+ const { ...body } = request ?? {};
807
+ return this._http.request({
808
+ method: "POST",
809
+ path: "/api/v1/campaigns/archive",
810
+ query: void 0,
811
+ body,
812
+ ...mergeRequestOptions(requestOptions)
813
+ });
814
+ }
815
+ /**
816
+ * Delete Campaigns
817
+ *
818
+ * Permanently delete archived campaigns by explicit id or by archived list filters. Requires `promotions:write`.
819
+ *
820
+ * `POST /api/v1/campaigns/delete`
821
+ */
822
+ delete(request, requestOptions) {
823
+ const { ...body } = request ?? {};
824
+ return this._http.request({
825
+ method: "POST",
826
+ path: "/api/v1/campaigns/delete",
827
+ query: void 0,
828
+ body,
829
+ ...mergeRequestOptions(requestOptions)
830
+ });
831
+ }
832
+ /**
833
+ * Get Campaign Options
834
+ *
835
+ * List the organization members and connected stores a campaign plan can name. Use a member `id` for `ownerId` and `approverId`. Requires `promotions:write`.
836
+ *
837
+ * `GET /api/v1/campaigns/options`
838
+ */
839
+ getOptions(request = {}, requestOptions) {
840
+ const { organizationId } = request ?? {};
841
+ return this._http.request({
842
+ method: "GET",
843
+ path: "/api/v1/campaigns/options",
844
+ query: { organizationId },
845
+ body: void 0,
846
+ ...mergeRequestOptions(requestOptions)
847
+ });
848
+ }
849
+ };
641
850
  var CatalogClient = class {
642
851
  constructor(_http) {
643
852
  this._http = _http;
@@ -2537,8 +2746,10 @@ var ZaloraClient = class {
2537
2746
  var OmniGeneratedClient = class {
2538
2747
  constructor(_http) {
2539
2748
  this._http = _http;
2749
+ this.agents = new AgentsClient(this._http);
2540
2750
  this.aop = new AopClient(this._http);
2541
2751
  this.api = new ApiClient(this._http);
2752
+ this.campaigns = new CampaignsClient(this._http);
2542
2753
  this.catalog = new CatalogClient(this._http);
2543
2754
  this.checkoutSessions = new CheckoutSessionsClient(this._http);
2544
2755
  this.compare = new CompareClient(this._http);
@@ -2569,8 +2780,10 @@ var OmniGeneratedClient = class {
2569
2780
  this.zalora = new ZaloraClient(this._http);
2570
2781
  }
2571
2782
  _http;
2783
+ agents;
2572
2784
  aop;
2573
2785
  api;
2786
+ campaigns;
2574
2787
  catalog;
2575
2788
  checkoutSessions;
2576
2789
  compare;