@omni-commerce/sdk 0.18.0 → 0.19.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.d.cts CHANGED
@@ -893,6 +893,46 @@ interface paths {
893
893
  patch?: never;
894
894
  trace?: never;
895
895
  };
896
+ "/api/v1/commerce/jobs/await": {
897
+ parameters: {
898
+ query?: never;
899
+ header?: never;
900
+ path?: never;
901
+ cookie?: never;
902
+ };
903
+ get?: never;
904
+ put?: never;
905
+ /**
906
+ * Await Commerce Jobs
907
+ * @description Wait for a mixed batch of returned commerce correlations: inventory_job, price_event, publish_job, delist_batch, store_switch, omni_delete, zalora_import, enrichment_batch, order_action and return_action. Maximum 50000 entries; IDs are trimmed and duplicates collapse by kind/id in first-requested order. timeoutMs=0 reads once; bounded waits allow up to 120000ms. Catalog jobs require catalog:read; order/return jobs require orders:read; mixed batches require both. Session callers include organizationId. Every job retains its target identity, status, errors and available label artifacts. Missing or inaccessible fulfillment jobs fail explicitly. needs_review is an uncertain outcome, never automatic success or authorization to resubmit. data.success describes completion; use state verification before claiming a marketplace effect. Scheduled future actions are verified after execution, not when scheduled.
908
+ */
909
+ post: operations["post_v1_commerce_jobs_await"];
910
+ delete?: never;
911
+ options?: never;
912
+ head?: never;
913
+ patch?: never;
914
+ trace?: never;
915
+ };
916
+ "/api/v1/commerce/state/verify": {
917
+ parameters: {
918
+ query?: never;
919
+ header?: never;
920
+ path?: never;
921
+ cookie?: never;
922
+ };
923
+ get?: never;
924
+ put?: never;
925
+ /**
926
+ * Verify Commerce State
927
+ * @description Perform fresh marketplace verification using the canonical services for every supported marketplace. For products provide productIds plus expected, or targets[{productId,expected}] for mixed values. For order and return operations provide their returned order_action/return_action correlations; product and fulfillment checks may share one request. Maximum 50000 entries per target array, with bounded concurrency. Catalog verification requires catalog:read; fulfillment verification requires orders:read; mixed batches require both. Session callers include organizationId. Missing, unauthorized, unsupported and unconfirmed targets fail explicitly. A return decision can be confirmed while later lifecycle steps remain pending. Labels confirm generated artifacts, not physical printing. Provider acceptance alone does not establish a changed state; tracking omitted by the provider remains unconfirmed. This read never resubmits a marketplace action.
928
+ */
929
+ post: operations["post_v1_commerce_state_verify"];
930
+ delete?: never;
931
+ options?: never;
932
+ head?: never;
933
+ patch?: never;
934
+ trace?: never;
935
+ };
896
936
  "/api/v1/compare": {
897
937
  parameters: {
898
938
  query?: never;
@@ -12359,6 +12399,405 @@ interface operations {
12359
12399
  };
12360
12400
  };
12361
12401
  };
12402
+ post_v1_commerce_jobs_await: {
12403
+ parameters: {
12404
+ query?: never;
12405
+ header?: never;
12406
+ path?: never;
12407
+ cookie?: never;
12408
+ };
12409
+ requestBody: {
12410
+ content: {
12411
+ "application/json": {
12412
+ /** @description Every returned commerce job correlation, including orders and returns. Maximum 50000; trimmed and deduplicated in first-requested order. */
12413
+ correlations: {
12414
+ /** @enum {string} */
12415
+ kind:
12416
+ | "inventory_job"
12417
+ | "price_event"
12418
+ | "publish_job"
12419
+ | "delist_batch"
12420
+ | "store_switch"
12421
+ | "omni_delete"
12422
+ | "zalora_import"
12423
+ | "enrichment_batch"
12424
+ | "order_action"
12425
+ | "return_action";
12426
+ id: string;
12427
+ platform?: string;
12428
+ storeId?: string;
12429
+ productId?: string;
12430
+ productIds?: string[];
12431
+ externalIds?: string[];
12432
+ }[];
12433
+ /** @description Wait budget in milliseconds; 0 is one status read. Maximum 120000. */
12434
+ timeoutMs?: number;
12435
+ organizationId?: string;
12436
+ };
12437
+ };
12438
+ };
12439
+ responses: {
12440
+ /** @description Request completed. Inspect data.success, per-target results and pendingCount for processing progress. */
12441
+ 200: {
12442
+ headers: {
12443
+ [name: string]: unknown;
12444
+ };
12445
+ content: {
12446
+ "application/json": {
12447
+ ok: boolean;
12448
+ apiVersion: string;
12449
+ /** Format: uuid */
12450
+ operationId: string;
12451
+ /** @enum {string} */
12452
+ status: "completed";
12453
+ data: {
12454
+ success: boolean;
12455
+ succeededCount: number;
12456
+ failedCount: number;
12457
+ productIds?: string[];
12458
+ orderIds?: string[];
12459
+ returnIds?: string[];
12460
+ correlations: {
12461
+ /** @enum {string} */
12462
+ kind:
12463
+ | "inventory_job"
12464
+ | "price_event"
12465
+ | "publish_job"
12466
+ | "delist_batch"
12467
+ | "store_switch"
12468
+ | "omni_delete"
12469
+ | "zalora_import"
12470
+ | "enrichment_batch"
12471
+ | "order_action"
12472
+ | "return_action";
12473
+ id: string;
12474
+ platform?: string;
12475
+ storeId?: string;
12476
+ productId?: string;
12477
+ productIds?: string[];
12478
+ externalIds?: string[];
12479
+ }[];
12480
+ message: string;
12481
+ allTerminal: boolean;
12482
+ timedOut: boolean;
12483
+ jobs: {
12484
+ /** @enum {string} */
12485
+ kind:
12486
+ | "inventory_job"
12487
+ | "price_event"
12488
+ | "publish_job"
12489
+ | "delist_batch"
12490
+ | "store_switch"
12491
+ | "omni_delete"
12492
+ | "zalora_import"
12493
+ | "enrichment_batch"
12494
+ | "order_action"
12495
+ | "return_action";
12496
+ id: string;
12497
+ /** @enum {string} */
12498
+ status:
12499
+ | "pending"
12500
+ | "running"
12501
+ | "success"
12502
+ | "error"
12503
+ | "superseded"
12504
+ | "skipped"
12505
+ | "unknown";
12506
+ terminal: boolean;
12507
+ orderId?: string;
12508
+ returnId?: string;
12509
+ productId?: string;
12510
+ productIds?: string[];
12511
+ platform?: string;
12512
+ storeId?: string;
12513
+ action?: string;
12514
+ sourceStatus?: string;
12515
+ labels?: {
12516
+ /** Format: uri */
12517
+ url: string;
12518
+ name: string | null;
12519
+ mimeType: string | null;
12520
+ }[];
12521
+ error?: string;
12522
+ message?: string;
12523
+ updatedAt?: string;
12524
+ externalIds?: string[];
12525
+ missingExternalIds?: string[];
12526
+ evidence?: {
12527
+ accepted?: boolean;
12528
+ verified?: boolean;
12529
+ statusBefore?: string | null;
12530
+ statusAfter?: string | null;
12531
+ };
12532
+ verification?: {
12533
+ ok: boolean;
12534
+ verified: boolean;
12535
+ skipped: boolean;
12536
+ reason?: string;
12537
+ expectedQuantity?: number;
12538
+ actualQuantity?: number | null;
12539
+ evidence?: string;
12540
+ verifiedAt?: string;
12541
+ };
12542
+ operations?: {
12543
+ delist: {
12544
+ status: string;
12545
+ result: {
12546
+ [key: string]: unknown;
12547
+ } | null;
12548
+ };
12549
+ publish: {
12550
+ status: string;
12551
+ result: {
12552
+ [key: string]: unknown;
12553
+ } | null;
12554
+ };
12555
+ };
12556
+ }[];
12557
+ pendingCount: number;
12558
+ };
12559
+ links: {
12560
+ [key: string]: string;
12561
+ };
12562
+ warnings: string[];
12563
+ recommendations: string[];
12564
+ };
12565
+ };
12566
+ };
12567
+ /** @description Invalid request, conflicting operations, singular arguments or a batch exceeding the endpoint limit. */
12568
+ 400: {
12569
+ headers: {
12570
+ [name: string]: unknown;
12571
+ };
12572
+ content?: never;
12573
+ };
12574
+ /** @description Missing or invalid credentials. */
12575
+ 401: {
12576
+ headers: {
12577
+ [name: string]: unknown;
12578
+ };
12579
+ content?: never;
12580
+ };
12581
+ /** @description Missing scope, organization mismatch, or a target outside the caller's assigned stores and markets. */
12582
+ 403: {
12583
+ headers: {
12584
+ [name: string]: unknown;
12585
+ };
12586
+ content?: never;
12587
+ };
12588
+ /** @description Rate limit exceeded. */
12589
+ 429: {
12590
+ headers: {
12591
+ [name: string]: unknown;
12592
+ };
12593
+ content?: never;
12594
+ };
12595
+ /** @description Service unavailable. Retry a submission with the same requestId and unchanged operations. */
12596
+ 503: {
12597
+ headers: {
12598
+ [name: string]: unknown;
12599
+ };
12600
+ content?: never;
12601
+ };
12602
+ };
12603
+ };
12604
+ post_v1_commerce_state_verify: {
12605
+ parameters: {
12606
+ query?: never;
12607
+ header?: never;
12608
+ path?: never;
12609
+ cookie?: never;
12610
+ };
12611
+ requestBody: {
12612
+ content: {
12613
+ "application/json": {
12614
+ /** @description Order and return action correlations to verify through fresh marketplace reads. May accompany product targets. */
12615
+ correlations?: {
12616
+ /** @enum {string} */
12617
+ kind: "order_action" | "return_action";
12618
+ /** Format: uuid */
12619
+ id: string;
12620
+ platform?: string;
12621
+ storeId?: string;
12622
+ productId?: string;
12623
+ productIds?: string[];
12624
+ externalIds?: string[];
12625
+ }[];
12626
+ /** @description Product or variant ids to verify together. Use every distinct productId returned by the completed commerce jobs (max 50000, bounded concurrency). */
12627
+ productIds?: string[];
12628
+ /** @description Expected commerce state after a write (price, quantity, listingStatus, etc). */
12629
+ expected?: {
12630
+ price?: number;
12631
+ salePrice?: number | null;
12632
+ currency?: string;
12633
+ quantity?: number;
12634
+ /** @enum {string} */
12635
+ listingStatus?: "active" | "draft" | "unlisted" | "deleted";
12636
+ platforms?: string[];
12637
+ };
12638
+ /** @description Per-product expected states for a mixed-value batch. Use every successful item's productId and commerceReceipt.expected together. Do not combine with productIds or shared expected. Identical duplicates are deduplicated; conflicting expectations are rejected. */
12639
+ targets?: {
12640
+ productId: string;
12641
+ expected: {
12642
+ price?: number;
12643
+ salePrice?: number | null;
12644
+ currency?: string;
12645
+ quantity?: number;
12646
+ /** @enum {string} */
12647
+ listingStatus?: "active" | "draft" | "unlisted" | "deleted";
12648
+ platforms?: string[];
12649
+ };
12650
+ }[];
12651
+ /**
12652
+ * @description Lifecycle action being verified. Use delete for Omni-only delete checks.
12653
+ * @enum {string}
12654
+ */
12655
+ action?:
12656
+ | "price"
12657
+ | "inventory"
12658
+ | "publish"
12659
+ | "update"
12660
+ | "delist"
12661
+ | "delete";
12662
+ /** @description Optional marketplace filter: shopee, lazada, tiktok, shopify, whatsapp, zalora, amazon, ebay. */
12663
+ platforms?: string[];
12664
+ /** @description Also assert Omni DB fields (default true). */
12665
+ includeOmni?: boolean;
12666
+ organizationId?: string;
12667
+ };
12668
+ };
12669
+ };
12670
+ responses: {
12671
+ /** @description Request completed. Inspect data.success, per-target results and pendingCount for processing progress. */
12672
+ 200: {
12673
+ headers: {
12674
+ [name: string]: unknown;
12675
+ };
12676
+ content: {
12677
+ "application/json": {
12678
+ ok: boolean;
12679
+ apiVersion: string;
12680
+ /** Format: uuid */
12681
+ operationId: string;
12682
+ /** @enum {string} */
12683
+ status: "completed";
12684
+ data: {
12685
+ success: boolean;
12686
+ succeededCount: number;
12687
+ failedCount: number;
12688
+ productIds?: string[];
12689
+ orderIds?: string[];
12690
+ returnIds?: string[];
12691
+ correlations: {
12692
+ /** @enum {string} */
12693
+ kind:
12694
+ | "inventory_job"
12695
+ | "price_event"
12696
+ | "publish_job"
12697
+ | "delist_batch"
12698
+ | "store_switch"
12699
+ | "omni_delete"
12700
+ | "zalora_import"
12701
+ | "enrichment_batch"
12702
+ | "order_action"
12703
+ | "return_action";
12704
+ id: string;
12705
+ platform?: string;
12706
+ storeId?: string;
12707
+ productId?: string;
12708
+ productIds?: string[];
12709
+ externalIds?: string[];
12710
+ }[];
12711
+ message: string;
12712
+ results: {
12713
+ success: boolean;
12714
+ productId: string;
12715
+ rootProductId?: string;
12716
+ verification: {
12717
+ ok: boolean;
12718
+ target: string;
12719
+ evidence: string;
12720
+ action?: string;
12721
+ platform?: string;
12722
+ storeId?: string;
12723
+ productId?: string;
12724
+ expected?: string;
12725
+ actual?: string;
12726
+ }[];
12727
+ listings: {
12728
+ [key: string]: unknown;
12729
+ }[];
12730
+ omni?: {
12731
+ [key: string]: unknown;
12732
+ };
12733
+ message: string;
12734
+ }[];
12735
+ jobs: {
12736
+ /** @enum {string} */
12737
+ kind: "order_action" | "return_action";
12738
+ id: string;
12739
+ success: boolean;
12740
+ orderId?: string;
12741
+ returnId?: string;
12742
+ action?: string;
12743
+ platform?: string;
12744
+ evidence: string;
12745
+ status?: string;
12746
+ statusBefore?: string | null;
12747
+ statusAfter?: string | null;
12748
+ labels?: {
12749
+ /** Format: uri */
12750
+ url: string;
12751
+ name: string | null;
12752
+ mimeType: string | null;
12753
+ }[];
12754
+ }[];
12755
+ };
12756
+ links: {
12757
+ [key: string]: string;
12758
+ };
12759
+ warnings: string[];
12760
+ recommendations: string[];
12761
+ };
12762
+ };
12763
+ };
12764
+ /** @description Invalid request, conflicting operations, singular arguments or a batch exceeding the endpoint limit. */
12765
+ 400: {
12766
+ headers: {
12767
+ [name: string]: unknown;
12768
+ };
12769
+ content?: never;
12770
+ };
12771
+ /** @description Missing or invalid credentials. */
12772
+ 401: {
12773
+ headers: {
12774
+ [name: string]: unknown;
12775
+ };
12776
+ content?: never;
12777
+ };
12778
+ /** @description Missing scope, organization mismatch, or a target outside the caller's assigned stores and markets. */
12779
+ 403: {
12780
+ headers: {
12781
+ [name: string]: unknown;
12782
+ };
12783
+ content?: never;
12784
+ };
12785
+ /** @description Rate limit exceeded. */
12786
+ 429: {
12787
+ headers: {
12788
+ [name: string]: unknown;
12789
+ };
12790
+ content?: never;
12791
+ };
12792
+ /** @description Service unavailable. Retry a submission with the same requestId and unchanged operations. */
12793
+ 503: {
12794
+ headers: {
12795
+ [name: string]: unknown;
12796
+ };
12797
+ content?: never;
12798
+ };
12799
+ };
12800
+ };
12362
12801
  get_v1_compare: {
12363
12802
  parameters: {
12364
12803
  query: {
@@ -15548,6 +15987,12 @@ interface operations {
15548
15987
  /** @enum {string} */
15549
15988
  status: "accepted";
15550
15989
  data: {
15990
+ correlations: {
15991
+ /** @constant */
15992
+ kind: "order_action";
15993
+ /** Format: uuid */
15994
+ id: string;
15995
+ }[];
15551
15996
  success: boolean;
15552
15997
  orderIds: string[];
15553
15998
  succeededCount: number;
@@ -21241,6 +21686,12 @@ interface operations {
21241
21686
  /** @enum {string} */
21242
21687
  status: "accepted";
21243
21688
  data: {
21689
+ correlations: {
21690
+ /** @constant */
21691
+ kind: "return_action";
21692
+ /** Format: uuid */
21693
+ id: string;
21694
+ }[];
21244
21695
  success: boolean;
21245
21696
  returnIds: string[];
21246
21697
  jobIds: string[];
@@ -21350,6 +21801,12 @@ interface operations {
21350
21801
  /** @enum {string} */
21351
21802
  status: "completed";
21352
21803
  data: {
21804
+ correlations: {
21805
+ /** @constant */
21806
+ kind: "return_action";
21807
+ /** Format: uuid */
21808
+ id: string;
21809
+ }[];
21353
21810
  success: boolean;
21354
21811
  returnIds: string[];
21355
21812
  jobIds: string[];
@@ -25546,6 +26003,26 @@ declare class CheckoutSessionsClient {
25546
26003
  */
25547
26004
  complete(request: OperationPath<operations["post_v1_checkout_sessions_by_sessionid_complete"]> & OperationQuery<operations["post_v1_checkout_sessions_by_sessionid_complete"]> & OperationBody<operations["post_v1_checkout_sessions_by_sessionid_complete"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["post_v1_checkout_sessions_by_sessionid_complete"]>>;
25548
26005
  }
26006
+ declare class CommerceClient {
26007
+ protected readonly _http: OmniHttp;
26008
+ constructor(_http: OmniHttp);
26009
+ /**
26010
+ * Await Commerce Jobs
26011
+ *
26012
+ * Wait for a mixed batch of returned commerce correlations: inventory_job, price_event, publish_job, delist_batch, store_switch, omni_delete, zalora_import, enrichment_batch, order_action and return_action. Maximum 50000 entries; IDs are trimmed and duplicates collapse by kind/id in first-requested order. timeoutMs=0 reads once; bounded waits allow up to 120000ms. Catalog jobs require catalog:read; order/return jobs require orders:read; mixed batches require both. Session callers include organizationId. Every job retains its target identity, status, errors and available label artifacts. Missing or inaccessible fulfillment jobs fail explicitly. needs_review is an uncertain outcome, never automatic success or authorization to resubmit. data.success describes completion; use state verification
26013
+ *
26014
+ * `POST /api/v1/commerce/jobs/await`
26015
+ */
26016
+ awaitJobs(request: OperationBody<operations["post_v1_commerce_jobs_await"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["post_v1_commerce_jobs_await"]>>;
26017
+ /**
26018
+ * Verify Commerce State
26019
+ *
26020
+ * Perform fresh marketplace verification using the canonical services for every supported marketplace. For products provide productIds plus expected, or targets[{productId,expected}] for mixed values. For order and return operations provide their returned order_action/return_action correlations; product and fulfillment checks may share one request. Maximum 50000 entries per target array, with bounded concurrency. Catalog verification requires catalog:read; fulfillment verification requires orders:read; mixed batches require both. Session callers include organizationId. Missing, unauthorized, unsupported and unconfirmed targets fail explicitly. A return decision can be confirmed while later lifecycle steps remain pending. Labels confirm generated artifacts, not physical printing. Provider acc
26021
+ *
26022
+ * `POST /api/v1/commerce/state/verify`
26023
+ */
26024
+ verifyState(request: OperationBody<operations["post_v1_commerce_state_verify"]>, requestOptions?: BaseRequestOptions): HttpResponsePromise<SuccessData<operations["post_v1_commerce_state_verify"]>>;
26025
+ }
25549
26026
  declare class CompareClient {
25550
26027
  protected readonly _http: OmniHttp;
25551
26028
  constructor(_http: OmniHttp);
@@ -26746,6 +27223,7 @@ declare class OmniGeneratedClient {
26746
27223
  readonly campaigns: CampaignsClient;
26747
27224
  readonly catalog: CatalogClient;
26748
27225
  readonly checkoutSessions: CheckoutSessionsClient;
27226
+ readonly commerce: CommerceClient;
26749
27227
  readonly compare: CompareClient;
26750
27228
  readonly directory: DirectoryClient;
26751
27229
  readonly documents: DocumentsClient;
@@ -26787,6 +27265,7 @@ type OmniResources = {
26787
27265
  campaigns: CampaignsClient;
26788
27266
  catalog: CatalogClient;
26789
27267
  checkoutSessions: CheckoutSessionsClient;
27268
+ commerce: CommerceClient;
26790
27269
  compare: CompareClient;
26791
27270
  directory: DirectoryClient;
26792
27271
  documents: DocumentsClient;
@@ -26859,7 +27338,7 @@ declare function constructEvent(payload: string | Uint8Array, headers: WebhookHe
26859
27338
  toleranceInSeconds?: number;
26860
27339
  }): Promise<ConstructedWebhookEvent>;
26861
27340
 
26862
- declare const SDK_VERSION = "0.18.0";
27341
+ declare const SDK_VERSION = "0.19.0";
26863
27342
 
26864
27343
  type ProductCreatedWebhookEvent = components["schemas"]["ProductCreatedWebhookEvent"];
26865
27344
  type ProductUpdatedWebhookEvent = components["schemas"]["ProductUpdatedWebhookEvent"];