@commercetools/history-sdk 3.6.0 → 4.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,43 @@
1
1
  # @commercetools/history-sdk
2
2
 
3
+ ## 4.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)! - **History changes**
14
+
15
+ <details>
16
+ <summary>Added Property(s)</summary>
17
+
18
+ - added property `businessUnit` to type `Record`
19
+ </details>
20
+
21
+ <details>
22
+ <summary>Changed Property(s)</summary>
23
+
24
+ - :warning: changed property `previousValue` of type `SetNameChange` from type `LocalizedString` to `string`
25
+ - :warning: changed property `nextValue` of type `SetNameChange` from type `LocalizedString` to `string`
26
+ </details>
27
+
28
+ <details>
29
+ <summary>Added QueryParameter(s)</summary>
30
+
31
+ - added query parameter `businessUnit` to method `get /{projectKey}`
32
+ - added query parameter `businessUnit` to method `get /{projectKey}/{resourceType}`
33
+ - added query parameter `businessUnit` to method `get /{projectKey}/{resourceType}/{ID}`
34
+ </details>
35
+
36
+ ### Patch Changes
37
+
38
+ - Updated dependencies [[`a6d0df2`](https://github.com/commercetools/commercetools-sdk-typescript/commit/a6d0df2034b72504db2aa2d13a8d3726d97cc881)]:
39
+ - @commercetools/sdk-client-v2@2.2.2
40
+
3
41
  ## 3.6.0
4
42
 
5
43
  ### 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}`;
@@ -40,6 +40,7 @@ export declare class ByProjectKeyByResourceTypeByIDRequestBuilder {
40
40
  clientId?: string;
41
41
  customerId?: string;
42
42
  associateId?: string;
43
+ businessUnit?: string;
43
44
  type?: string;
44
45
  source?: string;
45
46
  changes?: string | string[];
@@ -42,6 +42,7 @@ export declare class ByProjectKeyByResourceTypeRequestBuilder {
42
42
  clientId?: string;
43
43
  customerId?: string;
44
44
  associateId?: string;
45
+ businessUnit?: string;
45
46
  type?: string;
46
47
  resourceKey?: string;
47
48
  source?: string;
@@ -41,6 +41,7 @@ export declare class ByProjectKeyRequestBuilder {
41
41
  clientId?: string;
42
42
  customerId?: string;
43
43
  associateId?: string;
44
+ businessUnit?: string;
44
45
  type?: string;
45
46
  resourceId?: string;
46
47
  resourceKey?: string;
@@ -9,5 +9,6 @@ export * from "./models/change-history.js";
9
9
  export * from "./models/change-value.js";
10
10
  export * from "./models/common.js";
11
11
  export * from "./models/label.js";
12
+ export * from "./models/scalar-types.js";
12
13
  export * from "./shared/utils/common-types.js";
13
14
  export * from "./shared/utils/middleware.js";
@@ -73,6 +73,12 @@ export interface Record {
73
73
  *
74
74
  */
75
75
  readonly stores: KeyReference[];
76
+ /**
77
+ * Reference to the [Business Unit](ctp:api:type:BusinessUnit) associated with the [Change](ctp:history:type:Change).
78
+ *
79
+ *
80
+ */
81
+ readonly businessUnit?: KeyReference;
76
82
  /**
77
83
  * `true` if no change was detected.
78
84
  *
@@ -5157,12 +5157,7 @@ export interface SetMiddleNameChange {
5157
5157
  readonly nextValue: string;
5158
5158
  }
5159
5159
  /**
5160
- * Change triggered by the following update actions:
5161
- *
5162
- * - [Set Name](ctp:api:type:DiscountCodeSetNameAction) on Discount Codes.
5163
- * - [Set State Name](ctp:api:type:StateSetNameAction) on States.
5164
- * - [Set Name](ctp:api:type:StoreSetNameAction) on Stores.
5165
- *
5160
+ * Change triggered by the [Set Name](ctp:api:type:AssociateRoleSetNameAction) update action.
5166
5161
  */
5167
5162
  export interface SetNameChange {
5168
5163
  readonly type: 'SetNameChange';
@@ -5174,13 +5169,21 @@ export interface SetNameChange {
5174
5169
  * Value before the change.
5175
5170
  *
5176
5171
  */
5177
- readonly previousValue: LocalizedString;
5172
+ readonly previousValue: string;
5178
5173
  /**
5179
5174
  * Value after the change.
5180
5175
  *
5181
5176
  */
5182
- readonly nextValue: LocalizedString;
5177
+ readonly nextValue: string;
5183
5178
  }
5179
+ /**
5180
+ * Change triggered by the following update actions:
5181
+ *
5182
+ * - [Set Name](ctp:api:type:DiscountCodeSetNameAction) on Discount Codes.
5183
+ * - [Set State Name](ctp:api:type:StateSetNameAction) on States.
5184
+ * - [Set Name](ctp:api:type:StoreSetNameAction) on Stores.
5185
+ *
5186
+ */
5184
5187
  export interface SetLocalizedNameChange {
5185
5188
  readonly type: 'SetLocalizedNameChange';
5186
5189
  /**
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
3
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
4
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
5
+ */
6
+ export type Locale = string;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "name": "@commercetools/history-sdk",
7
- "version": "3.6.0",
7
+ "version": "4.0.0",
8
8
  "engines": {
9
9
  "node": ">=14"
10
10
  },
@@ -32,13 +32,13 @@
32
32
  "./dist/commercetools-history-sdk.esm.js": "./dist/commercetools-history-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"
39
39
  },
40
40
  "devDependencies": {
41
- "@commercetools/platform-sdk": "6.0.0",
41
+ "@commercetools/platform-sdk": "7.0.0",
42
42
  "@types/uuid": "9.0.2",
43
43
  "organize-imports-cli": "0.10.0",
44
44
  "tsconfig-replace-paths": "0.0.13",