Skip to content

Commit 3c9eff7

Browse files
authored
Merge pull request #156 from contentstack/fix/query-export
fixed management token support in export query, fixed mapping of asse…
2 parents 932c4cf + 2fbd5ed commit 3c9eff7

10 files changed

Lines changed: 30 additions & 22 deletions

File tree

packages/contentstack-bootstrap/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@contentstack/cli-cm-bootstrap",
33
"description": "Bootstrap contentstack apps",
4-
"version": "1.19.3",
4+
"version": "1.19.4",
55
"author": "Contentstack",
66
"bugs": "https://github.com/contentstack/cli/issues",
77
"scripts": {
@@ -16,7 +16,7 @@
1616
"test:report": "nyc --reporter=lcov mocha \"test/**/*.test.js\""
1717
},
1818
"dependencies": {
19-
"@contentstack/cli-cm-seed": "~1.15.3",
19+
"@contentstack/cli-cm-seed": "~1.15.4",
2020
"@contentstack/cli-command": "~1.8.2",
2121
"@contentstack/cli-config": "~1.20.3",
2222
"@contentstack/cli-utilities": "~1.18.3",
@@ -69,4 +69,4 @@
6969
}
7070
},
7171
"repository": "contentstack/cli"
72-
}
72+
}

packages/contentstack-clone/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "@contentstack/cli-cm-clone",
33
"description": "Contentstack stack clone plugin",
4-
"version": "1.21.4",
4+
"version": "1.21.5",
55
"author": "Contentstack",
66
"bugs": "https://github.com/rohitmishra209/cli-cm-clone/issues",
77
"dependencies": {
88
"@colors/colors": "^1.6.0",
99
"@contentstack/cli-cm-export": "~1.25.0",
10-
"@contentstack/cli-cm-import": "~1.33.0",
10+
"@contentstack/cli-cm-import": "~1.33.1",
1111
"@contentstack/cli-command": "~1.8.2",
1212
"@contentstack/cli-utilities": "~1.18.3",
1313
"@oclif/core": "^4.10.5",
@@ -81,4 +81,4 @@
8181
"cm:stack-clone": "O-CLN"
8282
}
8383
}
84-
}
84+
}

packages/contentstack-import/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@contentstack/cli-cm-import",
33
"description": "Contentstack CLI plugin to import content into stack",
4-
"version": "1.33.0",
4+
"version": "1.33.1",
55
"author": "Contentstack",
66
"bugs": "https://github.com/contentstack/cli/issues",
77
"dependencies": {
@@ -89,4 +89,4 @@
8989
}
9090
},
9191
"repository": "https://github.com/contentstack/cli"
92-
}
92+
}

packages/contentstack-import/src/utils/asset-helper.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,12 @@ export const lookupAssets = function (
266266
}
267267

268268
find(data.content_type.schema, data.entry);
269+
// findFileUrls scans the whole entry object, but is only triggered inside find() when a
270+
// text field has markdown/rich_text_type metadata. Content types with no such fields
271+
// (e.g. those storing asset URLs in plain text fields) never call findFileUrls, so URLs
272+
// in those fields are never collected. Calling it once unconditionally here ensures all
273+
// asset URLs in the entry are always captured, regardless of schema shape.
274+
findFileUrls({ field_metadata: {} }, data.entry, assetUrls);
269275
updateFileFields(data.entry, data, null, mappedAssetUids, matchedUids, unmatchedUids, mappedAssetUrls);
270276
assetUids = _.uniq(assetUids);
271277
assetUrls = _.uniq(assetUrls);

packages/contentstack-query-export/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@contentstack/cli-cm-export-query",
33
"description": "Contentstack CLI plugin to export content from stack",
4-
"version": "1.0.1",
4+
"version": "1.0.2",
55
"author": "Contentstack",
66
"bugs": "https://github.com/contentstack/cli/issues",
77
"dependencies": {
@@ -99,4 +99,4 @@
9999
}
100100
},
101101
"repository": "https://github.com/contentstack/cli"
102-
}
102+
}

packages/contentstack-query-export/src/core/module-exporter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class ModuleExporter {
7373
if (options.alias) {
7474
cmd.push('-a', options.alias);
7575
} else if (this.exportQueryConfig.managementToken) {
76-
cmd.push('-a', this.exportQueryConfig.managementToken);
76+
cmd.push('-a', this.exportQueryConfig.alias);
7777
}
7878

7979
// Branch

packages/contentstack-query-export/src/types/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ export interface QueryExportConfig extends DefaultConfig {
203203
batchDelayMs?: number;
204204
assetBatchSize?: number;
205205
assetBatchDelayMs?: number;
206+
alias?: string;
206207
context?: LogContext; // Log context for centralized logging
207208
}
208209

packages/contentstack-query-export/src/utils/config-handler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export async function setupQueryExportConfig(flags: any): Promise<QueryExportCon
3737
const { token, apiKey } = configHandler.get(`tokens.${flags.alias}`) || {};
3838
exportQueryConfig.managementToken = token;
3939
exportQueryConfig.stackApiKey = apiKey;
40+
exportQueryConfig.alias = flags.alias;
4041
if (!exportQueryConfig.managementToken) {
4142
throw new Error(`No management token found for alias ${flags.alias}.`);
4243
}

packages/contentstack-seed/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "@contentstack/cli-cm-seed",
33
"description": "create a Stack from existing content types, entries, assets, etc.",
4-
"version": "1.15.3",
4+
"version": "1.15.4",
55
"author": "Contentstack",
66
"bugs": "https://github.com/contentstack/cli/issues",
77
"dependencies": {
8-
"@contentstack/cli-cm-import": "~1.33.0",
8+
"@contentstack/cli-cm-import": "~1.33.1",
99
"@contentstack/cli-command": "~1.8.2",
1010
"@contentstack/cli-utilities": "~1.18.3",
1111
"inquirer": "8.2.7",
@@ -70,4 +70,4 @@
7070
"compile": "tsc -b tsconfig.json",
7171
"build": "pnpm compile && oclif manifest && oclif readme"
7272
}
73-
}
73+
}

pnpm-lock.yaml

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)