contensis-cli 1.0.0-beta.85 → 1.0.0-beta.86

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.
@@ -13,10 +13,23 @@ export const mapContensisOpts = (opts: any = {}) => ({
13
13
  : undefined,
14
14
  models: opts.modelIds,
15
15
  query:
16
- opts.id || opts.entryIds || opts.phrase || opts.fields
16
+ opts.id ||
17
+ opts.entryIds ||
18
+ opts.phrase ||
19
+ opts.fields ||
20
+ opts.orderBy ||
21
+ opts.paths ||
22
+ opts.assetType ||
23
+ opts.contentType ||
24
+ opts.dataFormat
17
25
  ? {
26
+ assetTypes: opts.assetType,
27
+ contentTypeIds: opts.contentType,
28
+ dataFormats: opts.dataFormat ? [opts.dataFormat] : undefined,
18
29
  fields: opts.fields,
19
30
  includeIds: opts.id || opts.entryIds,
31
+ includePaths: opts.paths,
32
+ orderBy: opts.orderBy,
20
33
  searchTerm: opts.phrase,
21
34
  }
22
35
  : undefined,
@@ -26,64 +39,72 @@ export const mapContensisOpts = (opts: any = {}) => ({
26
39
 
27
40
  /* Output options */
28
41
  const output = new Option(
29
- '-o, --output <output>',
42
+ '-o --output <output>',
30
43
  'save output to a file e.g. --output ./output.txt'
31
44
  );
32
45
 
33
46
  const format = new Option(
34
- '-f, --format <format>',
47
+ '-f --format <format>',
35
48
  'format output as csv, json, xml or table (default)'
36
49
  ).choices(['csv', 'json', 'xml', 'table']);
37
50
 
38
51
  /* Connect options */
39
52
  const alias = new Option(
40
- '-a, --alias <alias>',
53
+ '-a --alias <alias>',
41
54
  'the cloud CMS alias to connect your request with'
42
55
  );
43
56
 
44
57
  export const project = new Option(
45
- '-p, --project-id <projectId>',
58
+ '-p --project-id <projectId>',
46
59
  'the projectId to make your request with'
47
60
  );
48
61
 
49
62
  /* Authentication options */
50
63
  const user = new Option(
51
- '-u, --user <user>',
64
+ '-u --user <user>',
52
65
  'the username to authenticate your request with'
53
66
  );
54
67
  const password = new Option(
55
- '-pw, --password <password>',
68
+ '-pw --password <password>',
56
69
  'the password to use to login with (optional/insecure)'
57
70
  );
58
71
  const clientId = new Option(
59
- '-id, --client-id <clientId>',
72
+ '-id --client-id <clientId>',
60
73
  'the clientId to authenticate your request with'
61
74
  );
62
75
  const sharedSecret = new Option(
63
- '-s, --shared-secret <sharedSecret>',
76
+ '-s --shared-secret <sharedSecret>',
64
77
  'the shared secret to use when logging in with a client id'
65
78
  );
66
79
 
67
80
  /* Entry get options */
68
81
  export const zenql = new Option(
69
- '-q, --zenql <zenql>',
82
+ '-q --zenql <zenql>',
70
83
  'get entries with a supplied ZenQL statement'
71
84
  );
72
85
 
73
86
  export const entryId = new Option('-i --id <id...>', 'the entry id(s) to get');
87
+ export const contentTypes = new Option(
88
+ '-c --content-type <contentType...>',
89
+ 'get entries of these content type(s)'
90
+ );
91
+ export const assetTypes = new Option(
92
+ '-at --asset-type <assetType...>',
93
+ 'get assets of given content type(s) e.g. image word pdf'
94
+ );
74
95
 
75
96
  /* Import options */
76
97
  export const fromFile = new Option(
77
- '-file, --from-file <fromFile>',
98
+ '-file --from-file <fromFile>',
78
99
  'file path to import asset(s) from'
79
100
  );
80
101
 
81
102
  export const fromCms = new Option(
82
- '-source, --source-alias <fromCms>',
103
+ '-source --source-alias <fromCms>',
83
104
  'the cloud CMS alias to import asset(s) from'
84
105
  );
85
106
  export const fromProject = new Option(
86
- '-sp, --source-project-id <fromProject>',
107
+ '-sp --source-project-id <fromProject>',
87
108
  'the id of the Contensis project to import asset(s) from (Default: [last connected project])'
88
109
  );
89
110
 
@@ -111,9 +132,17 @@ export const addImportOptions = (program: Command) => {
111
132
  }
112
133
  return program;
113
134
  };
135
+
136
+ export const getEntryOptions = (command: Command) =>
137
+ command
138
+ .addOption(entryId)
139
+ .addOption(zenql)
140
+ .addOption(contentTypes)
141
+ .addOption(assetTypes);
142
+
114
143
  export const addGetEntryOptions = (program: Command) => {
115
144
  for (const command of program.commands) {
116
- command.addOption(entryId).addOption(zenql);
145
+ getEntryOptions(command);
117
146
  }
118
147
  return program;
119
148
  };
@@ -103,12 +103,12 @@ Example call:
103
103
  )
104
104
  .addOption(commit)
105
105
  .option(
106
- '-preserve, --preserve-guids',
106
+ '-preserve --preserve-guids',
107
107
  'include this flag when you are importing entries that you have previously exported and wish to update'
108
108
  )
109
109
  .addOption(
110
110
  new Option(
111
- '-oe, --output-entries <outputEntries>',
111
+ '-oe --output-entries <outputEntries>',
112
112
  'which details of the entries included in the import to output'
113
113
  )
114
114
  .choices(['errors', 'changes', 'all'])
@@ -12,7 +12,7 @@ export const makeLoginCommand = () => {
12
12
  'the password to use to login with (optional/insecure)'
13
13
  )
14
14
  .option(
15
- '-s, --shared-secret <sharedSecret>',
15
+ '-s --shared-secret <sharedSecret>',
16
16
  'the shared secret to use when logging in with a client id'
17
17
  )
18
18
  .usage('<user/clientId> [password] [-s <sharedSecret>]')
@@ -21,36 +21,36 @@ export const makePushCommand = () => {
21
21
  )
22
22
  .argument('[branch]', 'the branch we are pushing to')
23
23
  .option(
24
- '-r, --release',
24
+ '-r --release',
25
25
  'whether to release the pushed block version',
26
26
  false
27
27
  )
28
28
  .option(
29
- '-cid, --commit-id <commitId>',
29
+ '-cid --commit-id <commitId>',
30
30
  'the id of the source git commit for the supplied image uri'
31
31
  )
32
32
  .option(
33
- '-cmsg, --commit-message <commitMessage>',
33
+ '-cmsg --commit-message <commitMessage>',
34
34
  'the git commit message for the supplied commit id'
35
35
  )
36
36
  .option(
37
- '-cdt, --commit-datetime <commitDateTime>',
37
+ '-cdt --commit-datetime <commitDateTime>',
38
38
  'the timestamp of the source git commit for the supplied image uri'
39
39
  )
40
40
  .option(
41
- '-author, --author-email <authorEmail>',
41
+ '-author --author-email <authorEmail>',
42
42
  'the git email address of the author of the source git commit'
43
43
  )
44
44
  .option(
45
- '-committer, --committer-email <committerEmail>',
45
+ '-committer --committer-email <committerEmail>',
46
46
  'the git email address of the commiter of the source git commit'
47
47
  )
48
48
  .option(
49
- '-repo, --repository-url <repositoryUrl>',
49
+ '-repo --repository-url <repositoryUrl>',
50
50
  'the url of the source repository for the supplied image uri'
51
51
  )
52
52
  .option(
53
- '-pr, --provider <sourceProvider>',
53
+ '-pr --provider <sourceProvider>',
54
54
  'the url of the source repository for the supplied image uri'
55
55
  )
56
56
  .usage('<block-id> <image uri> [branch] [options]')
@@ -167,7 +167,7 @@ Example call:
167
167
  .description('add entry permissions to a role')
168
168
  .argument('<"Role name" or id>', 'the role name or id to update')
169
169
  .option(
170
- '-contenttypes, --content-type-ids [content-type-id...]',
170
+ '-contenttypes --content-type-ids [content-type-id...]',
171
171
  'any content type ids to add permissions for'
172
172
  )
173
173
  .option(
@@ -2307,7 +2307,7 @@ class ContensisCli {
2307
2307
 
2308
2308
  export const cliCommand = (
2309
2309
  commandArgs: string[],
2310
- outputOpts: OutputOptionsConstructorArg,
2310
+ outputOpts?: OutputOptionsConstructorArg,
2311
2311
  contensisOpts: Partial<MigrateRequest> = {}
2312
2312
  ) => {
2313
2313
  return new ContensisCli(['', '', ...commandArgs], outputOpts, contensisOpts);
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const LIB_VERSION = "1.0.0-beta.85";
1
+ export const LIB_VERSION = "1.0.0-beta.86";