@commercetools/history-sdk 1.18.0 → 2.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.
Files changed (23) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +112 -22
  3. package/dist/commercetools-history-sdk.browser.cjs.js +127 -198
  4. package/dist/commercetools-history-sdk.browser.esm.js +127 -198
  5. package/dist/commercetools-history-sdk.cjs.dev.js +127 -198
  6. package/dist/commercetools-history-sdk.cjs.prod.js +127 -198
  7. package/dist/commercetools-history-sdk.esm.js +127 -198
  8. package/dist/declarations/src/ctp/ctp-client.d.ts +2 -2
  9. package/dist/declarations/src/generated/client/api-root.d.ts +18 -25
  10. package/dist/declarations/src/generated/client/by-project-key-by-resource-type-by-id-request-builder.d.ts +48 -54
  11. package/dist/declarations/src/generated/client/by-project-key-by-resource-type-request-builder.d.ts +51 -57
  12. package/dist/declarations/src/generated/client/by-project-key-request-builder.d.ts +50 -56
  13. package/dist/declarations/src/generated/index.d.ts +12 -19
  14. package/dist/declarations/src/generated/models/change-value.d.ts +332 -339
  15. package/dist/declarations/src/generated/models/change.d.ts +4492 -4499
  16. package/dist/declarations/src/generated/models/common.d.ts +1115 -1121
  17. package/dist/declarations/src/generated/models/label.d.ts +83 -90
  18. package/dist/declarations/src/generated/shared/utils/common-types.d.ts +26 -33
  19. package/dist/declarations/src/generated/shared/utils/middleware.d.ts +8 -15
  20. package/dist/declarations/src/generated/shared/utils/requests-utils.d.ts +13 -20
  21. package/dist/declarations/src/generated/shared/utils/uri-utils.d.ts +7 -14
  22. package/dist/declarations/src/index.d.ts +2 -2
  23. package/package.json +9 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @commercetools/history-sdk
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#154](https://github.com/commercetools/commercetools-sdk-typescript/pull/154) [`25f1dea`](https://github.com/commercetools/commercetools-sdk-typescript/commit/25f1dea23eccdfdda01e9144ec2afe968ead58f2) Thanks [@jherey](https://github.com/jherey)! - This is the first major release of the sdk client
8
+
9
+ ## 1.20.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#146](https://github.com/commercetools/commercetools-sdk-typescript/pull/146) [`1f6f830`](https://github.com/commercetools/commercetools-sdk-typescript/commit/1f6f830bb25d98c15ac96e06635c5e2aa07fe1e8) Thanks [@ajimae](https://github.com/ajimae)! - release a new version of typescript
14
+
15
+ ### Patch Changes
16
+
17
+ - [#137](https://github.com/commercetools/commercetools-sdk-typescript/pull/137) [`f119f8a`](https://github.com/commercetools/commercetools-sdk-typescript/commit/f119f8a26255790a6faf3667e07b500497a08c21) Thanks [@github-actions](https://github.com/apps/github-actions)! - Update generated SDKs
18
+
19
+ ## 1.19.0
20
+
21
+ ### Minor Changes
22
+
23
+ - [#120](https://github.com/commercetools/commercetools-sdk-typescript/pull/120) [`4d01dba`](https://github.com/commercetools/commercetools-sdk-typescript/commit/4d01dbac9cfe38faaa0a11d3154a016759856772) Thanks [@github-actions](https://github.com/apps/github-actions)! - Update generated SDKs
24
+
25
+ ## 1.18.1
26
+
27
+ ### Patch Changes
28
+
29
+ - [#108](https://github.com/commercetools/commercetools-sdk-typescript/pull/108) [`026d91a`](https://github.com/commercetools/commercetools-sdk-typescript/commit/026d91a747b445b0913eabb7eb91ecc7f3eb257e) Thanks [@github-actions](https://github.com/apps/github-actions)! - Update generated SDKs
30
+
3
31
  ## 1.18.0
4
32
 
5
33
  ### Minor Changes
package/README.md CHANGED
@@ -1,36 +1,126 @@
1
- # Typescript SDK for commercetools Audit log APIs.
1
+ # Typescript SDK for commercetools Audit log (history) APIs.
2
2
 
3
- ## Install
3
+ ## Usage examples
4
4
 
5
- ```bash
6
- npm install --save @commercetools/history-sdk
7
- ```
5
+ ### Browser environment
8
6
 
9
- ### Browser
7
+ ```html
8
+ <script src="https://unpkg.com/@commercetools/sdk-client-v2@latest/dist/commercetools-sdk-client-v2.umd.js"></script>
9
+ <script src="https://unpkg.com/@commercetools/history-sdk@latest/dist/commercetools-history-sdk.umd.js"></script>
10
+ ```
10
11
 
11
12
  ```html
12
- <script src="https://unpkg.com/browse/@commercetools/history-sdk/dist/history-sdk.umd.js"></script>
13
13
  <script>
14
- // global: historySdk
14
+ // global: @commercetools/sdk-client-v2
15
+ // global: @commercetools/history-sdk
16
+ ;(function () {
17
+ // We can now access the sdk-client-v2 and history-sdk object as:
18
+ // const { ClientBuilder } = this['@commercetools/sdk-client-v2']
19
+ // const { createApiBuilderFromCtpClient } = this['@commercetools/history-sdk']
20
+ // or
21
+ // const { ClientBuilder } = window['@commercetools/sdk-client-v2']
22
+ // const { createApiBuilderFromCtpClient } = window['@commercetools/history-sdk']
23
+ })()
15
24
  </script>
16
25
  ```
17
26
 
18
- ### Usage example
27
+ ### Node environment
28
+
29
+ ```bash
30
+ npm install --save @commercetools/sdk-client-v2
31
+ npm install --save @commercetools/history-sdk
32
+ ```
19
33
 
20
34
  ```ts
21
- import { createAuthMiddlewareForClientCredentialsFlow } from '@commercetools/sdk-middleware-auth'
22
- import { createHttpMiddleware } from '@commercetools/sdk-middleware-http'
23
- import { createClient } from '@commercetools/sdk-client'
35
+ const {
36
+ ClientBuilder,
37
+ createAuthForClientCredentialsFlow,
38
+ createHttpClient,
39
+ } = require('@commercetools/sdk-client-v2')
40
+ const { createApiBuilderFromCtpClient } = require('@commercetools/history-sdk')
41
+ const fetch = require('node-fetch')
42
+
43
+ const projectKey = 'mc-project-key'
44
+ const authMiddlewareOptions = {
45
+ host: 'https://auth.europe-west1.gcp.commercetools.com',
46
+ projectKey,
47
+ credentials: {
48
+ clientId: 'mc-client-id',
49
+ clientSecret: 'mc-client-secrets',
50
+ },
51
+ oauthUri: 'https://auth.europe-west1.gcp.commercetools.com',
52
+ scopes: [`manage_project:${projectKey}`],
53
+ fetch,
54
+ }
55
+
56
+ const httpMiddlewareOptions = {
57
+ host: 'https://history.europe-west1.gcp.commercetools.com',
58
+ fetch,
59
+ }
60
+
61
+ const client = new ClientBuilder()
62
+ .withProjectKey(projectKey)
63
+ .withMiddleware(createAuthForClientCredentialsFlow(authMiddlewareOptions))
64
+ .withMiddleware(createHttpClient(httpMiddlewareOptions))
65
+ .withUserAgentMiddleware()
66
+ .build()
67
+
68
+ // or
69
+ const client = new ClientBuilder()
70
+ .withProjectKey(projectKey)
71
+ .withClientCredentialsFlow(authMiddlewareOptions)
72
+ .withHttpMiddleware(httpMiddlewareOptions)
73
+ .withUserAgentMiddleware()
74
+ .build()
75
+
76
+ const apiRoot = createApiBuilderFromCtpClient(client)
77
+
78
+ // calling the history-sdk functions
79
+ // get project details
80
+ apiRoot
81
+ .withProjectKey({ projectKey })
82
+ .recommendations()
83
+ .projectCategories()
84
+ .withProductId({
85
+ productId: product.id,
86
+ })
87
+ .get()
88
+ .execute()
89
+ .then((x) => {
90
+ /*...*/
91
+ })
92
+
93
+ apiRoot
94
+ .withProjectKey({ projectKey })
95
+ .imageSearch()
96
+ .post({
97
+ queryArgs: {
98
+ limit: 20,
99
+ },
100
+ body: image,
101
+ headers: {
102
+ 'Content-Type': 'image/jpeg',
103
+ },
104
+ })
105
+ .execute()
106
+ .then((x) => {
107
+ /*...*/
108
+ })
109
+
110
+ // -----------------------------------------------------------------------
111
+ // The sdk-client-v2 also has support for the old syntax
24
112
  import {
25
- createApiBuilderFromCtpClient,
26
- ApiRoot,
27
- } from '@commercetools/history-sdk'
113
+ createClient,
114
+ createHttpClient,
115
+ createAuthForClientCredentialsFlow,
116
+ } from '@commercetools/sdk-client-v2'
117
+ import { createApiBuilderFromCtpClient } from '@commercetools/history-sdk'
28
118
  import fetch from 'node-fetch'
29
119
 
30
120
  const projectKey = 'some_project_key'
31
121
 
32
- const authMiddleware = createAuthMiddlewareForClientCredentialsFlow({
33
- host: 'https://auth.europe-west1.gcp.commercetools.com/',
122
+ const authMiddleware = createAuthForClientCredentialsFlow({
123
+ host: 'https://auth.europe-west1.gcp.commercetools.com',
34
124
  projectKey,
35
125
  credentials: {
36
126
  clientId: 'some_id',
@@ -39,7 +129,7 @@ const authMiddleware = createAuthMiddlewareForClientCredentialsFlow({
39
129
  fetch,
40
130
  })
41
131
 
42
- const httpMiddleware = createHttpMiddleware({
132
+ const httpMiddleware = createHttpClient({
43
133
  host: 'https://history.europe-west1.gcp.commercetools.com',
44
134
  fetch,
45
135
  })
@@ -48,10 +138,10 @@ const ctpClient = createClient({
48
138
  middlewares: [authMiddleware, httpMiddleware],
49
139
  })
50
140
 
51
- const apiRoot: ApiRoot = createApiBuilderFromCtpClient(ctpClient)
141
+ const apiRoot = createApiBuilderFromCtpClient(ctpClient)
52
142
 
53
143
  apiRoot
54
- .withProjectKeyValue({ projectKey })
144
+ .withProjectKey({ projectKey })
55
145
  .recommendations()
56
146
  .projectCategories()
57
147
  .withProductId({
@@ -59,7 +149,7 @@ apiRoot
59
149
  })
60
150
  .get()
61
151
  .execute()
62
- .then(x => {
152
+ .then((x) => {
63
153
  /*...*/
64
154
  })
65
155
 
@@ -76,7 +166,7 @@ apiRoot
76
166
  },
77
167
  })
78
168
  .execute()
79
- .then(x => {
169
+ .then((x) => {
80
170
  /*...*/
81
171
  })
82
172
  ```
@@ -19,86 +19,36 @@ function _defineProperty(obj, key, value) {
19
19
  return obj;
20
20
  }
21
21
 
22
- function ownKeys(object, enumerableOnly) {
23
- var keys = Object.keys(object);
24
-
25
- if (Object.getOwnPropertySymbols) {
26
- var symbols = Object.getOwnPropertySymbols(object);
27
-
28
- if (enumerableOnly) {
29
- symbols = symbols.filter(function (sym) {
30
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
31
- });
32
- }
33
-
34
- keys.push.apply(keys, symbols);
35
- }
36
-
37
- return keys;
38
- }
39
-
40
- function _objectSpread2(target) {
41
- for (var i = 1; i < arguments.length; i++) {
42
- var source = arguments[i] != null ? arguments[i] : {};
43
-
44
- if (i % 2) {
45
- ownKeys(Object(source), true).forEach(function (key) {
46
- _defineProperty(target, key, source[key]);
47
- });
48
- } else if (Object.getOwnPropertyDescriptors) {
49
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
50
- } else {
51
- ownKeys(Object(source)).forEach(function (key) {
52
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
53
- });
54
- }
55
- }
56
-
57
- return target;
58
- }
59
-
60
- function _classCallCheck(instance, Constructor) {
61
- if (!(instance instanceof Constructor)) {
62
- throw new TypeError("Cannot call a class as a function");
63
- }
64
- }
65
-
66
- function _defineProperties(target, props) {
67
- for (var i = 0; i < props.length; i++) {
68
- var descriptor = props[i];
69
- descriptor.enumerable = descriptor.enumerable || false;
70
- descriptor.configurable = true;
71
- if ("value" in descriptor) descriptor.writable = true;
72
- Object.defineProperty(target, descriptor.key, descriptor);
73
- }
74
- }
75
-
76
- function _createClass(Constructor, protoProps, staticProps) {
77
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
78
- if (staticProps) _defineProperties(Constructor, staticProps);
79
- return Constructor;
80
- }
22
+ /**
23
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
24
+ * Please don't change this file manually but run `rmf-codegen generate <raml_file_path> -o <output_path> -t typescript_client` to update it.
25
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
26
+ */
81
27
 
82
28
  function isDefined(value) {
83
29
  return typeof value !== 'undefined' && value !== null;
84
30
  }
85
31
 
86
32
  function cleanObject(obj) {
87
- return Object.keys(obj).reduce(function (result, key) {
88
- var value = obj[key];
33
+ return Object.keys(obj).reduce((result, key) => {
34
+ const value = obj[key];
89
35
 
90
36
  if (Array.isArray(value)) {
91
- var values = value.filter(isDefined);
37
+ const values = value.filter(isDefined);
92
38
 
93
39
  if (!values.length) {
94
40
  return result;
95
41
  }
96
42
 
97
- return _objectSpread2(_objectSpread2({}, result), {}, _defineProperty({}, key, values));
43
+ return { ...result,
44
+ [key]: values
45
+ };
98
46
  }
99
47
 
100
48
  if (isDefined(value)) {
101
- return _objectSpread2(_objectSpread2({}, result), {}, _defineProperty({}, key, value));
49
+ return { ...result,
50
+ [key]: value
51
+ };
102
52
  }
103
53
 
104
54
  return result;
@@ -106,152 +56,145 @@ function cleanObject(obj) {
106
56
  }
107
57
 
108
58
  function formatQueryString(variableMap) {
109
- var map = cleanObject(variableMap);
110
- var result = querystring.stringify(map);
59
+ const map = cleanObject(variableMap);
60
+ const result = querystring.stringify(map);
111
61
 
112
62
  if (result === '') {
113
63
  return '';
114
64
  }
115
65
 
116
- return "?".concat(result);
66
+ return `?${result}`;
117
67
  }
118
68
 
119
69
  function buildRelativeUri(commonRequest) {
120
- var pathMap = commonRequest.pathVariables;
70
+ const pathMap = commonRequest.pathVariables;
121
71
  var uri = commonRequest.uriTemplate;
122
72
 
123
- for (var param in pathMap) {
124
- uri = uri.replace("{".concat(param, "}"), "".concat(pathMap[param]));
73
+ for (const param in pathMap) {
74
+ uri = uri.replace(`{${param}}`, `${pathMap[param]}`);
125
75
  }
126
76
 
127
- var resQuery = formatQueryString(commonRequest.queryParams || {});
128
- return "".concat(uri).concat(resQuery);
77
+ const resQuery = formatQueryString(commonRequest.queryParams || {});
78
+ return `${uri}${resQuery}`;
129
79
  }
130
80
 
131
- var ApiRequest = /*#__PURE__*/function () {
132
- function ApiRequest(request, requestExecutor) {
133
- _classCallCheck(this, ApiRequest);
134
-
81
+ class ApiRequest {
82
+ constructor(request, requestExecutor) {
135
83
  this.requestExecutor = requestExecutor;
136
84
 
137
85
  _defineProperty(this, "request", void 0);
138
86
 
139
- this.request = _objectSpread2(_objectSpread2({}, request), {}, {
87
+ this.request = { ...request,
140
88
  uri: buildRelativeUri(request)
141
- });
89
+ };
142
90
  }
143
91
 
144
- _createClass(ApiRequest, [{
145
- key: "clientRequest",
146
- value: function clientRequest() {
147
- return this.request;
148
- }
149
- }, {
150
- key: "execute",
151
- value: function execute() {
152
- return this.requestExecutor(this.request);
153
- }
154
- }]);
92
+ clientRequest() {
93
+ return this.request;
94
+ }
155
95
 
156
- return ApiRequest;
157
- }();
96
+ execute() {
97
+ return this.requestExecutor(this.request);
98
+ }
158
99
 
159
- var ByProjectKeyByResourceTypeByIDRequestBuilder = /*#__PURE__*/function () {
160
- function ByProjectKeyByResourceTypeByIDRequestBuilder(args) {
161
- _classCallCheck(this, ByProjectKeyByResourceTypeByIDRequestBuilder);
100
+ }
162
101
 
102
+ /**
103
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
104
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
105
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
106
+ */
107
+ class ByProjectKeyByResourceTypeByIDRequestBuilder {
108
+ constructor(args) {
163
109
  this.args = args;
164
110
  }
165
111
 
166
- _createClass(ByProjectKeyByResourceTypeByIDRequestBuilder, [{
167
- key: "get",
168
- value: function get(methodArgs) {
169
- return new ApiRequest({
170
- baseUri: this.args.baseUri,
171
- method: 'GET',
172
- uriTemplate: '/{projectKey}/{resourceType}/{ID}',
173
- pathVariables: this.args.pathArgs,
174
- headers: _objectSpread2({}, methodArgs === null || methodArgs === void 0 ? void 0 : methodArgs.headers),
175
- queryParams: methodArgs === null || methodArgs === void 0 ? void 0 : methodArgs.queryArgs
176
- }, this.args.executeRequest);
177
- }
178
- }]);
179
-
180
- return ByProjectKeyByResourceTypeByIDRequestBuilder;
181
- }();
112
+ get(methodArgs) {
113
+ return new ApiRequest({
114
+ baseUri: this.args.baseUri,
115
+ method: 'GET',
116
+ uriTemplate: '/{projectKey}/{resourceType}/{ID}',
117
+ pathVariables: this.args.pathArgs,
118
+ headers: { ...(methodArgs === null || methodArgs === void 0 ? void 0 : methodArgs.headers)
119
+ },
120
+ queryParams: methodArgs === null || methodArgs === void 0 ? void 0 : methodArgs.queryArgs
121
+ }, this.args.executeRequest);
122
+ }
182
123
 
183
- var ByProjectKeyByResourceTypeRequestBuilder = /*#__PURE__*/function () {
184
- function ByProjectKeyByResourceTypeRequestBuilder(args) {
185
- _classCallCheck(this, ByProjectKeyByResourceTypeRequestBuilder);
124
+ }
186
125
 
126
+ /**
127
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
128
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
129
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
130
+ */
131
+ class ByProjectKeyByResourceTypeRequestBuilder {
132
+ constructor(args) {
187
133
  this.args = args;
188
134
  }
189
135
 
190
- _createClass(ByProjectKeyByResourceTypeRequestBuilder, [{
191
- key: "withIDValue",
192
- value: function withIDValue(childPathArgs) {
193
- return new ByProjectKeyByResourceTypeByIDRequestBuilder({
194
- pathArgs: _objectSpread2(_objectSpread2({}, this.args.pathArgs), childPathArgs),
195
- executeRequest: this.args.executeRequest,
196
- baseUri: this.args.baseUri
197
- });
198
- }
199
- }, {
200
- key: "get",
201
- value: function get(methodArgs) {
202
- return new ApiRequest({
203
- baseUri: this.args.baseUri,
204
- method: 'GET',
205
- uriTemplate: '/{projectKey}/{resourceType}',
206
- pathVariables: this.args.pathArgs,
207
- headers: _objectSpread2({}, methodArgs === null || methodArgs === void 0 ? void 0 : methodArgs.headers),
208
- queryParams: methodArgs === null || methodArgs === void 0 ? void 0 : methodArgs.queryArgs
209
- }, this.args.executeRequest);
210
- }
211
- }]);
136
+ withIDValue(childPathArgs) {
137
+ return new ByProjectKeyByResourceTypeByIDRequestBuilder({
138
+ pathArgs: { ...this.args.pathArgs,
139
+ ...childPathArgs
140
+ },
141
+ executeRequest: this.args.executeRequest,
142
+ baseUri: this.args.baseUri
143
+ });
144
+ }
212
145
 
213
- return ByProjectKeyByResourceTypeRequestBuilder;
214
- }();
146
+ get(methodArgs) {
147
+ return new ApiRequest({
148
+ baseUri: this.args.baseUri,
149
+ method: 'GET',
150
+ uriTemplate: '/{projectKey}/{resourceType}',
151
+ pathVariables: this.args.pathArgs,
152
+ headers: { ...(methodArgs === null || methodArgs === void 0 ? void 0 : methodArgs.headers)
153
+ },
154
+ queryParams: methodArgs === null || methodArgs === void 0 ? void 0 : methodArgs.queryArgs
155
+ }, this.args.executeRequest);
156
+ }
215
157
 
216
- var ByProjectKeyRequestBuilder = /*#__PURE__*/function () {
217
- function ByProjectKeyRequestBuilder(args) {
218
- _classCallCheck(this, ByProjectKeyRequestBuilder);
158
+ }
219
159
 
160
+ /**
161
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
162
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
163
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
164
+ */
165
+ class ByProjectKeyRequestBuilder {
166
+ constructor(args) {
220
167
  this.args = args;
221
168
  }
222
169
 
223
- _createClass(ByProjectKeyRequestBuilder, [{
224
- key: "withResourceTypeValue",
225
- value: function withResourceTypeValue(childPathArgs) {
226
- return new ByProjectKeyByResourceTypeRequestBuilder({
227
- pathArgs: _objectSpread2(_objectSpread2({}, this.args.pathArgs), childPathArgs),
228
- executeRequest: this.args.executeRequest,
229
- baseUri: this.args.baseUri
230
- });
231
- }
232
- }, {
233
- key: "get",
234
- value: function get(methodArgs) {
235
- return new ApiRequest({
236
- baseUri: this.args.baseUri,
237
- method: 'GET',
238
- uriTemplate: '/{projectKey}',
239
- pathVariables: this.args.pathArgs,
240
- headers: _objectSpread2({}, methodArgs === null || methodArgs === void 0 ? void 0 : methodArgs.headers),
241
- queryParams: methodArgs === null || methodArgs === void 0 ? void 0 : methodArgs.queryArgs
242
- }, this.args.executeRequest);
243
- }
244
- }]);
170
+ withResourceTypeValue(childPathArgs) {
171
+ return new ByProjectKeyByResourceTypeRequestBuilder({
172
+ pathArgs: { ...this.args.pathArgs,
173
+ ...childPathArgs
174
+ },
175
+ executeRequest: this.args.executeRequest,
176
+ baseUri: this.args.baseUri
177
+ });
178
+ }
179
+
180
+ get(methodArgs) {
181
+ return new ApiRequest({
182
+ baseUri: this.args.baseUri,
183
+ method: 'GET',
184
+ uriTemplate: '/{projectKey}',
185
+ pathVariables: this.args.pathArgs,
186
+ headers: { ...(methodArgs === null || methodArgs === void 0 ? void 0 : methodArgs.headers)
187
+ },
188
+ queryParams: methodArgs === null || methodArgs === void 0 ? void 0 : methodArgs.queryArgs
189
+ }, this.args.executeRequest);
190
+ }
245
191
 
246
- return ByProjectKeyRequestBuilder;
247
- }();
192
+ }
248
193
 
249
- var ApiRoot = /*#__PURE__*/function () {
250
- function ApiRoot(args) {
194
+ class ApiRoot {
195
+ constructor(args) {
251
196
  var _args$baseUri;
252
197
 
253
- _classCallCheck(this, ApiRoot);
254
-
255
198
  _defineProperty(this, "executeRequest", void 0);
256
199
 
257
200
  _defineProperty(this, "baseUri", void 0);
@@ -260,51 +203,37 @@ var ApiRoot = /*#__PURE__*/function () {
260
203
  this.baseUri = (_args$baseUri = args.baseUri) !== null && _args$baseUri !== void 0 ? _args$baseUri : 'https://history.europe-west1.gcp.commercetools.com';
261
204
  }
262
205
 
263
- _createClass(ApiRoot, [{
264
- key: "withProjectKeyValue",
265
- value: function withProjectKeyValue(childPathArgs) {
266
- return new ByProjectKeyRequestBuilder({
267
- pathArgs: _objectSpread2({}, childPathArgs),
268
- executeRequest: this.executeRequest,
269
- baseUri: this.baseUri
270
- });
271
- }
272
- }]);
206
+ withProjectKeyValue(childPathArgs) {
207
+ return new ByProjectKeyRequestBuilder({
208
+ pathArgs: { ...childPathArgs
209
+ },
210
+ executeRequest: this.executeRequest,
211
+ baseUri: this.baseUri
212
+ });
213
+ }
273
214
 
274
- return ApiRoot;
275
- }();
215
+ }
276
216
 
277
217
  /**
278
- *
279
- * Generated file, please do not change!!!
280
- * From http://www.commercetools.com/ with love
281
- *
282
- * ,d88b.d88b,
283
- * 88888888888
284
- * `Y8888888Y'
285
- * `Y888Y'
286
- * `Y'
287
- *
218
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
219
+ * Please don't change this file manually but run `rmf-codegen generate <raml_file_path> -o <output_path> -t typescript_client` to update it.
220
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
288
221
  */
289
- var createExecutorFromMiddlewares = function createExecutorFromMiddlewares(executor, midds) {
222
+ const createExecutorFromMiddlewares = (executor, midds) => {
290
223
  if (!midds || midds.length == 0) {
291
224
  return executor;
292
225
  }
293
226
 
294
- var reduced = midds.reduce(reduceMiddleware);
227
+ const reduced = midds.reduce(reduceMiddleware);
295
228
  return middlewareToExecutor(reduced, executor);
296
229
  };
297
230
 
298
231
  function reduceMiddleware(middleware1, middleware2) {
299
- return function (request, executor) {
300
- return middleware1(request, middlewareToExecutor(middleware2, executor));
301
- };
232
+ return (request, executor) => middleware1(request, middlewareToExecutor(middleware2, executor));
302
233
  }
303
234
 
304
235
  function middlewareToExecutor(middleware, executor) {
305
- return function (request) {
306
- return middleware(request, executor);
307
- };
236
+ return request => middleware(request, executor);
308
237
  }
309
238
 
310
239
  function createApiBuilderFromCtpClient(ctpClient, baseUri) {