@commercetools/importapi-sdk 4.7.0 → 5.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @commercetools/importapi-sdk
2
2
 
3
+ ## 5.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#551](https://github.com/commercetools/commercetools-sdk-typescript/pull/551) [`9e7939a`](https://github.com/commercetools/commercetools-sdk-typescript/commit/9e7939a1df234fd1f4f77c60f4ff75b31d7fc3fd) Thanks [@github-actions](https://github.com/apps/github-actions)! - BREAKING CHANGE:
8
+
9
+ - fix URI parameters to be URI encoded
10
+
11
+ ### Minor Changes
12
+
13
+ - [#527](https://github.com/commercetools/commercetools-sdk-typescript/pull/527) [`00c6176`](https://github.com/commercetools/commercetools-sdk-typescript/commit/00c617692543f9a8d0ac64e81d583f89e002e81b) Thanks [@github-actions](https://github.com/apps/github-actions)! - **Import changes**
14
+
15
+ <details>
16
+ <summary>Added Property(s)</summary>
17
+
18
+ - added property `product` to type `ProductVariantPatch`
19
+ </details>
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies [[`a6d0df2`](https://github.com/commercetools/commercetools-sdk-typescript/commit/a6d0df2034b72504db2aa2d13a8d3726d97cc881)]:
24
+ - @commercetools/sdk-client-v2@2.2.2
25
+
3
26
  ## 4.7.0
4
27
 
5
28
  ### Minor Changes
@@ -86,7 +86,8 @@ function buildRelativeUri(commonRequest) {
86
86
  const pathMap = commonRequest.pathVariables;
87
87
  var uri = commonRequest.uriTemplate;
88
88
  for (const param in pathMap) {
89
- uri = uri.replace(`{${param}}`, `${pathMap[param]}`);
89
+ const value = encodeURIComponent(`${pathMap[param]}`);
90
+ uri = uri.replace(`{${param}}`, `${value}`);
90
91
  }
91
92
  const resQuery = formatQueryString(commonRequest.queryParams || {});
92
93
  return `${uri}${resQuery}`;
@@ -82,7 +82,8 @@ function buildRelativeUri(commonRequest) {
82
82
  const pathMap = commonRequest.pathVariables;
83
83
  var uri = commonRequest.uriTemplate;
84
84
  for (const param in pathMap) {
85
- uri = uri.replace(`{${param}}`, `${pathMap[param]}`);
85
+ const value = encodeURIComponent(`${pathMap[param]}`);
86
+ uri = uri.replace(`{${param}}`, `${value}`);
86
87
  }
87
88
  const resQuery = formatQueryString(commonRequest.queryParams || {});
88
89
  return `${uri}${resQuery}`;
@@ -86,7 +86,8 @@ function buildRelativeUri(commonRequest) {
86
86
  const pathMap = commonRequest.pathVariables;
87
87
  var uri = commonRequest.uriTemplate;
88
88
  for (const param in pathMap) {
89
- uri = uri.replace(`{${param}}`, `${pathMap[param]}`);
89
+ const value = encodeURIComponent(`${pathMap[param]}`);
90
+ uri = uri.replace(`{${param}}`, `${value}`);
90
91
  }
91
92
  const resQuery = formatQueryString(commonRequest.queryParams || {});
92
93
  return `${uri}${resQuery}`;
@@ -86,7 +86,8 @@ function buildRelativeUri(commonRequest) {
86
86
  const pathMap = commonRequest.pathVariables;
87
87
  var uri = commonRequest.uriTemplate;
88
88
  for (const param in pathMap) {
89
- uri = uri.replace(`{${param}}`, `${pathMap[param]}`);
89
+ const value = encodeURIComponent(`${pathMap[param]}`);
90
+ uri = uri.replace(`{${param}}`, `${value}`);
90
91
  }
91
92
  const resQuery = formatQueryString(commonRequest.queryParams || {});
92
93
  return `${uri}${resQuery}`;
@@ -82,7 +82,8 @@ function buildRelativeUri(commonRequest) {
82
82
  const pathMap = commonRequest.pathVariables;
83
83
  var uri = commonRequest.uriTemplate;
84
84
  for (const param in pathMap) {
85
- uri = uri.replace(`{${param}}`, `${pathMap[param]}`);
85
+ const value = encodeURIComponent(`${pathMap[param]}`);
86
+ uri = uri.replace(`{${param}}`, `${value}`);
86
87
  }
87
88
  const resQuery = formatQueryString(commonRequest.queryParams || {});
88
89
  return `${uri}${resQuery}`;
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { KeyReference, LocalizedString, Money, TypedMoney, TypeKeyReference } from "./common.js";
7
7
  /**
8
- * The representation to be sent to the server when creating a resource with custom fields.
8
+ * The representation to be sent to the server when creating a resource with Custom Fields.
9
9
  */
10
10
  export interface Custom {
11
11
  /**
@@ -14,19 +14,19 @@ export interface Custom {
14
14
  */
15
15
  readonly type: TypeKeyReference;
16
16
  /**
17
- * The custom fields of this object.
17
+ * The Custom Fields of this object.
18
18
  *
19
19
  */
20
20
  readonly fields?: FieldContainer;
21
21
  }
22
22
  /**
23
- * Maps the custom field names to the actual values.
23
+ * Maps the Custom Field names to actual values.
24
24
  */
25
25
  export interface FieldContainer {
26
26
  [key: string]: CustomField;
27
27
  }
28
28
  /**
29
- * Provides the value for a custom field of a specific type.
29
+ * Provides the value for a Custom Field of a specific type.
30
30
  */
31
31
  export type CustomField = BooleanField | BooleanSetField | DateField | DateSetField | DateTimeField | DateTimeSetField | EnumField | EnumSetField | LocalizedEnumField | LocalizedEnumSetField | LocalizedStringField | LocalizedStringSetField | MoneyField | MoneySetField | NumberField | NumberSetField | ReferenceField | ReferenceSetField | StringField | StringSetField | TimeField | TimeSetField;
32
32
  /**
@@ -318,7 +318,7 @@ export interface Parcel {
318
318
  */
319
319
  readonly items?: DeliveryItem[];
320
320
  /**
321
- * The representation to be sent to the server when creating a resource with custom fields.
321
+ * The representation to be sent to the server when creating a resource with Custom Fields.
322
322
  *
323
323
  */
324
324
  readonly custom?: Custom;
@@ -501,9 +501,8 @@ export interface ProductVariantImport extends ImportResource {
501
501
  */
502
502
  export interface ProductVariantPatch {
503
503
  /**
504
- * The [ProductVariant](/../api/projects/products#productvariant) to which this patch is applied.
505
- * The Reference to the [ProductVariant](/../api/projects/products#productvariant) with which the ProductVariantPatch is associated.
506
- * If referenced ProductVariant does not exist, the `state` of the [ImportOperation](/import-operation#importoperation) will be set to `unresolved` until the necessary ProductVariant is created.
504
+ * Reference to the [ProductVariant](/../api/projects/products#productvariant) to update.
505
+ * If the referenced ProductVariant does not exist, the `state` of the [ImportOperation](/import-operation#importoperation) will be set to `unresolved` until the necessary ProductVariant is created.
507
506
  *
508
507
  *
509
508
  */
@@ -524,6 +523,12 @@ export interface ProductVariantPatch {
524
523
  *
525
524
  */
526
525
  readonly staged?: boolean;
526
+ /**
527
+ * Reference to the [Product](/../api/projects/products#product) which contains the ProductVariant. Setting a value will batch process the import operations to minimize concurrency errors. If set, this field is required for every ProductVariantPatch in the [ProductVariantPatchRequest](ctp:import:type:ProductVariantPatchRequest).
528
+ *
529
+ *
530
+ */
531
+ readonly product?: ProductKeyReference;
527
532
  }
528
533
  export interface Attributes {
529
534
  [key: string]: Attribute | null;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "name": "@commercetools/importapi-sdk",
7
- "version": "4.7.0",
7
+ "version": "5.0.0",
8
8
  "engines": {
9
9
  "node": ">=14"
10
10
  },
@@ -32,7 +32,7 @@
32
32
  "./dist/commercetools-importapi-sdk.esm.js": "./dist/commercetools-importapi-sdk.browser.esm.js"
33
33
  },
34
34
  "dependencies": {
35
- "@commercetools/sdk-client-v2": "^2.1.6",
35
+ "@commercetools/sdk-client-v2": "^2.2.2",
36
36
  "@commercetools/sdk-middleware-auth": "^7.0.0",
37
37
  "@commercetools/sdk-middleware-http": "^7.0.0",
38
38
  "@commercetools/sdk-middleware-logger": "^3.0.0"