mcdev 5.0.2 → 5.1.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/.coverage-comment-template.svelte +177 -161
- package/.github/ISSUE_TEMPLATE/bug.yml +1 -0
- package/.github/dependabot.yml +8 -0
- package/.github/workflows/coverage-base-update.yml +6 -2
- package/.github/workflows/coverage-develop-branch.yml +7 -6
- package/.github/workflows/coverage-main-branch.yml +7 -6
- package/.github/workflows/coverage.yml +7 -2
- package/.husky/post-checkout +3 -2
- package/docs/dist/documentation.md +162 -47
- package/lib/Deployer.js +3 -3
- package/lib/cli.js +28 -0
- package/lib/index.js +173 -2
- package/lib/metadataTypes/Automation.js +400 -193
- package/lib/metadataTypes/DataExtension.js +5 -5
- package/lib/metadataTypes/MetadataType.js +42 -15
- package/lib/metadataTypes/Query.js +26 -0
- package/lib/metadataTypes/definitions/Asset.definition.js +1 -0
- package/lib/metadataTypes/definitions/Automation.definition.js +52 -6
- package/lib/metadataTypes/definitions/DataExtension.definition.js +1 -0
- package/lib/metadataTypes/definitions/DataExtract.definition.js +1 -0
- package/lib/metadataTypes/definitions/EmailSend.definition.js +1 -0
- package/lib/metadataTypes/definitions/Event.definition.js +1 -0
- package/lib/metadataTypes/definitions/Filter.definition.js +1 -0
- package/lib/metadataTypes/definitions/ImportFile.definition.js +1 -0
- package/lib/metadataTypes/definitions/MobileKeyword.definition.js +1 -0
- package/lib/metadataTypes/definitions/Query.definition.js +1 -0
- package/lib/metadataTypes/definitions/Role.definition.js +1 -0
- package/lib/metadataTypes/definitions/TriggeredSend.definition.js +1 -0
- package/lib/metadataTypes/definitions/User.definition.js +1 -0
- package/lib/util/devops.js +13 -11
- package/lib/util/util.js +152 -129
- package/package.json +5 -5
- package/test/general.test.js +26 -0
- package/test/mockRoot/.mcdevrc.json +1 -1
- package/test/mockRoot/deploy/testInstance/testBU/automation/testExisting_automation.automation-meta.json +53 -0
- package/test/mockRoot/deploy/testInstance/testBU/automation/testNew_automation.automation-meta.json +46 -0
- package/test/mockRoot/deploy/testInstance/testBU/query/{testExistingQuery.query-meta.json → testExisting_query.query-meta.json} +2 -2
- package/test/mockRoot/deploy/testInstance/testBU/query/{testNewQuery.query-meta.json → testNew_query.query-meta.json} +2 -2
- package/test/resourceFactory.js +64 -21
- package/test/resources/9999999/automation/build-expected.json +58 -0
- package/test/resources/9999999/automation/create-expected.json +46 -0
- package/test/resources/9999999/automation/create-testNew_automation-expected.md +28 -0
- package/test/resources/9999999/automation/delete-response.xml +40 -0
- package/test/resources/9999999/automation/retrieve-expected.json +58 -0
- package/test/resources/9999999/automation/retrieve-testExisting_automation-expected.md +30 -0
- package/test/resources/9999999/automation/template-expected.json +58 -0
- package/test/resources/9999999/automation/update-expected.json +46 -0
- package/test/resources/9999999/automation/update-testExisting_automation-expected.md +28 -0
- package/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-1f7f8788c560/get-response.json +85 -0
- package/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-1f7f8788c560/patch-response.json +85 -0
- package/test/resources/9999999/automation/v1/automations/a8afb0e2-b00a-4c88-ad2e-1f7f8788c560/get-response.json +85 -0
- package/test/resources/9999999/automation/v1/automations/post-response.json +85 -0
- package/test/resources/9999999/automation/v1/dataextracts/56c5370a-f988-4f36-b0ee-0f876573f6d7/get-response.json +38 -0
- package/test/resources/9999999/automation/v1/dataextracts/get-response.json +20 -0
- package/test/resources/9999999/automation/v1/filetransfers/72c328ac-f5b0-4e37-91d3-a775666f15a6/get-response.json +18 -0
- package/test/resources/9999999/automation/v1/filetransfers/get-response.json +15 -0
- package/test/resources/9999999/automation/v1/imports/get-response.json +38 -0
- package/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat/actions/start/post-response.txt +1 -0
- package/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat/get-response.json +2 -2
- package/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat/patch-response.json +2 -2
- package/test/resources/9999999/automation/v1/queries/get-response.json +4 -4
- package/test/resources/9999999/automation/v1/queries/post-response.json +2 -2
- package/test/resources/9999999/automation/v1/scripts/get-response.json +17 -0
- package/test/resources/9999999/dataFolder/retrieve-ContentType=automations-response.xml +48 -0
- package/test/resources/9999999/dataFolder/retrieve-ContentType=queryactivity-response.xml +48 -0
- package/test/resources/9999999/dataFolder/retrieve-response.xml +22 -0
- package/test/resources/9999999/emailSendDefinition/retrieve-response.xml +85 -0
- package/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow/get-response.json +21 -0
- package/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow/post-response.json +0 -0
- package/test/resources/9999999/legacy/v1/beta/bulk/automations/automation/definition/get-response.json +30 -0
- package/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation-response.xml +30 -0
- package/test/resources/9999999/program/retrieve-CustomerKey=testNew_automation-response.xml +30 -0
- package/test/resources/9999999/program/retrieve-Name=testExisting_automation-response.xml +31 -0
- package/test/resources/9999999/program/retrieve-response.xml +32 -0
- package/test/resources/9999999/query/build-expected.json +2 -2
- package/test/resources/9999999/query/get-expected.json +2 -2
- package/test/resources/9999999/query/get2-expected.json +2 -2
- package/test/resources/9999999/query/patch-expected.json +2 -2
- package/test/resources/9999999/query/post-expected.json +2 -2
- package/test/resources/9999999/query/template-expected.json +2 -2
- package/test/type.automation.test.js +259 -0
- package/test/type.dataExtension.test.js +3 -0
- package/test/type.query.test.js +39 -26
- package/test/type.user.test.js +17 -3
- package/test/utils.js +7 -6
- package/.coverage-comment-template.md +0 -20
- /package/test/mockRoot/deploy/testInstance/testBU/query/{testExistingQuery.query-meta.sql → testExisting_query.query-meta.sql} +0 -0
- /package/test/mockRoot/deploy/testInstance/testBU/query/{testNewQuery.query-meta.sql → testNew_query.query-meta.sql} +0 -0
package/lib/util/util.js
CHANGED
|
@@ -85,7 +85,6 @@ const Util = {
|
|
|
85
85
|
*
|
|
86
86
|
* @param {string} mlName name of marketList
|
|
87
87
|
* @param {TYPE.Mcdevrc} properties General configuration to be used in retrieve
|
|
88
|
-
* @returns {void} throws errors if problems were found
|
|
89
88
|
*/
|
|
90
89
|
verifyMarketList(mlName, properties) {
|
|
91
90
|
if (properties.marketList[mlName]) {
|
|
@@ -227,6 +226,65 @@ const Util = {
|
|
|
227
226
|
|
|
228
227
|
return typeChoices;
|
|
229
228
|
},
|
|
229
|
+
/**
|
|
230
|
+
* wrapper around our standard winston logging to console and logfile
|
|
231
|
+
*
|
|
232
|
+
* @param {boolean} [noLogFile=false] optional flag to indicate if we should log to file; CLI logs are always on
|
|
233
|
+
* @returns {object} initiated logger for console and file
|
|
234
|
+
*/
|
|
235
|
+
_createNewLoggerTransport: function (noLogFile = false) {
|
|
236
|
+
// {
|
|
237
|
+
// error: 0,
|
|
238
|
+
// warn: 1,
|
|
239
|
+
// info: 2,
|
|
240
|
+
// http: 3,
|
|
241
|
+
// verbose: 4,
|
|
242
|
+
// debug: 5,
|
|
243
|
+
// silly: 6
|
|
244
|
+
// }
|
|
245
|
+
const logFileName = new Date().toISOString().split(':').join('.');
|
|
246
|
+
const transports = {
|
|
247
|
+
console: new winston.transports.Console({
|
|
248
|
+
// Write logs to Console
|
|
249
|
+
level: Util.OPTIONS.loggerLevel || 'info',
|
|
250
|
+
format: winston.format.combine(
|
|
251
|
+
winston.format.colorize(),
|
|
252
|
+
winston.format.timestamp({ format: 'HH:mm:ss' }),
|
|
253
|
+
winston.format.simple(),
|
|
254
|
+
winston.format.printf(
|
|
255
|
+
(info) => `${info.timestamp} ${info.level}: ${info.message}`
|
|
256
|
+
)
|
|
257
|
+
),
|
|
258
|
+
}),
|
|
259
|
+
};
|
|
260
|
+
if (!noLogFile) {
|
|
261
|
+
transports.file = new winston.transports.File({
|
|
262
|
+
// Write logs to logfile
|
|
263
|
+
filename: 'logs/' + logFileName + '.log',
|
|
264
|
+
level: 'debug', // log everything
|
|
265
|
+
format: winston.format.combine(
|
|
266
|
+
winston.format.timestamp({ format: 'HH:mm:ss.SSS' }),
|
|
267
|
+
winston.format.simple(),
|
|
268
|
+
winston.format.printf(
|
|
269
|
+
(info) => `${info.timestamp} ${info.level}: ${info.message}`
|
|
270
|
+
)
|
|
271
|
+
),
|
|
272
|
+
});
|
|
273
|
+
transports.fileError = new winston.transports.File({
|
|
274
|
+
// Write logs to additional error-logfile for better visibility of errors
|
|
275
|
+
filename: 'logs/' + logFileName + '-errors.log',
|
|
276
|
+
level: 'error', // only log errors
|
|
277
|
+
format: winston.format.combine(
|
|
278
|
+
winston.format.timestamp({ format: 'HH:mm:ss.SSS' }),
|
|
279
|
+
winston.format.simple(),
|
|
280
|
+
winston.format.printf(
|
|
281
|
+
(info) => `${info.timestamp} ${info.level}: ${info.message}`
|
|
282
|
+
)
|
|
283
|
+
),
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
return transports;
|
|
287
|
+
},
|
|
230
288
|
|
|
231
289
|
loggerTransports: null,
|
|
232
290
|
/**
|
|
@@ -235,7 +293,91 @@ const Util = {
|
|
|
235
293
|
* @type {TYPE.Logger}
|
|
236
294
|
*/
|
|
237
295
|
logger: null,
|
|
238
|
-
|
|
296
|
+
/**
|
|
297
|
+
* initiate winston logger
|
|
298
|
+
*
|
|
299
|
+
* @param {boolean} [restart=false] if true, logger will be restarted; otherwise, an existing logger will be used
|
|
300
|
+
* @param {boolean} [noLogFile=false] if false, logger will log to file; otherwise, only to console
|
|
301
|
+
* @returns {void}
|
|
302
|
+
*/
|
|
303
|
+
startLogger: function (restart = false, noLogFile = false) {
|
|
304
|
+
if (
|
|
305
|
+
!(
|
|
306
|
+
Util.loggerTransports === null ||
|
|
307
|
+
restart ||
|
|
308
|
+
(!Util.loggerTransports?.file && !noLogFile && !Util.OPTIONS?.noLogFile)
|
|
309
|
+
)
|
|
310
|
+
) {
|
|
311
|
+
// logger already started
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
Util.loggerTransports = this._createNewLoggerTransport(
|
|
315
|
+
noLogFile || Util.OPTIONS?.noLogFile
|
|
316
|
+
);
|
|
317
|
+
const myWinston = winston.createLogger({
|
|
318
|
+
level: Util.OPTIONS.loggerLevel,
|
|
319
|
+
levels: winston.config.npm.levels,
|
|
320
|
+
transports: Object.values(Util.loggerTransports),
|
|
321
|
+
});
|
|
322
|
+
const winstonError = myWinston.error;
|
|
323
|
+
const winstonExtension = {
|
|
324
|
+
/**
|
|
325
|
+
* helper that prints better stack trace for errors
|
|
326
|
+
*
|
|
327
|
+
* @param {Error} ex the error
|
|
328
|
+
* @param {string} [message] optional custom message to be printed as error together with the exception's message
|
|
329
|
+
* @returns {void}
|
|
330
|
+
*/
|
|
331
|
+
errorStack: function (ex, message) {
|
|
332
|
+
if (message) {
|
|
333
|
+
// ! this method only sets exitCode=1 if message-param was set
|
|
334
|
+
// if not, then this method purely outputs debug information and should not change the exitCode
|
|
335
|
+
winstonError(message + ':');
|
|
336
|
+
winstonError(` ${ex.message} (${ex.code})`);
|
|
337
|
+
if (ex.endpoint) {
|
|
338
|
+
// ex.endpoint is only available if 'ex' is of type RestError
|
|
339
|
+
winstonError(' endpoint: ' + ex.endpoint);
|
|
340
|
+
}
|
|
341
|
+
Util.signalFatalError();
|
|
342
|
+
}
|
|
343
|
+
let stack;
|
|
344
|
+
/* eslint-disable unicorn/prefer-ternary */
|
|
345
|
+
if (
|
|
346
|
+
[
|
|
347
|
+
'ETIMEDOUT',
|
|
348
|
+
'EHOSTUNREACH',
|
|
349
|
+
'ENOTFOUND',
|
|
350
|
+
'ECONNRESET',
|
|
351
|
+
'ECONNABORTED',
|
|
352
|
+
].includes(ex.code)
|
|
353
|
+
) {
|
|
354
|
+
// the stack would just return a one-liner that does not help
|
|
355
|
+
stack = new Error().stack; // eslint-disable-line unicorn/error-message
|
|
356
|
+
} else {
|
|
357
|
+
stack = ex.stack;
|
|
358
|
+
}
|
|
359
|
+
/* eslint-enable unicorn/prefer-ternary */
|
|
360
|
+
myWinston.debug(stack);
|
|
361
|
+
},
|
|
362
|
+
/**
|
|
363
|
+
* errors should cause surrounding applications to take notice
|
|
364
|
+
* hence we overwrite the default error function here
|
|
365
|
+
*
|
|
366
|
+
* @param {string} msg - the message to log
|
|
367
|
+
* @returns {void}
|
|
368
|
+
*/
|
|
369
|
+
error: function (msg) {
|
|
370
|
+
winstonError(msg);
|
|
371
|
+
Util.signalFatalError();
|
|
372
|
+
},
|
|
373
|
+
};
|
|
374
|
+
Util.logger = Object.assign(myWinston, winstonExtension);
|
|
375
|
+
|
|
376
|
+
const processArgv = process.argv.slice(2);
|
|
377
|
+
Util.logger.debug(
|
|
378
|
+
`:: mcdev ${packageJsonMcdev.version} :: ⚡ mcdev ${processArgv.join(' ')}`
|
|
379
|
+
);
|
|
380
|
+
},
|
|
239
381
|
/**
|
|
240
382
|
* Logger helper for Metadata functions
|
|
241
383
|
*
|
|
@@ -416,7 +558,7 @@ const Util = {
|
|
|
416
558
|
* @param {string} cmd to be executed command
|
|
417
559
|
* @param {string[]} [args] list of arguments
|
|
418
560
|
* @param {boolean} [hideOutput] if true, output of command will be hidden from CLI
|
|
419
|
-
* @returns {string} output of command if hideOutput is true
|
|
561
|
+
* @returns {string|void} output of command if hideOutput is true
|
|
420
562
|
*/
|
|
421
563
|
execSync(cmd, args, hideOutput) {
|
|
422
564
|
args ||= [];
|
|
@@ -471,34 +613,30 @@ const Util = {
|
|
|
471
613
|
* @returns {void}
|
|
472
614
|
*/
|
|
473
615
|
setLoggingLevel(argv) {
|
|
474
|
-
Util.loggerTransports.console.file = 'debug';
|
|
475
616
|
if (argv.silent) {
|
|
476
617
|
// only errors printed to CLI
|
|
477
|
-
Util.logger.level = 'error';
|
|
478
618
|
Util.OPTIONS.loggerLevel = 'error';
|
|
479
|
-
Util.loggerTransports.console.level = 'error';
|
|
480
619
|
Util.logger.debug('CLI logger set to: silent');
|
|
481
620
|
} else if (argv.verbose) {
|
|
482
621
|
// chatty user cli logs
|
|
483
|
-
Util.logger.level = 'verbose';
|
|
484
622
|
Util.OPTIONS.loggerLevel = 'verbose';
|
|
485
|
-
Util.loggerTransports.console.level = 'verbose';
|
|
486
623
|
Util.logger.debug('CLI logger set to: verbose');
|
|
487
624
|
} else {
|
|
488
625
|
// default user cli logs
|
|
489
|
-
// TODO to be switched to "warn" when cli-process is integrated
|
|
490
|
-
Util.logger.level = 'info';
|
|
491
626
|
Util.OPTIONS.loggerLevel = 'info';
|
|
492
|
-
Util.loggerTransports.console.level = 'info';
|
|
493
627
|
Util.logger.debug('CLI logger set to: info / default');
|
|
494
628
|
}
|
|
495
629
|
if (argv.debug) {
|
|
496
630
|
// enables developer output & features. no change to actual logs
|
|
497
|
-
Util.logger.level = 'debug';
|
|
498
631
|
Util.OPTIONS.loggerLevel = 'debug';
|
|
499
|
-
Util.loggerTransports.console.level = 'debug';
|
|
500
632
|
Util.logger.debug('CLI logger set to: debug');
|
|
501
633
|
}
|
|
634
|
+
if (Util.loggerTransports?.console) {
|
|
635
|
+
Util.loggerTransports.console.level = Util.OPTIONS.loggerLevel;
|
|
636
|
+
}
|
|
637
|
+
if (Util.logger) {
|
|
638
|
+
Util.logger.level = Util.OPTIONS.loggerLevel;
|
|
639
|
+
}
|
|
502
640
|
},
|
|
503
641
|
/**
|
|
504
642
|
* outputs a warning that the given type is still in beta
|
|
@@ -643,122 +781,7 @@ const Util = {
|
|
|
643
781
|
return null;
|
|
644
782
|
},
|
|
645
783
|
};
|
|
646
|
-
/**
|
|
647
|
-
* wrapper around our standard winston logging to console and logfile
|
|
648
|
-
*
|
|
649
|
-
* @returns {object} initiated logger for console and file
|
|
650
|
-
*/
|
|
651
|
-
function createNewLoggerTransport() {
|
|
652
|
-
// {
|
|
653
|
-
// error: 0,
|
|
654
|
-
// warn: 1,
|
|
655
|
-
// info: 2,
|
|
656
|
-
// http: 3,
|
|
657
|
-
// verbose: 4,
|
|
658
|
-
// debug: 5,
|
|
659
|
-
// silly: 6
|
|
660
|
-
// }
|
|
661
|
-
const logFileName = new Date().toISOString().split(':').join('.');
|
|
662
|
-
return {
|
|
663
|
-
console: new winston.transports.Console({
|
|
664
|
-
// Write logs to Console
|
|
665
|
-
level: 'info', // log error, warn, info
|
|
666
|
-
format: winston.format.combine(
|
|
667
|
-
winston.format.colorize(),
|
|
668
|
-
winston.format.timestamp({ format: 'HH:mm:ss' }),
|
|
669
|
-
winston.format.simple(),
|
|
670
|
-
winston.format.printf((info) => `${info.timestamp} ${info.level}: ${info.message}`)
|
|
671
|
-
),
|
|
672
|
-
}),
|
|
673
|
-
file: new winston.transports.File({
|
|
674
|
-
// Write logs to logfile
|
|
675
|
-
filename: 'logs/' + logFileName + '.log',
|
|
676
|
-
level: 'debug', // log everything
|
|
677
|
-
format: winston.format.combine(
|
|
678
|
-
winston.format.timestamp({ format: 'HH:mm:ss.SSS' }),
|
|
679
|
-
winston.format.simple(),
|
|
680
|
-
winston.format.printf((info) => `${info.timestamp} ${info.level}: ${info.message}`)
|
|
681
|
-
),
|
|
682
|
-
}),
|
|
683
|
-
fileError: new winston.transports.File({
|
|
684
|
-
// Write logs to additional error-logfile for better visibility of errors
|
|
685
|
-
filename: 'logs/' + logFileName + '-errors.log',
|
|
686
|
-
level: 'error', // only log errors
|
|
687
|
-
format: winston.format.combine(
|
|
688
|
-
winston.format.timestamp({ format: 'HH:mm:ss.SSS' }),
|
|
689
|
-
winston.format.simple(),
|
|
690
|
-
winston.format.printf((info) => `${info.timestamp} ${info.level}: ${info.message}`)
|
|
691
|
-
),
|
|
692
|
-
}),
|
|
693
|
-
};
|
|
694
|
-
}
|
|
695
|
-
/**
|
|
696
|
-
* initiate winston logger
|
|
697
|
-
*
|
|
698
|
-
* @returns {void}
|
|
699
|
-
*/
|
|
700
|
-
function startLogger() {
|
|
701
|
-
Util.loggerTransports = createNewLoggerTransport();
|
|
702
|
-
const myWinston = winston.createLogger({
|
|
703
|
-
levels: winston.config.npm.levels,
|
|
704
|
-
transports: [
|
|
705
|
-
Util.loggerTransports.console,
|
|
706
|
-
Util.loggerTransports.file,
|
|
707
|
-
Util.loggerTransports.fileError,
|
|
708
|
-
],
|
|
709
|
-
});
|
|
710
|
-
const winstonError = myWinston.error;
|
|
711
|
-
const winstonExtension = {
|
|
712
|
-
/**
|
|
713
|
-
* helper that prints better stack trace for errors
|
|
714
|
-
*
|
|
715
|
-
* @param {Error} ex the error
|
|
716
|
-
* @param {string} [message] optional custom message to be printed as error together with the exception's message
|
|
717
|
-
* @returns {void}
|
|
718
|
-
*/
|
|
719
|
-
errorStack: function (ex, message) {
|
|
720
|
-
if (message) {
|
|
721
|
-
// ! this method only sets exitCode=1 if message-param was set
|
|
722
|
-
// if not, then this method purely outputs debug information and should not change the exitCode
|
|
723
|
-
winstonError(message + ':');
|
|
724
|
-
winstonError(` ${ex.message} (${ex.code})`);
|
|
725
|
-
if (ex.endpoint) {
|
|
726
|
-
// ex.endpoint is only available if 'ex' is of type RestError
|
|
727
|
-
winstonError(' endpoint: ' + ex.endpoint);
|
|
728
|
-
}
|
|
729
|
-
Util.signalFatalError();
|
|
730
|
-
}
|
|
731
|
-
let stack;
|
|
732
|
-
/* eslint-disable unicorn/prefer-ternary */
|
|
733
|
-
if (
|
|
734
|
-
['ETIMEDOUT', 'EHOSTUNREACH', 'ENOTFOUND', 'ECONNRESET', 'ECONNABORTED'].includes(
|
|
735
|
-
ex.code
|
|
736
|
-
)
|
|
737
|
-
) {
|
|
738
|
-
// the stack would just return a one-liner that does not help
|
|
739
|
-
stack = new Error().stack; // eslint-disable-line unicorn/error-message
|
|
740
|
-
} else {
|
|
741
|
-
stack = ex.stack;
|
|
742
|
-
}
|
|
743
|
-
/* eslint-enable unicorn/prefer-ternary */
|
|
744
|
-
myWinston.debug(stack);
|
|
745
|
-
},
|
|
746
|
-
/**
|
|
747
|
-
* errors should cause surrounding applications to take notice
|
|
748
|
-
* hence we overwrite the default error function here
|
|
749
|
-
*
|
|
750
|
-
* @param {string} msg - the message to log
|
|
751
|
-
* @returns {void}
|
|
752
|
-
*/
|
|
753
|
-
error: function (msg) {
|
|
754
|
-
winstonError(msg);
|
|
755
|
-
Util.signalFatalError();
|
|
756
|
-
},
|
|
757
|
-
};
|
|
758
|
-
Util.logger = Object.assign(myWinston, winstonExtension);
|
|
759
784
|
|
|
760
|
-
|
|
761
|
-
}
|
|
762
|
-
startLogger();
|
|
785
|
+
Util.startLogger(false, true);
|
|
763
786
|
|
|
764
787
|
module.exports = Util;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcdev",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "Accenture Salesforce Marketing Cloud DevTools",
|
|
5
5
|
"author": "Accenture: joern.berkefeld, douglas.midgley, robert.zimmermann, maciej.barnas",
|
|
6
6
|
"license": "MIT",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"simple-git": "3.18.0",
|
|
77
77
|
"toposort": "2.0.2",
|
|
78
78
|
"update-notifier": "5.1.0",
|
|
79
|
-
"winston": "3.
|
|
79
|
+
"winston": "3.9.0",
|
|
80
80
|
"yargs": "17.7.2"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
@@ -84,14 +84,14 @@
|
|
|
84
84
|
"axios-mock-adapter": "1.21.3",
|
|
85
85
|
"chai": "4.3.7",
|
|
86
86
|
"chai-files": "1.4.0",
|
|
87
|
-
"eslint": "8.
|
|
87
|
+
"eslint": "8.42.0",
|
|
88
88
|
"eslint-config-prettier": "8.7.0",
|
|
89
89
|
"eslint-config-ssjs": "1.1.11",
|
|
90
|
-
"eslint-plugin-jsdoc": "
|
|
90
|
+
"eslint-plugin-jsdoc": "46.2.5",
|
|
91
91
|
"eslint-plugin-mocha": "10.1.0",
|
|
92
92
|
"eslint-plugin-prettier": "4.2.1",
|
|
93
93
|
"eslint-plugin-unicorn": "47.0.0",
|
|
94
|
-
"fast-xml-parser": "4.2.
|
|
94
|
+
"fast-xml-parser": "4.2.4",
|
|
95
95
|
"husky": "8.0.3",
|
|
96
96
|
"jsdoc-to-markdown": "8.0.0",
|
|
97
97
|
"lint-staged": "13.2.2",
|
package/test/general.test.js
CHANGED
|
@@ -14,6 +14,22 @@ describe('GENERAL', () => {
|
|
|
14
14
|
testUtils.mockReset();
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
+
describe('init ================', () => {
|
|
18
|
+
it('should init a local project without downloading BUs');
|
|
19
|
+
it('should init a local project and download all BUs');
|
|
20
|
+
});
|
|
21
|
+
describe('join ================', () => {
|
|
22
|
+
it('should clone a project from git');
|
|
23
|
+
});
|
|
24
|
+
describe('upgrade ================', () => {
|
|
25
|
+
it('should upgrade a project to the latest version');
|
|
26
|
+
});
|
|
27
|
+
describe('reloadBUs ================', () => {
|
|
28
|
+
it('should load all BUs from the server and refresh the config');
|
|
29
|
+
});
|
|
30
|
+
describe('selectTypes ================', () => {
|
|
31
|
+
it('should change which types are selected for default retrieval');
|
|
32
|
+
});
|
|
17
33
|
describe('explainTypes ================', () => {
|
|
18
34
|
it('without options', () => {
|
|
19
35
|
handler.explainTypes();
|
|
@@ -59,4 +75,14 @@ describe('GENERAL', () => {
|
|
|
59
75
|
return;
|
|
60
76
|
});
|
|
61
77
|
});
|
|
78
|
+
describe('createDeltaPkg ================', () => {
|
|
79
|
+
it('should show diff to master branch');
|
|
80
|
+
// mcdev createDeltaPkg master # resolves to master..HEAD
|
|
81
|
+
it('should show diff between master and develop branch');
|
|
82
|
+
// mcdev createDeltaPkg master..develop
|
|
83
|
+
it(
|
|
84
|
+
'should show diff between master and develop branch and filter the results to only show MyProject/BU1'
|
|
85
|
+
);
|
|
86
|
+
// mcdev createDeltaPkg master..develop --filter 'MyProject/BU1'
|
|
87
|
+
});
|
|
62
88
|
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "updated on deploy",
|
|
3
|
+
"key": "testExisting_automation",
|
|
4
|
+
"name": "testExisting_automation",
|
|
5
|
+
"r__folder_Path": "my automations",
|
|
6
|
+
"schedule": {
|
|
7
|
+
"endDate": "2022-07-30T00:00:00",
|
|
8
|
+
"icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1",
|
|
9
|
+
"startDate": "2022-07-30T00:00:00",
|
|
10
|
+
"timezoneName": "W. Europe Standard Time",
|
|
11
|
+
"typeId": 3
|
|
12
|
+
},
|
|
13
|
+
"status": "PausedSchedule",
|
|
14
|
+
"steps": [
|
|
15
|
+
{
|
|
16
|
+
"activities": [
|
|
17
|
+
{
|
|
18
|
+
"name": "testExisting_dataExtract",
|
|
19
|
+
"r__type": "dataExtract"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "testExisting_emailSend",
|
|
23
|
+
"r__type": "emailSend"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "testExisting_fileTransfer",
|
|
27
|
+
"r__type": "fileTransfer"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "testExisting_importFile",
|
|
31
|
+
"r__type": "importFile"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "testExisting_query",
|
|
35
|
+
"r__type": "query"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "testExisting_script",
|
|
39
|
+
"r__type": "script"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"name": ""
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"notifications": [
|
|
46
|
+
{
|
|
47
|
+
"email": ["error-updated@test.accenture.com"],
|
|
48
|
+
"message": "test updated",
|
|
49
|
+
"type": "Error"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"type": "scheduled"
|
|
53
|
+
}
|
package/test/mockRoot/deploy/testInstance/testBU/automation/testNew_automation.automation-meta.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "created on deploy",
|
|
3
|
+
"key": "testNew_automation",
|
|
4
|
+
"name": "testNew_automation",
|
|
5
|
+
"r__folder_Path": "my automations",
|
|
6
|
+
"schedule": {
|
|
7
|
+
"endDate": "2022-07-30T00:00:00",
|
|
8
|
+
"icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1",
|
|
9
|
+
"startDate": "2022-07-30T00:00:00",
|
|
10
|
+
"timezoneName": "W. Europe Standard Time",
|
|
11
|
+
"typeId": 3
|
|
12
|
+
},
|
|
13
|
+
"status": "PausedSchedule",
|
|
14
|
+
"steps": [
|
|
15
|
+
{
|
|
16
|
+
"activities": [
|
|
17
|
+
{
|
|
18
|
+
"name": "testExisting_dataExtract",
|
|
19
|
+
"r__type": "dataExtract"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "testExisting_emailSend",
|
|
23
|
+
"r__type": "emailSend"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "testExisting_fileTransfer",
|
|
27
|
+
"r__type": "fileTransfer"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "testExisting_importFile",
|
|
31
|
+
"r__type": "importFile"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "testExisting_query",
|
|
35
|
+
"r__type": "query"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "testExisting_script",
|
|
39
|
+
"r__type": "script"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"name": ""
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"type": "scheduled"
|
|
46
|
+
}
|