@commercetools/processors 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +341 -0
- package/dist/index.d.mts +112 -0
- package/dist/index.d.ts +112 -0
- package/dist/index.js +476 -0
- package/dist/index.mjs +430 -0
- package/package.json +76 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
// src/field-filtering/defaultFilteringRules.ts
|
|
2
|
+
var defaultJsonRedactionText = "[REDACTED]";
|
|
3
|
+
var defaultUrlRedactionText = "REDACTED";
|
|
4
|
+
var defaultFilteringRules = {
|
|
5
|
+
jsonRedactionText: defaultJsonRedactionText,
|
|
6
|
+
urlRedactionText: defaultUrlRedactionText
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
// src/field-filtering/urlHelpers.ts
|
|
10
|
+
import qs from "qs";
|
|
11
|
+
var normaliseUrl = (url) => {
|
|
12
|
+
const protocolSplit = url.split("//");
|
|
13
|
+
let normalisedUrl = "";
|
|
14
|
+
if (protocolSplit[0] && (protocolSplit[0] === "http:" || protocolSplit[0] === "https:" || protocolSplit[0] === "ws:" || protocolSplit[0] === "wss:")) {
|
|
15
|
+
normalisedUrl = `${protocolSplit[0]}//`;
|
|
16
|
+
protocolSplit.splice(0, 1);
|
|
17
|
+
}
|
|
18
|
+
let query = "";
|
|
19
|
+
const querySplit = protocolSplit.join("//").split("?");
|
|
20
|
+
if (querySplit.length > 1) {
|
|
21
|
+
query = `?${querySplit.slice(1, querySplit.length).join("?")}`;
|
|
22
|
+
}
|
|
23
|
+
const pathSplit = querySplit[0].split("/");
|
|
24
|
+
for (let n = 0; n < pathSplit.length; n++) {
|
|
25
|
+
if (pathSplit[n]) {
|
|
26
|
+
normalisedUrl += `${pathSplit[n]}/`;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
normalisedUrl = normalisedUrl.substring(0, normalisedUrl.length - 1);
|
|
30
|
+
return normalisedUrl + query;
|
|
31
|
+
};
|
|
32
|
+
var toQueryObject = (key, value) => {
|
|
33
|
+
const obj = {};
|
|
34
|
+
obj[key] = value;
|
|
35
|
+
return obj;
|
|
36
|
+
};
|
|
37
|
+
var toQueryString = (obj) => {
|
|
38
|
+
return qs.stringify(obj, {
|
|
39
|
+
arrayFormat: "indices",
|
|
40
|
+
encodeValuesOnly: true,
|
|
41
|
+
format: "RFC3986"
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var generateQueryString = (query) => {
|
|
45
|
+
let queryString = "?";
|
|
46
|
+
Object.keys(query).forEach((key) => {
|
|
47
|
+
const value = query[key];
|
|
48
|
+
if (value !== void 0 && typeof value !== "function") {
|
|
49
|
+
if (value === null) {
|
|
50
|
+
queryString += `${key}=null&`;
|
|
51
|
+
} else {
|
|
52
|
+
queryString += `${toQueryString(toQueryObject(key, value))}&`;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
queryString = queryString.substring(0, queryString.length - 1);
|
|
57
|
+
return queryString;
|
|
58
|
+
};
|
|
59
|
+
var isValidUrl = (urlLike) => {
|
|
60
|
+
let url;
|
|
61
|
+
try {
|
|
62
|
+
url = new URL(urlLike);
|
|
63
|
+
} catch (_) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
return true;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// src/field-filtering/FieldFilteringHandler.ts
|
|
70
|
+
var FieldFilteringHandler = class {
|
|
71
|
+
filterPaths;
|
|
72
|
+
redactPaths;
|
|
73
|
+
filterProperties;
|
|
74
|
+
redactProperties;
|
|
75
|
+
whitelistPaths;
|
|
76
|
+
filterIncludes;
|
|
77
|
+
redactIncludes;
|
|
78
|
+
jsonRedactionText;
|
|
79
|
+
urlRedactionText;
|
|
80
|
+
hasFilteringRules = true;
|
|
81
|
+
constructor(config) {
|
|
82
|
+
this.filterPaths = config.paths?.filter((path) => path.type === "filter") ?? [];
|
|
83
|
+
this.redactPaths = config.paths?.filter((path) => path.type === "redact") ?? [];
|
|
84
|
+
this.filterProperties = config.properties?.filter((path) => path.type === "filter") ?? [];
|
|
85
|
+
this.redactProperties = config.properties?.filter((path) => path.type === "redact") ?? [];
|
|
86
|
+
this.whitelistPaths = config.whitelistPaths ?? [];
|
|
87
|
+
this.filterIncludes = config.includes?.filter((path) => path.type === "filter") ?? [];
|
|
88
|
+
this.redactIncludes = config.includes?.filter((path) => path.type === "redact") ?? [];
|
|
89
|
+
this.jsonRedactionText = config.jsonRedactionText ?? defaultJsonRedactionText;
|
|
90
|
+
this.urlRedactionText = config.urlRedactionText ?? defaultUrlRedactionText;
|
|
91
|
+
if (config.paths?.length === 0 && config.properties?.length === 0 && config.includes?.length === 0) {
|
|
92
|
+
this.hasFilteringRules = false;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
filterFields(data, currentPath) {
|
|
96
|
+
if (this.hasFilteringRules === false) {
|
|
97
|
+
return data;
|
|
98
|
+
}
|
|
99
|
+
if (this.filterConditionMet(currentPath ?? "", "redact")) {
|
|
100
|
+
return this.jsonRedactionText;
|
|
101
|
+
}
|
|
102
|
+
if (typeof data === "string") {
|
|
103
|
+
if (isValidUrl(data)) {
|
|
104
|
+
return this.filterUrlFields(data);
|
|
105
|
+
}
|
|
106
|
+
return data;
|
|
107
|
+
}
|
|
108
|
+
if (typeof data === "object") {
|
|
109
|
+
if (Array.isArray(data)) {
|
|
110
|
+
return data.map(
|
|
111
|
+
(datum) => this.filterFields(datum, currentPath)
|
|
112
|
+
);
|
|
113
|
+
} else if (data) {
|
|
114
|
+
Object.keys(data).forEach((key) => {
|
|
115
|
+
const newPath = currentPath ? `${currentPath}.${key}` : key;
|
|
116
|
+
if (this.filterConditionMet(newPath, "filter")) {
|
|
117
|
+
delete data[key];
|
|
118
|
+
} else {
|
|
119
|
+
data[key] = this.filterFields(
|
|
120
|
+
data[key],
|
|
121
|
+
newPath
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
return data;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return data;
|
|
129
|
+
}
|
|
130
|
+
filterConditionMet(path, type) {
|
|
131
|
+
let ruleIsSatisfied = this.testFilterRules(path, this.whitelistPaths);
|
|
132
|
+
if (ruleIsSatisfied) {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
ruleIsSatisfied = this.testFilterRules(path, this[`${type}Paths`]);
|
|
136
|
+
if (ruleIsSatisfied) {
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
const properties = path.split(".");
|
|
140
|
+
const propertyName = properties[properties.length - 1];
|
|
141
|
+
ruleIsSatisfied = this.testFilterRules(
|
|
142
|
+
propertyName,
|
|
143
|
+
this[`${type}Properties`]
|
|
144
|
+
);
|
|
145
|
+
if (ruleIsSatisfied) {
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
const includes = this[`${type}Includes`];
|
|
149
|
+
for (let n = 0; n < includes.length; n++) {
|
|
150
|
+
if (propertyName.includes(includes[n].value) || !includes[n].caseSensitive && propertyName.toLowerCase().includes(includes[n].value.toLowerCase())) {
|
|
151
|
+
n = includes.length;
|
|
152
|
+
ruleIsSatisfied = true;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return ruleIsSatisfied;
|
|
156
|
+
}
|
|
157
|
+
// checks regardless of "filter" | "redact"
|
|
158
|
+
testFilterRules(path, rules) {
|
|
159
|
+
let ruleIsSatisfied = false;
|
|
160
|
+
for (let n = 0; n < rules.length; n++) {
|
|
161
|
+
if (path === rules[n].value || !rules[n].caseSensitive && path.toLowerCase() === rules[n].value.toLowerCase()) {
|
|
162
|
+
n = rules.length;
|
|
163
|
+
ruleIsSatisfied = true;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return ruleIsSatisfied;
|
|
167
|
+
}
|
|
168
|
+
filterUrlFields(inputUrl) {
|
|
169
|
+
if (this.hasFilteringRules === false) {
|
|
170
|
+
return inputUrl;
|
|
171
|
+
}
|
|
172
|
+
const url = new URL(inputUrl);
|
|
173
|
+
const urlParams = new URLSearchParams(url.search);
|
|
174
|
+
const keysToDelete = [];
|
|
175
|
+
for (const [key, _] of urlParams.entries()) {
|
|
176
|
+
if (this.filterConditionMet(this.urlQueryKeyToObjectPath(key), "filter")) {
|
|
177
|
+
keysToDelete.push(key);
|
|
178
|
+
} else if (this.filterConditionMet(this.urlQueryKeyToObjectPath(key), "redact")) {
|
|
179
|
+
urlParams.set(key, this.urlRedactionText);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
keysToDelete.forEach((key) => urlParams.delete(key));
|
|
183
|
+
url.search = urlParams.toString();
|
|
184
|
+
return url.toString();
|
|
185
|
+
}
|
|
186
|
+
// assumes keys of string only
|
|
187
|
+
urlQueryKeyToObjectPath(urlQueryKey) {
|
|
188
|
+
const urlQueryKeyOpenBracketSplit = urlQueryKey.split("[");
|
|
189
|
+
if (urlQueryKeyOpenBracketSplit.length === 1) {
|
|
190
|
+
return urlQueryKey;
|
|
191
|
+
} else {
|
|
192
|
+
let objectPath = urlQueryKeyOpenBracketSplit.splice(0, 1)[0];
|
|
193
|
+
urlQueryKeyOpenBracketSplit.forEach((openBracketSplitValue, n) => {
|
|
194
|
+
const closeBracketSplit = openBracketSplitValue.split("]");
|
|
195
|
+
if (closeBracketSplit.length !== 2) {
|
|
196
|
+
console.warn(
|
|
197
|
+
`Object in URL params in incorrect format: [${urlQueryKeyOpenBracketSplit[n]}`
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
if (!closeBracketSplit[0].match(/^-?\d+$/)) {
|
|
201
|
+
objectPath += `.${closeBracketSplit[0]}`;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
return objectPath;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
// src/field-filtering/index.ts
|
|
210
|
+
var isFieldFilteringManager = (config) => {
|
|
211
|
+
return Boolean(
|
|
212
|
+
config?.filterFields && config?.filterUrlFields
|
|
213
|
+
);
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
// src/transform/transformPropertyName.ts
|
|
217
|
+
var isUpperCase = (str) => str !== str.toLowerCase();
|
|
218
|
+
var transformPropertyName = (propertyName) => {
|
|
219
|
+
if (!propertyName) {
|
|
220
|
+
return "";
|
|
221
|
+
}
|
|
222
|
+
propertyName = propertyName.replaceAll(/[_-]+/g, " ").trim();
|
|
223
|
+
let newPropertyName = propertyName.charAt(0).toLocaleUpperCase();
|
|
224
|
+
for (let n = 1; n < propertyName.length; n++) {
|
|
225
|
+
const char = propertyName.charAt(n);
|
|
226
|
+
if (!isUpperCase(char)) {
|
|
227
|
+
if (propertyName.charAt(n - 1) === " ") {
|
|
228
|
+
if (char !== " ") {
|
|
229
|
+
newPropertyName += char.toUpperCase();
|
|
230
|
+
}
|
|
231
|
+
} else {
|
|
232
|
+
newPropertyName += char;
|
|
233
|
+
}
|
|
234
|
+
} else {
|
|
235
|
+
if (propertyName.charAt(n - 1) !== " ") {
|
|
236
|
+
newPropertyName += " ";
|
|
237
|
+
}
|
|
238
|
+
newPropertyName += char;
|
|
239
|
+
const i = 1;
|
|
240
|
+
let nextChar = propertyName.charAt(n + i);
|
|
241
|
+
if (isUpperCase(nextChar)) {
|
|
242
|
+
do {
|
|
243
|
+
nextChar = propertyName.charAt(n + i);
|
|
244
|
+
if (isUpperCase(nextChar)) {
|
|
245
|
+
newPropertyName += nextChar;
|
|
246
|
+
n += 1;
|
|
247
|
+
}
|
|
248
|
+
} while (nextChar !== nextChar.toLowerCase());
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
return newPropertyName;
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
// src/transform/transformToolOutput.ts
|
|
256
|
+
var emptyObjectTransformValue = "no properties";
|
|
257
|
+
var emptyArrayTransformValue = "none";
|
|
258
|
+
var generateTabs = (tabCount) => {
|
|
259
|
+
let tabs = "";
|
|
260
|
+
for (let n = 0; n < tabCount; n++) {
|
|
261
|
+
tabs += " ";
|
|
262
|
+
}
|
|
263
|
+
return tabs;
|
|
264
|
+
};
|
|
265
|
+
var transformToolOutput = (args) => {
|
|
266
|
+
const { data, title, format } = args;
|
|
267
|
+
if (isPropertyTypeToBeIgnored(data)) {
|
|
268
|
+
return title ? `${transformTitle(title)}
|
|
269
|
+
${emptyObjectTransformValue}` : emptyObjectTransformValue;
|
|
270
|
+
}
|
|
271
|
+
if (format === "json") {
|
|
272
|
+
if (title) {
|
|
273
|
+
return JSON.stringify({
|
|
274
|
+
[transformTitle(title)]: data
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
return JSON.stringify(data);
|
|
278
|
+
}
|
|
279
|
+
let transformedDataAggregate = "";
|
|
280
|
+
if (title) {
|
|
281
|
+
transformedDataAggregate = `${transformTitle(title)}
|
|
282
|
+
`;
|
|
283
|
+
}
|
|
284
|
+
const transformedData = transformData({ data, tabCount: -1 });
|
|
285
|
+
return transformedDataAggregate += transformedData ?? emptyObjectTransformValue;
|
|
286
|
+
};
|
|
287
|
+
var transformTitle = (title) => `${transformPropertyName(title).toUpperCase()}`;
|
|
288
|
+
var transformData = (args) => {
|
|
289
|
+
const { data, tabCount } = args;
|
|
290
|
+
if (isPropertyTypeToBeIgnored(data)) {
|
|
291
|
+
return null;
|
|
292
|
+
}
|
|
293
|
+
switch (typeof data) {
|
|
294
|
+
case "string": {
|
|
295
|
+
if (data === "") {
|
|
296
|
+
return '""';
|
|
297
|
+
}
|
|
298
|
+
return data;
|
|
299
|
+
}
|
|
300
|
+
case "number":
|
|
301
|
+
case "bigint": {
|
|
302
|
+
return data.toString();
|
|
303
|
+
}
|
|
304
|
+
case "boolean": {
|
|
305
|
+
return data ? "Yes" : "No";
|
|
306
|
+
}
|
|
307
|
+
case "object": {
|
|
308
|
+
if (data === null) {
|
|
309
|
+
return "null";
|
|
310
|
+
}
|
|
311
|
+
if (Array.isArray(data)) {
|
|
312
|
+
return handleArrayTransformation({ array: data, tabCount });
|
|
313
|
+
}
|
|
314
|
+
return handleObjectTransformation({
|
|
315
|
+
data,
|
|
316
|
+
tabCount
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
default:
|
|
320
|
+
return null;
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
var handleArrayTransformation = (args) => {
|
|
324
|
+
const { array, tabCount } = args;
|
|
325
|
+
if (array.length === 0) {
|
|
326
|
+
return emptyArrayTransformValue;
|
|
327
|
+
}
|
|
328
|
+
if (isArrayWithoutObjectsOrArrays(array)) {
|
|
329
|
+
const simpleTransformedArray = array.reduce(
|
|
330
|
+
(previousValue, currentValue) => {
|
|
331
|
+
const transformedCurrentValue = transformData({
|
|
332
|
+
data: currentValue,
|
|
333
|
+
tabCount
|
|
334
|
+
});
|
|
335
|
+
if (transformedCurrentValue === null) {
|
|
336
|
+
return previousValue;
|
|
337
|
+
}
|
|
338
|
+
if (previousValue) {
|
|
339
|
+
return `${previousValue}, ${transformedCurrentValue}`;
|
|
340
|
+
} else {
|
|
341
|
+
return transformedCurrentValue;
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
""
|
|
345
|
+
);
|
|
346
|
+
return simpleTransformedArray === "" ? emptyArrayTransformValue : simpleTransformedArray;
|
|
347
|
+
}
|
|
348
|
+
let transformedData = "";
|
|
349
|
+
let unignoredArrayPropertyIndex = 0;
|
|
350
|
+
array.forEach((value) => {
|
|
351
|
+
if (!isPropertyTypeToBeIgnored(value)) {
|
|
352
|
+
transformedData += transformObjectOrArrayContent({
|
|
353
|
+
key: unignoredArrayPropertyIndex.toString(),
|
|
354
|
+
value,
|
|
355
|
+
tabCount
|
|
356
|
+
});
|
|
357
|
+
transformedData += "\n";
|
|
358
|
+
unignoredArrayPropertyIndex += 1;
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
if (transformedData === "") {
|
|
362
|
+
return emptyArrayTransformValue;
|
|
363
|
+
}
|
|
364
|
+
return transformedData.substring(0, transformedData.length - 1);
|
|
365
|
+
};
|
|
366
|
+
var handleObjectTransformation = (args) => {
|
|
367
|
+
const { data, tabCount } = args;
|
|
368
|
+
let transformedData = "";
|
|
369
|
+
Object.keys(data).forEach((key) => {
|
|
370
|
+
if (!isPropertyTypeToBeIgnored(data[key])) {
|
|
371
|
+
transformedData += transformObjectOrArrayContent({
|
|
372
|
+
key,
|
|
373
|
+
value: data[key],
|
|
374
|
+
tabCount: tabCount + 1
|
|
375
|
+
});
|
|
376
|
+
transformedData += "\n";
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
if (transformedData === "") {
|
|
380
|
+
return emptyObjectTransformValue;
|
|
381
|
+
}
|
|
382
|
+
return transformedData.substring(0, transformedData.length - 1);
|
|
383
|
+
};
|
|
384
|
+
var transformObjectOrArrayContent = (args) => {
|
|
385
|
+
const { key, value, tabCount } = args;
|
|
386
|
+
const transformedValue = transformData({
|
|
387
|
+
data: value,
|
|
388
|
+
// increase base indentation in arrays so child indices render under the parent label.
|
|
389
|
+
// Objects handle their own +1 indentation internally in handleObjectTransformation.
|
|
390
|
+
tabCount: Array.isArray(value) ? tabCount + 1 : tabCount
|
|
391
|
+
});
|
|
392
|
+
if (transformedValue === null) {
|
|
393
|
+
return "";
|
|
394
|
+
}
|
|
395
|
+
let transformedDataAggregate = `${generateTabs(tabCount)}${transformPropertyName(key)}:`;
|
|
396
|
+
if (typeof value !== "object" || transformedValue === "null" || transformedValue === emptyArrayTransformValue || transformedValue === emptyObjectTransformValue || Array.isArray(value) && isArrayWithoutObjectsOrArrays(value)) {
|
|
397
|
+
transformedDataAggregate += " ";
|
|
398
|
+
} else {
|
|
399
|
+
transformedDataAggregate += `
|
|
400
|
+
`;
|
|
401
|
+
}
|
|
402
|
+
return transformedDataAggregate += transformedValue;
|
|
403
|
+
};
|
|
404
|
+
var isArrayWithoutObjectsOrArrays = (array) => {
|
|
405
|
+
if (array.length === 0) {
|
|
406
|
+
return true;
|
|
407
|
+
}
|
|
408
|
+
let hasObjectOrArrayBeenFound = false;
|
|
409
|
+
for (let n = 0; n < array.length; n++) {
|
|
410
|
+
if (isObject(array[n]) || Array.isArray(array[n])) {
|
|
411
|
+
hasObjectOrArrayBeenFound = true;
|
|
412
|
+
n = array.length;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
return !hasObjectOrArrayBeenFound;
|
|
416
|
+
};
|
|
417
|
+
var isPropertyTypeToBeIgnored = (data) => typeof data === "undefined" || typeof data === "function";
|
|
418
|
+
var isObject = (data) => typeof data === "object" && data !== null && !Array.isArray(data);
|
|
419
|
+
export {
|
|
420
|
+
FieldFilteringHandler,
|
|
421
|
+
defaultFilteringRules,
|
|
422
|
+
defaultJsonRedactionText,
|
|
423
|
+
defaultUrlRedactionText,
|
|
424
|
+
generateQueryString,
|
|
425
|
+
isFieldFilteringManager,
|
|
426
|
+
isValidUrl,
|
|
427
|
+
normaliseUrl,
|
|
428
|
+
transformPropertyName,
|
|
429
|
+
transformToolOutput
|
|
430
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@commercetools/processors",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"mcpName": "io.github.commercetools/processors",
|
|
5
|
+
"homepage": "https://github.com/commercetools/processors",
|
|
6
|
+
"description": "A collection of output processors for commercetools MCP server",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"module": "dist/index.mjs",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"LICENSE",
|
|
13
|
+
"README.md",
|
|
14
|
+
"package.json"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"preinstall": "npx only-allow pnpm",
|
|
18
|
+
"prebuild": "pnpm run clean",
|
|
19
|
+
"dev:build": "tsup --env.NODE_ENV dev",
|
|
20
|
+
"build": "tsup",
|
|
21
|
+
"clean": "rm -rf dist",
|
|
22
|
+
"lint": "eslint \"./**/*.ts*\"",
|
|
23
|
+
"prettier": "prettier './**/*.{js,ts,md,html,css}' --write",
|
|
24
|
+
"prettier-check": "prettier './**/*.{js,ts,md,html,css}' --check",
|
|
25
|
+
"test": "jest",
|
|
26
|
+
"validate": "pnpm run lint --fix && pnpm run prettier && pnpm run test"
|
|
27
|
+
},
|
|
28
|
+
"packageManager": "pnpm@9.11.0",
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=18"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"dotenv": "17.2.1",
|
|
37
|
+
"qs": "6.14.0"
|
|
38
|
+
},
|
|
39
|
+
"keywords": [
|
|
40
|
+
"mcp",
|
|
41
|
+
"modelcontextprotocol",
|
|
42
|
+
"commercetools",
|
|
43
|
+
"field-filtering",
|
|
44
|
+
"transformations",
|
|
45
|
+
"transform",
|
|
46
|
+
"tools"
|
|
47
|
+
],
|
|
48
|
+
"author": "commercetools GmbH <info@commercetools.com> (https://commercetools.com)",
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "git+https://github.com/commercetools/commerce-mcp.git",
|
|
52
|
+
"directory": "processors"
|
|
53
|
+
},
|
|
54
|
+
"license": "MIT",
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@eslint/compat": "^1.3.2",
|
|
57
|
+
"@types/express": "^5.0.3",
|
|
58
|
+
"@types/jest": "^29.5.14",
|
|
59
|
+
"@types/node": "^22.17.2",
|
|
60
|
+
"@types/qs": "^6.14.0",
|
|
61
|
+
"@typescript-eslint/eslint-plugin": "^8.24.1",
|
|
62
|
+
"concurrently": "^9.2.0",
|
|
63
|
+
"eslint": "^9.17.0",
|
|
64
|
+
"eslint-config-prettier": "^10.0.1",
|
|
65
|
+
"eslint-plugin-import": "^2.31.0",
|
|
66
|
+
"eslint-plugin-jest": "^28.11.0",
|
|
67
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
68
|
+
"globals": "^15.15.0",
|
|
69
|
+
"jest": "^29.7.0",
|
|
70
|
+
"prettier": "^3.5.1",
|
|
71
|
+
"ts-jest": "^29.2.5",
|
|
72
|
+
"ts-node": "^10.9.2",
|
|
73
|
+
"tsup": "^8.3.5",
|
|
74
|
+
"typescript": "^5.8.3"
|
|
75
|
+
}
|
|
76
|
+
}
|