Skip to content

Commit 42a8633

Browse files
author
naman-contentstack
committed
chore: fix lint issues
1 parent 77ce3f0 commit 42a8633

40 files changed

Lines changed: 2311 additions & 2091 deletions

.talismanrc

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,34 @@
11
fileignoreconfig:
2-
- filename: packages/contentstack-import/test/unit/utils/extension-helper.test.ts
3-
checksum: c5aad4f28fbab6610d955490f061e647714b88f7b8f8d9cc4dbc3b4a10b9e59a
4-
- filename: packages/contentstack-import/test/unit/import/modules/locales.test.ts
5-
checksum: 0085926464eeb17cda0b9fb5a16853ad9c9aec9a42b54161107d0c808347498f
6-
- filename: packages/contentstack-import/test/unit/import/modules/publishing-rules.test.ts
7-
checksum: 0fcbff5dab2f9e594fe2a316c3c96e8d86bcd5d72e7c1f9eb35c0e3458f87817
2+
- filename: packages/contentstack-export/src/export/modules/environments.ts
3+
checksum: ee579ab17a42580cd74ebfc24dcb5e0500e1f61958abe8cc9890d3144d2a8d3b
4+
- filename: packages/contentstack-export/src/export/modules/workflows.ts
5+
checksum: d62538c6915d14b754c2f3d1d01c71e82361fce19281f41c6b258bbe4225bfc0
6+
- filename: packages/contentstack-export/src/export/modules/labels.ts
7+
checksum: bc3d0e099ff17157e4329ce41b4fb46440ebb48543e8cfc77bc30514eb325c2e
8+
- filename: packages/contentstack-export/src/commands/cm/stacks/export.ts
9+
checksum: 544a1384e9144c09c687152151e976f4f7cfc642abf796cd83d955fd440c6df5
10+
- filename: packages/contentstack-export/src/export/modules/locales.ts
11+
checksum: fde0b7d1e9f857f09e3ae9972513ea3886e72e52fcf574e7f0613e204c29c616
12+
- filename: packages/contentstack-export/src/export/modules/extensions.ts
13+
checksum: 3a130e782b2734822254c24e0ada301261aeb75bcf7338ebd90334e1e200d63f
14+
- filename: packages/contentstack-export/src/utils/basic-login.ts
15+
checksum: 5f654ddc90a4af5e1e65e31f18dcf41897fcd328b096fc38b5b759fb10a6189c
16+
- filename: packages/contentstack-export/src/export/modules/custom-roles.ts
17+
checksum: b392f2ad72f338e54cbf7dcf08290408cb5a7c91087702a429521ea2da48477e
18+
- filename: packages/contentstack-export/src/utils/export-config-handler.ts
19+
checksum: 83e8bef77dfe5171f5549f9e44975508bfb7bba3f8ef110611e995d4783057a8
20+
- filename: packages/contentstack-export/src/export/modules/webhooks.ts
21+
checksum: 84cef1cb7a949460866465d6dc87ee7de77dd7993c72523f6b93ac4b934e611a
22+
- filename: packages/contentstack-export/src/export/modules/stack.ts
23+
checksum: 74c8222bc09563d6407b792fc33445d6664c50060e84d1be85e50206c565dc25
24+
- filename: packages/contentstack-export/src/export/modules/entries.ts
25+
checksum: ffb79e14177a8722e0bcad9e95874cac249a17c6408915e10b1687d7a5cdcc1e
26+
- filename: packages/contentstack-export/src/export/modules/assets.ts
27+
checksum: 8d23c92daea085f5e4c40777f1a1b3f95cf1be0b4caf1e16658d0a763fb96e64
28+
- filename: packages/contentstack-export/src/types/default-config.ts
29+
checksum: cccb5a18f1e191119a636786eb4b70d4f8bfb4cb25c96cd1981d2802ded66932
30+
- filename: packages/contentstack-export/test/unit/export/modules/publishing-rules.test.ts
31+
checksum: 76068c1ca9d0837b5fd3eb98e297c7df6b89d0c2ca30d476c1eadfc6e95ac723
32+
- filename: packages/contentstack-export/src/config/index.ts
33+
checksum: 9148f79ef833f6dae4bbb77c3434e41b0b3c7bfa83877837f60e5c2db888f0bf
834
version: '1.0'

packages/contentstack-export/src/commands/cm/stacks/export.ts

Lines changed: 54 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
import { Command } from '@contentstack/cli-command';
22
import {
3-
cliux,
4-
messageHandler,
5-
printFlagDeprecation,
6-
managementSDKClient,
7-
flags,
83
ContentstackClient,
94
FlagInput,
5+
createLogContext,
6+
flags,
7+
getLogPath,
8+
handleAndLogError,
9+
log,
10+
managementSDKClient,
11+
messageHandler,
1012
pathValidator,
13+
printFlagDeprecation,
1114
sanitizePath,
12-
configHandler,
13-
log,
14-
handleAndLogError,
15-
getLogPath,
16-
createLogContext,
1715
} from '@contentstack/cli-utilities';
1816

1917
import { ModuleExporter } from '../../../export';
2018
import { ExportConfig } from '../../../types';
2119
import { setupExportConfig, writeExportMetaFile } from '../../../utils';
2220

2321
export default class ExportCommand extends Command {
22+
static aliases: string[] = ['cm:export'];
23+
2424
static description: string = messageHandler.parse('Export content from a stack');
2525

2626
static examples: string[] = [
@@ -33,23 +33,39 @@ export default class ExportCommand extends Command {
3333
'csdx cm:stacks:export --branch [optional] branch name',
3434
];
3535

36-
static usage: string =
37-
'cm:stacks:export [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]';
38-
3936
static flags: FlagInput = {
37+
alias: flags.string({
38+
char: 'a',
39+
description: 'The management token alias of the source stack from which you will export content.',
40+
}),
41+
'auth-token': flags.boolean({
42+
char: 'A',
43+
description: 'to use auth token',
44+
hidden: true,
45+
parse: printFlagDeprecation(['-A', '--auth-token']),
46+
}),
47+
branch: flags.string({
48+
char: 'B',
49+
// default: 'main',
50+
description:
51+
"[optional] The name of the branch where you want to export your content. If you don't mention the branch name, then by default the content will be exported from all the branches of your stack.",
52+
exclusive: ['branch-alias'],
53+
parse: printFlagDeprecation(['-B'], ['--branch']),
54+
}),
55+
'branch-alias': flags.string({
56+
description: '(Optional) The alias of the branch from which you want to export content.',
57+
exclusive: ['branch'],
58+
}),
4059
config: flags.string({
4160
char: 'c',
4261
description: '[optional] Path of the config',
4362
}),
44-
'stack-uid': flags.string({
45-
char: 's',
46-
description: 'API key of the source stack',
47-
hidden: true,
48-
parse: printFlagDeprecation(['-s', '--stack-uid'], ['-k', '--stack-api-key']),
49-
}),
50-
'stack-api-key': flags.string({
51-
char: 'k',
52-
description: 'API Key of the source stack',
63+
'content-types': flags.string({
64+
char: 't',
65+
description:
66+
'[optional] The UID of the content type(s) whose content you want to export. In case of multiple content types, specify the IDs separated by spaces.',
67+
multiple: true,
68+
parse: printFlagDeprecation(['-t'], ['--content-types']),
5369
}),
5470
data: flags.string({
5571
description: 'path or location to store the data',
@@ -60,61 +76,43 @@ export default class ExportCommand extends Command {
6076
char: 'd',
6177
description: 'The path or the location in your file system to store the exported content. For e.g., ./content',
6278
}),
63-
alias: flags.string({
64-
char: 'a',
65-
description: 'The management token alias of the source stack from which you will export content.',
66-
}),
6779
'management-token-alias': flags.string({
6880
description: 'alias of the management token',
6981
hidden: true,
7082
parse: printFlagDeprecation(['--management-token-alias'], ['-a', '--alias']),
7183
}),
72-
'auth-token': flags.boolean({
73-
char: 'A',
74-
description: 'to use auth token',
75-
hidden: true,
76-
parse: printFlagDeprecation(['-A', '--auth-token']),
77-
}),
7884
module: flags.string({
7985
char: 'm',
8086
description:
8187
'[optional] Specific module name. If not specified, the export command will export all the modules to the stack. The available modules are assets, content-types, entries, environments, extensions, marketplace-apps, global-fields, labels, locales, webhooks, workflows, custom-roles, taxonomies, and studio.',
8288
parse: printFlagDeprecation(['-m'], ['--module']),
8389
}),
84-
'content-types': flags.string({
85-
char: 't',
86-
description:
87-
'[optional] The UID of the content type(s) whose content you want to export. In case of multiple content types, specify the IDs separated by spaces.',
88-
multiple: true,
89-
parse: printFlagDeprecation(['-t'], ['--content-types']),
90-
}),
91-
branch: flags.string({
92-
char: 'B',
93-
// default: 'main',
94-
description:
95-
"[optional] The name of the branch where you want to export your content. If you don't mention the branch name, then by default the content will be exported from all the branches of your stack.",
96-
parse: printFlagDeprecation(['-B'], ['--branch']),
97-
exclusive: ['branch-alias'],
98-
}),
99-
'branch-alias': flags.string({
100-
description: '(Optional) The alias of the branch from which you want to export content.',
101-
exclusive: ['branch'],
90+
query: flags.string({
91+
description: '[optional] Query object (inline JSON or file path) to filter module exports.',
92+
hidden: true,
10293
}),
10394
'secured-assets': flags.boolean({
10495
description: '[optional] Use this flag for assets that are secured.',
10596
}),
97+
'stack-api-key': flags.string({
98+
char: 'k',
99+
description: 'API Key of the source stack',
100+
}),
101+
'stack-uid': flags.string({
102+
char: 's',
103+
description: 'API key of the source stack',
104+
hidden: true,
105+
parse: printFlagDeprecation(['-s', '--stack-uid'], ['-k', '--stack-api-key']),
106+
}),
106107
yes: flags.boolean({
107108
char: 'y',
108-
required: false,
109109
description: '[optional] Force override all Marketplace prompts.',
110-
}),
111-
query: flags.string({
112-
description: '[optional] Query object (inline JSON or file path) to filter module exports.',
113-
hidden: true,
110+
required: false,
114111
}),
115112
};
116113

117-
static aliases: string[] = ['cm:export'];
114+
static usage =
115+
'cm:stacks:export [-c <value>] [-k <value>] [-d <value>] [-a <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]';
118116

119117
async run(): Promise<void> {
120118
let exportDir: string = pathValidator('logs');

0 commit comments

Comments
 (0)