@viu/emporix-sdk 4.6.3 → 4.6.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @viu/emporix-sdk
2
2
 
3
+ ## 4.6.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#413](https://github.com/viuteam/emporix-sdk/pull/413) [`db008c3`](https://github.com/viuteam/emporix-sdk/commit/db008c3e393c032aa56312e045fde456979a220a) Thanks [@viu-release-bot](https://github.com/apps/viu-release-bot)! - chore(sdk): sync generated types with upstream Emporix API specs
8
+
9
+ Updated services: cart,coupon,order-v2
10
+
11
+ ## 4.6.4
12
+
13
+ ### Patch Changes
14
+
15
+ - [#411](https://github.com/viuteam/emporix-sdk/pull/411) [`bb55ec1`](https://github.com/viuteam/emporix-sdk/commit/bb55ec13a8cf45574d217cf1dffe34dcca7b0353) Thanks [@amnael1](https://github.com/amnael1)! - docs(sdk): sync the import service spec for queued import runs
16
+
17
+ Emporix now queues import runs. `client.imports.triggerRun` and `retryRun` return the run `QUEUED` instead of `RUNNING`, answer `409` while the configuration already has a run `QUEUED`, `RUNNING` or `RESUMABLE`, and no longer answer `429` when `maxConcurrentImports` is reached — the run waits instead. `ImportRun` gains the `RESUMABLE` status, `executionStartedAt`, `queueWaitingFor`, `queuePosition`, `supersededRequests` and `lastRequestedAt`; `startedAt` now means when the run was requested, and `mappingVersions` is absent while a run is queued. `cancelRun` stops a `RESUMABLE` run only with `force: true`. Code that waits for `RUNNING` after triggering a run must accept `QUEUED` too.
18
+
3
19
  ## 4.6.3
4
20
 
5
21
  ### Patch Changes
package/dist/cart.d.cts CHANGED
@@ -837,11 +837,46 @@ type DiscountResponse = {
837
837
  */
838
838
  links?: Array<Link>;
839
839
  discountValidationDetails?: DiscountValidationDetails;
840
+ /**
841
+ * Indicates whether the discount is limited to the vendors in `restrictions.vendors`.
842
+ */
843
+ vendorRestricted?: boolean;
844
+ restrictions?: DiscountRestrictions;
840
845
  /**
841
846
  * The index of the discount. It represents the discount position in the cart discounts array.
842
847
  */
843
848
  discountIndex?: number;
844
849
  };
850
+ /**
851
+ * Restrictions copied from the coupon.
852
+ */
853
+ type DiscountRestrictions = {
854
+ /**
855
+ * Start of the discount validity period.
856
+ */
857
+ validFrom?: string;
858
+ /**
859
+ * End of the discount validity period.
860
+ */
861
+ validUntil?: string;
862
+ minOrderValue?: Price & unknown;
863
+ /**
864
+ * Categories to which the discount applies.
865
+ */
866
+ includedCategories?: Array<string>;
867
+ /**
868
+ * Categories to which the discount does not apply.
869
+ */
870
+ excludedCategories?: Array<string>;
871
+ /**
872
+ * Customer segments to which the discount applies.
873
+ */
874
+ segments?: Array<string>;
875
+ /**
876
+ * Vendor identifiers to which the discount applies.
877
+ */
878
+ vendors?: Array<string>;
879
+ };
845
880
  type DiscountValidationDetails = {
846
881
  message?: string;
847
882
  details?: Array<string>;
package/dist/cart.d.ts CHANGED
@@ -837,11 +837,46 @@ type DiscountResponse = {
837
837
  */
838
838
  links?: Array<Link>;
839
839
  discountValidationDetails?: DiscountValidationDetails;
840
+ /**
841
+ * Indicates whether the discount is limited to the vendors in `restrictions.vendors`.
842
+ */
843
+ vendorRestricted?: boolean;
844
+ restrictions?: DiscountRestrictions;
840
845
  /**
841
846
  * The index of the discount. It represents the discount position in the cart discounts array.
842
847
  */
843
848
  discountIndex?: number;
844
849
  };
850
+ /**
851
+ * Restrictions copied from the coupon.
852
+ */
853
+ type DiscountRestrictions = {
854
+ /**
855
+ * Start of the discount validity period.
856
+ */
857
+ validFrom?: string;
858
+ /**
859
+ * End of the discount validity period.
860
+ */
861
+ validUntil?: string;
862
+ minOrderValue?: Price & unknown;
863
+ /**
864
+ * Categories to which the discount applies.
865
+ */
866
+ includedCategories?: Array<string>;
867
+ /**
868
+ * Categories to which the discount does not apply.
869
+ */
870
+ excludedCategories?: Array<string>;
871
+ /**
872
+ * Customer segments to which the discount applies.
873
+ */
874
+ segments?: Array<string>;
875
+ /**
876
+ * Vendor identifiers to which the discount applies.
877
+ */
878
+ vendors?: Array<string>;
879
+ };
845
880
  type DiscountValidationDetails = {
846
881
  message?: string;
847
882
  details?: Array<string>;
package/dist/index.cjs CHANGED
@@ -1244,7 +1244,7 @@ var HttpClient = class {
1244
1244
  };
1245
1245
 
1246
1246
  // package.json
1247
- var version = "4.6.3";
1247
+ var version = "4.6.5";
1248
1248
 
1249
1249
  // src/version.ts
1250
1250
  var SDK_VERSION = version;
@@ -8810,6 +8810,12 @@ var ImportService = class {
8810
8810
  * Trigger a run. `mode` defaults to `DELTA` server-side; `dryRun: true` maps
8811
8811
  * and validates without writing to the target.
8812
8812
  *
8813
+ * **The run comes back `QUEUED`, not `RUNNING`.** It starts when a worker is
8814
+ * free, usually within moments, or after one of the tenant's runs finishes when
8815
+ * `maxConcurrentImports` are already executing — no `429` any more. A
8816
+ * configuration holds at most one executing and one queued run: while it has a
8817
+ * run `QUEUED`, `RUNNING` or `RESUMABLE`, this call answers `409`.
8818
+ *
8813
8819
  * A dry run can also hand back what it *would* have written: pass
8814
8820
  * `sampleSize` (1–100, default 25) and read the run's `dryRunSample`. Set
8815
8821
  * `origin` to name what asked for the run — `trigger` only distinguishes
@@ -8902,6 +8908,9 @@ var ImportService = class {
8902
8908
  * with `accepted: false` when the run is unknown or already finished — that is
8903
8909
  * a result, not an error. A state conflict may instead come back as a `409`,
8904
8910
  * which does throw.
8911
+ *
8912
+ * A `QUEUED` run is cancelled at once, with or without `force`. A `RESUMABLE`
8913
+ * run stops only with `force: true`; without it the call answers `409`.
8905
8914
  */
8906
8915
  async cancelRun(runId, opts = {}, auth2 = SERVICE30) {
8907
8916
  const query = {};
@@ -9059,7 +9068,9 @@ var ImportService = class {
9059
9068
  });
9060
9069
  }
9061
9070
  /**
9062
- * The tenant's import limits and current consumption.
9071
+ * The tenant's import limits and current consumption. `maxConcurrentImports`
9072
+ * caps executing runs only: a run beyond it waits `QUEUED` instead of being
9073
+ * rejected.
9063
9074
  *
9064
9075
  * **Preview upstream**: the contract may change without a major bump.
9065
9076
  */
@@ -9075,8 +9086,10 @@ var ImportService = class {
9075
9086
  *
9076
9087
  * Returns a **new** run — the retry is its own run with `retry: true`, not a
9077
9088
  * mutation of the original. Poll it with {@link getRun} or follow it with
9078
- * {@link streamRun} exactly as you would a triggered run. Like one, it runs the
9079
- * published mappings and can finish `ABORTED`.
9089
+ * {@link streamRun} exactly as you would a triggered run. Like one, it comes
9090
+ * back `QUEUED`, answers `409` while the configuration has a run `QUEUED`,
9091
+ * `RUNNING` or `RESUMABLE`, runs the published mappings and can finish
9092
+ * `ABORTED`.
9080
9093
  *
9081
9094
  * Not retried on a 5xx, for the same reason {@link triggerRun} is not: a POST
9082
9095
  * that timed out may already have queued the retry.