qcobjects-cli 2.5.103-beta → 2.5.104-beta

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 (80) hide show
  1. package/VERSION +1 -1
  2. package/build-esbuild.js +4 -3
  3. package/package.json +55 -21
  4. package/public/browser/com.qcobjects.cli.commands.jira.client_services.js +66 -55
  5. package/public/browser/com.qcobjects.cli.commands.jira.client_services.js.map +2 -2
  6. package/public/browser/com.qcobjects.cli.commands.jira.js +138 -93
  7. package/public/browser/com.qcobjects.cli.commands.jira.js.map +4 -4
  8. package/public/browser/com.qcobjects.cli.commands.js +371 -14
  9. package/public/browser/com.qcobjects.cli.commands.js.map +4 -4
  10. package/public/browser/com.qcobjects.cli.commands.version.js +220 -214
  11. package/public/browser/com.qcobjects.cli.commands.version.js.map +2 -2
  12. package/public/browser/index.js +4042 -13
  13. package/public/browser/index.js.map +4 -4
  14. package/public/browser/org.qcobjects.common.pipelog.js +37 -24
  15. package/public/browser/org.qcobjects.common.pipelog.js.map +2 -2
  16. package/public/browser/org.qcobjects.enterprise.commands.js +108 -117
  17. package/public/browser/org.qcobjects.enterprise.commands.js.map +3 -3
  18. package/public/browser/org.quickcorp.qcobjects.api.client_services.js +64 -55
  19. package/public/browser/org.quickcorp.qcobjects.api.client_services.js.map +2 -2
  20. package/public/browser/org.quickcorp.qcobjects.cli.js +1280 -379
  21. package/public/browser/org.quickcorp.qcobjects.cli.js.map +4 -4
  22. package/public/browser/org.quickcorp.qcobjects.defaultsettings.js +373 -359
  23. package/public/browser/org.quickcorp.qcobjects.defaultsettings.js.map +2 -2
  24. package/public/browser/qcobjects-cli.js +4042 -13
  25. package/public/browser/qcobjects-cli.js.map +4 -4
  26. package/public/cjs/com.qcobjects.cli.commands.cjs +377 -6
  27. package/public/cjs/com.qcobjects.cli.commands.cjs.map +4 -4
  28. package/public/cjs/com.qcobjects.cli.commands.jira.cjs +82 -24
  29. package/public/cjs/com.qcobjects.cli.commands.jira.cjs.map +4 -4
  30. package/public/cjs/com.qcobjects.cli.commands.jira.client_services.cjs +25 -1
  31. package/public/cjs/com.qcobjects.cli.commands.jira.client_services.cjs.map +2 -2
  32. package/public/cjs/com.qcobjects.cli.commands.version.cjs +25 -6
  33. package/public/cjs/com.qcobjects.cli.commands.version.cjs.map +2 -2
  34. package/public/cjs/index.cjs +4042 -13
  35. package/public/cjs/index.cjs.map +4 -4
  36. package/public/cjs/org.qcobjects.common.pipelog.cjs +40 -14
  37. package/public/cjs/org.qcobjects.common.pipelog.cjs.map +2 -2
  38. package/public/cjs/org.qcobjects.enterprise.commands.cjs +38 -34
  39. package/public/cjs/org.qcobjects.enterprise.commands.cjs.map +3 -3
  40. package/public/cjs/org.quickcorp.qcobjects.api.client_services.cjs +24 -2
  41. package/public/cjs/org.quickcorp.qcobjects.api.client_services.cjs.map +2 -2
  42. package/public/cjs/org.quickcorp.qcobjects.cli.cjs +1032 -118
  43. package/public/cjs/org.quickcorp.qcobjects.cli.cjs.map +4 -4
  44. package/public/cjs/org.quickcorp.qcobjects.defaultsettings.cjs +362 -334
  45. package/public/cjs/org.quickcorp.qcobjects.defaultsettings.cjs.map +2 -2
  46. package/public/cjs/qcobjects-cli.cjs +4047 -13
  47. package/public/cjs/qcobjects-cli.cjs.map +4 -4
  48. package/public/esm/com.qcobjects.cli.commands.jira.client_services.mjs +50 -57
  49. package/public/esm/com.qcobjects.cli.commands.jira.client_services.mjs.map +2 -2
  50. package/public/esm/com.qcobjects.cli.commands.jira.mjs +119 -94
  51. package/public/esm/com.qcobjects.cli.commands.jira.mjs.map +4 -4
  52. package/public/esm/com.qcobjects.cli.commands.mjs +357 -16
  53. package/public/esm/com.qcobjects.cli.commands.mjs.map +4 -4
  54. package/public/esm/com.qcobjects.cli.commands.version.mjs +204 -216
  55. package/public/esm/com.qcobjects.cli.commands.version.mjs.map +2 -2
  56. package/public/esm/index.mjs +4043 -13
  57. package/public/esm/index.mjs.map +4 -4
  58. package/public/esm/org.qcobjects.common.pipelog.mjs +21 -26
  59. package/public/esm/org.qcobjects.common.pipelog.mjs.map +2 -2
  60. package/public/esm/org.qcobjects.enterprise.commands.mjs +92 -119
  61. package/public/esm/org.qcobjects.enterprise.commands.mjs.map +3 -3
  62. package/public/esm/org.quickcorp.qcobjects.api.client_services.mjs +48 -57
  63. package/public/esm/org.quickcorp.qcobjects.api.client_services.mjs.map +2 -2
  64. package/public/esm/org.quickcorp.qcobjects.cli.mjs +1266 -380
  65. package/public/esm/org.quickcorp.qcobjects.cli.mjs.map +4 -4
  66. package/public/esm/org.quickcorp.qcobjects.defaultsettings.mjs +357 -361
  67. package/public/esm/org.quickcorp.qcobjects.defaultsettings.mjs.map +2 -2
  68. package/public/esm/qcobjects-cli.mjs +4046 -14
  69. package/public/esm/qcobjects-cli.mjs.map +4 -4
  70. package/public/index.d.ts +140 -10
  71. package/src/com.qcobjects.cli.commands.jira.client_services.ts +19 -21
  72. package/src/com.qcobjects.cli.commands.jira.ts +11 -34
  73. package/src/com.qcobjects.cli.commands.ts +3 -9
  74. package/src/com.qcobjects.cli.commands.version.ts +1 -9
  75. package/src/org.qcobjects.common.pipelog.ts +18 -15
  76. package/src/org.qcobjects.enterprise.commands.ts +29 -50
  77. package/src/org.quickcorp.qcobjects.api.client_services.ts +1 -4
  78. package/src/org.quickcorp.qcobjects.cli.ts +28 -57
  79. package/src/org.quickcorp.qcobjects.defaultsettings.ts +359 -355
  80. package/src/qcobjects-cli.ts +4 -5
package/public/index.d.ts CHANGED
@@ -1,11 +1,139 @@
1
1
  #!/usr/bin/env node
2
- declare module "com.qcobjects.cli.commands.jira.client_services" { }
3
- declare module "com.qcobjects.cli.commands.jira" { }
4
- declare module "com.qcobjects.cli.commands" { }
5
- declare module "com.qcobjects.cli.commands.version" { }
2
+ declare module "com.qcobjects.cli.commands.jira.client_services" {
3
+ const Service: any;
4
+ export class JiraCloud extends Service {
5
+ static [x: string]: any;
6
+ constructor({ name, external, useHTTP2, cached, method, headers, basePath, url, withCredentials }: {
7
+ name?: string | undefined;
8
+ external?: boolean | undefined;
9
+ useHTTP2?: boolean | undefined;
10
+ cached?: boolean | undefined;
11
+ method?: string | undefined;
12
+ headers?: {
13
+ accept: string;
14
+ "content-type": string;
15
+ } | undefined;
16
+ basePath?: string | undefined;
17
+ url?: string | undefined;
18
+ withCredentials?: boolean | undefined;
19
+ });
20
+ done(service: any, standardResponse: any): void;
21
+ fail(e: any): void;
22
+ }
23
+ }
24
+ declare module "com.qcobjects.cli.commands.jira" {
25
+ const InheritClass: any;
26
+ export class CommandHandler extends InheritClass {
27
+ static [x: string]: any;
28
+ constructor({ switchCommander }: {
29
+ switchCommander: any;
30
+ });
31
+ getIssueList(): Promise<void>;
32
+ }
33
+ }
34
+ declare module "com.qcobjects.cli.commands.version" {
35
+ const InheritClass: any;
36
+ export class CommandHandler extends InheritClass {
37
+ static [x: string]: any;
38
+ constructor({ switchCommander }: {
39
+ switchCommander: any;
40
+ });
41
+ syncGit(versionString: any, commitMsg: any, syncNpm?: boolean): void;
42
+ parseVersionString(versionString: string): {
43
+ major: string;
44
+ minor: string;
45
+ patch: string;
46
+ };
47
+ getVersionStringFromFile(filename: any): any;
48
+ buildNewSemVersionString({ major, minor, patch }: {
49
+ major: string;
50
+ minor: string;
51
+ patch: string;
52
+ }): string;
53
+ parseVersionSuffix(versionString: string): string;
54
+ buildNewVersionString({ major, minor, patch }: any, suffix: any): string;
55
+ saveNewVersionFile(filename: any, versionString: any): void;
56
+ }
57
+ }
58
+ declare module "com.qcobjects.cli.commands" {
59
+ export * as versionCommand from "com.qcobjects.cli.commands.version";
60
+ export * as jiraCommand from "com.qcobjects.cli.commands.jira";
61
+ }
62
+ declare module "org.quickcorp.qcobjects.defaultsettings" {
63
+ export const __get_version__: () => {
64
+ qcobjects: any;
65
+ sdk: any;
66
+ cli: any;
67
+ };
68
+ export const __get_version_string__: () => string;
69
+ }
70
+ declare module "org.qcobjects.enterprise.commands" {
71
+ const InheritClass: any;
72
+ export class QCObjectsEnterprise extends InheritClass {
73
+ static [x: string]: any;
74
+ install(): void;
75
+ upgrade(switchCommander: any): void;
76
+ installEnterprise(license: string | any[], email: any): void;
77
+ }
78
+ }
79
+ declare module "org.quickcorp.qcobjects.api.client_services" {
80
+ const Service: any;
81
+ export class QuickCorpCloud extends Service {
82
+ static [x: string]: any;
83
+ constructor({ name, external, useHTTP2, cached, method, headers, basePath, url, withCredentials }: {
84
+ name?: string | undefined;
85
+ external?: boolean | undefined;
86
+ useHTTP2?: boolean | undefined;
87
+ cached?: boolean | undefined;
88
+ method?: string | undefined;
89
+ headers?: {
90
+ origin: string;
91
+ "content-type": string;
92
+ } | undefined;
93
+ basePath?: string | undefined;
94
+ url?: string | undefined;
95
+ withCredentials?: boolean | undefined;
96
+ });
97
+ _new_(o: any): void;
98
+ done(service: any, standardResponse: any): void;
99
+ fail(e: any): void;
100
+ }
101
+ }
102
+ declare module "org.quickcorp.qcobjects.cli" {
103
+ const InheritClass: any;
104
+ export * as EnterpriseCommands from "org.qcobjects.enterprise.commands";
105
+ export * as QuickCorpServices from "org.quickcorp.qcobjects.api.client_services";
106
+ export * as customCommands from "com.qcobjects.cli.commands";
107
+ export const getPluginCommandsList: () => any;
108
+ export class SwitchCommander extends InheritClass {
109
+ static [x: string]: any;
110
+ choiceOption: {
111
+ generateSw: (_appName: boolean, options: {
112
+ dir: any;
113
+ }) => void;
114
+ create: (_appName: boolean, options: {
115
+ createAmp: any;
116
+ createPwa: any;
117
+ createPhp: any;
118
+ createCustom: any;
119
+ }) => void;
120
+ publish(_appName: any, _options: any): void;
121
+ upgradeToEnterprise(_appName: any, _options: any): void;
122
+ };
123
+ constructor();
124
+ shellCommands(_shell_commands: any[]): Promise<unknown>;
125
+ fileListRecursive(dir: string): string | any[];
126
+ register(email: any, phonenumber: any): Promise<unknown>;
127
+ generateServiceWorker(appName: any, dirPrefix?: string): Promise<unknown>;
128
+ copyTemplate(source: any, dest: any): Promise<void>;
129
+ initCommand(): void;
130
+ }
131
+ }
6
132
  declare module "qcobjects-cli" {
7
133
  const InheritClass: any;
8
- class Main extends InheritClass {
134
+ export * as defaultSettings from "org.quickcorp.qcobjects.defaultsettings";
135
+ export class Main extends InheritClass {
136
+ static [x: string]: any;
9
137
  constructor();
10
138
  }
11
139
  const __main__: Main;
@@ -15,12 +143,14 @@ declare module "index" {
15
143
  import * as cli from "qcobjects-cli";
16
144
  export default cli;
17
145
  }
18
- declare module "org.qcobjects.common.pipelog" { }
19
- declare module "org.qcobjects.enterprise.commands" { }
20
- declare module "org.quickcorp.qcobjects.api.client_services" { }
21
- declare module "org.quickcorp.qcobjects.cli" { }
146
+ declare module "org.qcobjects.common.pipelog" {
147
+ const InheritClass: any;
148
+ export class PipeLog extends InheritClass {
149
+ static [x: string]: any;
150
+ pipe(o: any): string;
151
+ }
152
+ }
22
153
  declare module "org.quickcorp.qcobjects.collab.server" { }
23
- declare module "org.quickcorp.qcobjects.defaultsettings" { }
24
154
  declare module "org.quickcorp.qcobjects.main.file" { }
25
155
  declare module "org.quickcorp.qcobjects.main.http.gae.server" { }
26
156
  declare module "org.quickcorp.qcobjects.main.http.server" { }
@@ -30,23 +30,23 @@
30
30
  /*eslint no-undef: "off"*/
31
31
  "use strict";
32
32
 
33
- const {Package, Service, logger} = require ("qcobjects");
33
+ const { Package, Service, logger } = require("qcobjects");
34
34
 
35
- class JiraCloud extends Service {
36
- constructor ({
37
- name= "jira_cloud",
38
- external= true,
39
- useHTTP2= true,
40
- cached= false,
41
- method= "POST",
42
- headers= {
43
- "accept":"application/json",
44
- "content-type":"application/json"
35
+ export class JiraCloud extends Service {
36
+ constructor({
37
+ name = "jira_cloud",
38
+ external = true,
39
+ useHTTP2 = true,
40
+ cached = false,
41
+ method = "POST",
42
+ headers = {
43
+ "accept": "application/json",
44
+ "content-type": "application/json"
45
45
  },
46
- basePath= "",
47
- url= "",
48
- withCredentials= false
49
- }){
46
+ basePath = "",
47
+ url = "",
48
+ withCredentials = false
49
+ }) {
50
50
  super({
51
51
  name,
52
52
  external,
@@ -68,19 +68,17 @@ class JiraCloud extends Service {
68
68
 
69
69
  }
70
70
 
71
- done(service: any,standardResponse: any) {
71
+ done(service: any, standardResponse: any) {
72
72
  // service loaded
73
73
  logger.debug(standardResponse);
74
74
  }
75
75
 
76
- fail (e: any){
77
- logger.debug(e);
76
+ fail(e: any) {
77
+ logger.debug(e);
78
78
  }
79
79
 
80
80
  }
81
81
 
82
82
  Package("com.qcobjects.cli.commands.jira.client_services", [
83
- JiraCloud
83
+ JiraCloud
84
84
  ]);
85
-
86
- exports = {JiraCloud};
@@ -29,32 +29,28 @@
29
29
  /*eslint no-mixed-operators: "off"*/
30
30
  /*eslint no-undef: "off"*/
31
31
  "use strict";
32
- const fs = require("fs");
33
32
  const path = require("path");
34
33
  const absolutePath = path.resolve(__dirname, "./");
35
- const templatePath = path.resolve(__dirname, "./templates/apps/") + "/";
36
- const templatePwaPath = path.resolve(__dirname, "./templates/pwa/") + "/";
37
- const package_config = require(absolutePath + "/../package.json");
38
34
  const {
39
35
  exec,
40
36
  execSync
41
37
  } = require("child_process");
42
38
 
43
- const {Package, InheritClass, _DataStringify, New, CONFIG, logger, serviceLoader} = require("qcobjects");
39
+ const { Package, InheritClass, _DataStringify, New, CONFIG, logger, serviceLoader } = require("qcobjects");
44
40
 
45
- const {JiraCloud} = require(absolutePath + "/com.qcobjects.cli.commands.jira.client_services");
41
+ import { JiraCloud } from "./com.qcobjects.cli.commands.jira.client_services";
46
42
 
47
- class CommandHandler extends InheritClass {
43
+ export class CommandHandler extends InheritClass {
48
44
  constructor({
49
45
  switchCommander
50
- }:{switchCommander:any}) {
51
- super({switchCommander});
46
+ }: { switchCommander: any }) {
47
+ super({ switchCommander });
52
48
  this.choiceOption = {
53
- issues: function (options:any) {
49
+ issues: function () {
54
50
 
55
- this.getIssueList().then(function (response:any) {
51
+ this.getIssueList().then(function (response: any) {
56
52
  console.log(_DataStringify(response));
57
- }).catch((e:any) => {
53
+ }).catch((e: any) => {
58
54
  console.log(e);
59
55
  process.exit(1);
60
56
  });
@@ -82,13 +78,9 @@ class CommandHandler extends InheritClass {
82
78
  }
83
79
  });
84
80
 
85
-
86
-
87
-
88
-
89
81
  }
90
82
 
91
- getIssueList(username: any, password: any, project: any) {
83
+ getIssueList() {
92
84
  return new Promise<void>(function (resolve, reject) {
93
85
  logger.info("I'm going to get the issue list from the jira cloud...");
94
86
  const jira_config = CONFIG.get("jira", null);
@@ -111,20 +103,6 @@ class CommandHandler extends InheritClass {
111
103
  }
112
104
  });
113
105
  try {
114
- const service = serviceLoader(cloudClient).then((successResponse: { service: { template: any; }; responseHeaders: any; }) => {
115
- const template = successResponse.service.template;
116
- const responseHeaders = successResponse.responseHeaders;
117
- if (responseHeaders[":status"] === 200 || !cloudClient.useHTTP2) {
118
- const response = JSON.parse(template);
119
- resolve(response);
120
- } else {
121
- console.error("\u{1F926} Something went wrong \u{1F926} when trying to get jira issues from the cloud. The status was: " + responseHeaders[":status"]);
122
- reject(template as Error);
123
- }
124
- }).catch((e: any) => {
125
- console.error("\u{1F926} Something went wrong \u{1F926} when trying to get jira issues from the cloud");
126
- reject(e as Error);
127
- });
128
106
  } catch (e) {
129
107
  console.error("\u{1F926} Something went wrong \u{1F926} when trying to get jira issues from the cloud");
130
108
  reject(e as Error);
@@ -132,7 +110,7 @@ class CommandHandler extends InheritClass {
132
110
 
133
111
  } else {
134
112
  console.error("\u{1F926} Something went wrong \u{1F926} You need to set the jira config settings");
135
- reject(new Error ("\u{1F926} Something went wrong \u{1F926} You need to set the jira config settings"));
113
+ reject(new Error("\u{1F926} Something went wrong \u{1F926} You need to set the jira config settings"));
136
114
  }
137
115
 
138
116
  });
@@ -142,6 +120,5 @@ class CommandHandler extends InheritClass {
142
120
  }
143
121
 
144
122
  Package("com.qcobjects.cli.commands.jira", [
145
-
146
- CommandHandler
123
+ CommandHandler
147
124
  ]);
@@ -29,14 +29,8 @@
29
29
  /*eslint no-mixed-operators: "off"*/
30
30
  /*eslint no-undef: "off"*/
31
31
  "use strict";
32
- const fs = require("fs");
33
- const path = require("path");
34
- const absolutePath = path.resolve( __dirname, "./" );
35
- const templatePath = path.resolve( __dirname, "./templates/apps/" )+"/";
36
- const templatePwaPath = path.resolve( __dirname, "./templates/pwa/" )+"/";
37
- const package_config = require(absolutePath+"/../package.json");
38
- const { exec,execSync } = require("child_process");
39
32
 
40
33
  // plugin commands here
41
- require(absolutePath+"/com.qcobjects.cli.commands.version");
42
- require(absolutePath+"/com.qcobjects.cli.commands.jira");
34
+
35
+ export * as versionCommand from "./com.qcobjects.cli.commands.version";
36
+ export * as jiraCommand from "./com.qcobjects.cli.commands.jira";
@@ -31,15 +31,11 @@
31
31
  "use strict";
32
32
  const fs = require("fs");
33
33
  const path = require("path");
34
- const absolutePath = path.resolve(__dirname, "./");
35
- const templatePath = path.resolve(__dirname, "./templates/apps/") + "/";
36
- const templatePwaPath = path.resolve(__dirname, "./templates/pwa/") + "/";
37
- const package_config = require(absolutePath + "/../package.json");
38
34
  const { exec, execSync } = require("child_process");
39
35
 
40
36
  const { Package, InheritClass, logger } = require("qcobjects");
41
37
 
42
- class CommandHandler extends InheritClass {
38
+ export class CommandHandler extends InheritClass {
43
39
 
44
40
  constructor({ switchCommander }: { switchCommander: any }) {
45
41
  super({ switchCommander });
@@ -140,7 +136,6 @@ class CommandHandler extends InheritClass {
140
136
  }
141
137
  );
142
138
  var minorVersionTags = versionTags.filter((tag: { version: string; }) => tag.version !== "").map((tag: { version: string; }) => tag.version.split(".")[0] + "." + tag.version.split(".")[1]).unique();
143
- var majorVersionTags = versionTags.filter((tag: { version: string; }) => tag.version !== "").map((tag: { version: string; }) => tag.version.split(".")[0]).unique();
144
139
  var history = minorVersionTags.map((minor: string) => {
145
140
  return {
146
141
  "major": minor.split(".")[0],
@@ -286,8 +281,5 @@ class CommandHandler extends InheritClass {
286
281
 
287
282
 
288
283
  Package("com.qcobjects.cli.commands.version", [
289
-
290
284
  CommandHandler
291
285
  ]);
292
-
293
- exports = {CommandHandler};
@@ -32,24 +32,27 @@
32
32
 
33
33
  const {Package, InheritClass} = require("qcobjects");
34
34
 
35
- Package("org.qcobjects.common.pipelog", [
36
- class PipeLog extends InheritClass {
35
+ export class PipeLog extends InheritClass {
37
36
 
38
- pipe(o:any) {
39
- var _o = [];
40
- for (var k in o) {
41
- if (typeof o[k] !== "undefined" &&
42
- o[k] !== null &&
43
- typeof o[k] !== "function") {
44
- try {
45
- _o.push("" + k + "=" + o[k].toString());
46
- } catch (e) {
47
- // error logging, do nothing
48
- }
37
+ pipe(o:any) {
38
+ var _o = [];
39
+ for (var k in o) {
40
+ if (typeof o[k] !== "undefined" &&
41
+ o[k] !== null &&
42
+ typeof o[k] !== "function") {
43
+ try {
44
+ _o.push("" + k + "=" + o[k].toString());
45
+ } catch (e) {
46
+ // error logging, do nothing
49
47
  }
50
48
  }
51
- return _o.join(" ");
52
49
  }
53
-
50
+ return _o.join(" ");
54
51
  }
52
+
53
+ }
54
+
55
+
56
+ Package("org.qcobjects.common.pipelog", [
57
+ PipeLog
55
58
  ]);
@@ -29,26 +29,21 @@
29
29
  /*eslint no-mixed-operators: "off"*/
30
30
  /*eslint no-undef: "off"*/
31
31
  "use strict";
32
- const fs = require("fs");
33
- const path = require("path");
34
- const absolutePath = path.resolve( __dirname, "./" );
35
- const templatePath = path.resolve( __dirname, "./templates/apps/" )+"/";
36
- const templatePwaPath = path.resolve( __dirname, "./templates/pwa/" )+"/";
37
- const package_config = require(absolutePath+"/../package.json");
38
- const { exec,execSync } = require("child_process");
39
-
40
- const {Package, InheritClass, CONFIG, logger} = require("qcobjects");
32
+
33
+ import { execSync } from "node:child_process";
34
+
35
+ const { Package, InheritClass, CONFIG, logger } = require("qcobjects");
41
36
  const license = CONFIG.get("enterprise-license", "1234");
42
37
  const email = CONFIG.get("enterprise-email", "a@b.com");
43
38
 
44
- class QCObjectsEnterprise extends InheritClass {
45
-
46
- install (switchCommander:any) {
39
+ export class QCObjectsEnterprise extends InheritClass {
40
+
41
+ install() {
47
42
  const instance = this;
48
43
  return instance.installEnterprise(license, email);
49
44
  }
50
45
 
51
- upgrade (switchCommander:any){
46
+ upgrade(switchCommander: any) {
52
47
  const instance = this;
53
48
  const readline = require("readline");
54
49
 
@@ -57,18 +52,17 @@ class QCObjectsEnterprise extends InheritClass {
57
52
  output: process.stdout
58
53
  });
59
54
 
60
- var emailQuestion = function (){
55
+ var emailQuestion = function () {
61
56
  rl.question(`
62
57
  [NOTE: No information will be sent to a server until I got your consent]
63
58
 
64
59
  Please tell me your e-Mail (\u{1F48C}):
65
60
  `, (email: string) => {
66
- const asterisk = "*";
67
- if (email !== ""){
68
- var phoneNumberQuestion = function (){
69
- rl.question ("Please tell me your phone number (\u{1F919}): \n", (phonenumber: string) => {
70
- if (phonenumber !== ""){
71
- rl.question (`
61
+ if (email !== "") {
62
+ var phoneNumberQuestion = function () {
63
+ rl.question("Please tell me your phone number (\u{1F919}): \n", (phonenumber: string) => {
64
+ if (phonenumber !== "") {
65
+ rl.question(`
72
66
  Please select one of the following options (type a number):
73
67
 
74
68
  1.- \u{1F640} This is your first interaction \u{1F60D} with QCObjects Enterprise Edition \u{1F3E2},
@@ -82,12 +76,12 @@ class QCObjectsEnterprise extends InheritClass {
82
76
  3.- \u{1F3C3} You want to quit this form, as you got here accidentally
83
77
  (You should think about it. It's not a coincidence, It's destiny \u{1F600}).
84
78
 
85
- Please enter the number of the option and press [enter]: `, (interaction_option: any)=> {
86
- logger.infoEnabled=true;
79
+ Please enter the number of the option and press [enter]: `, (interaction_option: any) => {
80
+ logger.infoEnabled = true;
87
81
 
88
82
  switch (interaction_option) {
89
83
  case "1":
90
- switchCommander.register(email,phonenumber).then(function (response: any){
84
+ switchCommander.register(email, phonenumber).then(function () {
91
85
  logger.info(`\u{1F44F} Congrats! You have been successfully registered to the cloud! \u{1F44F}
92
86
  One of our executives will be in touch with you as soon as possible to give you the next steps
93
87
  to get a new License Number and start using QCObjects Entrprise Edition!
@@ -95,7 +89,7 @@ class QCObjectsEnterprise extends InheritClass {
95
89
  (In the meantime, you can continue using all the features of the QCObjects Community Edition)
96
90
  `);
97
91
  rl.close();
98
- }).catch ((e: any)=>{
92
+ }).catch(() => {
99
93
  rl.close();
100
94
  });
101
95
  break;
@@ -146,18 +140,17 @@ class QCObjectsEnterprise extends InheritClass {
146
140
 
147
141
  }
148
142
 
149
- installEnterprise (license: string | any[], email: any) {
143
+ installEnterprise(license: string | any[], email: any) {
150
144
  const asterisk = "*";
151
145
 
152
146
  logger.info(`Your entered license number is ${asterisk.repeat(license.length)} and the email that you have entered is ${email}`);
153
147
  logger.info("Now, I'm installing QCObjects Enterprise Edition in your computer...");
154
148
  const cmdDownloadGit = `npm i --force -g git+https://license:${license}@software.qcobjects.io/qcobjects-enterprise/qcobjects-enterprise.git`;
155
- exec(cmdDownloadGit,(err: any,stdout: any,stderr: string | string[])=>{
156
- if(!err){
157
- exec("qcobjects --version",(err: any,stdout: string | string[],stderr: any)=>{
158
- if (stdout.lastIndexOf("Enterprise Edition")!==-1){
159
- logger.info("\u{1F44F} Congrats! Now you have installed QCObjects Entrprise Edition! \u{1F44F}");
160
- logger.info(`You can test it using:
149
+ execSync(cmdDownloadGit);
150
+ const stdout = execSync("qcobjects --version");
151
+ if (stdout.lastIndexOf("Enterprise Edition") !== -1) {
152
+ logger.info("\u{1F44F} Congrats! Now you have installed QCObjects Entrprise Edition! \u{1F44F}");
153
+ logger.info(`You can test it using:
161
154
  > qcobjects --version
162
155
 
163
156
  To find more help, type the command:
@@ -166,30 +159,16 @@ To find more help, type the command:
166
159
 
167
160
  Enjoy!
168
161
  `);
169
- } else {
170
- console.log("\u{1F926} Something went wrong \u{1F926} when trying to update your license to QCObjects Enterprise Edition");
171
- console.log("Ask your executive to help");
172
- }
173
- });
174
-
175
- } else {
176
- console.log("\u{1F926} Something went wrong \u{1F926} when trying to update your license to QCObjects Enterprise Edition");
177
- if (stderr.lastIndexOf("Authentication failed")!==-1){
178
- console.log("Please ask to your executive for the right license number");
179
- } else {
180
- console.log(stderr);
181
- }
182
- }
183
- }).stdout.on("data", function(data: any) {
184
- console.log(data);
185
- });
162
+ } else {
163
+ console.log("\u{1F926} Something went wrong \u{1F926} when trying to update your license to QCObjects Enterprise Edition");
164
+ console.log("Ask your executive to help");
165
+ }
186
166
 
187
167
  }
188
168
 
189
169
  }
190
170
 
191
- Package ("org.qcobjects.enterprise.commands", [
171
+ Package("org.qcobjects.enterprise.commands", [
192
172
  QCObjectsEnterprise
193
173
  ]);
194
174
 
195
- exports = {QCObjectsEnterprise};
@@ -32,7 +32,7 @@
32
32
 
33
33
  const {Package, Service, logger} = require("qcobjects");
34
34
 
35
- class QuickCorpCloud extends Service {
35
+ export class QuickCorpCloud extends Service {
36
36
  constructor ({
37
37
  name= "quickcorp_cloud",
38
38
  external= true,
@@ -83,6 +83,3 @@ Package("org.quickcorp.qcobjects.api.client_services", [
83
83
  QuickCorpCloud
84
84
  ]);
85
85
 
86
- exports = {
87
- QuickCorpCloud
88
- };