@cyklang/cli 0.11.6 → 0.11.7
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/build/Cmd.js +34 -18
- package/build/index.js +1 -1
- package/package.json +1 -1
- package/src/Cmd.ts +34 -18
- package/src/index.ts +1 -1
package/build/Cmd.js
CHANGED
|
@@ -74,35 +74,51 @@ class Cmd extends commander_1.Command {
|
|
|
74
74
|
*/
|
|
75
75
|
async updateAuthAccess(tableName, prefix, id, options) {
|
|
76
76
|
try {
|
|
77
|
-
let
|
|
77
|
+
let setAuth;
|
|
78
78
|
if (options.auth) {
|
|
79
79
|
if (' basic | token | cookie | any | none | null '.indexOf(' ' + options.auth + ' ') === -1) {
|
|
80
|
-
throw 'valid authentication schemas are : basic | token | cookie | any | null';
|
|
80
|
+
throw 'valid authentication schemas are : basic | token | cookie | any | none | null';
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
setAuth = `<set name="record.${prefix}_auth">`;
|
|
83
83
|
if (' none | null '.indexOf(' ' + options.auth + ' ') === -1)
|
|
84
|
-
|
|
84
|
+
setAuth += ` "${options.auth}" `;
|
|
85
85
|
else
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
setAuth += ' null ';
|
|
87
|
+
setAuth += "</set>";
|
|
88
88
|
}
|
|
89
|
-
let
|
|
89
|
+
let setAccess;
|
|
90
90
|
if (options.access) {
|
|
91
|
-
|
|
91
|
+
setAccess = `<set name="record.${prefix}_access">`;
|
|
92
92
|
if (' null | none '.indexOf(' ' + options.access + ' ') === -1)
|
|
93
|
-
|
|
93
|
+
setAccess += ` "${options.access}" `;
|
|
94
94
|
else
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
setAccess += ' null ';
|
|
96
|
+
setAccess += "</set>";
|
|
97
97
|
}
|
|
98
98
|
const inst = `
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
99
|
+
|
|
100
|
+
<object name="result_select"/>
|
|
101
|
+
|
|
102
|
+
<db.select table='${tableName}' result='result_select'>
|
|
103
|
+
<string name='where'>"${prefix}_id = ${id}"</string>
|
|
104
|
+
</db.select>
|
|
105
|
+
|
|
106
|
+
<if>
|
|
107
|
+
<condition>result_select.resultset.length() == 0</condition>
|
|
108
|
+
<then>
|
|
109
|
+
<print>"ID not found in the table: ${id} / ${tableName}"</print>
|
|
110
|
+
</then>
|
|
111
|
+
<else>
|
|
112
|
+
<object name="record">result_select.resultset.at(0)</object>
|
|
113
|
+
|
|
114
|
+
${setAuth}
|
|
115
|
+
${setAccess}
|
|
116
|
+
|
|
117
|
+
<db.update table='${tableName}'>
|
|
118
|
+
<object>record</object>
|
|
119
|
+
</db.update>
|
|
120
|
+
</else>
|
|
121
|
+
</if>
|
|
106
122
|
`;
|
|
107
123
|
if (!this.dbManager)
|
|
108
124
|
throw 'prologue() has not been called before';
|
package/build/index.js
CHANGED
|
@@ -182,7 +182,7 @@ class StopCommand extends commander_1.Command {
|
|
|
182
182
|
*/
|
|
183
183
|
const program = new commander_1.Command();
|
|
184
184
|
program.name('cyk').description('cyklang CLI')
|
|
185
|
-
.version('0.11.
|
|
185
|
+
.version('0.11.7');
|
|
186
186
|
program.addCommand(new StartCommand('start'));
|
|
187
187
|
program.addCommand(new StopCommand('stop'));
|
|
188
188
|
program.addCommand(new InstallCommand_1.InstallCommand('install'));
|
package/package.json
CHANGED
package/src/Cmd.ts
CHANGED
|
@@ -57,40 +57,56 @@ export class Cmd extends Command {
|
|
|
57
57
|
|
|
58
58
|
try {
|
|
59
59
|
|
|
60
|
-
let
|
|
60
|
+
let setAuth: string | undefined
|
|
61
61
|
|
|
62
62
|
if (options.auth) {
|
|
63
63
|
if (' basic | token | cookie | any | none | null '.indexOf(' ' + options.auth + ' ') === -1) {
|
|
64
|
-
throw 'valid authentication schemas are : basic | token | cookie | any | null'
|
|
64
|
+
throw 'valid authentication schemas are : basic | token | cookie | any | none | null'
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
setAuth = `<set name="record.${prefix}_auth">`
|
|
67
67
|
if (' none | null '.indexOf(' ' + options.auth + ' ') === -1)
|
|
68
|
-
|
|
68
|
+
setAuth += ` "${options.auth}" `
|
|
69
69
|
else
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
setAuth += ' null '
|
|
71
|
+
setAuth += "</set>"
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
let
|
|
74
|
+
let setAccess: string | undefined
|
|
75
75
|
|
|
76
76
|
if (options.access) {
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
setAccess = `<set name="record.${prefix}_access">`
|
|
79
79
|
if (' null | none '.indexOf(' ' + options.access + ' ') === -1)
|
|
80
|
-
|
|
80
|
+
setAccess += ` "${options.access}" `
|
|
81
81
|
else
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
setAccess += ' null '
|
|
83
|
+
setAccess += "</set>"
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
const inst = `
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
|
|
88
|
+
<object name="result_select"/>
|
|
89
|
+
|
|
90
|
+
<db.select table='${tableName}' result='result_select'>
|
|
91
|
+
<string name='where'>"${prefix}_id = ${id}"</string>
|
|
92
|
+
</db.select>
|
|
93
|
+
|
|
94
|
+
<if>
|
|
95
|
+
<condition>result_select.resultset.length() == 0</condition>
|
|
96
|
+
<then>
|
|
97
|
+
<print>"ID not found in the table: ${id} / ${tableName}"</print>
|
|
98
|
+
</then>
|
|
99
|
+
<else>
|
|
100
|
+
<object name="record">result_select.resultset.at(0)</object>
|
|
101
|
+
|
|
102
|
+
${setAuth}
|
|
103
|
+
${setAccess}
|
|
104
|
+
|
|
105
|
+
<db.update table='${tableName}'>
|
|
106
|
+
<object>record</object>
|
|
107
|
+
</db.update>
|
|
108
|
+
</else>
|
|
109
|
+
</if>
|
|
94
110
|
`
|
|
95
111
|
|
|
96
112
|
if (!this.dbManager) throw 'prologue() has not been called before'
|
package/src/index.ts
CHANGED
|
@@ -176,7 +176,7 @@ class StopCommand extends Command {
|
|
|
176
176
|
*/
|
|
177
177
|
const program = new Command()
|
|
178
178
|
program.name('cyk').description('cyklang CLI')
|
|
179
|
-
.version('0.11.
|
|
179
|
+
.version('0.11.7')
|
|
180
180
|
program.addCommand(new StartCommand('start'))
|
|
181
181
|
program.addCommand(new StopCommand('stop'))
|
|
182
182
|
program.addCommand(new InstallCommand('install'))
|