@dynamicweb/cli 1.0.11 → 1.0.13

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.
@@ -286,11 +286,8 @@ export function resolveFilePath(filePath) {
286
286
  return path.join(p.dir, resolvedPath);
287
287
  }
288
288
 
289
+
289
290
  function wildcardToRegExp(wildcard) {
290
- return new RegExp('^' + wildcard
291
- .replace(/\./g, '\\.')
292
- .replace(/\*/g, '.*')
293
- .replace(/\+/g, '.+')
294
- .replace(/\?/g, '.')
295
- + '$');
291
+ return new RegExp('^' + wildcard.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '$');
296
292
  }
293
+
@@ -13,6 +13,11 @@ export function installCommand() {
13
13
  .positional('filePath', {
14
14
  describe: 'Path to the file to install'
15
15
  })
16
+ .option('queue', {
17
+ alias: 'q',
18
+ type: 'boolean',
19
+ describe: 'Queues the install for next Dynamicweb recycle'
20
+ })
16
21
  },
17
22
  handler: (argv) => {
18
23
  if (argv.verbose) console.info(`Installing file located at :${argv.filePath}`)
@@ -25,13 +30,14 @@ async function handleInstall(argv) {
25
30
  let env = await setupEnv(argv);
26
31
  let user = await setupUser(argv, env);
27
32
  await uploadFiles(env, user, [ argv.filePath ], 'System/AddIns/Local', false, true);
28
- await installAddin(env, user, resolveFilePath(argv.filePath))
33
+ await installAddin(env, user, resolveFilePath(argv.filePath), argv.queue)
29
34
  }
30
35
 
31
- async function installAddin(env, user, resolvedPath) {
36
+ async function installAddin(env, user, resolvedPath, queue) {
32
37
  console.log('Installing addin')
33
38
  let filename = path.basename(resolvedPath);
34
39
  let data = {
40
+ 'Queue': queue,
35
41
  'Ids': [
36
42
  `${filename.substring(0, filename.lastIndexOf('.')) || filename}|${path.extname(resolvedPath)}`
37
43
  ]
@@ -118,6 +118,7 @@ async function loginInteractive(result, verbose) {
118
118
  getConfig().env[result.environment].users[result.username].apiKey = apiKey;
119
119
  getConfig().env[result.environment].current = getConfig().env[result.environment].current || {};
120
120
  getConfig().env[result.environment].current.user = result.username;
121
+ console.log("You're now logged in as " + result.username)
121
122
  updateConfig();
122
123
  }
123
124
 
@@ -131,12 +132,11 @@ async function login(username, password, env, protocol, verbose) {
131
132
  headers: {
132
133
  'Content-Type': 'application/x-www-form-urlencoded'
133
134
  },
134
- agent: getAgent(protocol)
135
+ agent: getAgent(protocol),
136
+ redirect: "manual"
135
137
  });
136
138
 
137
- if (res.ok) {
138
- console.log(res)
139
- console.log(res.json())
139
+ if (res.ok || res.status == 302) {
140
140
  let user = parseCookies(res.headers.get('set-cookie')).user;
141
141
  if (!user) return;
142
142
  return await getToken(user, env, protocol, verbose)
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@dynamicweb/cli",
3
3
  "type": "module",
4
4
  "description": "Dynamicweb CLI is a commandline tool for interacting with Dynamicweb 10 solutions.",
5
- "version": "1.0.11",
5
+ "version": "1.0.13",
6
6
  "main": "bin/index.js",
7
7
  "files": [
8
8
  "bin/*"