qcobjects-cli 2.3.49 → 2.4.21
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/.github/FUNDING.yml +12 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- package/.github/ISSUE_TEMPLATE/custom.md +10 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/ISSUE_TEMPLATE/issue-template.md +33 -0
- package/.github/workflows/codeql-analysis.yml +71 -0
- package/.github/workflows/npmpublish-beta.yml +38 -0
- package/.github/workflows/npmpublish-lts.yml +38 -0
- package/.github/workflows/npmpublish-main.yml +38 -0
- package/.gitlab-ci.yml +3 -2
- package/VERSION +1 -1
- package/backend/com.qcobjects.backend.microservice.static.js +40 -24
- package/backend/org.qcobjects.backend.php.js +149 -116
- package/{org.quickcorp.qcobjects.cli.commands.jira.client_services.js → com.qcobjects.cli.commands.jira.client_services.js} +29 -22
- package/{org.quickcorp.qcobjects.cli.commands.jira.js → com.qcobjects.cli.commands.jira.js} +77 -60
- package/{org.quickcorp.qcobjects.cli.commands.js → com.qcobjects.cli.commands.js} +3 -3
- package/com.qcobjects.cli.commands.version.js +285 -0
- package/org.qcobjects.common.pipelog.js +55 -0
- package/org.qcobjects.enterprise.commands.js +149 -139
- package/org.quickcorp.qcobjects.api.client_services.js +31 -20
- package/org.quickcorp.qcobjects.cli.js +288 -275
- package/org.quickcorp.qcobjects.collab.server.js +317 -308
- package/org.quickcorp.qcobjects.defaultsettings.js +1 -1
- package/org.quickcorp.qcobjects.main.file.js +100 -79
- package/org.quickcorp.qcobjects.main.http.gae.server.js +265 -234
- package/org.quickcorp.qcobjects.main.http.server.js +156 -147
- package/org.quickcorp.qcobjects.main.http2.server.js +198 -191
- package/package.json +18 -10
- package/qcobjects-cli.js +8 -11
- package/qcobjects-collab.js +8 -6
- package/qcobjects-createcert.js +28 -16
- package/qcobjects-gae-http-server.js +8 -5
- package/qcobjects-http-server.js +7 -5
- package/qcobjects-http2-server.js +8 -5
- package/qcobjects-shell.js +113 -107
- package/org.quickcorp.qcobjects.cli.commands.version.js +0 -267
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* QCObjects CLI 2.
|
|
2
|
+
* QCObjects CLI 2.4.x
|
|
3
3
|
* ________________
|
|
4
4
|
*
|
|
5
5
|
* Author: Jean Machuca <correojean@gmail.com>
|
|
@@ -33,84 +33,41 @@ const path = require("path");
|
|
|
33
33
|
const fs = require("fs");
|
|
34
34
|
const mime = require("mime");
|
|
35
35
|
|
|
36
|
-
const absolutePath = path.resolve(
|
|
36
|
+
const absolutePath = path.resolve(__dirname, "./");
|
|
37
37
|
|
|
38
|
-
Package("org.quickcorp.qcobjects.main.file",[
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
isTemplate:function (){
|
|
50
|
-
return CONFIG.get("useTemplate") && (this.file_extension()==".html" || this.file_extension() == ".tpl.html");
|
|
51
|
-
},
|
|
52
|
-
_done:function (){
|
|
53
|
-
var appTemplateInstance = this;
|
|
54
|
-
const source = appTemplateInstance.template;
|
|
55
|
-
if (appTemplateInstance.isTemplate()){
|
|
38
|
+
Package("org.quickcorp.qcobjects.main.file", [
|
|
39
|
+
class FileDispatcher extends InheritClass {
|
|
40
|
+
constructor({
|
|
41
|
+
name = CONFIG.get("documentRootFileIndex"),
|
|
42
|
+
template = "",
|
|
43
|
+
templateURI = CONFIG.get("documentRootFileIndex"),
|
|
44
|
+
headers = {},
|
|
45
|
+
body = "",
|
|
46
|
+
filename = ""
|
|
47
|
+
}) {
|
|
48
|
+
super(...arguments);
|
|
56
49
|
|
|
57
|
-
|
|
58
|
-
name: "static_source",
|
|
59
|
-
template: source,
|
|
60
|
-
cached:false,
|
|
61
|
-
tplsource: "inline",
|
|
62
|
-
data: {
|
|
63
|
-
title: "QCObjects"
|
|
64
|
-
},
|
|
65
|
-
done ({request, component}) {
|
|
66
|
-
appTemplateInstance.body = component.parsedAssignmentText;
|
|
67
|
-
return Promise.resolve({request, component});
|
|
68
|
-
}
|
|
69
|
-
}));
|
|
50
|
+
var o = this;
|
|
70
51
|
|
|
71
|
-
} else {
|
|
72
|
-
appTemplateInstance.body = source;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if ([".png",
|
|
76
|
-
".jpg",
|
|
77
|
-
".jpeg",
|
|
78
|
-
".json",
|
|
79
|
-
".html",
|
|
80
|
-
".tpl.html",
|
|
81
|
-
".css",
|
|
82
|
-
".js",
|
|
83
|
-
".svg"].includes(appTemplateInstance.file_extension())){
|
|
84
|
-
appTemplateInstance.headers["content-type"]=mime.getType(appTemplateInstance.templateURI);
|
|
85
|
-
appTemplateInstance.headers["cache-control"]=CONFIG.get("cacheControl", "max-age=31536000");
|
|
86
|
-
appTemplateInstance.done.call(appTemplateInstance,
|
|
87
|
-
appTemplateInstance.headers,
|
|
88
|
-
appTemplateInstance.body,
|
|
89
|
-
appTemplateInstance.templateURI,
|
|
90
|
-
appTemplateInstance.isTemplate());
|
|
91
|
-
} else {
|
|
92
|
-
appTemplateInstance.done.call(appTemplateInstance,
|
|
93
|
-
{
|
|
94
|
-
":status": 403,
|
|
95
|
-
"content-type": "text/plain"
|
|
96
|
-
},
|
|
97
|
-
"FORBIDDEN","notfound.html",false);
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
done:function (headers,body){},
|
|
101
|
-
_new_:function (o){
|
|
102
52
|
var scriptname = o.scriptname;
|
|
103
53
|
this.filename = scriptname;
|
|
104
|
-
var pathname = (o.pathname !== "")?(o.pathname+"/"):("");
|
|
54
|
+
var pathname = (o.pathname !== "") ? (o.pathname + "/") : ("");
|
|
105
55
|
var appTemplateInstance = this;
|
|
56
|
+
if (typeof appTemplateInstance.headers === "undefined"){
|
|
57
|
+
appTemplateInstance.headers = {
|
|
58
|
+
":status": 500,
|
|
59
|
+
"content-type": "text/html"
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
106
63
|
appTemplateInstance.done = o.done;
|
|
107
|
-
appTemplateInstance.templateURI = CONFIG.get("documentRoot")+pathname+scriptname;
|
|
108
|
-
appTemplateInstance.templateURI = appTemplateInstance.templateURI.replace("//","/");
|
|
64
|
+
appTemplateInstance.templateURI = CONFIG.get("documentRoot") + pathname + scriptname;
|
|
65
|
+
appTemplateInstance.templateURI = appTemplateInstance.templateURI.replace("//", "/");
|
|
109
66
|
|
|
110
|
-
if (appTemplateInstance.isTemplate()){
|
|
111
|
-
fs.readFile(appTemplateInstance.templateURI, function(err, data) {
|
|
112
|
-
logger.debug("reading data from "+appTemplateInstance.templateURI);
|
|
113
|
-
if (typeof data !== "undefined"){
|
|
67
|
+
if (appTemplateInstance.isTemplate()) {
|
|
68
|
+
fs.readFile(appTemplateInstance.templateURI, function (err, data) {
|
|
69
|
+
logger.debug("reading data from " + appTemplateInstance.templateURI);
|
|
70
|
+
if (typeof data !== "undefined") {
|
|
114
71
|
appTemplateInstance.template = data.toString();
|
|
115
72
|
appTemplateInstance._done.call(appTemplateInstance);
|
|
116
73
|
} else {
|
|
@@ -119,20 +76,84 @@ Package("org.quickcorp.qcobjects.main.file",[
|
|
|
119
76
|
"content-type": "text/html"
|
|
120
77
|
};
|
|
121
78
|
appTemplateInstance.done.call(appTemplateInstance,
|
|
122
|
-
|
|
123
|
-
|
|
79
|
+
appTemplateInstance.headers,
|
|
80
|
+
"FILE NOT FOUND", "notfound.html", false);
|
|
124
81
|
logger.debug("file not found");
|
|
125
82
|
}
|
|
126
83
|
});
|
|
127
84
|
} else {
|
|
128
|
-
appTemplateInstance.headers[":status"]=200;
|
|
129
|
-
appTemplateInstance.headers["content-type"]=mime.getType(appTemplateInstance.templateURI);
|
|
85
|
+
appTemplateInstance.headers[":status"] = 200;
|
|
86
|
+
appTemplateInstance.headers["content-type"] = mime.getType(appTemplateInstance.templateURI);
|
|
130
87
|
appTemplateInstance.done.call(appTemplateInstance,
|
|
131
|
-
|
|
132
|
-
|
|
88
|
+
appTemplateInstance.headers,
|
|
89
|
+
"", appTemplateInstance.templateURI, false);
|
|
133
90
|
}
|
|
134
91
|
|
|
135
92
|
logger.info("FileDispatcher initialized");
|
|
93
|
+
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
file_extension() {
|
|
97
|
+
return this.filename.substr(this.filename.indexOf("."));
|
|
98
|
+
}
|
|
99
|
+
isTemplate() {
|
|
100
|
+
return CONFIG.get("useTemplate") && (this.file_extension() == ".html" || this.file_extension() == ".tpl.html");
|
|
136
101
|
}
|
|
137
|
-
|
|
138
|
-
|
|
102
|
+
_done() {
|
|
103
|
+
var appTemplateInstance = this;
|
|
104
|
+
const source = appTemplateInstance.template;
|
|
105
|
+
if (appTemplateInstance.isTemplate()) {
|
|
106
|
+
|
|
107
|
+
(New(Component, {
|
|
108
|
+
name: "static_source",
|
|
109
|
+
template: source,
|
|
110
|
+
cached: false,
|
|
111
|
+
tplsource: "inline",
|
|
112
|
+
data: {
|
|
113
|
+
title: "QCObjects"
|
|
114
|
+
},
|
|
115
|
+
done({
|
|
116
|
+
request,
|
|
117
|
+
component
|
|
118
|
+
}) {
|
|
119
|
+
appTemplateInstance.body = component.parsedAssignmentText;
|
|
120
|
+
return Promise.resolve({
|
|
121
|
+
request,
|
|
122
|
+
component
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}));
|
|
126
|
+
|
|
127
|
+
} else {
|
|
128
|
+
appTemplateInstance.body = source;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if ([".png",
|
|
132
|
+
".jpg",
|
|
133
|
+
".jpeg",
|
|
134
|
+
".json",
|
|
135
|
+
".html",
|
|
136
|
+
".tpl.html",
|
|
137
|
+
".css",
|
|
138
|
+
".js",
|
|
139
|
+
".svg"
|
|
140
|
+
].includes(appTemplateInstance.file_extension())) {
|
|
141
|
+
appTemplateInstance.headers["content-type"] = mime.getType(appTemplateInstance.templateURI);
|
|
142
|
+
appTemplateInstance.headers["cache-control"] = CONFIG.get("cacheControl", "max-age=31536000");
|
|
143
|
+
appTemplateInstance.done.call(appTemplateInstance,
|
|
144
|
+
appTemplateInstance.headers,
|
|
145
|
+
appTemplateInstance.body,
|
|
146
|
+
appTemplateInstance.templateURI,
|
|
147
|
+
appTemplateInstance.isTemplate());
|
|
148
|
+
} else {
|
|
149
|
+
appTemplateInstance.done.call(appTemplateInstance, {
|
|
150
|
+
":status": 403,
|
|
151
|
+
"content-type": "text/plain"
|
|
152
|
+
},
|
|
153
|
+
"FORBIDDEN", "notfound.html", false);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
done(headers, body) {}
|
|
157
|
+
|
|
158
|
+
}
|
|
159
|
+
]);
|