@commercetools/sdk-client-v2 2.5.0 → 3.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 (38) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +0 -2
  3. package/dist/commercetools-sdk-client-v2.browser.cjs.js +22 -34
  4. package/dist/commercetools-sdk-client-v2.browser.esm.js +22 -30
  5. package/dist/commercetools-sdk-client-v2.cjs.d.ts +1 -1
  6. package/dist/commercetools-sdk-client-v2.cjs.dev.js +22 -34
  7. package/dist/commercetools-sdk-client-v2.cjs.prod.js +22 -34
  8. package/dist/commercetools-sdk-client-v2.esm.js +22 -30
  9. package/dist/commercetools-sdk-client-v2.umd.js +14 -1
  10. package/dist/declarations/src/client-builder/ClientBuilder.d.ts +1 -0
  11. package/dist/declarations/src/client-builder/ClientBuilder.d.ts.map +1 -0
  12. package/dist/declarations/src/index.d.ts +1 -0
  13. package/dist/declarations/src/index.d.ts.map +1 -0
  14. package/dist/declarations/src/sdk-client/client.d.ts +1 -0
  15. package/dist/declarations/src/sdk-client/client.d.ts.map +1 -0
  16. package/dist/declarations/src/sdk-client/errors.d.ts +1 -0
  17. package/dist/declarations/src/sdk-client/errors.d.ts.map +1 -0
  18. package/dist/declarations/src/sdk-middleware-auth/anonymous-session-flow.d.ts +1 -0
  19. package/dist/declarations/src/sdk-middleware-auth/anonymous-session-flow.d.ts.map +1 -0
  20. package/dist/declarations/src/sdk-middleware-auth/client-credentials-flow.d.ts +1 -0
  21. package/dist/declarations/src/sdk-middleware-auth/client-credentials-flow.d.ts.map +1 -0
  22. package/dist/declarations/src/sdk-middleware-auth/existing-token.d.ts +1 -0
  23. package/dist/declarations/src/sdk-middleware-auth/existing-token.d.ts.map +1 -0
  24. package/dist/declarations/src/sdk-middleware-auth/password-flow.d.ts +1 -0
  25. package/dist/declarations/src/sdk-middleware-auth/password-flow.d.ts.map +1 -0
  26. package/dist/declarations/src/sdk-middleware-auth/refresh-token-flow.d.ts +1 -0
  27. package/dist/declarations/src/sdk-middleware-auth/refresh-token-flow.d.ts.map +1 -0
  28. package/dist/declarations/src/sdk-middleware-correlation-id/correlation-id.d.ts +1 -0
  29. package/dist/declarations/src/sdk-middleware-correlation-id/correlation-id.d.ts.map +1 -0
  30. package/dist/declarations/src/sdk-middleware-http/http.d.ts +1 -0
  31. package/dist/declarations/src/sdk-middleware-http/http.d.ts.map +1 -0
  32. package/dist/declarations/src/sdk-middleware-logger/logger.d.ts +1 -0
  33. package/dist/declarations/src/sdk-middleware-logger/logger.d.ts.map +1 -0
  34. package/dist/declarations/src/sdk-middleware-queue/queue.d.ts +1 -0
  35. package/dist/declarations/src/sdk-middleware-queue/queue.d.ts.map +1 -0
  36. package/dist/declarations/src/sdk-middleware-user-agent/user-agent.d.ts +1 -0
  37. package/dist/declarations/src/sdk-middleware-user-agent/user-agent.d.ts.map +1 -0
  38. package/package.json +6 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @commercetools/sdk-client-v2
2
2
 
3
+ ## 3.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#896](https://github.com/commercetools/commercetools-sdk-typescript/pull/896) [`f9b8cb6`](https://github.com/commercetools/commercetools-sdk-typescript/commit/f9b8cb605d99fe5ece13bdc3c152eb4818e19b3b) Thanks [@lojzatran](https://github.com/lojzatran)! - Remove support of nodejs 16
8
+
3
9
  ## 2.5.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -40,7 +40,6 @@ const {
40
40
  createHttpClient,
41
41
  } = require('@commercetools/sdk-client-v2')
42
42
  const { createApiBuilderFromCtpClient } = require('@commercetools/platform-sdk')
43
- const fetch = require('node-fetch')
44
43
 
45
44
  const projectKey = 'mc-project-key'
46
45
  const authMiddlewareOptions = {
@@ -128,7 +127,6 @@ import {
128
127
  createAuthForClientCredentialsFlow,
129
128
  } from '@commercetools/sdk-client-v2'
130
129
  import { createApiBuilderFromCtpClient } from '@commercetools/platform-sdk'
131
- import fetch from 'node-fetch'
132
130
 
133
131
  const projectKey = 'some_project_key'
134
132
 
@@ -2,14 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var fetch$1 = require('node-fetch');
6
5
  var _ = require('buffer/');
7
6
 
8
- function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
9
-
10
- var fetch__default = /*#__PURE__*/_interopDefault(fetch$1);
11
-
12
- function toPrimitive(t, r) {
7
+ function _toPrimitive(t, r) {
13
8
  if ("object" != typeof t || !t) return t;
14
9
  var e = t[Symbol.toPrimitive];
15
10
  if (void 0 !== e) {
@@ -20,24 +15,18 @@ function toPrimitive(t, r) {
20
15
  return ("string" === r ? String : Number)(t);
21
16
  }
22
17
 
23
- function toPropertyKey(t) {
24
- var i = toPrimitive(t, "string");
18
+ function _toPropertyKey(t) {
19
+ var i = _toPrimitive(t, "string");
25
20
  return "symbol" == typeof i ? i : i + "";
26
21
  }
27
22
 
28
- function _defineProperty(obj, key, value) {
29
- key = toPropertyKey(key);
30
- if (key in obj) {
31
- Object.defineProperty(obj, key, {
32
- value: value,
33
- enumerable: true,
34
- configurable: true,
35
- writable: true
36
- });
37
- } else {
38
- obj[key] = value;
39
- }
40
- return obj;
23
+ function _defineProperty(e, r, t) {
24
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
25
+ value: t,
26
+ enumerable: !0,
27
+ configurable: !0,
28
+ writable: !0
29
+ }) : e[r] = t, e;
41
30
  }
42
31
 
43
32
  function isDefined(value) {
@@ -1068,9 +1057,9 @@ function createQueueMiddleware({
1068
1057
 
1069
1058
  var packageJson = {
1070
1059
  name: "@commercetools/sdk-client-v2",
1071
- version: "2.5.0",
1060
+ version: "3.0.0",
1072
1061
  engines: {
1073
- node: ">=14"
1062
+ node: ">=18"
1074
1063
  },
1075
1064
  description: "commercetools Composable Commerce TypeScript SDK client.",
1076
1065
  keywords: [
@@ -1101,8 +1090,7 @@ var packageJson = {
1101
1090
  url: "https://github.com/commercetools/commercetools-sdk-typescript/issues"
1102
1091
  },
1103
1092
  dependencies: {
1104
- buffer: "^6.0.3",
1105
- "node-fetch": "^2.6.1"
1093
+ buffer: "^6.0.3"
1106
1094
  },
1107
1095
  files: [
1108
1096
  "dist",
@@ -1116,17 +1104,17 @@ var packageJson = {
1116
1104
  "./dist/commercetools-sdk-client-v2.esm.js": "./dist/commercetools-sdk-client-v2.browser.esm.js"
1117
1105
  },
1118
1106
  devDependencies: {
1119
- "abort-controller": "3.0.0",
1120
1107
  "common-tags": "1.8.2",
1121
1108
  dotenv: "16.4.5",
1122
1109
  jest: "29.7.0",
1123
- nock: "12.0.3",
1110
+ nock: "^14.0.0-beta.19",
1124
1111
  "organize-imports-cli": "0.10.0"
1125
1112
  },
1126
1113
  scripts: {
1127
1114
  organize_imports: "find src -type f -name '*.ts' | xargs organize-imports-cli",
1128
1115
  postbuild: "yarn organize_imports",
1129
- post_process_generate: "yarn organize_imports"
1116
+ post_process_generate: "yarn organize_imports",
1117
+ docs: "typedoc --out docs"
1130
1118
  }
1131
1119
  };
1132
1120
 
@@ -1218,7 +1206,7 @@ class ClientBuilder {
1218
1206
  credentials
1219
1207
  }).withHttpMiddleware({
1220
1208
  host: baseUri,
1221
- fetch: fetch__default["default"]
1209
+ fetch: fetch
1222
1210
  }).withLoggerMiddleware().withUserAgentMiddleware();
1223
1211
  }
1224
1212
  withAuthMiddleware(authMiddleware) {
@@ -1239,7 +1227,7 @@ class ClientBuilder {
1239
1227
  },
1240
1228
  oauthUri: options.oauthUri || '',
1241
1229
  scopes: options.scopes,
1242
- fetch: options.fetch || fetch__default["default"],
1230
+ fetch: options.fetch || fetch,
1243
1231
  ...options
1244
1232
  }));
1245
1233
  }
@@ -1255,7 +1243,7 @@ class ClientBuilder {
1255
1243
  password: options.credentials.user.password || ''
1256
1244
  }
1257
1245
  },
1258
- fetch: options.fetch || fetch__default["default"],
1246
+ fetch: options.fetch || fetch,
1259
1247
  ...options
1260
1248
  }));
1261
1249
  }
@@ -1268,7 +1256,7 @@ class ClientBuilder {
1268
1256
  clientSecret: options.credentials.clientSecret || '',
1269
1257
  anonymousId: options.credentials.anonymousId || ''
1270
1258
  },
1271
- fetch: options.fetch || fetch__default["default"],
1259
+ fetch: options.fetch || fetch,
1272
1260
  ...options
1273
1261
  }));
1274
1262
  }
@@ -1280,7 +1268,7 @@ class ClientBuilder {
1280
1268
  clientId: options.credentials.clientId || '',
1281
1269
  clientSecret: options.credentials.clientSecret || ''
1282
1270
  },
1283
- fetch: options.fetch || fetch__default["default"],
1271
+ fetch: options.fetch || fetch,
1284
1272
  refreshToken: options.refreshToken || '',
1285
1273
  ...options
1286
1274
  }));
@@ -1294,7 +1282,7 @@ class ClientBuilder {
1294
1282
  withHttpMiddleware(options) {
1295
1283
  this.httpMiddleware = createHttpMiddleware({
1296
1284
  host: options.host || 'https://api.europe-west1.gcp.commercetools.com',
1297
- fetch: options.fetch || fetch__default["default"],
1285
+ fetch: options.fetch || fetch,
1298
1286
  ...options
1299
1287
  });
1300
1288
  return this;
@@ -1,7 +1,6 @@
1
- import fetch$1 from 'node-fetch';
2
1
  import { Buffer } from 'buffer/';
3
2
 
4
- function toPrimitive(t, r) {
3
+ function _toPrimitive(t, r) {
5
4
  if ("object" != typeof t || !t) return t;
6
5
  var e = t[Symbol.toPrimitive];
7
6
  if (void 0 !== e) {
@@ -12,24 +11,18 @@ function toPrimitive(t, r) {
12
11
  return ("string" === r ? String : Number)(t);
13
12
  }
14
13
 
15
- function toPropertyKey(t) {
16
- var i = toPrimitive(t, "string");
14
+ function _toPropertyKey(t) {
15
+ var i = _toPrimitive(t, "string");
17
16
  return "symbol" == typeof i ? i : i + "";
18
17
  }
19
18
 
20
- function _defineProperty(obj, key, value) {
21
- key = toPropertyKey(key);
22
- if (key in obj) {
23
- Object.defineProperty(obj, key, {
24
- value: value,
25
- enumerable: true,
26
- configurable: true,
27
- writable: true
28
- });
29
- } else {
30
- obj[key] = value;
31
- }
32
- return obj;
19
+ function _defineProperty(e, r, t) {
20
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
21
+ value: t,
22
+ enumerable: !0,
23
+ configurable: !0,
24
+ writable: !0
25
+ }) : e[r] = t, e;
33
26
  }
34
27
 
35
28
  function isDefined(value) {
@@ -1060,9 +1053,9 @@ function createQueueMiddleware({
1060
1053
 
1061
1054
  var packageJson = {
1062
1055
  name: "@commercetools/sdk-client-v2",
1063
- version: "2.5.0",
1056
+ version: "3.0.0",
1064
1057
  engines: {
1065
- node: ">=14"
1058
+ node: ">=18"
1066
1059
  },
1067
1060
  description: "commercetools Composable Commerce TypeScript SDK client.",
1068
1061
  keywords: [
@@ -1093,8 +1086,7 @@ var packageJson = {
1093
1086
  url: "https://github.com/commercetools/commercetools-sdk-typescript/issues"
1094
1087
  },
1095
1088
  dependencies: {
1096
- buffer: "^6.0.3",
1097
- "node-fetch": "^2.6.1"
1089
+ buffer: "^6.0.3"
1098
1090
  },
1099
1091
  files: [
1100
1092
  "dist",
@@ -1108,17 +1100,17 @@ var packageJson = {
1108
1100
  "./dist/commercetools-sdk-client-v2.esm.js": "./dist/commercetools-sdk-client-v2.browser.esm.js"
1109
1101
  },
1110
1102
  devDependencies: {
1111
- "abort-controller": "3.0.0",
1112
1103
  "common-tags": "1.8.2",
1113
1104
  dotenv: "16.4.5",
1114
1105
  jest: "29.7.0",
1115
- nock: "12.0.3",
1106
+ nock: "^14.0.0-beta.19",
1116
1107
  "organize-imports-cli": "0.10.0"
1117
1108
  },
1118
1109
  scripts: {
1119
1110
  organize_imports: "find src -type f -name '*.ts' | xargs organize-imports-cli",
1120
1111
  postbuild: "yarn organize_imports",
1121
- post_process_generate: "yarn organize_imports"
1112
+ post_process_generate: "yarn organize_imports",
1113
+ docs: "typedoc --out docs"
1122
1114
  }
1123
1115
  };
1124
1116
 
@@ -1210,7 +1202,7 @@ class ClientBuilder {
1210
1202
  credentials
1211
1203
  }).withHttpMiddleware({
1212
1204
  host: baseUri,
1213
- fetch: fetch$1
1205
+ fetch: fetch
1214
1206
  }).withLoggerMiddleware().withUserAgentMiddleware();
1215
1207
  }
1216
1208
  withAuthMiddleware(authMiddleware) {
@@ -1231,7 +1223,7 @@ class ClientBuilder {
1231
1223
  },
1232
1224
  oauthUri: options.oauthUri || '',
1233
1225
  scopes: options.scopes,
1234
- fetch: options.fetch || fetch$1,
1226
+ fetch: options.fetch || fetch,
1235
1227
  ...options
1236
1228
  }));
1237
1229
  }
@@ -1247,7 +1239,7 @@ class ClientBuilder {
1247
1239
  password: options.credentials.user.password || ''
1248
1240
  }
1249
1241
  },
1250
- fetch: options.fetch || fetch$1,
1242
+ fetch: options.fetch || fetch,
1251
1243
  ...options
1252
1244
  }));
1253
1245
  }
@@ -1260,7 +1252,7 @@ class ClientBuilder {
1260
1252
  clientSecret: options.credentials.clientSecret || '',
1261
1253
  anonymousId: options.credentials.anonymousId || ''
1262
1254
  },
1263
- fetch: options.fetch || fetch$1,
1255
+ fetch: options.fetch || fetch,
1264
1256
  ...options
1265
1257
  }));
1266
1258
  }
@@ -1272,7 +1264,7 @@ class ClientBuilder {
1272
1264
  clientId: options.credentials.clientId || '',
1273
1265
  clientSecret: options.credentials.clientSecret || ''
1274
1266
  },
1275
- fetch: options.fetch || fetch$1,
1267
+ fetch: options.fetch || fetch,
1276
1268
  refreshToken: options.refreshToken || '',
1277
1269
  ...options
1278
1270
  }));
@@ -1286,7 +1278,7 @@ class ClientBuilder {
1286
1278
  withHttpMiddleware(options) {
1287
1279
  this.httpMiddleware = createHttpMiddleware({
1288
1280
  host: options.host || 'https://api.europe-west1.gcp.commercetools.com',
1289
- fetch: options.fetch || fetch$1,
1281
+ fetch: options.fetch || fetch,
1290
1282
  ...options
1291
1283
  });
1292
1284
  return this;
@@ -1,2 +1,2 @@
1
- export * from "./declarations/src/index";
1
+ export * from "./declarations/src/index.js";
2
2
  //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWVyY2V0b29scy1zZGstY2xpZW50LXYyLmNqcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi9kZWNsYXJhdGlvbnMvc3JjL2luZGV4LmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEifQ==
@@ -2,14 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var fetch$1 = require('node-fetch');
6
5
  var _ = require('buffer/');
7
6
 
8
- function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
9
-
10
- var fetch__default = /*#__PURE__*/_interopDefault(fetch$1);
11
-
12
- function toPrimitive(t, r) {
7
+ function _toPrimitive(t, r) {
13
8
  if ("object" != typeof t || !t) return t;
14
9
  var e = t[Symbol.toPrimitive];
15
10
  if (void 0 !== e) {
@@ -20,24 +15,18 @@ function toPrimitive(t, r) {
20
15
  return ("string" === r ? String : Number)(t);
21
16
  }
22
17
 
23
- function toPropertyKey(t) {
24
- var i = toPrimitive(t, "string");
18
+ function _toPropertyKey(t) {
19
+ var i = _toPrimitive(t, "string");
25
20
  return "symbol" == typeof i ? i : i + "";
26
21
  }
27
22
 
28
- function _defineProperty(obj, key, value) {
29
- key = toPropertyKey(key);
30
- if (key in obj) {
31
- Object.defineProperty(obj, key, {
32
- value: value,
33
- enumerable: true,
34
- configurable: true,
35
- writable: true
36
- });
37
- } else {
38
- obj[key] = value;
39
- }
40
- return obj;
23
+ function _defineProperty(e, r, t) {
24
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
25
+ value: t,
26
+ enumerable: !0,
27
+ configurable: !0,
28
+ writable: !0
29
+ }) : e[r] = t, e;
41
30
  }
42
31
 
43
32
  function isDefined(value) {
@@ -1068,9 +1057,9 @@ function createQueueMiddleware({
1068
1057
 
1069
1058
  var packageJson = {
1070
1059
  name: "@commercetools/sdk-client-v2",
1071
- version: "2.5.0",
1060
+ version: "3.0.0",
1072
1061
  engines: {
1073
- node: ">=14"
1062
+ node: ">=18"
1074
1063
  },
1075
1064
  description: "commercetools Composable Commerce TypeScript SDK client.",
1076
1065
  keywords: [
@@ -1101,8 +1090,7 @@ var packageJson = {
1101
1090
  url: "https://github.com/commercetools/commercetools-sdk-typescript/issues"
1102
1091
  },
1103
1092
  dependencies: {
1104
- buffer: "^6.0.3",
1105
- "node-fetch": "^2.6.1"
1093
+ buffer: "^6.0.3"
1106
1094
  },
1107
1095
  files: [
1108
1096
  "dist",
@@ -1116,17 +1104,17 @@ var packageJson = {
1116
1104
  "./dist/commercetools-sdk-client-v2.esm.js": "./dist/commercetools-sdk-client-v2.browser.esm.js"
1117
1105
  },
1118
1106
  devDependencies: {
1119
- "abort-controller": "3.0.0",
1120
1107
  "common-tags": "1.8.2",
1121
1108
  dotenv: "16.4.5",
1122
1109
  jest: "29.7.0",
1123
- nock: "12.0.3",
1110
+ nock: "^14.0.0-beta.19",
1124
1111
  "organize-imports-cli": "0.10.0"
1125
1112
  },
1126
1113
  scripts: {
1127
1114
  organize_imports: "find src -type f -name '*.ts' | xargs organize-imports-cli",
1128
1115
  postbuild: "yarn organize_imports",
1129
- post_process_generate: "yarn organize_imports"
1116
+ post_process_generate: "yarn organize_imports",
1117
+ docs: "typedoc --out docs"
1130
1118
  }
1131
1119
  };
1132
1120
 
@@ -1218,7 +1206,7 @@ class ClientBuilder {
1218
1206
  credentials
1219
1207
  }).withHttpMiddleware({
1220
1208
  host: baseUri,
1221
- fetch: fetch__default["default"]
1209
+ fetch: fetch
1222
1210
  }).withLoggerMiddleware().withUserAgentMiddleware();
1223
1211
  }
1224
1212
  withAuthMiddleware(authMiddleware) {
@@ -1239,7 +1227,7 @@ class ClientBuilder {
1239
1227
  },
1240
1228
  oauthUri: options.oauthUri || '',
1241
1229
  scopes: options.scopes,
1242
- fetch: options.fetch || fetch__default["default"],
1230
+ fetch: options.fetch || fetch,
1243
1231
  ...options
1244
1232
  }));
1245
1233
  }
@@ -1255,7 +1243,7 @@ class ClientBuilder {
1255
1243
  password: options.credentials.user.password || ''
1256
1244
  }
1257
1245
  },
1258
- fetch: options.fetch || fetch__default["default"],
1246
+ fetch: options.fetch || fetch,
1259
1247
  ...options
1260
1248
  }));
1261
1249
  }
@@ -1268,7 +1256,7 @@ class ClientBuilder {
1268
1256
  clientSecret: options.credentials.clientSecret || '',
1269
1257
  anonymousId: options.credentials.anonymousId || ''
1270
1258
  },
1271
- fetch: options.fetch || fetch__default["default"],
1259
+ fetch: options.fetch || fetch,
1272
1260
  ...options
1273
1261
  }));
1274
1262
  }
@@ -1280,7 +1268,7 @@ class ClientBuilder {
1280
1268
  clientId: options.credentials.clientId || '',
1281
1269
  clientSecret: options.credentials.clientSecret || ''
1282
1270
  },
1283
- fetch: options.fetch || fetch__default["default"],
1271
+ fetch: options.fetch || fetch,
1284
1272
  refreshToken: options.refreshToken || '',
1285
1273
  ...options
1286
1274
  }));
@@ -1294,7 +1282,7 @@ class ClientBuilder {
1294
1282
  withHttpMiddleware(options) {
1295
1283
  this.httpMiddleware = createHttpMiddleware({
1296
1284
  host: options.host || 'https://api.europe-west1.gcp.commercetools.com',
1297
- fetch: options.fetch || fetch__default["default"],
1285
+ fetch: options.fetch || fetch,
1298
1286
  ...options
1299
1287
  });
1300
1288
  return this;
@@ -2,14 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var fetch$1 = require('node-fetch');
6
5
  var _ = require('buffer/');
7
6
 
8
- function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
9
-
10
- var fetch__default = /*#__PURE__*/_interopDefault(fetch$1);
11
-
12
- function toPrimitive(t, r) {
7
+ function _toPrimitive(t, r) {
13
8
  if ("object" != typeof t || !t) return t;
14
9
  var e = t[Symbol.toPrimitive];
15
10
  if (void 0 !== e) {
@@ -20,24 +15,18 @@ function toPrimitive(t, r) {
20
15
  return ("string" === r ? String : Number)(t);
21
16
  }
22
17
 
23
- function toPropertyKey(t) {
24
- var i = toPrimitive(t, "string");
18
+ function _toPropertyKey(t) {
19
+ var i = _toPrimitive(t, "string");
25
20
  return "symbol" == typeof i ? i : i + "";
26
21
  }
27
22
 
28
- function _defineProperty(obj, key, value) {
29
- key = toPropertyKey(key);
30
- if (key in obj) {
31
- Object.defineProperty(obj, key, {
32
- value: value,
33
- enumerable: true,
34
- configurable: true,
35
- writable: true
36
- });
37
- } else {
38
- obj[key] = value;
39
- }
40
- return obj;
23
+ function _defineProperty(e, r, t) {
24
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
25
+ value: t,
26
+ enumerable: !0,
27
+ configurable: !0,
28
+ writable: !0
29
+ }) : e[r] = t, e;
41
30
  }
42
31
 
43
32
  function isDefined(value) {
@@ -1068,9 +1057,9 @@ function createQueueMiddleware({
1068
1057
 
1069
1058
  var packageJson = {
1070
1059
  name: "@commercetools/sdk-client-v2",
1071
- version: "2.5.0",
1060
+ version: "3.0.0",
1072
1061
  engines: {
1073
- node: ">=14"
1062
+ node: ">=18"
1074
1063
  },
1075
1064
  description: "commercetools Composable Commerce TypeScript SDK client.",
1076
1065
  keywords: [
@@ -1101,8 +1090,7 @@ var packageJson = {
1101
1090
  url: "https://github.com/commercetools/commercetools-sdk-typescript/issues"
1102
1091
  },
1103
1092
  dependencies: {
1104
- buffer: "^6.0.3",
1105
- "node-fetch": "^2.6.1"
1093
+ buffer: "^6.0.3"
1106
1094
  },
1107
1095
  files: [
1108
1096
  "dist",
@@ -1116,17 +1104,17 @@ var packageJson = {
1116
1104
  "./dist/commercetools-sdk-client-v2.esm.js": "./dist/commercetools-sdk-client-v2.browser.esm.js"
1117
1105
  },
1118
1106
  devDependencies: {
1119
- "abort-controller": "3.0.0",
1120
1107
  "common-tags": "1.8.2",
1121
1108
  dotenv: "16.4.5",
1122
1109
  jest: "29.7.0",
1123
- nock: "12.0.3",
1110
+ nock: "^14.0.0-beta.19",
1124
1111
  "organize-imports-cli": "0.10.0"
1125
1112
  },
1126
1113
  scripts: {
1127
1114
  organize_imports: "find src -type f -name '*.ts' | xargs organize-imports-cli",
1128
1115
  postbuild: "yarn organize_imports",
1129
- post_process_generate: "yarn organize_imports"
1116
+ post_process_generate: "yarn organize_imports",
1117
+ docs: "typedoc --out docs"
1130
1118
  }
1131
1119
  };
1132
1120
 
@@ -1218,7 +1206,7 @@ class ClientBuilder {
1218
1206
  credentials
1219
1207
  }).withHttpMiddleware({
1220
1208
  host: baseUri,
1221
- fetch: fetch__default["default"]
1209
+ fetch: fetch
1222
1210
  }).withLoggerMiddleware().withUserAgentMiddleware();
1223
1211
  }
1224
1212
  withAuthMiddleware(authMiddleware) {
@@ -1239,7 +1227,7 @@ class ClientBuilder {
1239
1227
  },
1240
1228
  oauthUri: options.oauthUri || '',
1241
1229
  scopes: options.scopes,
1242
- fetch: options.fetch || fetch__default["default"],
1230
+ fetch: options.fetch || fetch,
1243
1231
  ...options
1244
1232
  }));
1245
1233
  }
@@ -1255,7 +1243,7 @@ class ClientBuilder {
1255
1243
  password: options.credentials.user.password || ''
1256
1244
  }
1257
1245
  },
1258
- fetch: options.fetch || fetch__default["default"],
1246
+ fetch: options.fetch || fetch,
1259
1247
  ...options
1260
1248
  }));
1261
1249
  }
@@ -1268,7 +1256,7 @@ class ClientBuilder {
1268
1256
  clientSecret: options.credentials.clientSecret || '',
1269
1257
  anonymousId: options.credentials.anonymousId || ''
1270
1258
  },
1271
- fetch: options.fetch || fetch__default["default"],
1259
+ fetch: options.fetch || fetch,
1272
1260
  ...options
1273
1261
  }));
1274
1262
  }
@@ -1280,7 +1268,7 @@ class ClientBuilder {
1280
1268
  clientId: options.credentials.clientId || '',
1281
1269
  clientSecret: options.credentials.clientSecret || ''
1282
1270
  },
1283
- fetch: options.fetch || fetch__default["default"],
1271
+ fetch: options.fetch || fetch,
1284
1272
  refreshToken: options.refreshToken || '',
1285
1273
  ...options
1286
1274
  }));
@@ -1294,7 +1282,7 @@ class ClientBuilder {
1294
1282
  withHttpMiddleware(options) {
1295
1283
  this.httpMiddleware = createHttpMiddleware({
1296
1284
  host: options.host || 'https://api.europe-west1.gcp.commercetools.com',
1297
- fetch: options.fetch || fetch__default["default"],
1285
+ fetch: options.fetch || fetch,
1298
1286
  ...options
1299
1287
  });
1300
1288
  return this;
@@ -1,7 +1,6 @@
1
- import fetch$1 from 'node-fetch';
2
1
  import { Buffer } from 'buffer/';
3
2
 
4
- function toPrimitive(t, r) {
3
+ function _toPrimitive(t, r) {
5
4
  if ("object" != typeof t || !t) return t;
6
5
  var e = t[Symbol.toPrimitive];
7
6
  if (void 0 !== e) {
@@ -12,24 +11,18 @@ function toPrimitive(t, r) {
12
11
  return ("string" === r ? String : Number)(t);
13
12
  }
14
13
 
15
- function toPropertyKey(t) {
16
- var i = toPrimitive(t, "string");
14
+ function _toPropertyKey(t) {
15
+ var i = _toPrimitive(t, "string");
17
16
  return "symbol" == typeof i ? i : i + "";
18
17
  }
19
18
 
20
- function _defineProperty(obj, key, value) {
21
- key = toPropertyKey(key);
22
- if (key in obj) {
23
- Object.defineProperty(obj, key, {
24
- value: value,
25
- enumerable: true,
26
- configurable: true,
27
- writable: true
28
- });
29
- } else {
30
- obj[key] = value;
31
- }
32
- return obj;
19
+ function _defineProperty(e, r, t) {
20
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
21
+ value: t,
22
+ enumerable: !0,
23
+ configurable: !0,
24
+ writable: !0
25
+ }) : e[r] = t, e;
33
26
  }
34
27
 
35
28
  function isDefined(value) {
@@ -1060,9 +1053,9 @@ function createQueueMiddleware({
1060
1053
 
1061
1054
  var packageJson = {
1062
1055
  name: "@commercetools/sdk-client-v2",
1063
- version: "2.5.0",
1056
+ version: "3.0.0",
1064
1057
  engines: {
1065
- node: ">=14"
1058
+ node: ">=18"
1066
1059
  },
1067
1060
  description: "commercetools Composable Commerce TypeScript SDK client.",
1068
1061
  keywords: [
@@ -1093,8 +1086,7 @@ var packageJson = {
1093
1086
  url: "https://github.com/commercetools/commercetools-sdk-typescript/issues"
1094
1087
  },
1095
1088
  dependencies: {
1096
- buffer: "^6.0.3",
1097
- "node-fetch": "^2.6.1"
1089
+ buffer: "^6.0.3"
1098
1090
  },
1099
1091
  files: [
1100
1092
  "dist",
@@ -1108,17 +1100,17 @@ var packageJson = {
1108
1100
  "./dist/commercetools-sdk-client-v2.esm.js": "./dist/commercetools-sdk-client-v2.browser.esm.js"
1109
1101
  },
1110
1102
  devDependencies: {
1111
- "abort-controller": "3.0.0",
1112
1103
  "common-tags": "1.8.2",
1113
1104
  dotenv: "16.4.5",
1114
1105
  jest: "29.7.0",
1115
- nock: "12.0.3",
1106
+ nock: "^14.0.0-beta.19",
1116
1107
  "organize-imports-cli": "0.10.0"
1117
1108
  },
1118
1109
  scripts: {
1119
1110
  organize_imports: "find src -type f -name '*.ts' | xargs organize-imports-cli",
1120
1111
  postbuild: "yarn organize_imports",
1121
- post_process_generate: "yarn organize_imports"
1112
+ post_process_generate: "yarn organize_imports",
1113
+ docs: "typedoc --out docs"
1122
1114
  }
1123
1115
  };
1124
1116
 
@@ -1210,7 +1202,7 @@ class ClientBuilder {
1210
1202
  credentials
1211
1203
  }).withHttpMiddleware({
1212
1204
  host: baseUri,
1213
- fetch: fetch$1
1205
+ fetch: fetch
1214
1206
  }).withLoggerMiddleware().withUserAgentMiddleware();
1215
1207
  }
1216
1208
  withAuthMiddleware(authMiddleware) {
@@ -1231,7 +1223,7 @@ class ClientBuilder {
1231
1223
  },
1232
1224
  oauthUri: options.oauthUri || '',
1233
1225
  scopes: options.scopes,
1234
- fetch: options.fetch || fetch$1,
1226
+ fetch: options.fetch || fetch,
1235
1227
  ...options
1236
1228
  }));
1237
1229
  }
@@ -1247,7 +1239,7 @@ class ClientBuilder {
1247
1239
  password: options.credentials.user.password || ''
1248
1240
  }
1249
1241
  },
1250
- fetch: options.fetch || fetch$1,
1242
+ fetch: options.fetch || fetch,
1251
1243
  ...options
1252
1244
  }));
1253
1245
  }
@@ -1260,7 +1252,7 @@ class ClientBuilder {
1260
1252
  clientSecret: options.credentials.clientSecret || '',
1261
1253
  anonymousId: options.credentials.anonymousId || ''
1262
1254
  },
1263
- fetch: options.fetch || fetch$1,
1255
+ fetch: options.fetch || fetch,
1264
1256
  ...options
1265
1257
  }));
1266
1258
  }
@@ -1272,7 +1264,7 @@ class ClientBuilder {
1272
1264
  clientId: options.credentials.clientId || '',
1273
1265
  clientSecret: options.credentials.clientSecret || ''
1274
1266
  },
1275
- fetch: options.fetch || fetch$1,
1267
+ fetch: options.fetch || fetch,
1276
1268
  refreshToken: options.refreshToken || '',
1277
1269
  ...options
1278
1270
  }));
@@ -1286,7 +1278,7 @@ class ClientBuilder {
1286
1278
  withHttpMiddleware(options) {
1287
1279
  this.httpMiddleware = createHttpMiddleware({
1288
1280
  host: options.host || 'https://api.europe-west1.gcp.commercetools.com',
1289
- fetch: options.fetch || fetch$1,
1281
+ fetch: options.fetch || fetch,
1290
1282
  ...options
1291
1283
  });
1292
1284
  return this;
@@ -1 +1,14 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@commercetools/sdk-client-v2"]=t():e["@commercetools/sdk-client-v2"]=t()}(self,(()=>(()=>{var e={146:()=>{},830:()=>{},33:()=>{},633:()=>{},854:()=>{},435:(e,t,r)=>{"use strict";r.d(t,{A:()=>j});var n=r(33),o=r.n(n),i=r(822),a=r(571),s=r(241),c=r(901),u=r(646),l=r(726),d=r(510),h=r(650),f=r(345),p=r(412),y=r(15),w=function(){return w=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},w.apply(this,arguments)},v=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},g=u.A,m=a.A,b=s.A,A=l.A,O=c.A;const j=function(){function e(){this.middlewares=[]}return e.prototype.withProjectKey=function(e){return this.projectKey=e,this},e.prototype.defaultClient=function(e,t,r,n){return this.withClientCredentialsFlow({host:r,projectKey:n||this.projectKey,credentials:t}).withHttpMiddleware({host:e,fetch:o()}).withLoggerMiddleware().withUserAgentMiddleware()},e.prototype.withAuthMiddleware=function(e){return this.authMiddleware=e,this},e.prototype.withMiddleware=function(e){return this.middlewares.push(e),this},e.prototype.withClientCredentialsFlow=function(e){return this.withAuthMiddleware(b(w({host:e.host||"https://auth.europe-west1.gcp.commercetools.com",projectKey:e.projectKey||this.projectKey,credentials:{clientId:e.credentials.clientId||"",clientSecret:e.credentials.clientSecret||""},oauthUri:e.oauthUri||"",scopes:e.scopes,fetch:e.fetch||o()},e)))},e.prototype.withPasswordFlow=function(e){return this.withAuthMiddleware(g(w({host:e.host||"https://auth.europe-west1.gcp.commercetools.com",projectKey:e.projectKey||this.projectKey,credentials:{clientId:e.credentials.clientId||"",clientSecret:e.credentials.clientSecret||"",user:{username:e.credentials.user.username||"",password:e.credentials.user.password||""}},fetch:e.fetch||o()},e)))},e.prototype.withAnonymousSessionFlow=function(e){return this.withAuthMiddleware(m(w({host:e.host||"https://auth.europe-west1.gcp.commercetools.com",projectKey:this.projectKey||e.projectKey,credentials:{clientId:e.credentials.clientId||"",clientSecret:e.credentials.clientSecret||"",anonymousId:e.credentials.anonymousId||""},fetch:e.fetch||o()},e)))},e.prototype.withRefreshTokenFlow=function(e){return this.withAuthMiddleware(A(w({host:e.host||"https://auth.europe-west1.gcp.commercetools.com",projectKey:this.projectKey||e.projectKey,credentials:{clientId:e.credentials.clientId||"",clientSecret:e.credentials.clientSecret||""},fetch:e.fetch||o(),refreshToken:e.refreshToken||""},e)))},e.prototype.withExistingTokenFlow=function(e,t){return this.withAuthMiddleware(O(e,w({force:t.force||!0},t)))},e.prototype.withHttpMiddleware=function(e){return this.httpMiddleware=(0,h.A)(w({host:e.host||"https://api.europe-west1.gcp.commercetools.com",fetch:e.fetch||o()},e)),this},e.prototype.withUserAgentMiddleware=function(e){return this.userAgentMiddleware=(0,y.A)(e),this},e.prototype.withQueueMiddleware=function(e){return this.queueMiddleware=(0,p.A)(w({concurrency:e.concurrency||20},e)),this},e.prototype.withLoggerMiddleware=function(e){var t=e||{},r=(t.logger,v(t,["logger"]));return this.loggerMiddleware="function"==typeof(null==e?void 0:e.logger)&&e.logger(r)||(0,f.A)(),this},e.prototype.withCorrelationIdMiddleware=function(e){return this.correlationIdMiddleware=(0,d.A)(w({generate:e.generate||null},e)),this},e.prototype.withTelemetryMiddleware=function(e){var t=e.createTelemetryMiddleware,r=v(e,["createTelemetryMiddleware"]);return this.withUserAgentMiddleware({customAgent:(null==r?void 0:r.userAgent)||"typescript-sdk-apm-middleware"}),this.telemetryMiddleware=t(r),this},e.prototype.withBeforeExecutionMiddleware=function(e){var t=e||{},r=(t.middleware,v(t,["middleware"]));return this.beforeMiddleware=e.middleware(r),this},e.prototype.withAfterExecutionMiddleware=function(e){var t=e||{},r=(t.middleware,v(t,["middleware"]));return this.afterMiddleware=e.middleware(r),this},e.prototype.build=function(){var e=this.middlewares.slice();return this.telemetryMiddleware&&e.push(this.telemetryMiddleware),this.correlationIdMiddleware&&e.push(this.correlationIdMiddleware),this.userAgentMiddleware&&e.push(this.userAgentMiddleware),this.authMiddleware&&e.push(this.authMiddleware),this.beforeMiddleware&&e.push(this.beforeMiddleware),this.queueMiddleware&&e.push(this.queueMiddleware),this.httpMiddleware&&e.push(this.httpMiddleware),this.afterMiddleware&&e.push(this.afterMiddleware),this.loggerMiddleware&&e.push(this.loggerMiddleware),(0,i.Ay)({middlewares:e})},e}()},822:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>b,eh:()=>m});var n=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},o=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function i(e){return null!=e}function a(e){var t,r,n={},i=new URLSearchParams(e);try{for(var a=o(i.keys()),s=a.next();!s.done;s=a.next()){var c=s.value;i.getAll(c).length>1?n[c]=i.getAll(c):n[c]=i.get(c)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return n}function s(e){var t,r,a;if(e=i(a=e)?"string"==typeof a?a:Object.fromEntries(Object.entries(a).filter((function(e){var t=n(e,2),r=(t[0],t[1]);return![null,void 0,""].includes(r)}))):"",!e)return"";var s=new URLSearchParams(e),c=function(e,t){Array.isArray(t)&&(s.delete(e),t.filter(i).forEach((function(t){return s.append(e,t)})))};try{for(var u=o(Object.entries(e)),l=u.next();!l.done;l=u.next()){var d=n(l.value,2);c(d[0],d[1])}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}return s.toString()}function c(e,t){return void 0===t&&(t=s),t(e)}const u=["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"];function l(e,t,r){if(void 0===r&&(r={allowedMethods:u}),!t)throw new Error('The "'.concat(e,'" function requires a "Request" object as an argument. See https://commercetools.github.io/nodejs/sdk/Glossary.html#clientrequest'));if("string"!=typeof t.uri)throw new Error('The "'.concat(e,'" Request object requires a valid uri. See https://commercetools.github.io/nodejs/sdk/Glossary.html#clientrequest'));if(!r.allowedMethods.includes(t.method))throw new Error('The "'.concat(e,'" Request object requires a valid method. See https://commercetools.github.io/nodejs/sdk/Glossary.html#clientrequest'))}var d,h=function(){return h=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},h.apply(this,arguments)},f=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},p=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},y=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},w=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},v=20;function g(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=e.filter((function(e){return"function"==typeof e}))).length?e[0]:e.reduce((function(e,t){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e(t.apply(void 0,w([],y(r),!1)))}}))}function m(e,t,r){var n=this;if(l("process",e,{allowedMethods:["GET"]}),"function"!=typeof t)throw new Error('The "process" function accepts a "Function" as a second argument that returns a Promise. See https://commercetools.github.io/nodejs/sdk/api/sdkClient.html#processrequest-processfn-options');var o=h({limit:v,total:Number.POSITIVE_INFINITY,accumulate:!0},r);return new Promise((function(r,i){var s,u="";if(e&&e.uri){var l=y(e.uri.split("?"),2),v=l[0],g=l[1];s=v,u=g}var m,A=h({},(void 0===m&&(m=a),m(u))),O=h({limit:o.limit},A),j=!1,M=o.total,C=function(a){for(var u=[],l=1;l<arguments.length;l++)u[l-1]=arguments[l];return f(n,w([a],y(u),!1),void 0,(function(n,a){var u,l,f,y,w,v,g,m,A,E,S,k,T,q;return void 0===a&&(a=[]),p(this,(function(p){switch(p.label){case 0:u=O.limit<M?O.limit:M,l=c(h(h({},O),{limit:u})),f=h({sort:o.sort||"id asc",withTotal:!1},n?{where:'id > "'.concat(n,'"')}:{}),y=c(f),w=h(h({},e),{uri:"".concat(s,"?").concat(y,"&").concat(l)}),p.label=1;case 1:return p.trys.push([1,4,,5]),[4,b(d).execute(w)];case 2:return v=p.sent(),g=v.body,m=g.results,!(A=g.count)&&j?[2,r(a||[])]:[4,Promise.resolve(t(v))];case 3:return E=p.sent(),S=[],j=!0,o.accumulate&&(S=a.concat(E||[])),M-=A,A<O.limit||!M?[2,r(S||[])]:(k=m[A-1],T=k&&k.id,C(T,S),[3,5]);case 4:return q=p.sent(),i(q),[3,5];case 5:return[2]}}))}))};C()}))}function b(e){if(d=e,!e)throw new Error("Missing required options");if(e.middlewares&&!Array.isArray(e.middlewares))throw new Error("Middlewares should be an array");if(!e.middlewares||!Array.isArray(e.middlewares)||!e.middlewares.length)throw new Error("You need to provide at least one middleware");return{process:m,execute:function(t){return l("exec",t),new Promise((function(r,n){g.apply(void 0,w([],y(e.middlewares),!1))((function(e,t){if(t.error)t.reject(t.error);else{var r={body:t.body||{},statusCode:t.statusCode};t.headers&&(r.headers=t.headers),t.request&&(r.request=t.request),t.resolve(r)}}))(t,{resolve:r,reject:n,body:void 0,error:void 0})}))}}}},367:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>y,Dr:()=>a,j$:()=>s});var n=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},o=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};function i(e,t,r){void 0===r&&(r={}),this.status=this.statusCode=this.code=e,this.message=t,Object.assign(this,r),this.name=this.constructor.name,this.constructor.prototype.__proto__=Error.prototype,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}function a(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.call.apply(i,o([this,0],n(e),!1))}function s(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.call.apply(i,o([this],n(e),!1))}function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.call.apply(i,o([this,400],n(e),!1))}function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.call.apply(i,o([this,401],n(e),!1))}function l(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.call.apply(i,o([this,403],n(e),!1))}function d(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.call.apply(i,o([this,404],n(e),!1))}function h(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.call.apply(i,o([this,409],n(e),!1))}function f(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.call.apply(i,o([this,500],n(e),!1))}function p(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.call.apply(i,o([this,503],n(e),!1))}function y(e){switch(e){case 0:return a;case 400:return c;case 401:return u;case 403:return l;case 404:return d;case 409:return h;case 500:return f;case 503:return p;default:return}}},571:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(105),o=r(486),i=r(539),a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function s(e){var t=e.tokenCache||(0,i.A)({token:"",expirationTime:-1}),r=[],s=(0,i.A)(!1);return function(i){return function(c,u){if(c.headers&&c.headers.authorization||c.headers&&c.headers.Authorization)i(c,u);else{var l=a(a({request:c,response:u},(0,o.O4)(e)),{pendingTasks:r,requestState:s,tokenCache:t,fetch:e.fetch});(0,n.A)(l,i,e)}}}}},105:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(486),o=r(146),i=function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},s=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};function c(e,t){return i(i({},t),{headers:i(i({},t.headers),{Authorization:"Bearer ".concat(e)})})}function u(e){return a(this,arguments,void 0,(function(e){var t,r,n,i,a,u,l,d,h,f,p,y=e.fetcher,w=e.url,v=e.basicAuth,g=e.body,m=e.tokenCache,b=e.requestState,A=e.pendingTasks,O=e.response,j=e.tokenCacheKey;return s(this,(function(e){switch(e.label){case 0:return e.trys.push([0,5,,6]),[4,y(w,{method:"POST",headers:{Authorization:"Basic ".concat(v),"Content-Length":o.Buffer.byteLength(g).toString(),"Content-Type":"application/x-www-form-urlencoded"},body:g})];case 1:return(t=e.sent()).ok?[4,t.json()]:[3,3];case 2:return r=e.sent(),n=r.access_token,i=r.expires_in,a=r.refresh_token,u=function(e){return Date.now()+1e3*e-3e5}(i),m.set({token:n,expirationTime:u,refreshToken:a},j),b.set(!1),l=A.slice(),A=[],l.forEach((function(e){var t=c(n,e.request);e.next(t,e.response)})),[2];case 3:return d=void 0,[4,t.text()];case 4:h=e.sent();try{d=JSON.parse(h)}catch(e){}return f=new Error(d?d.message:h),d&&(f.body=d),b.set(!1),O.reject(f),[3,6];case 5:return p=e.sent(),b.set(!1),O&&"function"==typeof O.reject&&O.reject(p),[3,6];case 6:return[2]}}))}))}function l(e,t,r){var o=e.request,a=e.response,s=e.url,l=e.basicAuth,d=e.body,h=e.pendingTasks,f=e.requestState,p=e.tokenCache,y=e.tokenCacheKey,w=e.fetch;if(!w&&"undefined"==typeof fetch)throw new Error("`fetch` is not available. Please pass in `fetch` as an option or have it globally available.");if(w||(w=fetch),o.headers&&o.headers.authorization||o.headers&&o.headers.Authorization)t(o,a);else{var v=p.get(y);if(v&&v.token&&Date.now()<v.expirationTime)t(c(v.token,o),a);else if(h.push({request:o,response:a,next:t}),!f.get())if(f.set(!0),v&&v.refreshToken&&(!v.token||v.token&&Date.now()>v.expirationTime)){if(!r)throw new Error("Missing required options");u(i(i({fetcher:w},(0,n.nO)(i(i({},r),{refreshToken:v.refreshToken}))),{tokenCacheKey:y,tokenCache:p,requestState:f,pendingTasks:h,response:a}))}else u({fetcher:w,url:s,basicAuth:l,body:d,tokenCacheKey:y,tokenCache:p,requestState:f,pendingTasks:h,response:a})}}},486:(e,t,r)=>{"use strict";r.d(t,{O4:()=>c,Wh:()=>a,nO:()=>s,wg:()=>i});var n=r(146),o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o.apply(this,arguments)};function i(e){if(!e)throw new Error("Missing required options");if(!e.host)throw new Error("Missing required option (host)");if(!e.projectKey)throw new Error("Missing required option (projectKey)");if(!e.credentials)throw new Error("Missing required option (credentials)");var t=e.credentials,r=t.clientId,o=t.clientSecret;if(!r||!o)throw new Error("Missing required credentials (clientId, clientSecret)");var i=e.scopes?e.scopes.join(" "):void 0,a=n.Buffer.from("".concat(r,":").concat(o)).toString("base64"),s=e.oauthUri||"/oauth/token";return{basicAuth:a,url:e.host.replace(/\/$/,"")+s,body:"grant_type=client_credentials".concat(i?"&scope=".concat(i):"")}}function a(e){if(!e)throw new Error("Missing required options");if(!e.host)throw new Error("Missing required option (host)");if(!e.projectKey)throw new Error("Missing required option (projectKey)");if(!e.credentials)throw new Error("Missing required option (credentials)");var t=e.credentials,r=t.clientId,o=t.clientSecret,i=t.user,a=e.projectKey;if(!(r&&o&&i))throw new Error("Missing required credentials (clientId, clientSecret, user)");var s=i.username,c=i.password;if(!s||!c)throw new Error("Missing required user credentials (username, password)");var u=(e.scopes||[]).join(" "),l=u?"&scope=".concat(u):"",d=n.Buffer.from("".concat(r,":").concat(o)).toString("base64"),h=e.oauthUri||"/oauth/".concat(a,"/customers/token");return{basicAuth:d,url:e.host.replace(/\/$/,"")+h,body:"grant_type=password&username=".concat(encodeURIComponent(s),"&password=").concat(encodeURIComponent(c)).concat(l)}}function s(e){if(!e)throw new Error("Missing required options");if(!e.host)throw new Error("Missing required option (host)");if(!e.projectKey)throw new Error("Missing required option (projectKey)");if(!e.credentials)throw new Error("Missing required option (credentials)");if(!e.refreshToken)throw new Error("Missing required option (refreshToken)");var t=e.credentials,r=t.clientId,o=t.clientSecret;if(!r||!o)throw new Error("Missing required credentials (clientId, clientSecret)");var i=n.Buffer.from("".concat(r,":").concat(o)).toString("base64"),a=e.oauthUri||"/oauth/token";return{basicAuth:i,url:e.host.replace(/\/$/,"")+a,body:"grant_type=refresh_token&refresh_token=".concat(encodeURIComponent(e.refreshToken))}}function c(e){if(!e)throw new Error("Missing required options");if(!e.projectKey)throw new Error("Missing required option (projectKey)");var t=e.projectKey;e.oauthUri=e.oauthUri||"/oauth/".concat(t,"/anonymous/token");var r=i(e);return e.credentials.anonymousId&&(r.body+="&anonymous_id=".concat(e.credentials.anonymousId)),o({},r)}},241:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(105),o=r(486);function i(e){return{clientId:e.credentials.clientId,host:e.host,projectKey:e.projectKey}}var a=r(539),s=function(){return s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)};function c(e){var t=e.tokenCache||(0,a.A)({token:"",expirationTime:-1}),r=(0,a.A)(!1),c=[];return function(a){return function(u,l){if(u.headers&&u.headers.authorization||u.headers&&u.headers.Authorization)a(u,l);else{var d=s(s({request:u,response:l},(0,o.wg)(e)),{pendingTasks:c,requestState:r,tokenCache:t,tokenCacheKey:i(e),fetch:e.fetch});(0,n.A)(d,a)}}}}},901:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};function o(e,t){return void 0===e&&(e=""),void 0===t&&(t={}),function(r){return function(o,i){if("string"!=typeof e)throw new Error("authorization must be a string");var a=void 0===t.force||t.force;if(!e||(o.headers&&o.headers.authorization||o.headers&&o.headers.Authorization)&&!1===a)return r(o,i);var s=n(n({},o),{headers:n(n({},o.headers),{Authorization:e})});return r(s,i)}}}},646:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(105),o=r(486),i=r(539),a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function s(e){var t=e.tokenCache||(0,i.A)({}),r=[],s=(0,i.A)(!1);return function(i){return function(c,u){if(c.headers&&c.headers.authorization||c.headers&&c.headers.Authorization)i(c,u);else{var l=a(a({request:c,response:u},(0,o.Wh)(e)),{pendingTasks:r,requestState:s,tokenCache:t,fetch:e.fetch});(0,n.A)(l,i,e)}}}}},726:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(105),o=r(486),i=r(539),a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function s(e){var t=e.tokenCache||(0,i.A)({token:"",expirationTime:-1}),r=[],s=(0,i.A)(!1);return function(i){return function(c,u){if(c.headers&&c.headers.authorization||c.headers&&c.headers.Authorization)i(c,u);else{var l=a(a({request:c,response:u},(0,o.nO)(e)),{pendingTasks:r,requestState:s,tokenCache:t,fetch:e.fetch});(0,n.A)(l,i)}}}}},539:(e,t,r)=>{"use strict";function n(e){var t=e;return{get:function(e){return t},set:function(e,r){t=e}}}r.d(t,{A:()=>n})},510:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};function o(e){return function(t){return function(r,o){var i=n(n({},r),{headers:n(n({},r.headers),{"X-Correlation-ID":e.generate()})});t(i,o)}}}},650:(e,t,r)=>{"use strict";r.d(t,{A:()=>f});var n=r(146),o=r(367);function i(e){if(e.raw)return e.raw();if(!e.forEach)return{};var t={};return e.forEach((function(e,r){t[r]=e})),t}var a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)},s=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},c=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},u=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};function l(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function d(e,t,r,n,o){return n&&0!==e?Math.min(Math.round((Math.random()+1)*t*Math.pow(2,e)),o):t}function h(e,t){t&&(e&&e.headers&&e.headers.authorization&&(e.headers.authorization="Bearer ********"),e&&e.headers&&e.headers.Authorization&&(e.headers.Authorization="Bearer ********"))}function f(e){var t,r=e.host,f=e.credentialsMode,p=e.includeResponseHeaders,y=e.includeOriginalRequest,w=e.includeRequestInErrorResponse,v=void 0===w||w,g=e.maskSensitiveHeaderData,m=void 0===g||g,b=e.headersWithStringBody,A=void 0===b?[]:b,O=e.enableRetry,j=e.timeout,M=e.retryConfig,C=void 0===M?{}:M,E=C.maxRetries,S=void 0===E?10:E,k=C.backoff,T=void 0===k||k,q=C.retryDelay,x=void 0===q?200:q,P=C.maxDelay,I=void 0===P?1/0:P,K=C.retryOnAbort,R=void 0!==K&&K,U=C.retryCodes,N=void 0===U?[503]:U,B=e.fetch,F=e.getAbortController;if(!B)throw new Error("`fetch` is not available. Please pass in `fetch` as an option or have it globally available.");if(j&&!F)throw new Error("`AbortController` is not available. Please pass in `getAbortController` as an option or have AbortController globally available when using timeout.");if(t=B||fetch,!Array.isArray(N))throw new Error("`retryCodes` option must be an array of retry status (error) codes.");if(!Array.isArray(A))throw new Error("`headersWithStringBody` option must be an array of strings");return function(e){return function(w,g){var b=r.replace(/\/$/,"")+w.uri,M=a({},w.headers);Object.prototype.hasOwnProperty.call(M,"Content-Type")||Object.prototype.hasOwnProperty.call(M,"content-type")||(M["Content-Type"]="application/json"),null===M["Content-Type"]&&delete M["Content-Type"];var C=u(["application/json","application/graphql"],c(A),!1).indexOf(M["Content-Type"])>-1&&"string"==typeof w.body||l(w.body)?w.body:JSON.stringify(w.body||void 0);C&&("string"==typeof C||l(C))&&(M["Content-Length"]=n.Buffer.byteLength(C).toString());var E={method:w.method,headers:M};f&&(E.credentialsMode=f),C&&(E.body=C);var k=0;!function r(){var n,c;j&&(c=(F?F():null)||new AbortController,E.signal=c.signal,n=setTimeout((function(){c.abort()}),j)),t(b,E).then((function(t){if(t.ok)return"HEAD"===E.method?void e(w,a(a({},g),{statusCode:t.status})):void t.text().then((function(n){var o;try{o=n.length>0?JSON.parse(n):{}}catch(e){if(O&&k<S)return setTimeout(r,d(k,x,0,T,I)),void(k+=1);o=n}var s=a(a({},g),{body:o,statusCode:t.status});p&&(s.headers=i(t.headers)),y&&(s.request=a({},E),h(s.request,m)),e(w,s)})).catch((function(t){if(O&&k<S)return setTimeout(r,d(k,x,0,T,I)),void(k+=1);var n=new o.Dr(t.message,a(a({},v?{originalRequest:w}:{}),{retryCount:k}));h(n.originalRequest,m),e(w,a(a({},g),{error:n,statusCode:0}))}));t.text().then((function(n){var c;try{c=JSON.parse(n)}catch(u){c=n}var u=function(e){var t,r=e.statusCode,n=e.message,i=s(e,["statusCode","message"]),a=n||"Unexpected non-JSON error response";404===r&&(a="URI not found: ".concat((null===(t=i.originalRequest)||void 0===t?void 0:t.uri)||i.uri),delete i.uri);var c=(0,o.Ay)(r);return c?new c(a,i):new o.j$(r,a,i)}(a(a(a({statusCode:t.status},v?{originalRequest:w}:404===t.status?{uri:w.uri}:{}),{retryCount:k,headers:i(t.headers)}),"object"==typeof c?{message:c.message,body:c}:{message:c,body:c}));if(O&&(-1!==N.indexOf(u.statusCode)||-1!==(null==N?void 0:N.indexOf(u.message)))&&k<S)return setTimeout(r,d(k,x,0,T,I)),void(k+=1);h(u.originalRequest,m);var l=a(a({},g),{error:u,statusCode:t.status});e(w,l)}))}),(function(t){if(O&&(R||!c||!c.signal)&&k<S)return setTimeout(r,d(k,x,0,T,I)),void(k+=1);var n=new o.Dr(t.message,a(a({},v?{originalRequest:w}:{}),{retryCount:k}));h(n.originalRequest,m),e(w,a(a({},g),{error:n,statusCode:0}))})).finally((function(){clearTimeout(n)}))}()}}}},345:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(830);function o(){return function(e){return function(t,r){var o=r.error,i=r.body,a=r.statusCode;n.log("Request: ",t),n.log("Response: ",{error:o,body:i,statusCode:a}),e(t,r)}}}},412:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};function o(e){var t=e.concurrency,r=void 0===t?20:t,o=[],i=0,a=function(e){if(i-=1,o.length&&i<=r){var t=o.shift();i+=1,e(t.request,t.response)}};return function(e){return function(t,s){var c=n(n({},s),{resolve:function(t){s.resolve(t),a(e)},reject:function(t){s.reject(t),a(e)}});if(o.push({request:t,response:c}),i<r){var u=o.shift();i+=1,e(u.request,u.response)}}}}},15:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});const n={rE:"2.5.0"};var o=r(633),i=function(){return"undefined"!=typeof window&&window.document&&9===window.document.nodeType};var a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function s(e){var t=function(e){if(!e||0===Object.keys(e).length||!{}.hasOwnProperty.call(e,"name"))throw new Error("Missing required option `name`");var t=e.version?"".concat(e.name,"/").concat(e.version):e.name,r=null;e.libraryName&&!e.libraryVersion?r=e.libraryName:e.libraryName&&e.libraryVersion&&(r="".concat(e.libraryName,"/").concat(e.libraryVersion));var n=null;return e.contactUrl&&!e.contactEmail?n="(+".concat(e.contactUrl,")"):!e.contactUrl&&e.contactEmail?n="(+".concat(e.contactEmail,")"):e.contactUrl&&e.contactEmail&&(n="(+".concat(e.contactUrl,"; +").concat(e.contactEmail,")")),[t,function(){if(i())return window.navigator.userAgent;var e=(null==o?void 0:o.version.slice(1))||"12";return"node.js/".concat(e)}(),r,n,e.customAgent||""].filter(Boolean).join(" ")}(a(a({},e),{name:"commercetools-sdk-javascript-v2/".concat(n.rE)}));return function(e){return function(r,n){var o=a(a({},r),{headers:a(a({},r.headers),{"User-Agent":t})});e(o,n)}}}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{ClientBuilder:()=>e.A,Process:()=>t.eh,createAuthForAnonymousSessionFlow:()=>i.A,createAuthForClientCredentialsFlow:()=>a.A,createAuthForPasswordFlow:()=>c.A,createAuthForRefreshTokenFlow:()=>u.A,createAuthWithExistingToken:()=>s.A,createClient:()=>t.Ay,createCorrelationIdMiddleware:()=>l.A,createHttpClient:()=>d.A,createLoggerMiddleware:()=>h.A,createQueueMiddleware:()=>f.A,createUserAgentMiddleware:()=>p.A,getErrorByCode:()=>o.Ay});var e=r(435),t=r(822),o=r(367),i=r(571),a=r(241),s=r(901),c=r(646),u=r(726),l=r(510),d=r(650),h=r(345),f=r(412),p=r(15),y=r(854),w={};for(const e in y)["default","ClientBuilder","createClient","Process","getErrorByCode","createAuthForAnonymousSessionFlow","createAuthForClientCredentialsFlow","createAuthWithExistingToken","createAuthForPasswordFlow","createAuthForRefreshTokenFlow","createCorrelationIdMiddleware","createHttpClient","createLoggerMiddleware","createQueueMiddleware","createUserAgentMiddleware"].indexOf(e)<0&&(w[e]=()=>y[e]);r.d(n,w)})(),n})()));
1
+ var window;(window||={})["@commercetools/sdk-client-v2"]=(()=>{var Ar=Object.create;var ue=Object.defineProperty;var Br=Object.getOwnPropertyDescriptor;var Rr=Object.getOwnPropertyNames;var Ir=Object.getPrototypeOf,Fr=Object.prototype.hasOwnProperty;var Ae=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ke=(t,e)=>{for(var r in e)ue(t,r,{get:e[r],enumerable:!0})},He=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Rr(e))!Fr.call(t,n)&&n!==r&&ue(t,n,{get:()=>e[n],enumerable:!(i=Br(e,n))||i.enumerable});return t};var Be=(t,e,r)=>(r=t!=null?Ar(Ir(t)):{},He(e||!t||!t.__esModule?ue(r,"default",{value:t,enumerable:!0}):r,t)),Tr=t=>He(ue({},"__esModule",{value:!0}),t);var We=Ae(de=>{"use strict";de.byteLength=Nr;de.toByteArray=jr;de.fromByteArray=_r;var b=[],R=[],Or=typeof Uint8Array<"u"?Uint8Array:Array,Fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(D=0,Qe=Fe.length;D<Qe;++D)b[D]=Fe[D],R[Fe.charCodeAt(D)]=D;var D,Qe;R[45]=62;R[95]=63;function Ve(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}function Nr(t){var e=Ve(t),r=e[0],i=e[1];return(r+i)*3/4-i}function Pr(t,e,r){return(e+r)*3/4-r}function jr(t){var e,r=Ve(t),i=r[0],n=r[1],o=new Or(Pr(t,i,n)),s=0,u=n>0?i-4:i,l;for(l=0;l<u;l+=4)e=R[t.charCodeAt(l)]<<18|R[t.charCodeAt(l+1)]<<12|R[t.charCodeAt(l+2)]<<6|R[t.charCodeAt(l+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return n===2&&(e=R[t.charCodeAt(l)]<<2|R[t.charCodeAt(l+1)]>>4,o[s++]=e&255),n===1&&(e=R[t.charCodeAt(l)]<<10|R[t.charCodeAt(l+1)]<<4|R[t.charCodeAt(l+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function qr(t){return b[t>>18&63]+b[t>>12&63]+b[t>>6&63]+b[t&63]}function Lr(t,e,r){for(var i,n=[],o=e;o<r;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),n.push(qr(i));return n.join("")}function _r(t){for(var e,r=t.length,i=r%3,n=[],o=16383,s=0,u=r-i;s<u;s+=o)n.push(Lr(t,s,s+o>u?u:s+o));return i===1?(e=t[r-1],n.push(b[e>>2]+b[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(b[e>>10]+b[e>>4&63]+b[e<<2&63]+"=")),n.join("")}});var Ye=Ae(Te=>{Te.read=function(t,e,r,i,n){var o,s,u=n*8-i-1,l=(1<<u)-1,c=l>>1,h=-7,d=r?n-1:0,f=r?-1:1,p=t[e+d];for(d+=f,o=p&(1<<-h)-1,p>>=-h,h+=u;h>0;o=o*256+t[e+d],d+=f,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=i;h>0;s=s*256+t[e+d],d+=f,h-=8);if(o===0)o=1-c;else{if(o===l)return s?NaN:(p?-1:1)*(1/0);s=s+Math.pow(2,i),o=o-c}return(p?-1:1)*s*Math.pow(2,o-i)};Te.write=function(t,e,r,i,n,o){var s,u,l,c=o*8-n-1,h=(1<<c)-1,d=h>>1,f=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:o-1,g=i?1:-1,k=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+d>=1?e+=f/l:e+=f*Math.pow(2,1-d),e*l>=2&&(s++,l/=2),s+d>=h?(u=0,s=h):s+d>=1?(u=(e*l-1)*Math.pow(2,n),s=s+d):(u=e*Math.pow(2,d-1)*Math.pow(2,n),s=0));n>=8;t[r+p]=u&255,p+=g,u/=256,n-=8);for(s=s<<n|u,c+=n;c>0;t[r+p]=s&255,p+=g,s/=256,c-=8);t[r+p-g]|=k*128}});var pe=Ae(Q=>{"use strict";var Ce=We(),G=Ye(),Xe=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Q.Buffer=a;Q.SlowBuffer=Gr;Q.INSPECT_MAX_BYTES=50;var he=2147483647;Q.kMaxLength=he;a.TYPED_ARRAY_SUPPORT=$r();!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function $r(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}});Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function O(t){if(t>he)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,a.prototype),e}function a(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Se(t)}return rr(t,e,r)}a.poolSize=8192;function rr(t,e,r){if(typeof t=="string")return Kr(t,e);if(ArrayBuffer.isView(t))return Hr(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(U(t,ArrayBuffer)||t&&U(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(U(t,SharedArrayBuffer)||t&&U(t.buffer,SharedArrayBuffer)))return Ue(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return a.from(i,e,r);let n=zr(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return a.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}a.from=function(t,e,r){return rr(t,e,r)};Object.setPrototypeOf(a.prototype,Uint8Array.prototype);Object.setPrototypeOf(a,Uint8Array);function tr(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function Dr(t,e,r){return tr(t),t<=0?O(t):e!==void 0?typeof r=="string"?O(t).fill(e,r):O(t).fill(e):O(t)}a.alloc=function(t,e,r){return Dr(t,e,r)};function Se(t){return tr(t),O(t<0?0:Oe(t)|0)}a.allocUnsafe=function(t){return Se(t)};a.allocUnsafeSlow=function(t){return Se(t)};function Kr(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=ir(t,e)|0,i=O(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}function be(t){let e=t.length<0?0:Oe(t.length)|0,r=O(e);for(let i=0;i<e;i+=1)r[i]=t[i]&255;return r}function Hr(t){if(U(t,Uint8Array)){let e=new Uint8Array(t);return Ue(e.buffer,e.byteOffset,e.byteLength)}return be(t)}function Ue(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&r===void 0?i=new Uint8Array(t):r===void 0?i=new Uint8Array(t,e):i=new Uint8Array(t,e,r),Object.setPrototypeOf(i,a.prototype),i}function zr(t){if(a.isBuffer(t)){let e=Oe(t.length)|0,r=O(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||Pe(t.length)?O(0):be(t);if(t.type==="Buffer"&&Array.isArray(t.data))return be(t.data)}function Oe(t){if(t>=he)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+he.toString(16)+" bytes");return t|0}function Gr(t){return+t!=t&&(t=0),a.alloc(+t)}a.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==a.prototype};a.compare=function(e,r){if(U(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),U(r,Uint8Array)&&(r=a.from(r,r.offset,r.byteLength)),!a.isBuffer(e)||!a.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let i=e.length,n=r.length;for(let o=0,s=Math.min(i,n);o<s;++o)if(e[o]!==r[o]){i=e[o],n=r[o];break}return i<n?-1:n<i?1:0};a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return a.alloc(0);let i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;let n=a.allocUnsafe(r),o=0;for(i=0;i<e.length;++i){let s=e[i];if(U(s,Uint8Array))o+s.length>n.length?(a.isBuffer(s)||(s=a.from(s)),s.copy(n,o)):Uint8Array.prototype.set.call(n,s,o);else if(a.isBuffer(s))s.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return n};function ir(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||U(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return ke(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return hr(t).length;default:if(n)return i?-1:ke(t).length;e=(""+e).toLowerCase(),n=!0}}a.byteLength=ir;function Jr(t,e,r){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return tt(this,e,r);case"utf8":case"utf-8":return or(this,e,r);case"ascii":return et(this,e,r);case"latin1":case"binary":return rt(this,e,r);case"base64":return Zr(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return it(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}a.prototype._isBuffer=!0;function K(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}a.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)K(this,r,r+1);return this};a.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)K(this,r,r+3),K(this,r+1,r+2);return this};a.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)K(this,r,r+7),K(this,r+1,r+6),K(this,r+2,r+5),K(this,r+3,r+4);return this};a.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?or(this,0,e):Jr.apply(this,arguments)};a.prototype.toLocaleString=a.prototype.toString;a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:a.compare(this,e)===0};a.prototype.inspect=function(){let e="",r=Q.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};Xe&&(a.prototype[Xe]=a.prototype.inspect);a.prototype.compare=function(e,r,i,n,o){if(U(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),r<0||i>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=i)return 0;if(n>=o)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,o>>>=0,this===e)return 0;let s=o-n,u=i-r,l=Math.min(s,u),c=this.slice(n,o),h=e.slice(r,i);for(let d=0;d<l;++d)if(c[d]!==h[d]){s=c[d],u=h[d];break}return s<u?-1:u<s?1:0};function nr(t,e,r,i,n){if(t.length===0)return-1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Pe(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=a.from(e,i)),a.isBuffer(e))return e.length===0?-1:Ze(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Ze(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function Ze(t,e,r,i,n){let o=1,s=t.length,u=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,s/=2,u/=2,r/=2}function l(h,d){return o===1?h[d]:h.readUInt16BE(d*o)}let c;if(n){let h=-1;for(c=r;c<s;c++)if(l(t,c)===l(e,h===-1?0:c-h)){if(h===-1&&(h=c),c-h+1===u)return h*o}else h!==-1&&(c-=c-h),h=-1}else for(r+u>s&&(r=s-u),c=r;c>=0;c--){let h=!0;for(let d=0;d<u;d++)if(l(t,c+d)!==l(e,d)){h=!1;break}if(h)return c}return-1}a.prototype.includes=function(e,r,i){return this.indexOf(e,r,i)!==-1};a.prototype.indexOf=function(e,r,i){return nr(this,e,r,i,!0)};a.prototype.lastIndexOf=function(e,r,i){return nr(this,e,r,i,!1)};function Qr(t,e,r,i){r=Number(r)||0;let n=t.length-r;i?(i=Number(i),i>n&&(i=n)):i=n;let o=e.length;i>o/2&&(i=o/2);let s;for(s=0;s<i;++s){let u=parseInt(e.substr(s*2,2),16);if(Pe(u))return s;t[r+s]=u}return s}function Vr(t,e,r,i){return fe(ke(e,t.length-r),t,r,i)}function Wr(t,e,r,i){return fe(at(e),t,r,i)}function Yr(t,e,r,i){return fe(hr(e),t,r,i)}function Xr(t,e,r,i){return fe(ut(e,t.length-r),t,r,i)}a.prototype.write=function(e,r,i,n){if(r===void 0)n="utf8",i=this.length,r=0;else if(i===void 0&&typeof r=="string")n=r,i=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-r;if((i===void 0||i>o)&&(i=o),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return Qr(this,e,r,i);case"utf8":case"utf-8":return Vr(this,e,r,i);case"ascii":case"latin1":case"binary":return Wr(this,e,r,i);case"base64":return Yr(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xr(this,e,r,i);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Zr(t,e,r){return e===0&&r===t.length?Ce.fromByteArray(t):Ce.fromByteArray(t.slice(e,r))}function or(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n<r;){let o=t[n],s=null,u=o>239?4:o>223?3:o>191?2:1;if(n+u<=r){let l,c,h,d;switch(u){case 1:o<128&&(s=o);break;case 2:l=t[n+1],(l&192)===128&&(d=(o&31)<<6|l&63,d>127&&(s=d));break;case 3:l=t[n+1],c=t[n+2],(l&192)===128&&(c&192)===128&&(d=(o&15)<<12|(l&63)<<6|c&63,d>2047&&(d<55296||d>57343)&&(s=d));break;case 4:l=t[n+1],c=t[n+2],h=t[n+3],(l&192)===128&&(c&192)===128&&(h&192)===128&&(d=(o&15)<<18|(l&63)<<12|(c&63)<<6|h&63,d>65535&&d<1114112&&(s=d))}}s===null?(s=65533,u=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|s&1023),i.push(s),n+=u}return vr(i)}var ve=4096;function vr(t){let e=t.length;if(e<=ve)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=ve));return r}function et(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]&127);return i}function rt(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function tt(t,e,r){let i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let o=e;o<r;++o)n+=lt[t[o]];return n}function it(t,e,r){let i=t.slice(e,r),n="";for(let o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}a.prototype.slice=function(e,r){let i=this.length;e=~~e,r=r===void 0?i:~~r,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<e&&(r=e);let n=this.subarray(e,r);return Object.setPrototypeOf(n,a.prototype),n};function y(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||y(e,r,this.length);let n=this[e],o=1,s=0;for(;++s<r&&(o*=256);)n+=this[e+s]*o;return n};a.prototype.readUintBE=a.prototype.readUIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||y(e,r,this.length);let n=this[e+--r],o=1;for(;r>0&&(o*=256);)n+=this[e+--r]*o;return n};a.prototype.readUint8=a.prototype.readUInt8=function(e,r){return e=e>>>0,r||y(e,1,this.length),this[e]};a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||y(e,2,this.length),this[e]|this[e+1]<<8};a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||y(e,2,this.length),this[e]<<8|this[e+1]};a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||y(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||y(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};a.prototype.readBigUInt64LE=q(function(e){e=e>>>0,J(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&W(e,this.length-8);let n=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))});a.prototype.readBigUInt64BE=q(function(e){e=e>>>0,J(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&W(e,this.length-8);let n=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<<BigInt(32))+BigInt(o)});a.prototype.readIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||y(e,r,this.length);let n=this[e],o=1,s=0;for(;++s<r&&(o*=256);)n+=this[e+s]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*r)),n};a.prototype.readIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||y(e,r,this.length);let n=r,o=1,s=this[e+--n];for(;n>0&&(o*=256);)s+=this[e+--n]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s};a.prototype.readInt8=function(e,r){return e=e>>>0,r||y(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};a.prototype.readInt16LE=function(e,r){e=e>>>0,r||y(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};a.prototype.readInt16BE=function(e,r){e=e>>>0,r||y(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};a.prototype.readInt32LE=function(e,r){return e=e>>>0,r||y(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};a.prototype.readInt32BE=function(e,r){return e=e>>>0,r||y(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};a.prototype.readBigInt64LE=q(function(e){e=e>>>0,J(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&W(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});a.prototype.readBigInt64BE=q(function(e){e=e>>>0,J(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&W(e,this.length-8);let n=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)});a.prototype.readFloatLE=function(e,r){return e=e>>>0,r||y(e,4,this.length),G.read(this,e,!0,23,4)};a.prototype.readFloatBE=function(e,r){return e=e>>>0,r||y(e,4,this.length),G.read(this,e,!1,23,4)};a.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||y(e,8,this.length),G.read(this,e,!0,52,8)};a.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||y(e,8,this.length),G.read(this,e,!1,52,8)};function M(t,e,r,i,n,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let u=Math.pow(2,8*i)-1;M(this,e,r,i,u,0)}let o=1,s=0;for(this[r]=e&255;++s<i&&(o*=256);)this[r+s]=e/o&255;return r+i};a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let u=Math.pow(2,8*i)-1;M(this,e,r,i,u,0)}let o=i-1,s=1;for(this[r+o]=e&255;--o>=0&&(s*=256);)this[r+o]=e/s&255;return r+i};a.prototype.writeUint8=a.prototype.writeUInt8=function(e,r,i){return e=+e,r=r>>>0,i||M(this,e,r,1,255,0),this[r]=e&255,r+1};a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||M(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||M(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||M(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||M(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function sr(t,e,r,i,n){dr(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,r}function ar(t,e,r,i,n){dr(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o=o>>8,t[r+6]=o,o=o>>8,t[r+5]=o,o=o>>8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s=s>>8,t[r+2]=s,s=s>>8,t[r+1]=s,s=s>>8,t[r]=s,r+8}a.prototype.writeBigUInt64LE=q(function(e,r=0){return sr(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});a.prototype.writeBigUInt64BE=q(function(e,r=0){return ar(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});a.prototype.writeIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let l=Math.pow(2,8*i-1);M(this,e,r,i,l-1,-l)}let o=0,s=1,u=0;for(this[r]=e&255;++o<i&&(s*=256);)e<0&&u===0&&this[r+o-1]!==0&&(u=1),this[r+o]=(e/s>>0)-u&255;return r+i};a.prototype.writeIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let l=Math.pow(2,8*i-1);M(this,e,r,i,l-1,-l)}let o=i-1,s=1,u=0;for(this[r+o]=e&255;--o>=0&&(s*=256);)e<0&&u===0&&this[r+o+1]!==0&&(u=1),this[r+o]=(e/s>>0)-u&255;return r+i};a.prototype.writeInt8=function(e,r,i){return e=+e,r=r>>>0,i||M(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};a.prototype.writeInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||M(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};a.prototype.writeInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||M(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};a.prototype.writeInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||M(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};a.prototype.writeInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||M(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};a.prototype.writeBigInt64LE=q(function(e,r=0){return sr(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});a.prototype.writeBigInt64BE=q(function(e,r=0){return ar(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ur(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function lr(t,e,r,i,n){return e=+e,r=r>>>0,n||ur(t,e,r,4,34028234663852886e22,-34028234663852886e22),G.write(t,e,r,i,23,4),r+4}a.prototype.writeFloatLE=function(e,r,i){return lr(this,e,r,!0,i)};a.prototype.writeFloatBE=function(e,r,i){return lr(this,e,r,!1,i)};function cr(t,e,r,i,n){return e=+e,r=r>>>0,n||ur(t,e,r,8,17976931348623157e292,-17976931348623157e292),G.write(t,e,r,i,52,8),r+8}a.prototype.writeDoubleLE=function(e,r,i){return cr(this,e,r,!0,i)};a.prototype.writeDoubleBE=function(e,r,i){return cr(this,e,r,!1,i)};a.prototype.copy=function(e,r,i,n){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-i&&(n=e.length-r+i);let o=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),r),o};a.prototype.fill=function(e,r,i,n){if(typeof e=="string"){if(typeof r=="string"?(n=r,r=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let s=e.charCodeAt(0);(n==="utf8"&&s<128||n==="latin1")&&(e=s)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let o;if(typeof e=="number")for(o=r;o<i;++o)this[o]=e;else{let s=a.isBuffer(e)?e:a.from(e,n),u=s.length;if(u===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<i-r;++o)this[o+r]=s[o%u]}return this};var z={};function Ne(t,e,r){z[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}Ne("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Ne("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Ne("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=er(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=er(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function er(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function nt(t,e,r){J(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&W(e,t.length-(r+1))}function dr(t,e,r,i,n,o){if(t>r||t<e){let s=typeof e=="bigint"?"n":"",u;throw o>3?e===0||e===BigInt(0)?u=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:u=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:u=`>= ${e}${s} and <= ${r}${s}`,new z.ERR_OUT_OF_RANGE("value",u,t)}nt(i,n,o)}function J(t,e){if(typeof t!="number")throw new z.ERR_INVALID_ARG_TYPE(e,"number",t)}function W(t,e,r){throw Math.floor(t)!==t?(J(t,r),new z.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new z.ERR_BUFFER_OUT_OF_BOUNDS:new z.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var ot=/[^+/0-9A-Za-z-_]/g;function st(t){if(t=t.split("=")[0],t=t.trim().replace(ot,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ke(t,e){e=e||1/0;let r,i=t.length,n=null,o=[];for(let s=0;s<i;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function at(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function ut(t,e){let r,i,n,o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),i=r>>8,n=r%256,o.push(n),o.push(i);return o}function hr(t){return Ce.toByteArray(st(t))}function fe(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function U(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function Pe(t){return t!==t}var lt=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let i=r*16;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function q(t){return typeof BigInt>"u"?ct:t}function ct(){throw new Error("BigInt not supported")}});var Ct={};Ke(Ct,{ClientBuilder:()=>ae,Process:()=>Ie,createAuthForAnonymousSessionFlow:()=>Y,createAuthForClientCredentialsFlow:()=>X,createAuthForPasswordFlow:()=>v,createAuthForRefreshTokenFlow:()=>ee,createAuthWithExistingToken:()=>Z,createClient:()=>H,createCorrelationIdMiddleware:()=>re,createHttpClient:()=>ie,createLoggerMiddleware:()=>ne,createQueueMiddleware:()=>oe,createUserAgentMiddleware:()=>se,getErrorByCode:()=>te});function ze(t){return typeof t<"u"&&t!==null}function Cr(t){return ze(t)?typeof t=="string"?t:Object.fromEntries(Object.entries(t).filter(([e,r])=>![null,void 0,""].includes(r))):""}function br(t){let e={},r=new URLSearchParams(t);for(let i of r.keys())r.getAll(i).length>1?e[i]=r.getAll(i):e[i]=r.get(i);return e}function Ur(t){if(t=Cr(t),!t)return"";let e=new URLSearchParams(t);for(let[r,i]of Object.entries(t))Array.isArray(i)&&(e.delete(r),i.filter(ze).forEach(n=>e.append(r,n)));return e.toString()}function Re(t,e=br){return e(t)}function le(t,e=Ur){return e(t)}var Ge=["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"];function ce(t,e,r={allowedMethods:Ge}){if(!e)throw new Error(`The "${t}" function requires a "Request" object as an argument. See https://commercetools.github.io/nodejs/sdk/Glossary.html#clientrequest`);if(typeof e.uri!="string")throw new Error(`The "${t}" Request object requires a valid uri. See https://commercetools.github.io/nodejs/sdk/Glossary.html#clientrequest`);if(!r.allowedMethods.includes(e.method))throw new Error(`The "${t}" Request object requires a valid method. See https://commercetools.github.io/nodejs/sdk/Glossary.html#clientrequest`)}var Je,kr=20;function Sr(...t){return t=t.filter(e=>typeof e=="function"),t.length===1?t[0]:t.reduce((e,r)=>(...i)=>e(r(...i)))}function Ie(t,e,r){if(ce("process",t,{allowedMethods:["GET"]}),typeof e!="function")throw new Error('The "process" function accepts a "Function" as a second argument that returns a Promise. See https://commercetools.github.io/nodejs/sdk/api/sdkClient.html#processrequest-processfn-options');let i={limit:kr,total:Number.POSITIVE_INFINITY,accumulate:!0,...r};return new Promise((n,o)=>{let s,u="";if(t&&t.uri){let[p,g]=t.uri.split("?");s=p,u=g}let l={...Re(u)},c={limit:i.limit,...l},h=!1,d=i.total,f=async(p,g=[])=>{let k=c.limit<d?c.limit:d,L=le({...c,limit:k}),_={sort:i.sort||"id asc",withTotal:!1,...p?{where:`id > "${p}"`}:{}},I=le(_),w={...t,uri:`${s}?${I}&${L}`};try{let T=await H(Je).execute(w),{results:Ee,count:E}=T.body;if(!E&&h)return n(g||[]);let j=await Promise.resolve(e(T)),C=[];if(h=!0,i.accumulate&&(C=g.concat(j||[])),d-=E,E<c.limit||!d)return n(C||[]);let m=Ee[E-1],$=m&&m.id;f($,C)}catch(T){o(T)}};f()})}function H(t){if(Je=t,!t)throw new Error("Missing required options");if(t.middlewares&&!Array.isArray(t.middlewares))throw new Error("Middlewares should be an array");if(!t.middlewares||!Array.isArray(t.middlewares)||!t.middlewares.length)throw new Error("You need to provide at least one middleware");return{process:Ie,execute(e){return ce("exec",e),new Promise((r,i)=>{let n=(s,u)=>{if(u.error)u.reject(u.error);else{let l={body:u.body||{},statusCode:u.statusCode};u.headers&&(l.headers=u.headers),u.request&&(l.request=u.request),u.resolve(l)}};Sr(...t.middlewares)(n)(e,{resolve:r,reject:i,body:void 0,error:void 0})})}}}var Le={};Ke(Le,{createAuthMiddlewareForAnonymousSessionFlow:()=>Y,createAuthMiddlewareForClientCredentialsFlow:()=>X,createAuthMiddlewareForPasswordFlow:()=>v,createAuthMiddlewareForRefreshTokenFlow:()=>ee,createAuthMiddlewareWithExistingToken:()=>Z});var we=Be(pe());function je(t){if(!t)throw new Error("Missing required options");if(!t.host)throw new Error("Missing required option (host)");if(!t.projectKey)throw new Error("Missing required option (projectKey)");if(!t.credentials)throw new Error("Missing required option (credentials)");let{clientId:e,clientSecret:r}=t.credentials;if(!(e&&r))throw new Error("Missing required credentials (clientId, clientSecret)");let i=t.scopes?t.scopes.join(" "):void 0,n=we.Buffer.from(`${e}:${r}`).toString("base64"),o=t.oauthUri||"/oauth/token",s=t.host.replace(/\/$/,"")+o,u=`grant_type=client_credentials${i?`&scope=${i}`:""}`;return{basicAuth:n,url:s,body:u}}function fr(t){if(!t)throw new Error("Missing required options");if(!t.host)throw new Error("Missing required option (host)");if(!t.projectKey)throw new Error("Missing required option (projectKey)");if(!t.credentials)throw new Error("Missing required option (credentials)");let{clientId:e,clientSecret:r,user:i}=t.credentials,n=t.projectKey;if(!(e&&r&&i))throw new Error("Missing required credentials (clientId, clientSecret, user)");let{username:o,password:s}=i;if(!(o&&s))throw new Error("Missing required user credentials (username, password)");let u=(t.scopes||[]).join(" "),l=u?`&scope=${u}`:"",c=we.Buffer.from(`${e}:${r}`).toString("base64"),h=t.oauthUri||`/oauth/${n}/customers/token`,d=t.host.replace(/\/$/,"")+h,f=`grant_type=password&username=${encodeURIComponent(o)}&password=${encodeURIComponent(s)}${l}`;return{basicAuth:c,url:d,body:f}}function me(t){if(!t)throw new Error("Missing required options");if(!t.host)throw new Error("Missing required option (host)");if(!t.projectKey)throw new Error("Missing required option (projectKey)");if(!t.credentials)throw new Error("Missing required option (credentials)");if(!t.refreshToken)throw new Error("Missing required option (refreshToken)");let{clientId:e,clientSecret:r}=t.credentials;if(!(e&&r))throw new Error("Missing required credentials (clientId, clientSecret)");let i=we.Buffer.from(`${e}:${r}`).toString("base64"),n=t.oauthUri||"/oauth/token",o=t.host.replace(/\/$/,"")+n,s=`grant_type=refresh_token&refresh_token=${encodeURIComponent(t.refreshToken)}`;return{basicAuth:i,url:o,body:s}}function pr(t){if(!t)throw new Error("Missing required options");if(!t.projectKey)throw new Error("Missing required option (projectKey)");let e=t.projectKey;t.oauthUri=t.oauthUri||`/oauth/${e}/anonymous/token`;let r=je(t);return t.credentials.anonymousId&&(r.body+=`&anonymous_id=${t.credentials.anonymousId}`),{...r}}var mr=Be(pe());function yr(t,e){return{...e,headers:{...e.headers,Authorization:`Bearer ${t}`}}}function dt(t){return Date.now()+t*1e3-5*60*1e3}async function wr({fetcher:t,url:e,basicAuth:r,body:i,tokenCache:n,requestState:o,pendingTasks:s,response:u,tokenCacheKey:l}){try{let c=await t(e,{method:"POST",headers:{Authorization:`Basic ${r}`,"Content-Length":mr.Buffer.byteLength(i).toString(),"Content-Type":"application/x-www-form-urlencoded"},body:i});if(c.ok){let{access_token:p,expires_in:g,refresh_token:k}=await c.json(),L=dt(g);n.set({token:p,expirationTime:L,refreshToken:k},l),o.set(!1);let _=s.slice();s=[],_.forEach(I=>{let w=yr(p,I.request);I.next(w,I.response)});return}let h,d=await c.text();try{h=JSON.parse(d)}catch{}let f=new Error(h?h.message:d);h&&(f.body=h),o.set(!1),u.reject(f)}catch(c){o.set(!1),u&&typeof u.reject=="function"&&u.reject(c)}}function N({request:t,response:e,url:r,basicAuth:i,body:n,pendingTasks:o,requestState:s,tokenCache:u,tokenCacheKey:l,fetch:c},h,d){if(!c&&typeof fetch>"u")throw new Error("`fetch` is not available. Please pass in `fetch` as an option or have it globally available.");if(c||(c=fetch),t.headers&&t.headers.authorization||t.headers&&t.headers.Authorization){h(t,e);return}let f=u.get(l);if(f&&f.token&&Date.now()<f.expirationTime){let p=yr(f.token,t);h(p,e);return}if(o.push({request:t,response:e,next:h}),!s.get()){if(s.set(!0),f&&f.refreshToken&&(!f.token||f.token&&Date.now()>f.expirationTime)){if(!d)throw new Error("Missing required options");wr({fetcher:c,...me({...d,refreshToken:f.refreshToken}),tokenCacheKey:l,tokenCache:u,requestState:s,pendingTasks:o,response:e});return}wr({fetcher:c,url:r,basicAuth:i,body:n,tokenCacheKey:l,tokenCache:u,requestState:s,pendingTasks:o,response:e})}}function A(t){let e=t;return{get:r=>e,set:(r,i)=>{e=r}}}function Y(t){let e=t.tokenCache||A({token:"",expirationTime:-1}),r=[],i=A(!1);return n=>(o,s)=>{if(o.headers&&o.headers.authorization||o.headers&&o.headers.Authorization){n(o,s);return}let u={request:o,response:s,...pr(t),pendingTasks:r,requestState:i,tokenCache:e,fetch:t.fetch};N(u,n,t)}}function qe(t){return{clientId:t.credentials.clientId,host:t.host,projectKey:t.projectKey}}function X(t){let e=t.tokenCache||A({token:"",expirationTime:-1}),r=A(!1),i=[];return n=>(o,s)=>{if(o.headers&&o.headers.authorization||o.headers&&o.headers.Authorization){n(o,s);return}let u={request:o,response:s,...je(t),pendingTasks:i,requestState:r,tokenCache:e,tokenCacheKey:qe(t),fetch:t.fetch};N(u,n)}}function Z(t="",e={}){return r=>(i,n)=>{if(typeof t!="string")throw new Error("authorization must be a string");let o=e.force===void 0?!0:e.force;if(!t||(i.headers&&i.headers.authorization||i.headers&&i.headers.Authorization)&&o===!1)return r(i,n);let s={...i,headers:{...i.headers,Authorization:t}};return r(s,n)}}function v(t){let e=t.tokenCache||A({}),r=[],i=A(!1);return n=>(o,s)=>{if(o.headers&&o.headers.authorization||o.headers&&o.headers.Authorization){n(o,s);return}let u={request:o,response:s,...fr(t),pendingTasks:r,requestState:i,tokenCache:e,fetch:t.fetch};N(u,n,t)}}function ee(t){let e=t.tokenCache||A({token:"",expirationTime:-1}),r=[],i=A(!1);return n=>(o,s)=>{if(o.headers&&o.headers.authorization||o.headers&&o.headers.Authorization){n(o,s);return}let u={request:o,response:s,...me(t),pendingTasks:r,requestState:i,tokenCache:e,fetch:t.fetch};N(u,n)}}function re(t){return e=>(r,i)=>{let n={...r,headers:{...r.headers,"X-Correlation-ID":t.generate()}};e(n,i)}}var Mr=Be(pe());function P(t,e,r={}){this.status=this.statusCode=this.code=t,this.message=e,Object.assign(this,r),this.name=this.constructor.name,this.constructor.prototype.__proto__=Error.prototype,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}function ye(...t){P.call(this,0,...t)}function gr(...t){P.call(this,...t)}function ht(...t){P.call(this,400,...t)}function ft(...t){P.call(this,401,...t)}function pt(...t){P.call(this,403,...t)}function wt(...t){P.call(this,404,...t)}function mt(...t){P.call(this,409,...t)}function yt(...t){P.call(this,500,...t)}function gt(...t){P.call(this,503,...t)}function te(t){switch(t){case 0:return ye;case 400:return ht;case 401:return ft;case 403:return pt;case 404:return wt;case 409:return mt;case 500:return yt;case 503:return gt;default:return}}function ge(t){if(t.raw)return t.raw();if(!t.forEach)return{};let e={};return t.forEach((r,i)=>{e[i]=r}),e}function xr(t){return t!=null&&t.constructor!=null&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function xt({statusCode:t,message:e,...r}){let i=e||"Unexpected non-JSON error response";t===404&&(i=`URI not found: ${r.originalRequest?.uri||r.uri}`,delete r.uri);let n=te(t);return n?new n(i,r):new gr(t,i,r)}function xe(t,e,r,i,n){return i&&t!==0?Math.min(Math.round((Math.random()+1)*e*2**t),n):e}function Me(t,e){e&&(t&&t.headers&&t.headers.authorization&&(t.headers.authorization="Bearer ********"),t&&t.headers&&t.headers.Authorization&&(t.headers.Authorization="Bearer ********"))}function ie({host:t,credentialsMode:e,includeResponseHeaders:r,includeOriginalRequest:i,includeRequestInErrorResponse:n=!0,maskSensitiveHeaderData:o=!0,headersWithStringBody:s=[],enableRetry:u,timeout:l,retryConfig:{maxRetries:c=10,backoff:h=!0,retryDelay:d=200,maxDelay:f=1/0,retryOnAbort:p=!1,retryCodes:g=[503]}={},fetch:k,getAbortController:L}){if(!k)throw new Error("`fetch` is not available. Please pass in `fetch` as an option or have it globally available.");if(l&&!L)throw new Error("`AbortController` is not available. Please pass in `getAbortController` as an option or have AbortController globally available when using timeout.");let _;if(k?_=k:_=fetch,!Array.isArray(g))throw new Error("`retryCodes` option must be an array of retry status (error) codes.");if(!Array.isArray(s))throw new Error("`headersWithStringBody` option must be an array of strings");return I=>(w,T)=>{let Ee=t.replace(/\/$/,"")+w.uri,E={...w.headers};Object.prototype.hasOwnProperty.call(E,"Content-Type")||Object.prototype.hasOwnProperty.call(E,"content-type")||(E["Content-Type"]="application/json"),E["Content-Type"]===null&&delete E["Content-Type"];let j=["application/json","application/graphql",...s].indexOf(E["Content-Type"])>-1&&typeof w.body=="string"||xr(w.body)?w.body:JSON.stringify(w.body||void 0);j&&(typeof j=="string"||xr(j))&&(E["Content-Length"]=Mr.Buffer.byteLength(j).toString());let C={method:w.method,headers:E};e&&(C.credentialsMode=e),j&&(C.body=j);let m=0;function $(){let $e,V;l&&(V=(L?L():null)||new AbortController,C.signal=V.signal,$e=setTimeout(()=>{V.abort()},l)),_(Ee,C).then(B=>{if(B.ok){if(C.method==="HEAD"){I(w,{...T,statusCode:B.status});return}B.text().then(F=>{let x;try{x=F.length>0?JSON.parse(F):{}}catch{if(u&&m<c){setTimeout($,xe(m,d,c,h,f)),m+=1;return}x=F}let S={...T,body:x,statusCode:B.status};r&&(S.headers=ge(B.headers)),i&&(S.request={...C},Me(S.request,o)),I(w,S)}).catch(F=>{if(u&&m<c){setTimeout($,xe(m,d,c,h,f)),m+=1;return}let x=new ye(F.message,{...n?{originalRequest:w}:{},retryCount:m});Me(x.originalRequest,o),I(w,{...T,error:x,statusCode:0})});return}B.text().then(F=>{let x;try{x=JSON.parse(F)}catch{x=F}let S=xt({statusCode:B.status,...n?{originalRequest:w}:B.status===404?{uri:w.uri}:{},retryCount:m,headers:ge(B.headers),...typeof x=="object"?{message:x.message,body:x}:{message:x,body:x}});if(u&&(g.indexOf(S.statusCode)!==-1||g?.indexOf(S.message)!==-1)&&m<c){setTimeout($,xe(m,d,c,h,f)),m+=1;return}Me(S.originalRequest,o);let De={...T,error:S,statusCode:B.status};I(w,De)})},B=>{if(u&&(p||!V||!V.signal)&&m<c){setTimeout($,xe(m,d,c,h,f)),m+=1;return}let F=new ye(B.message,{...n?{originalRequest:w}:{},retryCount:m});Me(F.originalRequest,o),I(w,{...T,error:F,statusCode:0})}).finally(()=>{clearTimeout($e)})}$()}}function ne(){return t=>(e,r)=>{let{error:i,body:n,statusCode:o}=r;console.log("Request: ",e),console.log("Response: ",{error:i,body:n,statusCode:o}),t(e,r)}}function oe({concurrency:t=20}){let e=[],r=0,i=n=>{if(r-=1,e.length&&r<=t){let o=e.shift();r+=1,n(o.request,o.response)}};return n=>(o,s)=>{let u={...s,resolve(l){s.resolve(l),i(n)},reject(l){s.reject(l),i(n)}};if(e.push({request:o,response:u}),r<t){let l=e.shift();r+=1,n(l.request,l.response)}}}var Er={name:"@commercetools/sdk-client-v2",version:"3.0.0",engines:{node:">=18"},description:"commercetools Composable Commerce TypeScript SDK client.",keywords:["commercetools","composable commerce","sdk","typescript","client","middleware","http","oauth","auth"],homepage:"https://github.com/commercetools/commercetools-sdk-typescript",license:"MIT",directories:{lib:"lib",test:"test"},publishConfig:{access:"public"},repository:{type:"git",url:"git+https://github.com/commercetools/commercetools-sdk-typescript.git"},bugs:{url:"https://github.com/commercetools/commercetools-sdk-typescript/issues"},dependencies:{buffer:"^6.0.3"},files:["dist","CHANGELOG.md"],author:"Chukwuemeka Ajima <meeky.ae@gmail.com>",main:"dist/commercetools-sdk-client-v2.cjs.js",module:"dist/commercetools-sdk-client-v2.esm.js",browser:{"./dist/commercetools-sdk-client-v2.cjs.js":"./dist/commercetools-sdk-client-v2.browser.cjs.js","./dist/commercetools-sdk-client-v2.esm.js":"./dist/commercetools-sdk-client-v2.browser.esm.js"},devDependencies:{"common-tags":"1.8.2",dotenv:"16.4.5",jest:"29.7.0",nock:"^14.0.0-beta.19","organize-imports-cli":"0.10.0"},scripts:{organize_imports:"find src -type f -name '*.ts' | xargs organize-imports-cli",postbuild:"yarn organize_imports",post_process_generate:"yarn organize_imports",docs:"typedoc --out docs"}};var Et=()=>typeof window<"u"&&window.document&&window.document.nodeType===9;function At(){return Et()?window.navigator.userAgent:`node.js/${process?.version.slice(1)||"12"}`}function _e(t){if(!t||Object.keys(t).length===0||!{}.hasOwnProperty.call(t,"name"))throw new Error("Missing required option `name`");let e=t.version?`${t.name}/${t.version}`:t.name,r=null;t.libraryName&&!t.libraryVersion?r=t.libraryName:t.libraryName&&t.libraryVersion&&(r=`${t.libraryName}/${t.libraryVersion}`);let i=null;t.contactUrl&&!t.contactEmail?i=`(+${t.contactUrl})`:!t.contactUrl&&t.contactEmail?i=`(+${t.contactEmail})`:t.contactUrl&&t.contactEmail&&(i=`(+${t.contactUrl}; +${t.contactEmail})`);let n=At(),o=t.customAgent||"";return[e,n,r,i,o].filter(Boolean).join(" ")}function se(t){let e=_e({...t,name:`commercetools-sdk-javascript-v2/${Er.version}`});return r=>(i,n)=>{let o={...i,headers:{...i.headers,"User-Agent":e}};r(o,n)}}var{createAuthMiddlewareForPasswordFlow:Bt,createAuthMiddlewareForAnonymousSessionFlow:Rt,createAuthMiddlewareForClientCredentialsFlow:It,createAuthMiddlewareForRefreshTokenFlow:Ft,createAuthMiddlewareWithExistingToken:Tt}=Le,ae=class{projectKey;authMiddleware;httpMiddleware;userAgentMiddleware;correlationIdMiddleware;loggerMiddleware;queueMiddleware;telemetryMiddleware;beforeMiddleware;afterMiddleware;middlewares=[];withProjectKey(e){return this.projectKey=e,this}defaultClient(e,r,i,n){return this.withClientCredentialsFlow({host:i,projectKey:n||this.projectKey,credentials:r}).withHttpMiddleware({host:e,fetch}).withLoggerMiddleware().withUserAgentMiddleware()}withAuthMiddleware(e){return this.authMiddleware=e,this}withMiddleware(e){return this.middlewares.push(e),this}withClientCredentialsFlow(e){return this.withAuthMiddleware(It({host:e.host||"https://auth.europe-west1.gcp.commercetools.com",projectKey:e.projectKey||this.projectKey,credentials:{clientId:e.credentials.clientId||"",clientSecret:e.credentials.clientSecret||""},oauthUri:e.oauthUri||"",scopes:e.scopes,fetch:e.fetch||fetch,...e}))}withPasswordFlow(e){return this.withAuthMiddleware(Bt({host:e.host||"https://auth.europe-west1.gcp.commercetools.com",projectKey:e.projectKey||this.projectKey,credentials:{clientId:e.credentials.clientId||"",clientSecret:e.credentials.clientSecret||"",user:{username:e.credentials.user.username||"",password:e.credentials.user.password||""}},fetch:e.fetch||fetch,...e}))}withAnonymousSessionFlow(e){return this.withAuthMiddleware(Rt({host:e.host||"https://auth.europe-west1.gcp.commercetools.com",projectKey:this.projectKey||e.projectKey,credentials:{clientId:e.credentials.clientId||"",clientSecret:e.credentials.clientSecret||"",anonymousId:e.credentials.anonymousId||""},fetch:e.fetch||fetch,...e}))}withRefreshTokenFlow(e){return this.withAuthMiddleware(Ft({host:e.host||"https://auth.europe-west1.gcp.commercetools.com",projectKey:this.projectKey||e.projectKey,credentials:{clientId:e.credentials.clientId||"",clientSecret:e.credentials.clientSecret||""},fetch:e.fetch||fetch,refreshToken:e.refreshToken||"",...e}))}withExistingTokenFlow(e,r){return this.withAuthMiddleware(Tt(e,{force:r.force||!0,...r}))}withHttpMiddleware(e){return this.httpMiddleware=ie({host:e.host||"https://api.europe-west1.gcp.commercetools.com",fetch:e.fetch||fetch,...e}),this}withUserAgentMiddleware(e){return this.userAgentMiddleware=se(e),this}withQueueMiddleware(e){return this.queueMiddleware=oe({concurrency:e.concurrency||20,...e}),this}withLoggerMiddleware(e){let{logger:r,...i}=e||{};return this.loggerMiddleware=typeof e?.logger=="function"&&e.logger(i)||ne(),this}withCorrelationIdMiddleware(e){return this.correlationIdMiddleware=re({generate:e.generate||null,...e}),this}withTelemetryMiddleware(e){let{createTelemetryMiddleware:r,...i}=e;return this.withUserAgentMiddleware({customAgent:i?.userAgent||"typescript-sdk-apm-middleware"}),this.telemetryMiddleware=r(i),this}withBeforeExecutionMiddleware(e){let{middleware:r,...i}=e||{};return this.beforeMiddleware=e.middleware(i),this}withAfterExecutionMiddleware(e){let{middleware:r,...i}=e||{};return this.afterMiddleware=e.middleware(i),this}build(){let e=this.middlewares.slice();return this.telemetryMiddleware&&e.push(this.telemetryMiddleware),this.correlationIdMiddleware&&e.push(this.correlationIdMiddleware),this.userAgentMiddleware&&e.push(this.userAgentMiddleware),this.authMiddleware&&e.push(this.authMiddleware),this.beforeMiddleware&&e.push(this.beforeMiddleware),this.queueMiddleware&&e.push(this.queueMiddleware),this.httpMiddleware&&e.push(this.httpMiddleware),this.afterMiddleware&&e.push(this.afterMiddleware),this.loggerMiddleware&&e.push(this.loggerMiddleware),H({middlewares:e})}};return Tr(Ct);})();
2
+ /*! Bundled license information:
3
+
4
+ ieee754/index.js:
5
+ (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
6
+
7
+ buffer/index.js:
8
+ (*!
9
+ * The buffer module from node.js, for the browser.
10
+ *
11
+ * @author Feross Aboukhadijeh <https://feross.org>
12
+ * @license MIT
13
+ *)
14
+ */
@@ -30,3 +30,4 @@ export default class ClientBuilder {
30
30
  withAfterExecutionMiddleware(options: AfterExecutionMiddlewareOptions): this;
31
31
  build(): Client;
32
32
  }
33
+ //# sourceMappingURL=ClientBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClientBuilder.d.ts","sourceRoot":"../../../../src/client-builder","sources":["ClientBuilder.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,EAC9B,qBAAqB,EACrB,gCAAgC,EAChC,MAAM,EACN,8BAA8B,EAC9B,WAAW,EACX,8BAA8B,EAC9B,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,UAAU,EAEV,6BAA6B,EAC7B,sBAAsB,EACtB,4BAA4B,EAC5B,gBAAgB,EACjB,wBAAoB;AAUrB,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,OAAO,CAAC,UAAU,CAAoB;IACtC,OAAO,CAAC,cAAc,CAAsB;IAC5C,OAAO,CAAC,cAAc,CAAsB;IAC5C,OAAO,CAAC,mBAAmB,CAAsB;IACjD,OAAO,CAAC,uBAAuB,CAAsB;IACrD,OAAO,CAAC,gBAAgB,CAAsB;IAC9C,OAAO,CAAC,eAAe,CAAsB;IAC7C,OAAO,CAAC,mBAAmB,CAAsB;IACjD,OAAO,CAAC,gBAAgB,CAAsB;IAC9C,OAAO,CAAC,eAAe,CAAsB;IAC7C,OAAO,CAAC,WAAW,CAAwB;IAE3C,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa;IAK1C,aAAa,CACX,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,WAAW,EACxB,QAAQ,CAAC,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,MAAM,GAClB,aAAa;IAchB,kBAAkB,CAAC,cAAc,EAAE,UAAU,GAAG,aAAa;IAK7D,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,aAAa;IAKrD,yBAAyB,CAAC,OAAO,EAAE,qBAAqB,GAAG,aAAa;IAiBxE,gBAAgB,CAAC,OAAO,EAAE,6BAA6B,GAAG,aAAa;IAmBvE,wBAAwB,CACtB,OAAO,EAAE,8BAA8B,GACtC,aAAa;IAgBhB,oBAAoB,CAAC,OAAO,EAAE,4BAA4B,GAAG,aAAa;IAgB1E,qBAAqB,CACnB,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,8BAA8B,GACvC,aAAa;IAShB,kBAAkB,CAAC,OAAO,EAAE,qBAAqB,GAAG,aAAa;IASjE,uBAAuB,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,aAAa;IAKtE,mBAAmB,CAAC,OAAO,EAAE,sBAAsB,GAAG,aAAa;IAQnE,oBAAoB,CAAC,OAAO,CAAC,EAAE,uBAAuB,GAAG,aAAa;IAQtE,2BAA2B,CACzB,OAAO,EAAE,8BAA8B,GACtC,aAAa;IAQhB,uBAAuB,CAAC,CAAC,SAAS,gBAAgB,EAChD,OAAO,EAAE,CAAC,GACT,aAAa;IAUhB,6BAA6B,CAAC,OAAO,EAAE,gCAAgC;IAMvE,4BAA4B,CAAC,OAAO,EAAE,+BAA+B;IAMrE,KAAK,IAAI,MAAM;CAgBhB"}
@@ -12,3 +12,4 @@ export { default as createLoggerMiddleware } from "./sdk-middleware-logger/logge
12
12
  export { default as createQueueMiddleware } from "./sdk-middleware-queue/queue.js";
13
13
  export { default as createUserAgentMiddleware } from "./sdk-middleware-user-agent/user-agent.js";
14
14
  export * from "./types/sdk.js";
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"../../../src","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,0CAAsC;AACzE,OAAO,EACH,OAAO,IAAI,YAAY,EACvB,OAAO,IAAI,OAAO,EACrB,+BAA2B;AAC5B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,+BAA2B;AAC/D,OAAO,EAAE,OAAO,IAAI,iCAAiC,EAAE,wDAAoD;AAC3G,OAAO,EAAE,OAAO,IAAI,kCAAkC,EAAE,yDAAqD;AAC7G,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,gDAA4C;AAC7F,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,+CAA2C;AAC1F,OAAO,EAAE,OAAO,IAAI,6BAA6B,EAAE,oDAAgD;AACnG,OAAO,EAAE,OAAO,IAAI,6BAA6B,EAAE,0DAAsD;AACzG,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,sCAAkC;AACxE,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,0CAAsC;AAClF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,wCAAoC;AAC/E,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,kDAA8C;AAC7F,+BAA6B"}
@@ -10,3 +10,4 @@ export declare function process<T = any>(request: ClientRequest, fn: ProcessFn,
10
10
  };
11
11
  }>>;
12
12
  export default function createClient(options: ClientOptions): Client;
13
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"../../../../src/sdk-client","sources":["client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,aAAa,EACb,aAAa,EAKb,SAAS,EACT,cAAc,EAEf,wBAAsB;AAKvB,eAAO,MAAM,UAAU,KAAK,CAAA;AAc5B,wBAAgB,OAAO,CAAC,CAAC,GAAG,GAAG,EAC7B,OAAO,EAAE,aAAa,EACtB,EAAE,EAAE,SAAS,EACb,UAAU,EAAE,cAAc,GACzB,OAAO,CACR,KAAK,CAAC;IACJ,UAAU,EAAE,GAAG,CAAA;IACf,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAA;QACb,MAAM,EAAE,MAAM,CAAA;QACd,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,CAAC,EAAE,CAAA;KACb,CAAA;CACF,CAAC,CACH,CA+FA;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAsDnE"}
@@ -8,3 +8,4 @@ export declare function ConcurrentModification(this: any, ...args: Array<unknown
8
8
  export declare function InternalServerError(this: any, ...args: Array<unknown>): void;
9
9
  export declare function ServiceUnavailable(this: any, ...args: Array<unknown>): void;
10
10
  export default function getErrorByCode(code: number): typeof NetworkError;
11
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"../../../../src/sdk-client","sources":["errors.ts"],"names":[],"mappings":"AAmBA,wBAAgB,YAAY,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,QAM9D;AACD,wBAAgB,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,QAEhD;AACD,wBAAgB,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,QAE5D;AACD,wBAAgB,YAAY,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,QAE9D;AACD,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,QAE3D;AACD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,QAE1D;AACD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,QAExE;AACD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,QAErE;AACD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,QAEpE;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,IAAI,EAAE,MAAM,uBAqBlD"}
@@ -1,2 +1,3 @@
1
1
  import { AuthMiddlewareOptions, Middleware } from "../types/sdk.js";
2
2
  export default function createAuthMiddlewareForAnonymousSessionFlow(options: AuthMiddlewareOptions): Middleware;
3
+ //# sourceMappingURL=anonymous-session-flow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anonymous-session-flow.d.ts","sourceRoot":"../../../../src/sdk-middleware-auth","sources":["anonymous-session-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,UAAU,EASX,wBAAsB;AAKvB,MAAM,CAAC,OAAO,UAAU,2CAA2C,CACjE,OAAO,EAAE,qBAAqB,GAC7B,UAAU,CAiCZ"}
@@ -1,2 +1,3 @@
1
1
  import { AuthMiddlewareOptions, Middleware } from "../types/sdk.js";
2
2
  export default function createAuthMiddlewareForClientCredentialsFlow(options: AuthMiddlewareOptions): Middleware;
3
+ //# sourceMappingURL=client-credentials-flow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-credentials-flow.d.ts","sourceRoot":"../../../../src/sdk-middleware-auth","sources":["client-credentials-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,UAAU,EASX,wBAAsB;AAMvB,MAAM,CAAC,OAAO,UAAU,4CAA4C,CAClE,OAAO,EAAE,qBAAqB,GAC7B,UAAU,CAkCZ"}
@@ -1,2 +1,3 @@
1
1
  import { ExistingTokenMiddlewareOptions, Middleware } from "../types/sdk.js";
2
2
  export default function createAuthMiddlewareWithExistingToken(authorization?: string, options?: ExistingTokenMiddlewareOptions): Middleware;
3
+ //# sourceMappingURL=existing-token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"existing-token.d.ts","sourceRoot":"../../../../src/sdk-middleware-auth","sources":["existing-token.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,UAAU,EAIX,wBAAsB;AAEvB,MAAM,CAAC,OAAO,UAAU,qCAAqC,CAC3D,aAAa,GAAE,MAAW,EAC1B,OAAO,GAAE,8BAAmC,GAC3C,UAAU,CA4BZ"}
@@ -1,2 +1,3 @@
1
1
  import { Middleware, PasswordAuthMiddlewareOptions } from "../types/sdk.js";
2
2
  export default function createAuthMiddlewareForPasswordFlow(options: PasswordAuthMiddlewareOptions): Middleware;
3
+ //# sourceMappingURL=password-flow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"password-flow.d.ts","sourceRoot":"../../../../src/sdk-middleware-auth","sources":["password-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAIV,6BAA6B,EAI9B,wBAAsB;AAKvB,MAAM,CAAC,OAAO,UAAU,mCAAmC,CACzD,OAAO,EAAE,6BAA6B,GACrC,UAAU,CA2BZ"}
@@ -1,2 +1,3 @@
1
1
  import { Middleware, RefreshAuthMiddlewareOptions } from "../types/sdk.js";
2
2
  export default function createAuthMiddlewareForRefreshTokenFlow(options: RefreshAuthMiddlewareOptions): Middleware;
3
+ //# sourceMappingURL=refresh-token-flow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refresh-token-flow.d.ts","sourceRoot":"../../../../src/sdk-middleware-auth","sources":["refresh-token-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAIV,4BAA4B,EAM7B,wBAAsB;AAKvB,MAAM,CAAC,OAAO,UAAU,uCAAuC,CAC7D,OAAO,EAAE,4BAA4B,GACpC,UAAU,CAiCZ"}
@@ -1,2 +1,3 @@
1
1
  import type { CorrelationIdMiddlewareOptions, Middleware } from "../types/sdk.js";
2
2
  export default function createCorrelationIdMiddleware(options: CorrelationIdMiddlewareOptions): Middleware;
3
+ //# sourceMappingURL=correlation-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"correlation-id.d.ts","sourceRoot":"../../../../src/sdk-middleware-correlation-id","sources":["correlation-id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,UAAU,EAIX,wBAAsB;AAEvB,MAAM,CAAC,OAAO,UAAU,6BAA6B,CACnD,OAAO,EAAE,8BAA8B,GACtC,UAAU,CAYZ"}
@@ -1,2 +1,3 @@
1
1
  import { HttpMiddlewareOptions, Middleware } from "../types/sdk.js";
2
2
  export default function createHttpMiddleware({ host, credentialsMode, includeResponseHeaders, includeOriginalRequest, includeRequestInErrorResponse, maskSensitiveHeaderData, headersWithStringBody, enableRetry, timeout, retryConfig: { maxRetries, backoff, retryDelay, maxDelay, retryOnAbort, retryCodes, }, fetch: fetcher, getAbortController, }: HttpMiddlewareOptions): Middleware;
3
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"../../../../src/sdk-middleware-http","sources":["http.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,qBAAqB,EAErB,UAAU,EAMX,wBAAsB;AA4DvB,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,IAAI,EACJ,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,6BAAoC,EACpC,uBAA8B,EAC9B,qBAA0B,EAC1B,WAAW,EACX,OAAO,EACP,WAAW,EAAE,EAEX,UAAe,EACf,OAAc,EACd,UAAgB,EAChB,QAAmB,EAEnB,YAAoB,EACpB,UAAkB,GACd,EACN,KAAK,EAAE,OAAO,EACd,kBAAkB,GACnB,EAAE,qBAAqB,GAAG,UAAU,CAmRpC"}
@@ -1,2 +1,3 @@
1
1
  import type { Middleware } from "../types/sdk.js";
2
2
  export default function createLoggerMiddleware(): Middleware;
3
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"../../../../src/sdk-middleware-logger","sources":["logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EAIX,wBAAsB;AAEvB,MAAM,CAAC,OAAO,UAAU,sBAAsB,IAAI,UAAU,CAQ3D"}
@@ -1,2 +1,3 @@
1
1
  import type { Middleware, QueueMiddlewareOptions } from "../types/sdk.js";
2
2
  export default function createQueueMiddleware({ concurrency, }: QueueMiddlewareOptions): Middleware;
3
+ //# sourceMappingURL=queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.d.ts","sourceRoot":"../../../../src/sdk-middleware-queue","sources":["queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,UAAU,EAIV,sBAAsB,EACvB,wBAAoB;AAOrB,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAC5C,WAAgB,GACjB,EAAE,sBAAsB,GAAG,UAAU,CA6CrC"}
@@ -1,2 +1,3 @@
1
1
  import { HttpUserAgentOptions, Middleware } from "../types/sdk.js";
2
2
  export default function createUserAgentMiddleware(options?: HttpUserAgentOptions): Middleware;
3
+ //# sourceMappingURL=user-agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-agent.d.ts","sourceRoot":"../../../../src/sdk-middleware-user-agent","sources":["user-agent.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,oBAAoB,EACpB,UAAU,EAGX,wBAAoB;AAErB,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAC/C,OAAO,CAAC,EAAE,oBAAoB,GAC7B,UAAU,CAiBZ"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@commercetools/sdk-client-v2",
3
- "version": "2.5.0",
3
+ "version": "3.0.0",
4
4
  "engines": {
5
- "node": ">=14"
5
+ "node": ">=18"
6
6
  },
7
7
  "description": "commercetools Composable Commerce TypeScript SDK client.",
8
8
  "keywords": [
@@ -33,8 +33,7 @@
33
33
  "url": "https://github.com/commercetools/commercetools-sdk-typescript/issues"
34
34
  },
35
35
  "dependencies": {
36
- "buffer": "^6.0.3",
37
- "node-fetch": "^2.6.1"
36
+ "buffer": "^6.0.3"
38
37
  },
39
38
  "files": ["dist", "CHANGELOG.md"],
40
39
  "author": "Chukwuemeka Ajima <meeky.ae@gmail.com>",
@@ -45,16 +44,16 @@
45
44
  "./dist/commercetools-sdk-client-v2.esm.js": "./dist/commercetools-sdk-client-v2.browser.esm.js"
46
45
  },
47
46
  "devDependencies": {
48
- "abort-controller": "3.0.0",
49
47
  "common-tags": "1.8.2",
50
48
  "dotenv": "16.4.5",
51
49
  "jest": "29.7.0",
52
- "nock": "12.0.3",
50
+ "nock": "^14.0.0-beta.19",
53
51
  "organize-imports-cli": "0.10.0"
54
52
  },
55
53
  "scripts": {
56
54
  "organize_imports": "find src -type f -name '*.ts' | xargs organize-imports-cli",
57
55
  "postbuild": "yarn organize_imports",
58
- "post_process_generate": "yarn organize_imports"
56
+ "post_process_generate": "yarn organize_imports",
57
+ "docs": "typedoc --out docs"
59
58
  }
60
59
  }