@provartesting/provardx-cli 0.0.7-beta → 1.1.1

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 (89) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +232 -14
  3. package/lib/commands/provar/automation/config/generate.d.ts +1 -1
  4. package/lib/commands/provar/automation/config/generate.js +1 -5
  5. package/lib/commands/provar/automation/config/generate.js.map +1 -1
  6. package/lib/commands/provar/automation/config/get.d.ts +1 -1
  7. package/lib/commands/provar/automation/config/get.js +1 -6
  8. package/lib/commands/provar/automation/config/get.js.map +1 -1
  9. package/lib/commands/provar/automation/config/load.d.ts +1 -1
  10. package/lib/commands/provar/automation/config/load.js +1 -6
  11. package/lib/commands/provar/automation/config/load.js.map +1 -1
  12. package/lib/commands/provar/automation/config/set.d.ts +1 -1
  13. package/lib/commands/provar/automation/config/set.js +1 -6
  14. package/lib/commands/provar/automation/config/set.js.map +1 -1
  15. package/lib/commands/provar/automation/config/validate.d.ts +1 -1
  16. package/lib/commands/provar/automation/config/validate.js +1 -4
  17. package/lib/commands/provar/automation/config/validate.js.map +1 -1
  18. package/oclif.manifest.json +1 -247
  19. package/package.json +8 -6
  20. package/lib/Utility/GenericError.d.ts +0 -11
  21. package/lib/Utility/GenericError.js +0 -26
  22. package/lib/Utility/GenericError.js.map +0 -1
  23. package/lib/Utility/TestRunError.d.ts +0 -8
  24. package/lib/Utility/TestRunError.js +0 -20
  25. package/lib/Utility/TestRunError.js.map +0 -1
  26. package/lib/Utility/errorCode.d.ts +0 -1
  27. package/lib/Utility/errorCode.js +0 -8
  28. package/lib/Utility/errorCode.js.map +0 -1
  29. package/lib/Utility/errorHandler.d.ts +0 -15
  30. package/lib/Utility/errorHandler.js +0 -22
  31. package/lib/Utility/errorHandler.js.map +0 -1
  32. package/lib/Utility/fileSupport.d.ts +0 -12
  33. package/lib/Utility/fileSupport.js +0 -63
  34. package/lib/Utility/fileSupport.js.map +0 -1
  35. package/lib/Utility/genericErrorHandler.d.ts +0 -10
  36. package/lib/Utility/genericErrorHandler.js +0 -22
  37. package/lib/Utility/genericErrorHandler.js.map +0 -1
  38. package/lib/Utility/jsonSupport.d.ts +0 -8
  39. package/lib/Utility/jsonSupport.js +0 -48
  40. package/lib/Utility/jsonSupport.js.map +0 -1
  41. package/lib/Utility/propertyFileValidator.d.ts +0 -13
  42. package/lib/Utility/propertyFileValidator.js +0 -85
  43. package/lib/Utility/propertyFileValidator.js.map +0 -1
  44. package/lib/Utility/provarConfig.d.ts +0 -12
  45. package/lib/Utility/provarConfig.js +0 -38
  46. package/lib/Utility/provarConfig.js.map +0 -1
  47. package/lib/Utility/provardxExecutor.d.ts +0 -7
  48. package/lib/Utility/provardxExecutor.js +0 -31
  49. package/lib/Utility/provardxExecutor.js.map +0 -1
  50. package/lib/Utility/sfProvarCommandResult.d.ts +0 -13
  51. package/lib/Utility/sfProvarCommandResult.js +0 -30
  52. package/lib/Utility/sfProvarCommandResult.js.map +0 -1
  53. package/lib/Utility/stringSupport.d.ts +0 -8
  54. package/lib/Utility/stringSupport.js +0 -37
  55. package/lib/Utility/stringSupport.js.map +0 -1
  56. package/lib/Utility/userSupport.d.ts +0 -16
  57. package/lib/Utility/userSupport.js +0 -66
  58. package/lib/Utility/userSupport.js.map +0 -1
  59. package/lib/commands/provar/automation/metadata/download.d.ts +0 -13
  60. package/lib/commands/provar/automation/metadata/download.js +0 -96
  61. package/lib/commands/provar/automation/metadata/download.js.map +0 -1
  62. package/lib/commands/provar/automation/project/compile.d.ts +0 -9
  63. package/lib/commands/provar/automation/project/compile.js +0 -69
  64. package/lib/commands/provar/automation/project/compile.js.map +0 -1
  65. package/lib/commands/provar/automation/setup.d.ts +0 -12
  66. package/lib/commands/provar/automation/setup.js +0 -65
  67. package/lib/commands/provar/automation/setup.js.map +0 -1
  68. package/lib/commands/provar/automation/test/run.d.ts +0 -13
  69. package/lib/commands/provar/automation/test/run.js +0 -156
  70. package/lib/commands/provar/automation/test/run.js.map +0 -1
  71. package/lib/constants/commandConstants.d.ts +0 -11
  72. package/lib/constants/commandConstants.js +0 -13
  73. package/lib/constants/commandConstants.js.map +0 -1
  74. package/lib/constants/errorMessages.d.ts +0 -15
  75. package/lib/constants/errorMessages.js +0 -23
  76. package/lib/constants/errorMessages.js.map +0 -1
  77. package/lib/constants/propertyFileContent.d.ts +0 -24
  78. package/lib/constants/propertyFileContent.js +0 -25
  79. package/lib/constants/propertyFileContent.js.map +0 -1
  80. package/lib/constants/propertyFileSchema.d.ts +0 -254
  81. package/lib/constants/propertyFileSchema.js +0 -248
  82. package/lib/constants/propertyFileSchema.js.map +0 -1
  83. package/lib/constants/sfCommandConstants.d.ts +0 -5
  84. package/lib/constants/sfCommandConstants.js +0 -7
  85. package/lib/constants/sfCommandConstants.js.map +0 -1
  86. package/messages/provar.automation.project.compile.md +0 -21
  87. package/messages/provar.automation.setup.md +0 -23
  88. package/messages/provar.automation.test.run.md +0 -19
  89. package/messages/provar.metadata.download.md +0 -23
@@ -1,56 +1,5 @@
1
1
  {
2
2
  "commands": {
3
- "provar:automation:setup": {
4
- "aliases": [],
5
- "args": {},
6
- "description": "Download and Install Provar Automation.",
7
- "examples": [
8
- "<%= config.bin %> <%= command.id %>"
9
- ],
10
- "flags": {
11
- "json": {
12
- "description": "Format output as json.",
13
- "helpGroup": "GLOBAL",
14
- "name": "json",
15
- "allowNo": false,
16
- "type": "boolean"
17
- },
18
- "version": {
19
- "char": "v",
20
- "name": "version",
21
- "summary": "Provar Automation build version number.",
22
- "hasDynamicHelp": false,
23
- "multiple": false,
24
- "type": "option"
25
- }
26
- },
27
- "hasDynamicHelp": false,
28
- "hiddenAliases": [],
29
- "id": "provar:automation:setup",
30
- "pluginAlias": "@provartesting/provardx-cli",
31
- "pluginName": "@provartesting/provardx-cli",
32
- "pluginType": "core",
33
- "strict": true,
34
- "summary": "Download and Install Provar Automation.",
35
- "enableJsonFlag": true,
36
- "isESM": true,
37
- "relativePath": [
38
- "lib",
39
- "commands",
40
- "provar",
41
- "automation",
42
- "setup.js"
43
- ],
44
- "aliasPermutations": [],
45
- "permutations": [
46
- "provar:automation:setup",
47
- "automation:provar:setup",
48
- "automation:setup:provar",
49
- "provar:setup:automation",
50
- "setup:provar:automation",
51
- "setup:automation:provar"
52
- ]
53
- },
54
3
  "provar:automation:config:generate": {
55
4
  "aliases": [],
56
5
  "args": {},
@@ -385,202 +334,7 @@
385
334
  "validate:config:provar:automation",
386
335
  "validate:config:automation:provar"
387
336
  ]
388
- },
389
- "provar:automation:metadata:download": {
390
- "aliases": [],
391
- "args": {},
392
- "description": "Download any required metadata for a specified Provar Salesforce connection.",
393
- "examples": [
394
- "<%= config.bin %> <%= command.id %>"
395
- ],
396
- "flags": {
397
- "json": {
398
- "description": "Format output as json.",
399
- "helpGroup": "GLOBAL",
400
- "name": "json",
401
- "allowNo": false,
402
- "type": "boolean"
403
- },
404
- "connections": {
405
- "char": "c",
406
- "name": "connections",
407
- "required": true,
408
- "summary": "Comma-separated list of names of Provar Salesforce connections to use, as defined in the project.",
409
- "hasDynamicHelp": false,
410
- "multiple": false,
411
- "type": "option"
412
- }
413
- },
414
- "hasDynamicHelp": false,
415
- "hiddenAliases": [],
416
- "id": "provar:automation:metadata:download",
417
- "pluginAlias": "@provartesting/provardx-cli",
418
- "pluginName": "@provartesting/provardx-cli",
419
- "pluginType": "core",
420
- "strict": true,
421
- "summary": "Download any required metadata for a specified Provar Salesforce connection.",
422
- "enableJsonFlag": true,
423
- "isESM": true,
424
- "relativePath": [
425
- "lib",
426
- "commands",
427
- "provar",
428
- "automation",
429
- "metadata",
430
- "download.js"
431
- ],
432
- "aliasPermutations": [],
433
- "permutations": [
434
- "provar:automation:metadata:download",
435
- "automation:provar:metadata:download",
436
- "automation:metadata:provar:download",
437
- "automation:metadata:download:provar",
438
- "provar:metadata:automation:download",
439
- "metadata:provar:automation:download",
440
- "metadata:automation:provar:download",
441
- "metadata:automation:download:provar",
442
- "provar:metadata:download:automation",
443
- "metadata:provar:download:automation",
444
- "metadata:download:provar:automation",
445
- "metadata:download:automation:provar",
446
- "provar:automation:download:metadata",
447
- "automation:provar:download:metadata",
448
- "automation:download:provar:metadata",
449
- "automation:download:metadata:provar",
450
- "provar:download:automation:metadata",
451
- "download:provar:automation:metadata",
452
- "download:automation:provar:metadata",
453
- "download:automation:metadata:provar",
454
- "provar:download:metadata:automation",
455
- "download:provar:metadata:automation",
456
- "download:metadata:provar:automation",
457
- "download:metadata:automation:provar"
458
- ]
459
- },
460
- "provar:automation:project:compile": {
461
- "aliases": [],
462
- "args": {},
463
- "description": "Compile PageObject and PageControl Java source files into object code.",
464
- "examples": [
465
- "Compile the project using the configuration set in the properties file.\n\n- <%= config.bin %> <%= command.id %>"
466
- ],
467
- "flags": {
468
- "json": {
469
- "description": "Format output as json.",
470
- "helpGroup": "GLOBAL",
471
- "name": "json",
472
- "allowNo": false,
473
- "type": "boolean"
474
- }
475
- },
476
- "hasDynamicHelp": false,
477
- "hiddenAliases": [],
478
- "id": "provar:automation:project:compile",
479
- "pluginAlias": "@provartesting/provardx-cli",
480
- "pluginName": "@provartesting/provardx-cli",
481
- "pluginType": "core",
482
- "strict": true,
483
- "summary": "Compile PageObject and PageControl Java source files into object code.",
484
- "enableJsonFlag": true,
485
- "isESM": true,
486
- "relativePath": [
487
- "lib",
488
- "commands",
489
- "provar",
490
- "automation",
491
- "project",
492
- "compile.js"
493
- ],
494
- "aliasPermutations": [],
495
- "permutations": [
496
- "provar:automation:project:compile",
497
- "automation:provar:project:compile",
498
- "automation:project:provar:compile",
499
- "automation:project:compile:provar",
500
- "provar:project:automation:compile",
501
- "project:provar:automation:compile",
502
- "project:automation:provar:compile",
503
- "project:automation:compile:provar",
504
- "provar:project:compile:automation",
505
- "project:provar:compile:automation",
506
- "project:compile:provar:automation",
507
- "project:compile:automation:provar",
508
- "provar:automation:compile:project",
509
- "automation:provar:compile:project",
510
- "automation:compile:provar:project",
511
- "automation:compile:project:provar",
512
- "provar:compile:automation:project",
513
- "compile:provar:automation:project",
514
- "compile:automation:provar:project",
515
- "compile:automation:project:provar",
516
- "provar:compile:project:automation",
517
- "compile:provar:project:automation",
518
- "compile:project:provar:automation",
519
- "compile:project:automation:provar"
520
- ]
521
- },
522
- "provar:automation:test:run": {
523
- "aliases": [],
524
- "args": {},
525
- "description": "Run the tests as specified in the loaded properties file.",
526
- "examples": [
527
- "<%= config.bin %> <%= command.id %>"
528
- ],
529
- "flags": {
530
- "json": {
531
- "description": "Format output as json.",
532
- "helpGroup": "GLOBAL",
533
- "name": "json",
534
- "allowNo": false,
535
- "type": "boolean"
536
- }
537
- },
538
- "hasDynamicHelp": false,
539
- "hiddenAliases": [],
540
- "id": "provar:automation:test:run",
541
- "pluginAlias": "@provartesting/provardx-cli",
542
- "pluginName": "@provartesting/provardx-cli",
543
- "pluginType": "core",
544
- "strict": true,
545
- "summary": "Run the tests as specified in the loaded properties file.",
546
- "enableJsonFlag": true,
547
- "isESM": true,
548
- "relativePath": [
549
- "lib",
550
- "commands",
551
- "provar",
552
- "automation",
553
- "test",
554
- "run.js"
555
- ],
556
- "aliasPermutations": [],
557
- "permutations": [
558
- "provar:automation:test:run",
559
- "automation:provar:test:run",
560
- "automation:test:provar:run",
561
- "automation:test:run:provar",
562
- "provar:test:automation:run",
563
- "test:provar:automation:run",
564
- "test:automation:provar:run",
565
- "test:automation:run:provar",
566
- "provar:test:run:automation",
567
- "test:provar:run:automation",
568
- "test:run:provar:automation",
569
- "test:run:automation:provar",
570
- "provar:automation:run:test",
571
- "automation:provar:run:test",
572
- "automation:run:provar:test",
573
- "automation:run:test:provar",
574
- "provar:run:automation:test",
575
- "run:provar:automation:test",
576
- "run:automation:provar:test",
577
- "run:automation:test:provar",
578
- "provar:run:test:automation",
579
- "run:provar:test:automation",
580
- "run:test:provar:automation",
581
- "run:test:automation:provar"
582
- ]
583
337
  }
584
338
  },
585
- "version": "0.0.7-beta"
339
+ "version": "1.1.1"
586
340
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@provartesting/provardx-cli",
3
3
  "description": "A plugin for the Salesforce CLI to orchestrate testing activities and report quality metrics to Provar Manager",
4
- "version": "0.0.7-beta",
4
+ "version": "1.1.1",
5
5
  "license": "BSD-3-Clause",
6
6
  "dependencies": {
7
- "@oclif/core": "^3.18.1",
7
+ "@oclif/core": "^3.26.2",
8
8
  "@salesforce/core": "^6.5.1",
9
9
  "@salesforce/kit": "^3.0.15",
10
10
  "@salesforce/sf-plugins-core": "^7.1.4",
@@ -13,9 +13,10 @@
13
13
  "cli-ux": "^6.0.9",
14
14
  "fast-xml-parser": "^4.3.6",
15
15
  "jsonschema": "^1.4.1",
16
- "xml-js": "^1.6.11",
17
16
  "node-stream-zip": "^1.15.0",
18
- "sync-request": "^6.1.0"
17
+ "@provartesting/provardx-plugins-utils": "0.0.2-beta",
18
+ "sync-request": "^6.1.0",
19
+ "xml-js": "^1.6.11"
19
20
  },
20
21
  "devDependencies": {
21
22
  "@oclif/plugin-command-snapshot": "^5.0.2",
@@ -92,10 +93,11 @@
92
93
  "docs": "sf-docs",
93
94
  "format": "wireit",
94
95
  "lint": "wireit",
96
+ "postinstall": "node ./scripts/postInstall.js",
95
97
  "postpack": "shx rm -f oclif.manifest.json",
96
98
  "prepack": "sf-prepack",
97
99
  "test": "wireit",
98
- "test:nuts": "nyc mocha \"**/*setup.nut.ts\" \"**/*generate.nut.ts\" \"**/*permission.nut.ts\" \"**/*load.nut.ts\" \"**/*validate.nut.ts\" \"**/*get.nut.ts\" \"**/*set.nut.ts\" \"**/*download.nut.ts\" \"**/*compile.nut.ts\" \"**/*run.nut.ts\" --slow 4500 --timeout 600000 --reporter mochawesome",
100
+ "test:nuts": "nyc mocha \"**/*setup.nut.ts\" \"**/*generate.nut.ts\" \"**/*permission.nut.ts\" \"**/*load.nut.ts\" \"**/*validate.nut.ts\" \"**/*get.nut.ts\" --slow 4500 --timeout 600000 --reporter mochawesome",
99
101
  "test:only": "wireit",
100
102
  "version": "oclif readme"
101
103
  },
@@ -206,4 +208,4 @@
206
208
  },
207
209
  "exports": "./lib/index.js",
208
210
  "type": "module"
209
- }
211
+ }
@@ -1,11 +0,0 @@
1
- import { ErrorCode } from './errorCode.js';
2
- export declare class GenericError {
3
- private message;
4
- private code;
5
- getCode(): ErrorCode;
6
- setCode(value: ErrorCode): void;
7
- getMessage(): string;
8
- setMessage(value: string): void;
9
- toString(): string;
10
- constructError(): object;
11
- }
@@ -1,26 +0,0 @@
1
- export class GenericError {
2
- message = 'message';
3
- code = 'GENERIC_ERROR';
4
- getCode() {
5
- return this.code;
6
- }
7
- setCode(value) {
8
- this.code = value;
9
- }
10
- getMessage() {
11
- return this.message;
12
- }
13
- setMessage(value) {
14
- this.message = value;
15
- }
16
- toString() {
17
- return `[${this.code}] ${this.message}`;
18
- }
19
- constructError() {
20
- return {
21
- code: this.getCode(),
22
- message: this.getMessage(),
23
- };
24
- }
25
- }
26
- //# sourceMappingURL=GenericError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GenericError.js","sourceRoot":"","sources":["../../src/Utility/GenericError.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,YAAY;IACf,OAAO,GAAW,SAAS,CAAC;IAC5B,IAAI,GAAc,eAAe,CAAC;IAEnC,OAAO;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IACM,OAAO,CAAC,KAAgB;QAC7B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IACpB,CAAC;IAEM,UAAU;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACM,UAAU,CAAC,KAAa;QAC7B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACvB,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;IAC1C,CAAC;IAEM,cAAc;QACnB,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE;YACpB,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE;SAC3B,CAAC;IACJ,CAAC;CACF"}
@@ -1,8 +0,0 @@
1
- import { GenericError } from './GenericError.js';
2
- export declare class TestRunError extends GenericError {
3
- private testCasePath;
4
- getTestCasePath(): string;
5
- setTestCasePath(value: string): void;
6
- toString(): string;
7
- constructError(): object;
8
- }
@@ -1,20 +0,0 @@
1
- import { GenericError } from './GenericError.js';
2
- export class TestRunError extends GenericError {
3
- testCasePath = 'testCasePath';
4
- getTestCasePath() {
5
- return this.testCasePath;
6
- }
7
- setTestCasePath(value) {
8
- this.testCasePath = value;
9
- }
10
- toString() {
11
- return `[${this.testCasePath}] ${this.getMessage()}`;
12
- }
13
- constructError() {
14
- return {
15
- testCasePath: this.getTestCasePath(),
16
- message: this.getMessage(),
17
- };
18
- }
19
- }
20
- //# sourceMappingURL=TestRunError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TestRunError.js","sourceRoot":"","sources":["../../src/Utility/TestRunError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,OAAO,YAAa,SAAQ,YAAY;IACpC,YAAY,GAAW,cAAc,CAAC;IAEvC,eAAe;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IACM,eAAe,CAAC,KAAa;QAClC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;IAC5B,CAAC;IACM,QAAQ;QACb,OAAO,IAAI,IAAI,CAAC,YAAY,KAAK,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC;IACvD,CAAC;IACM,cAAc;QACnB,OAAO;YACL,YAAY,EAAE,IAAI,CAAC,eAAe,EAAE;YACpC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE;SAC3B,CAAC;IACJ,CAAC;CACF"}
@@ -1 +0,0 @@
1
- export type ErrorCode = 'MISSING_FILE' | 'MALFORMED_FILE' | 'MISSING_PROPERTY' | 'MISSING_PROPERTIES' | 'INVALID_VALUES' | 'INVALID_VALUE' | 'MISSING_VALUE' | 'INVALID_FILE_EXTENSION' | 'GENERATE_OPERATION_DENIED' | 'INVALID_PATH' | 'INSUFFICIENT_PERMISSIONS' | 'INVALID_ARGUMENT' | 'INVALID_PROPERTY' | 'UNKNOWN_PROPERTY' | 'DOWNLOAD_ERROR' | 'GENERIC_ERROR' | 'TEST_CASE_NAME' | 'COMPILATION_ERROR' | 'SETUP_ERROR' | 'TEST_RUN_ERROR';
@@ -1,8 +0,0 @@
1
- /*
2
- * Copyright (c) 2024 Provar Limited.
3
- * All rights reserved.
4
- * Licensed under the BSD 3-Clause license.
5
- * For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
- */
7
- export {};
8
- //# sourceMappingURL=errorCode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errorCode.js","sourceRoot":"","sources":["../../src/Utility/errorCode.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -1,15 +0,0 @@
1
- import { ErrorCode } from './errorCode.js';
2
- /**
3
- * ErrorHandler to manage multiple errors thrown while execution of commands.
4
- *
5
- */
6
- export type Error = {
7
- code: ErrorCode;
8
- message: string;
9
- };
10
- export default class ErrorHandler {
11
- private errors;
12
- addErrorsToList(eCode: ErrorCode, eMessage: string): void;
13
- getErrors(): Error[];
14
- errorsToStringArray(): string[];
15
- }
@@ -1,22 +0,0 @@
1
- /*
2
- * Copyright (c) 2024 Provar Limited.
3
- * All rights reserved.
4
- * Licensed under the BSD 3-Clause license.
5
- * For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
- */
7
- export default class ErrorHandler {
8
- errors = [];
9
- addErrorsToList(eCode, eMessage) {
10
- this.errors.push({
11
- code: eCode,
12
- message: eMessage,
13
- });
14
- }
15
- getErrors() {
16
- return this.errors;
17
- }
18
- errorsToStringArray() {
19
- return this.errors.map((e) => `[${e.code}] ${e.message}`);
20
- }
21
- }
22
- //# sourceMappingURL=errorHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errorHandler.js","sourceRoot":"","sources":["../../src/Utility/errorHandler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAcH,MAAM,CAAC,OAAO,OAAO,YAAY;IACvB,MAAM,GAAY,EAAE,CAAC;IAEtB,eAAe,CAAC,KAAgB,EAAE,QAAgB;QACvD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YACf,IAAI,EAAE,KAAK;YACX,OAAO,EAAE,QAAQ;SAClB,CAAC,CAAC;IACL,CAAC;IAEM,SAAS;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAEM,mBAAmB;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5D,CAAC;CACF"}
@@ -1,12 +0,0 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- import * as fs from 'node:fs';
3
- /**
4
- * Contains all the methods that deals with generic file related operations.
5
- *
6
- */
7
- export declare function generateFile(filePath: string): void;
8
- export declare function getExtension(filename: string): string;
9
- export declare function unzipFile(srcDirectory: string, targetDirectory: string, onComplete: () => void): void;
10
- export declare function unlinkFileIfExist(filePath: string): void;
11
- export declare function fileContainsString(fileContent: string, searchString: string): boolean;
12
- export declare function unzipFileSynchronously(filestream: fs.WriteStream, filePath: string): Promise<void>;
@@ -1,63 +0,0 @@
1
- /*
2
- * Copyright (c) 2024 Provar Limited.
3
- * All rights reserved.
4
- * Licensed under the BSD 3-Clause license.
5
- * For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
- */
7
- /* eslint-disable */
8
- import * as fs from 'node:fs';
9
- import StreamZip from 'node-stream-zip';
10
- import { propertyFileContent } from '../constants/propertyFileContent.js';
11
- /**
12
- * Contains all the methods that deals with generic file related operations.
13
- *
14
- */
15
- export function generateFile(filePath) {
16
- fs.writeFileSync(filePath, JSON.stringify(propertyFileContent, null, 3));
17
- }
18
- export function getExtension(filename) {
19
- const i = filename.lastIndexOf('.');
20
- return i < 0 ? '' : filename.substr(i);
21
- }
22
- export function unzipFile(srcDirectory, targetDirectory, onComplete) {
23
- const zip = new StreamZip({
24
- file: srcDirectory,
25
- storeEntries: true,
26
- });
27
- zip.on('ready', () => {
28
- zip.extract(null, targetDirectory, () => {
29
- zip.close();
30
- onComplete();
31
- });
32
- });
33
- }
34
- export function unlinkFileIfExist(filePath) {
35
- if (fs.existsSync(filePath)) {
36
- fs.unlinkSync(filePath);
37
- }
38
- }
39
- export function fileContainsString(fileContent, searchString) {
40
- return fileContent.includes(searchString);
41
- }
42
- export async function unzipFileSynchronously(filestream, filePath) {
43
- const resolvers = {
44
- done: null,
45
- error: null,
46
- };
47
- const promise = new Promise((resolve, error) => {
48
- resolvers.done = resolve;
49
- resolvers.error = error;
50
- });
51
- filestream.on('finish', () => {
52
- unzipFile(`${filePath}.zip`, `${filePath}`, () => {
53
- resolvers.done();
54
- });
55
- });
56
- filestream.on('error', (error) => {
57
- unzipFile(`${filePath}.zip`, `${filePath}`, () => {
58
- resolvers.error(error);
59
- });
60
- });
61
- return promise;
62
- }
63
- //# sourceMappingURL=fileSupport.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fileSupport.js","sourceRoot":"","sources":["../../src/Utility/fileSupport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,oBAAoB;AAEpB,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E;;;GAGG;AAEH,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,MAAM,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,YAAoB,EAAE,eAAuB,EAAE,UAAsB;IAC7F,MAAM,GAAG,GAAG,IAAI,SAAS,CAAC;QACxB,IAAI,EAAE,YAAY;QAClB,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;IACH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;QACnB,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE;YACtC,GAAG,CAAC,KAAK,EAAE,CAAC;YACZ,UAAU,EAAE,CAAC;QACf,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,QAAgB;IAChD,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5B,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC1B,CAAC;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,WAAmB,EAAE,YAAoB;IAC1E,OAAO,WAAW,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,UAA0B,EAAE,QAAgB;IACvF,MAAM,SAAS,GAAQ;QACrB,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,IAAI;KACZ,CAAC;IACF,MAAM,OAAO,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;QACnD,SAAS,CAAC,IAAI,GAAG,OAAO,CAAC;QACzB,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC;IAC1B,CAAC,CAAC,CAAC;IACH,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;QAC3B,SAAS,CAAC,GAAG,QAAQ,MAAM,EAAE,GAAG,QAAQ,EAAE,EAAE,GAAG,EAAE;YAC/C,SAAS,CAAC,IAAI,EAAE,CAAC;QACnB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;QAC/B,SAAS,CAAC,GAAG,QAAQ,MAAM,EAAE,GAAG,QAAQ,EAAE,EAAE,GAAG,EAAE;YAC/C,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1,10 +0,0 @@
1
- import { GenericError } from './GenericError.js';
2
- /**
3
- * ErrorHandler class to manage multiple errors thrown during command execution.
4
- */
5
- export default class GenericErrorHandler {
6
- private errors;
7
- addErrorsToList(errorObject: GenericError): void;
8
- errorsToStringArray(): string[];
9
- getErrors(): object[];
10
- }
@@ -1,22 +0,0 @@
1
- /*
2
- * Copyright (c) 2024 Provar Limited.
3
- * All rights reserved.
4
- * Licensed under the BSD 3-Clause license.
5
- * For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
- */
7
- /**
8
- * ErrorHandler class to manage multiple errors thrown during command execution.
9
- */
10
- export default class GenericErrorHandler {
11
- errors = [];
12
- addErrorsToList(errorObject) {
13
- this.errors.push(errorObject);
14
- }
15
- errorsToStringArray() {
16
- return this.errors.map((e) => `${e.toString()}\n`);
17
- }
18
- getErrors() {
19
- return this.errors.map((e) => e.constructError());
20
- }
21
- }
22
- //# sourceMappingURL=genericErrorHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"genericErrorHandler.js","sourceRoot":"","sources":["../../src/Utility/genericErrorHandler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,mBAAmB;IAC9B,MAAM,GAAmB,EAAE,CAAC;IAE7B,eAAe,CAAC,WAAyB;QAC9C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAChC,CAAC;IACM,mBAAmB;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACrD,CAAC;IAEM,SAAS;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC;IACpD,CAAC;CACF"}
@@ -1,8 +0,0 @@
1
- /**
2
- * Custom logics from JSON manipulation.
3
- *
4
- */
5
- export declare function getNestedProperty(jsonData: any, property: string): any;
6
- export declare function checkNestedProperty(jsonData: any, property: string): boolean;
7
- export declare function setNestedProperty(jsonData: any, property: string, value: string | undefined): void;
8
- export declare function parseJSONString(jsonInput: string): any;
@@ -1,48 +0,0 @@
1
- /*
2
- * Copyright (c) 2024 Provar Limited.
3
- * All rights reserved.
4
- * Licensed under the BSD 3-Clause license.
5
- * For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
- */
7
- /**
8
- * Custom logics from JSON manipulation.
9
- *
10
- */
11
- /* eslint-disable */
12
- export function getNestedProperty(jsonData, property) {
13
- const propertyPath = property.split('.');
14
- for (let i = 0; i < propertyPath.length; i++) {
15
- jsonData = jsonData[propertyPath[i]];
16
- }
17
- return jsonData;
18
- }
19
- export function checkNestedProperty(jsonData, property) {
20
- const propertyPath = property.split('.');
21
- for (const nestedProperty of propertyPath) {
22
- if (!jsonData?.hasOwnProperty(nestedProperty)) {
23
- return false;
24
- }
25
- jsonData = jsonData[nestedProperty];
26
- }
27
- return true;
28
- }
29
- export function setNestedProperty(jsonData, property, value) {
30
- const propertyPath = property.split('.');
31
- const propertyPathLength = propertyPath.length;
32
- for (var i = 0; i < propertyPathLength - 1; i++) {
33
- var nestedProperty = propertyPath[i];
34
- if (!jsonData[nestedProperty])
35
- jsonData[nestedProperty] = {};
36
- jsonData = jsonData[nestedProperty];
37
- }
38
- jsonData[propertyPath[propertyPathLength - 1]] = value;
39
- }
40
- export function parseJSONString(jsonInput) {
41
- try {
42
- return JSON.parse(jsonInput);
43
- }
44
- catch (err) {
45
- return jsonInput;
46
- }
47
- }
48
- //# sourceMappingURL=jsonSupport.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsonSupport.js","sourceRoot":"","sources":["../../src/Utility/jsonSupport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AAEH,oBAAoB;AACpB,MAAM,UAAU,iBAAiB,CAAC,QAAa,EAAE,QAAgB;IAC/D,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7C,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,QAAa,EAAE,QAAgB;IACjE,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzC,KAAK,MAAM,cAAc,IAAI,YAAY,EAAE,CAAC;QAC1C,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,EAAE,CAAC;YAC9C,OAAO,KAAK,CAAC;QACf,CAAC;QACD,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,QAAa,EAAE,QAAgB,EAAE,KAAyB;IAC1F,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzC,MAAM,kBAAkB,GAAG,YAAY,CAAC,MAAM,CAAC;IAC/C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,kBAAkB,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAChD,IAAI,cAAc,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QACrC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC;YAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC;QAC7D,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IACtC,CAAC;IACD,QAAQ,CAAC,YAAY,CAAC,kBAAkB,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,SAAiB;IAC/C,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
@@ -1,13 +0,0 @@
1
- import { ValidatorResult } from 'jsonschema';
2
- import ErrorHandler, { Error } from './errorHandler.js';
3
- /**
4
- * Contains code to load the config file and validation login for provardx-properties.json
5
- *
6
- */
7
- export default class PropertyFileValidator {
8
- validationResults: ValidatorResult;
9
- private errorHandler;
10
- constructor(errorHandler: ErrorHandler);
11
- validate(): Promise<boolean>;
12
- getValidationErrors(): Error[];
13
- }