@takeshape/cli 8.246.2 → 8.249.0
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.
- package/dist/commands/import/schema-import.d.ts.map +1 -1
- package/dist/commands/import/schema-import.js +6 -3
- package/dist/index.js +4 -3
- package/dist/options.d.ts +3 -0
- package/dist/options.d.ts.map +1 -1
- package/dist/options.js +3 -0
- package/dist/util/api.d.ts.map +1 -1
- package/dist/util/api.js +7 -3
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-import.d.ts","sourceRoot":"","sources":["../../../../src/commands/import/schema-import.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"schema-import.d.ts","sourceRoot":"","sources":["../../../../src/commands/import/schema-import.ts"],"names":[],"mappings":";AAqBA,wBAkCG"}
|
|
@@ -33,7 +33,8 @@ takeshape import --schema --from ./path/to/schema.json
|
|
|
33
33
|
Replace your project's schema by uploading a new one
|
|
34
34
|
|
|
35
35
|
Flags:
|
|
36
|
-
--from
|
|
36
|
+
--from Directory containing a schema.json or path to schema.json file
|
|
37
|
+
--preserveAuth Do not overwrite service authentication
|
|
37
38
|
*/
|
|
38
39
|
var _default = (0, _linkedCommand.linkedCommand)(async (cli, params) => {
|
|
39
40
|
const {
|
|
@@ -60,14 +61,16 @@ var _default = (0, _linkedCommand.linkedCommand)(async (cli, params) => {
|
|
|
60
61
|
|
|
61
62
|
try {
|
|
62
63
|
const newSchema = JSON.parse(_fsExtra.default.readFileSync(file).toString());
|
|
63
|
-
const validationString = (0, _formatValidationResult.formatValidationResult)((0, _schema.validateSchema)(newSchema
|
|
64
|
+
const validationString = (0, _formatValidationResult.formatValidationResult)((0, _schema.validateSchema)(newSchema, {
|
|
65
|
+
suppressErrorPaths: [..._schema.projectSchemaImportOptionalProps]
|
|
66
|
+
}));
|
|
64
67
|
|
|
65
68
|
if (validationString) {
|
|
66
69
|
return (0, _fatalError.fatalError)(validationString);
|
|
67
70
|
}
|
|
68
71
|
|
|
69
72
|
(0, _log.default)(`Uploading schema from ${file}…\n`);
|
|
70
|
-
const schemaImportPath = `${(0, _branches.getBranchBasePath)(branchParams, projectId)}/schema?force=true`;
|
|
73
|
+
const schemaImportPath = `${(0, _branches.getBranchBasePath)(branchParams, projectId)}/schema?force=true&preserveAuth=${Boolean(flags.preserveAuth)}`;
|
|
71
74
|
const uploaded = await (0, _api.default)(params, 'POST', schemaImportPath, newSchema);
|
|
72
75
|
(0, _log.default)(_chalk.default.green('Success!'), `Schema updated to version ${uploaded.version}.`);
|
|
73
76
|
process.exit(0);
|
package/dist/index.js
CHANGED
|
@@ -74,9 +74,10 @@ const help = `
|
|
|
74
74
|
--schema import a takeshape schema from a directory or JSON file to the currently linked project
|
|
75
75
|
--roles import roles from a directory or JSON file to the currently linked project
|
|
76
76
|
|
|
77
|
-
--from
|
|
78
|
-
--to
|
|
79
|
-
--name
|
|
77
|
+
--from specifies the file, directory, zip or url to import (required)
|
|
78
|
+
--to either "new-project" or "current-project" (default "new-project")
|
|
79
|
+
--name for use with --project specifies a new name for the imported project
|
|
80
|
+
--preserveAuth do not overwrite service authentication
|
|
80
81
|
|
|
81
82
|
export Options
|
|
82
83
|
One of
|
package/dist/options.d.ts
CHANGED
package/dist/options.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,MAAM,CAAC;AAE5B,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,MAAM,CAAC;AAE5B,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0EV,CAAC;AAEX,oBAAY,KAAK,GAAG,OAAO,OAAO,CAAC,KAAK,CAAC;AACzC,oBAAY,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,GAAG;IAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;CAAC,CAAC"}
|
package/dist/options.js
CHANGED
package/dist/util/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/util/api.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAC;AAanC,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAG1C;AAED,wBAAgB,aAAa,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMxE;AAED,wBAA8B,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/util/api.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAC;AAanC,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAG1C;AAED,wBAAgB,aAAa,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMxE;AAED,wBAA8B,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CA6B3G"}
|
package/dist/util/api.js
CHANGED
|
@@ -59,10 +59,14 @@ async function api(params, method, path, body) {
|
|
|
59
59
|
const res = await (0, _nodeFetch.default)(endpoint, requestParams);
|
|
60
60
|
|
|
61
61
|
if (res.ok) {
|
|
62
|
-
const
|
|
62
|
+
const contentLengthHeader = res.headers.get('content-length');
|
|
63
63
|
|
|
64
|
-
if (
|
|
65
|
-
|
|
64
|
+
if (contentLengthHeader !== null) {
|
|
65
|
+
const contentLength = parseInt(contentLengthHeader, 10);
|
|
66
|
+
|
|
67
|
+
if (contentLength === 0) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
return res.json();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takeshape/cli",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.249.0",
|
|
4
4
|
"description": "TakeShape CLI",
|
|
5
5
|
"homepage": "https://www.takeshape.io",
|
|
6
6
|
"repository": {
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"@graphql-codegen/typescript": "^2.4.5",
|
|
26
26
|
"@graphql-tools/graphql-file-loader": "^7.3.3",
|
|
27
27
|
"@graphql-tools/load": "^7.5.1",
|
|
28
|
-
"@takeshape/schema": "8.
|
|
29
|
-
"@takeshape/ssg": "8.
|
|
30
|
-
"@takeshape/streams": "8.
|
|
31
|
-
"@takeshape/util": "8.
|
|
28
|
+
"@takeshape/schema": "8.249.0",
|
|
29
|
+
"@takeshape/ssg": "8.249.0",
|
|
30
|
+
"@takeshape/streams": "8.249.0",
|
|
31
|
+
"@takeshape/util": "8.249.0",
|
|
32
32
|
"archiver": "^1.3.0",
|
|
33
33
|
"async-retry": "^1.2.1",
|
|
34
34
|
"bluebird": "^3.4.6",
|