@dynamicweb/cli 1.0.10 → 1.0.11

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.
@@ -104,7 +104,6 @@ async function handleFiles(argv) {
104
104
  if (argv.recursive) {
105
105
  await processDirectory(env, user, resolvedPath, argv.outPath, resolvedPath, argv.createEmpty, true, argv.overwrite);
106
106
  } else {
107
- console.log(resolvedPath)
108
107
  let filesInDir = getFilesInDirectory(resolvedPath);
109
108
  await uploadFiles(env, user, filesInDir, argv.outPath, argv.createEmpty, argv.overwrite);
110
109
  }
@@ -291,6 +290,7 @@ function wildcardToRegExp(wildcard) {
291
290
  return new RegExp('^' + wildcard
292
291
  .replace(/\./g, '\\.')
293
292
  .replace(/\*/g, '.*')
293
+ .replace(/\+/g, '.+')
294
294
  .replace(/\?/g, '.')
295
295
  + '$');
296
296
  }
@@ -54,16 +54,25 @@ async function getProperties(argv) {
54
54
  })
55
55
  if (res.ok) {
56
56
  let body = await res.json()
57
- return body.model.propertyNames
57
+ if (body.model.properties.groups === undefined) {
58
+ console.log('Unable to fetch query parameters');
59
+ process.exit(1);
60
+ }
61
+ return body.model.properties.groups.filter(g => g.name === 'Properties')[0].fields.map(field => `${field.name} (${field.typeName})`)
58
62
  }
59
- console.log(res)
63
+ console.log('Unable to fetch query parameters');
64
+ console.log(res);
65
+ process.exit(1);
60
66
  }
61
67
 
62
68
  async function getQueryParams(argv) {
63
69
  let params = {}
64
70
  if (argv.interactive) {
65
71
  let props = { interactive: { default: true }}
66
- Array.from(await getProperties(argv)).forEach(p => props[p] = { type: 'input', prompt: 'if-no-arg'})
72
+ let properties = await getProperties(argv);
73
+ console.log('The following properties will be requested:')
74
+ console.log(properties)
75
+ Array.from(properties).forEach(p => props[p] = { type: 'input', prompt: 'if-no-arg'})
67
76
  await yargsInteractive()
68
77
  .interactive(props)
69
78
  .then((result) => {
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.10",
5
+ "version": "1.0.11",
6
6
  "main": "bin/index.js",
7
7
  "files": [
8
8
  "bin/*"