@takeshape/cli 10.2.23 → 10.2.24
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/branch/commands/create.js +2 -3
- package/dist/commands/branch/commands/delete.js +2 -3
- package/dist/commands/branch/commands/list.js +2 -3
- package/dist/commands/branch/commands/merge.js +2 -3
- package/dist/commands/branch/commands/promote.js +2 -3
- package/dist/commands/branch/commands/tag-version.js +2 -3
- package/dist/commands/branch/commands/url.js +3 -5
- package/dist/commands/branch/index.js +1 -2
- package/dist/commands/build-or-watch.js +2 -3
- package/dist/commands/deploy/index.js +2 -3
- package/dist/commands/export/index.js +1 -2
- package/dist/commands/export/project-export.js +2 -3
- package/dist/commands/export/schema-export.js +2 -3
- package/dist/commands/import/index.js +1 -2
- package/dist/commands/import/project-import.js +2 -3
- package/dist/commands/import/roles-import.js +2 -3
- package/dist/commands/import/schema-import.js +2 -3
- package/dist/commands/link.js +2 -3
- package/dist/commands/login.js +1 -2
- package/dist/commands/logout.js +1 -2
- package/dist/commands/schema.js +2 -3
- package/dist/commands/status.js +2 -3
- package/dist/commands/types.js +2 -3
- package/dist/commands/unlink.js +1 -2
- package/dist/commands/validate.js +1 -2
- package/dist/config.js +2 -4
- package/dist/graphql.js +4 -8
- package/dist/log.js +1 -2
- package/dist/options.js +2 -3
- package/dist/util/data.js +8 -16
- package/dist/util/generate-types.js +2 -3
- package/dist/util/get-client-schema.js +2 -4
- package/dist/util/login.js +2 -4
- package/dist/util/messages.js +6 -12
- package/dist/util/spin.js +1 -2
- package/package.json +7 -7
|
@@ -24,7 +24,7 @@ mutation ($input: TSCreateSchemaBranchInput!) {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
`);
|
|
27
|
-
const createBranch = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, params) => {
|
|
27
|
+
const createBranch = exports.createBranch = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, params) => {
|
|
28
28
|
const {
|
|
29
29
|
branch,
|
|
30
30
|
environment
|
|
@@ -52,5 +52,4 @@ const createBranch = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, pa
|
|
|
52
52
|
} catch (e) {
|
|
53
53
|
(0, _fatalError.fatalError)(e.message);
|
|
54
54
|
}
|
|
55
|
-
});
|
|
56
|
-
exports.createBranch = createBranch;
|
|
55
|
+
});
|
|
@@ -20,7 +20,7 @@ mutation ($input: TSDeleteSchemaBranchInput!) {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
`);
|
|
23
|
-
const deleteBranch = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, params) => {
|
|
23
|
+
const deleteBranch = exports.deleteBranch = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, params) => {
|
|
24
24
|
const {
|
|
25
25
|
branch,
|
|
26
26
|
environment
|
|
@@ -43,5 +43,4 @@ const deleteBranch = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, pa
|
|
|
43
43
|
} else {
|
|
44
44
|
(0, _log.default)(_chalk.default.green(`Branch "${branchName}" not found, no action taken`));
|
|
45
45
|
}
|
|
46
|
-
});
|
|
47
|
-
exports.deleteBranch = deleteBranch;
|
|
46
|
+
});
|
|
@@ -26,7 +26,7 @@ const getBranchListQuery = (0, _graphql.graphQLQuery)(`
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
`);
|
|
29
|
-
const listBranches = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, params) => {
|
|
29
|
+
const listBranches = exports.listBranches = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, params) => {
|
|
30
30
|
const client = (0, _graphql.createAdminConnector)(params, params.authToken, params.projectId);
|
|
31
31
|
const {
|
|
32
32
|
nodes: branches
|
|
@@ -41,5 +41,4 @@ const listBranches = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, pa
|
|
|
41
41
|
'Version URL': branch.latestVersion.graphqlUrl
|
|
42
42
|
}));
|
|
43
43
|
}
|
|
44
|
-
});
|
|
45
|
-
exports.listBranches = listBranches;
|
|
44
|
+
});
|
|
@@ -53,7 +53,7 @@ function ensureHeadArgs(cli) {
|
|
|
53
53
|
}
|
|
54
54
|
return (0, _branches.getBranchArgs)(cli.flags.head);
|
|
55
55
|
}
|
|
56
|
-
const mergeBranch = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, params) => {
|
|
56
|
+
const mergeBranch = exports.mergeBranch = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, params) => {
|
|
57
57
|
try {
|
|
58
58
|
const {
|
|
59
59
|
dryRun,
|
|
@@ -128,5 +128,4 @@ const mergeBranch = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, par
|
|
|
128
128
|
} catch (e) {
|
|
129
129
|
(0, _fatalError.fatalError)(e.message);
|
|
130
130
|
}
|
|
131
|
-
});
|
|
132
|
-
exports.mergeBranch = mergeBranch;
|
|
131
|
+
});
|
|
@@ -20,7 +20,7 @@ mutation ($input: TSPromoteSchemaBranchInput!) {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
`);
|
|
23
|
-
const promoteBranch = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, params) => {
|
|
23
|
+
const promoteBranch = exports.promoteBranch = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, params) => {
|
|
24
24
|
const {
|
|
25
25
|
branch,
|
|
26
26
|
environment
|
|
@@ -36,5 +36,4 @@ const promoteBranch = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, p
|
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
(0, _log.default)(_chalk.default.green(`Branch "${branch ?? environment.toLowerCase()}" was promoted to production!`));
|
|
39
|
-
});
|
|
40
|
-
exports.promoteBranch = promoteBranch;
|
|
39
|
+
});
|
|
@@ -17,7 +17,7 @@ const createBranchTag = (0, _graphql.graphQLQuery)( /* GraphQL */`
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
`);
|
|
20
|
-
const tagBranchVersion = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, params) => {
|
|
20
|
+
const tagBranchVersion = exports.tagBranchVersion = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, params) => {
|
|
21
21
|
const {
|
|
22
22
|
branch,
|
|
23
23
|
environment
|
|
@@ -46,5 +46,4 @@ const tagBranchVersion = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli
|
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
process.stdout.write(graphqlUrl);
|
|
49
|
-
});
|
|
50
|
-
exports.tagBranchVersion = tagBranchVersion;
|
|
49
|
+
});
|
|
@@ -27,7 +27,7 @@ const getBranchQuery = (0, _graphql.graphQLQuery)( /* GraphQL */`
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
`);
|
|
30
|
-
const getVersionUrl = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, params) => {
|
|
30
|
+
const getVersionUrl = exports.getVersionUrl = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, params) => {
|
|
31
31
|
const {
|
|
32
32
|
branch,
|
|
33
33
|
environment
|
|
@@ -50,8 +50,7 @@ const getVersionUrl = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, p
|
|
|
50
50
|
}
|
|
51
51
|
process.stdout.write(result.graphqlUrl);
|
|
52
52
|
});
|
|
53
|
-
exports.
|
|
54
|
-
const getUrl = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, params) => {
|
|
53
|
+
const getUrl = exports.getUrl = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, params) => {
|
|
55
54
|
const {
|
|
56
55
|
branch,
|
|
57
56
|
environment
|
|
@@ -65,5 +64,4 @@ const getUrl = (0, _linkedCommand.loggedInAndLinkedCommand)(async (cli, params)
|
|
|
65
64
|
return (0, _fatalError.fatalError)('Branch does not exist');
|
|
66
65
|
}
|
|
67
66
|
process.stdout.write(result.graphqlUrl);
|
|
68
|
-
});
|
|
69
|
-
exports.getUrl = getUrl;
|
|
67
|
+
});
|
|
@@ -27,7 +27,7 @@ function buildHandler(config, params) {
|
|
|
27
27
|
return (0, _files.writePages)(config.buildPath)(pages);
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
var _default = (0, _linkedCommand.linkedCommand)(async (cli, params) => {
|
|
30
|
+
var _default = exports.default = (0, _linkedCommand.linkedCommand)(async (cli, params) => {
|
|
31
31
|
const command = cli.input[0];
|
|
32
32
|
const sitePath = _path.default.dirname(params.configFilePath);
|
|
33
33
|
const fileLoader = (0, _ssg.createFileSystemLoader)(sitePath);
|
|
@@ -51,5 +51,4 @@ var _default = (0, _linkedCommand.linkedCommand)(async (cli, params) => {
|
|
|
51
51
|
await (0, _pusher.subscribe)(params, build.bind(null, true));
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
});
|
|
55
|
-
exports.default = _default;
|
|
54
|
+
});
|
|
@@ -29,7 +29,7 @@ function successMessage({
|
|
|
29
29
|
(0, _log.default)(`Deploy Size: ${_chalk.default.green((0, _prettyBytes.default)(zipSize))}`);
|
|
30
30
|
(0, _log.default)(`Files Deployed: ${_chalk.default.green(`${fileCount}`)}`);
|
|
31
31
|
}
|
|
32
|
-
var _default = (0, _linkedCommand.linkedCommand)(async (_, params) => {
|
|
32
|
+
var _default = exports.default = (0, _linkedCommand.linkedCommand)(async (_, params) => {
|
|
33
33
|
if (!params.siteId || !params.siteName) {
|
|
34
34
|
(0, _log.default)('Error: no site selected. Please run `takeshape link`.');
|
|
35
35
|
process.exit(1);
|
|
@@ -52,5 +52,4 @@ var _default = (0, _linkedCommand.linkedCommand)(async (_, params) => {
|
|
|
52
52
|
(0, _log.default)('An error occurred with deploying - ', e);
|
|
53
53
|
process.exit(1);
|
|
54
54
|
}
|
|
55
|
-
});
|
|
56
|
-
exports.default = _default;
|
|
55
|
+
});
|
|
@@ -46,7 +46,7 @@ Options:
|
|
|
46
46
|
--without-data: download an empty project, defaults to false
|
|
47
47
|
--to: the path to save the download, defaults to current directory
|
|
48
48
|
*/
|
|
49
|
-
var _default = (0, _linkedCommand.loggedInCommand)(async (cli, params) => {
|
|
49
|
+
var _default = exports.default = (0, _linkedCommand.loggedInCommand)(async (cli, params) => {
|
|
50
50
|
const {
|
|
51
51
|
flags
|
|
52
52
|
} = cli;
|
|
@@ -85,5 +85,4 @@ var _default = (0, _linkedCommand.loggedInCommand)(async (cli, params) => {
|
|
|
85
85
|
(0, _log.default)(_chalk.default.red('Error: ', error.message));
|
|
86
86
|
process.exit(1);
|
|
87
87
|
}
|
|
88
|
-
});
|
|
89
|
-
exports.default = _default;
|
|
88
|
+
});
|
|
@@ -24,7 +24,7 @@ Download your project's schema.
|
|
|
24
24
|
Options:
|
|
25
25
|
--to: the path to save the download or the full file path, defaults to current directory
|
|
26
26
|
*/
|
|
27
|
-
var _default = (0, _linkedCommand.loggedInCommand)(async (cli, params) => {
|
|
27
|
+
var _default = exports.default = (0, _linkedCommand.loggedInCommand)(async (cli, params) => {
|
|
28
28
|
const {
|
|
29
29
|
flags
|
|
30
30
|
} = cli;
|
|
@@ -63,5 +63,4 @@ var _default = (0, _linkedCommand.loggedInCommand)(async (cli, params) => {
|
|
|
63
63
|
} catch (e) {
|
|
64
64
|
return (0, _fatalError.fatalError)(e.message);
|
|
65
65
|
}
|
|
66
|
-
});
|
|
67
|
-
exports.default = _default;
|
|
66
|
+
});
|
|
@@ -104,7 +104,7 @@ Flags:
|
|
|
104
104
|
--name Provides a name for the newly imported project.
|
|
105
105
|
Otherwise, the import will use the name in the pattern.yml file.
|
|
106
106
|
*/
|
|
107
|
-
var _default = (0, _linkedCommand.loggedInCommand)(async (cli, params) => {
|
|
107
|
+
var _default = exports.default = (0, _linkedCommand.loggedInCommand)(async (cli, params) => {
|
|
108
108
|
const {
|
|
109
109
|
flags
|
|
110
110
|
} = cli;
|
|
@@ -157,5 +157,4 @@ var _default = (0, _linkedCommand.loggedInCommand)(async (cli, params) => {
|
|
|
157
157
|
} catch (error) {
|
|
158
158
|
return (0, _fatalError.fatalError)(error.message);
|
|
159
159
|
}
|
|
160
|
-
});
|
|
161
|
-
exports.default = _default;
|
|
160
|
+
});
|
|
@@ -14,7 +14,7 @@ var _schema = require("@takeshape/schema");
|
|
|
14
14
|
var _fs = require("../../util/fs");
|
|
15
15
|
var _branches = require("../../util/branches");
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
var _default = (0, _linkedCommand.linkedCommand)(async (cli, params) => {
|
|
17
|
+
var _default = exports.default = (0, _linkedCommand.linkedCommand)(async (cli, params) => {
|
|
18
18
|
const {
|
|
19
19
|
flags
|
|
20
20
|
} = cli;
|
|
@@ -38,5 +38,4 @@ var _default = (0, _linkedCommand.linkedCommand)(async (cli, params) => {
|
|
|
38
38
|
} catch (e) {
|
|
39
39
|
return (0, _fatalError.fatalError)(e.message);
|
|
40
40
|
}
|
|
41
|
-
});
|
|
42
|
-
exports.default = _default;
|
|
41
|
+
});
|
|
@@ -25,7 +25,7 @@ Flags:
|
|
|
25
25
|
--from Directory containing a schema.json or path to schema.json file
|
|
26
26
|
--preserveAuth Do not overwrite service authentication
|
|
27
27
|
*/
|
|
28
|
-
var _default = (0, _linkedCommand.linkedCommand)(async (cli, params) => {
|
|
28
|
+
var _default = exports.default = (0, _linkedCommand.linkedCommand)(async (cli, params) => {
|
|
29
29
|
const {
|
|
30
30
|
flags
|
|
31
31
|
} = cli;
|
|
@@ -66,5 +66,4 @@ var _default = (0, _linkedCommand.linkedCommand)(async (cli, params) => {
|
|
|
66
66
|
} catch (e) {
|
|
67
67
|
return (0, _fatalError.fatalError)(e.message);
|
|
68
68
|
}
|
|
69
|
-
});
|
|
70
|
-
exports.default = _default;
|
|
69
|
+
});
|
package/dist/commands/link.js
CHANGED
|
@@ -11,7 +11,7 @@ var _config = require("../config");
|
|
|
11
11
|
var _linkedCommand = require("../util/linked-command");
|
|
12
12
|
var _selectProject = require("../util/select-project");
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
var _default = (0, _linkedCommand.loggedInCommand)(async (_, params) => {
|
|
14
|
+
var _default = exports.default = (0, _linkedCommand.loggedInCommand)(async (_, params) => {
|
|
15
15
|
try {
|
|
16
16
|
const project = await (0, _selectProject.selectProject)(params);
|
|
17
17
|
if (!project) {
|
|
@@ -43,5 +43,4 @@ var _default = (0, _linkedCommand.loggedInCommand)(async (_, params) => {
|
|
|
43
43
|
} catch (e) {
|
|
44
44
|
(0, _log.default)(e);
|
|
45
45
|
}
|
|
46
|
-
});
|
|
47
|
-
exports.default = _default;
|
|
46
|
+
});
|
package/dist/commands/login.js
CHANGED
package/dist/commands/logout.js
CHANGED
package/dist/commands/schema.js
CHANGED
|
@@ -9,10 +9,9 @@ var _connector = require("../util/connector");
|
|
|
9
9
|
var _getClientSchema = _interopRequireDefault(require("../util/get-client-schema"));
|
|
10
10
|
var _branches = require("../util/branches");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
var _default = (0, _linkedCommand.linkedCommand)(async (cli, params) => {
|
|
12
|
+
var _default = exports.default = (0, _linkedCommand.linkedCommand)(async (cli, params) => {
|
|
13
13
|
const connector = (0, _connector.createConnector)(params, (0, _branches.getBranchParams)(cli), {
|
|
14
14
|
cache: false
|
|
15
15
|
});
|
|
16
16
|
await (0, _getClientSchema.default)(connector);
|
|
17
|
-
});
|
|
18
|
-
exports.default = _default;
|
|
17
|
+
});
|
package/dist/commands/status.js
CHANGED
|
@@ -7,7 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
var _linkedCommand = require("../util/linked-command");
|
|
8
8
|
var _log = _interopRequireDefault(require("../log"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
var _default = (0, _linkedCommand.linkedCommand)(async (cli, params) => {
|
|
10
|
+
var _default = exports.default = (0, _linkedCommand.linkedCommand)(async (cli, params) => {
|
|
11
11
|
(0, _log.default)(`Project: ${params.projectName} \nStatic Site: ${params.siteName ?? 'not configured'}`);
|
|
12
|
-
});
|
|
13
|
-
exports.default = _default;
|
|
12
|
+
});
|
package/dist/commands/types.js
CHANGED
|
@@ -18,8 +18,7 @@ Options:
|
|
|
18
18
|
--in: if provided, will generate types used
|
|
19
19
|
--to: the path to save the download or the full file path, defaults to current directory
|
|
20
20
|
*/
|
|
21
|
-
var _default = (0, _linkedCommand.linkedCommand)(async cli => {
|
|
21
|
+
var _default = exports.default = (0, _linkedCommand.linkedCommand)(async cli => {
|
|
22
22
|
const output = cli.flags.to ?? DEFAULT_GENERATED_FILE;
|
|
23
23
|
await (0, _generateTypes.generateTypes)(_getClientSchema.SCHEMA_FILE_NAME, output);
|
|
24
|
-
});
|
|
25
|
-
exports.default = _default;
|
|
24
|
+
});
|
package/dist/commands/unlink.js
CHANGED
package/dist/config.js
CHANGED
|
@@ -21,10 +21,8 @@ var _connector = require("./util/connector");
|
|
|
21
21
|
var _getClientSchema = _interopRequireDefault(require("./util/get-client-schema"));
|
|
22
22
|
var _ignore = _interopRequireDefault(require("ignore"));
|
|
23
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
-
const TAKESHAPE_CONFIG_FILENAME = '.takeshaperc';
|
|
25
|
-
exports.
|
|
26
|
-
const GRAPHQL_CONFIG_FILENAME = '.graphqlconfig';
|
|
27
|
-
exports.GRAPHQL_CONFIG_FILENAME = GRAPHQL_CONFIG_FILENAME;
|
|
24
|
+
const TAKESHAPE_CONFIG_FILENAME = exports.TAKESHAPE_CONFIG_FILENAME = '.takeshaperc';
|
|
25
|
+
const GRAPHQL_CONFIG_FILENAME = exports.GRAPHQL_CONFIG_FILENAME = '.graphqlconfig';
|
|
28
26
|
function getHomeConfigPath() {
|
|
29
27
|
return _path.default.join(_os.default.homedir(), TAKESHAPE_CONFIG_FILENAME);
|
|
30
28
|
}
|
package/dist/graphql.js
CHANGED
|
@@ -20,10 +20,8 @@ const getGraphQLEndpointFactory = (path, useBranch) => (params, pathParams) => {
|
|
|
20
20
|
const basePath = projectId ? useBranch ? (0, _branches2.getBranchBasePath)(branchParams, projectId) : `/project/${projectId}` : '';
|
|
21
21
|
return `${params.endpoint}${basePath}${path}`;
|
|
22
22
|
};
|
|
23
|
-
const getGraphQLEndpoint = getGraphQLEndpointFactory('/graphql', true);
|
|
24
|
-
exports.
|
|
25
|
-
const getGraphQLAdminEndpoint = getGraphQLEndpointFactory('/admin-graphql', false);
|
|
26
|
-
exports.getGraphQLAdminEndpoint = getGraphQLAdminEndpoint;
|
|
23
|
+
const getGraphQLEndpoint = exports.getGraphQLEndpoint = getGraphQLEndpointFactory('/graphql', true);
|
|
24
|
+
const getGraphQLAdminEndpoint = exports.getGraphQLAdminEndpoint = getGraphQLEndpointFactory('/admin-graphql', false);
|
|
27
25
|
const defaultOptions = {
|
|
28
26
|
retries: 3,
|
|
29
27
|
timeout: 0
|
|
@@ -66,10 +64,8 @@ const createConnectorFactory = getGraphQLEndpoint => (params, authToken, pathPar
|
|
|
66
64
|
});
|
|
67
65
|
};
|
|
68
66
|
exports.createConnectorFactory = createConnectorFactory;
|
|
69
|
-
const createConnector = createConnectorFactory(getGraphQLEndpoint);
|
|
70
|
-
exports.
|
|
71
|
-
const createAdminConnector = createConnectorFactory(getGraphQLAdminEndpoint);
|
|
72
|
-
exports.createAdminConnector = createAdminConnector;
|
|
67
|
+
const createConnector = exports.createConnector = createConnectorFactory(getGraphQLEndpoint);
|
|
68
|
+
const createAdminConnector = exports.createAdminConnector = createConnectorFactory(getGraphQLAdminEndpoint);
|
|
73
69
|
function graphQLQuery(query) {
|
|
74
70
|
return async (client, variables) => {
|
|
75
71
|
const {
|
package/dist/log.js
CHANGED
package/dist/options.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.options = void 0;
|
|
7
|
-
const options = {
|
|
7
|
+
const options = exports.options = {
|
|
8
8
|
flags: {
|
|
9
9
|
token: {
|
|
10
10
|
type: 'string',
|
|
@@ -99,5 +99,4 @@ const options = {
|
|
|
99
99
|
type: 'string'
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
};
|
|
103
|
-
exports.options = options;
|
|
102
|
+
};
|
package/dist/util/data.js
CHANGED
|
@@ -18,7 +18,7 @@ var _graphql = require("../graphql");
|
|
|
18
18
|
var _errors = require("../errors");
|
|
19
19
|
var _os = _interopRequireDefault(require("os"));
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
const projectListQuery = `
|
|
21
|
+
const projectListQuery = exports.projectListQuery = `
|
|
22
22
|
{
|
|
23
23
|
projects: getProjectList {
|
|
24
24
|
value: id
|
|
@@ -27,8 +27,7 @@ const projectListQuery = `
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
`;
|
|
30
|
-
exports.
|
|
31
|
-
const siteListQuery = `
|
|
30
|
+
const siteListQuery = exports.siteListQuery = `
|
|
32
31
|
{
|
|
33
32
|
sites: getTSStaticSiteList {
|
|
34
33
|
items {
|
|
@@ -38,15 +37,13 @@ const siteListQuery = `
|
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
39
|
`;
|
|
41
|
-
exports.
|
|
42
|
-
const getProjectQuery = `
|
|
40
|
+
const getProjectQuery = exports.getProjectQuery = `
|
|
43
41
|
query($id: ID!) {
|
|
44
42
|
project: getProject(id: $id) {
|
|
45
43
|
status
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
46
|
`;
|
|
49
|
-
exports.getProjectQuery = getProjectQuery;
|
|
50
47
|
async function fetchProjects(params) {
|
|
51
48
|
try {
|
|
52
49
|
const client = (0, _graphql.createAdminConnector)(params, params.authToken);
|
|
@@ -60,11 +57,10 @@ async function fetchProjects(params) {
|
|
|
60
57
|
throw (0, _errors.formatErrorMessage)(e, 'fetching your projects');
|
|
61
58
|
}
|
|
62
59
|
}
|
|
63
|
-
const laterSite = {
|
|
60
|
+
const laterSite = exports.laterSite = {
|
|
64
61
|
name: 'Select site later',
|
|
65
62
|
value: 'NONE'
|
|
66
63
|
};
|
|
67
|
-
exports.laterSite = laterSite;
|
|
68
64
|
async function fetchSites(params, pathParams) {
|
|
69
65
|
try {
|
|
70
66
|
const client = (0, _graphql.createConnector)(params, params.authToken, pathParams);
|
|
@@ -79,7 +75,7 @@ async function fetchSites(params, pathParams) {
|
|
|
79
75
|
throw (0, _errors.formatErrorMessage)(e, 'fetching your static sites');
|
|
80
76
|
}
|
|
81
77
|
}
|
|
82
|
-
const createPersonalAccessTokenMutation = (0, _graphql.graphQLQuery)(`
|
|
78
|
+
const createPersonalAccessTokenMutation = exports.createPersonalAccessTokenMutation = (0, _graphql.graphQLQuery)(`
|
|
83
79
|
mutation ($name: String!){
|
|
84
80
|
result: createPersonalAccessToken(name: $name) {
|
|
85
81
|
accessToken
|
|
@@ -87,8 +83,7 @@ const createPersonalAccessTokenMutation = (0, _graphql.graphQLQuery)(`
|
|
|
87
83
|
}
|
|
88
84
|
}
|
|
89
85
|
`);
|
|
90
|
-
exports.
|
|
91
|
-
const createReadOnlyApiKeyMutation = (0, _graphql.graphQLQuery)(`
|
|
86
|
+
const createReadOnlyApiKeyMutation = exports.createReadOnlyApiKeyMutation = (0, _graphql.graphQLQuery)(`
|
|
92
87
|
mutation ($name: String!){
|
|
93
88
|
result: createApiKey(name: $name role: "read") {
|
|
94
89
|
id
|
|
@@ -96,19 +91,16 @@ const createReadOnlyApiKeyMutation = (0, _graphql.graphQLQuery)(`
|
|
|
96
91
|
}
|
|
97
92
|
}
|
|
98
93
|
`);
|
|
99
|
-
exports.
|
|
100
|
-
const deletePersonalAccessTokenMutation = (0, _graphql.graphQLQuery)(`
|
|
94
|
+
const deletePersonalAccessTokenMutation = exports.deletePersonalAccessTokenMutation = (0, _graphql.graphQLQuery)(`
|
|
101
95
|
mutation ($id: ID!){
|
|
102
96
|
result: deletePersonalAccessToken(id: $id)
|
|
103
97
|
}
|
|
104
98
|
`);
|
|
105
|
-
exports.
|
|
106
|
-
const deleteApiKeyMutation = (0, _graphql.graphQLQuery)(`
|
|
99
|
+
const deleteApiKeyMutation = exports.deleteApiKeyMutation = (0, _graphql.graphQLQuery)(`
|
|
107
100
|
mutation ($id: ID!){
|
|
108
101
|
result: deleteApiKey(id: $id)
|
|
109
102
|
}
|
|
110
103
|
`);
|
|
111
|
-
exports.deleteApiKeyMutation = deleteApiKeyMutation;
|
|
112
104
|
function createKeyName() {
|
|
113
105
|
return `TakeShape CLI ${_os.default.hostname()} ${new Date().toISOString().split('T')[0]}`;
|
|
114
106
|
}
|
|
@@ -14,8 +14,8 @@ var _graphqlFileLoader = require("@graphql-tools/graphql-file-loader");
|
|
|
14
14
|
var _chalk = _interopRequireDefault(require("chalk"));
|
|
15
15
|
var _log = _interopRequireDefault(require("../log"));
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
function _getRequireWildcardCache(
|
|
18
|
-
function _interopRequireWildcard(
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
19
|
/** Uses [GraphQL Code Generator](https://www.graphql-code-generator.com/)
|
|
20
20
|
* to create TypeScript definitions from a GraphQL schema file.
|
|
21
21
|
*/
|
|
@@ -38,7 +38,6 @@ async function generateTypes(schemaFile, outputFile) {
|
|
|
38
38
|
{
|
|
39
39
|
typescript: {} // Here you can pass configuration to the plugin
|
|
40
40
|
}],
|
|
41
|
-
|
|
42
41
|
pluginMap: {
|
|
43
42
|
typescript: typescriptPlugin
|
|
44
43
|
}
|
|
@@ -9,8 +9,7 @@ var _graphql = require("graphql");
|
|
|
9
9
|
var _fsExtra = _interopRequireDefault(require("fs-extra"));
|
|
10
10
|
var _oraWrapper = _interopRequireDefault(require("./ora-wrapper"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
const SCHEMA_FILE_NAME = 'takeshape-project.graphql';
|
|
13
|
-
exports.SCHEMA_FILE_NAME = SCHEMA_FILE_NAME;
|
|
12
|
+
const SCHEMA_FILE_NAME = exports.SCHEMA_FILE_NAME = 'takeshape-project.graphql';
|
|
14
13
|
async function getClientSchema(connector) {
|
|
15
14
|
const res = await connector({
|
|
16
15
|
query: (0, _graphql.getIntrospectionQuery)()
|
|
@@ -19,5 +18,4 @@ async function getClientSchema(connector) {
|
|
|
19
18
|
const result = (0, _graphql.printSchema)(schema);
|
|
20
19
|
await _fsExtra.default.writeFile(SCHEMA_FILE_NAME, result);
|
|
21
20
|
}
|
|
22
|
-
var _default = (0, _oraWrapper.default)(getClientSchema, 'Getting client schema.', `Client schema saved as ${SCHEMA_FILE_NAME}.`, 'Failed while getting client schema.');
|
|
23
|
-
exports.default = _default;
|
|
21
|
+
var _default = exports.default = (0, _oraWrapper.default)(getClientSchema, 'Getting client schema.', `Client schema saved as ${SCHEMA_FILE_NAME}.`, 'Failed while getting client schema.');
|
package/dist/util/login.js
CHANGED
|
@@ -16,12 +16,11 @@ var _getPort = _interopRequireDefault(require("get-port"));
|
|
|
16
16
|
var _auth = require("../auth");
|
|
17
17
|
var _messages = require("./messages");
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
const waitingQuestions = [{
|
|
19
|
+
const waitingQuestions = exports.waitingQuestions = [{
|
|
20
20
|
type: 'input',
|
|
21
21
|
name: 'token',
|
|
22
22
|
message: 'Opening a web browser to log you in. If the browser gives you a token, paste it here:\n'
|
|
23
23
|
}];
|
|
24
|
-
exports.waitingQuestions = waitingQuestions;
|
|
25
24
|
async function loginBrowser(params) {
|
|
26
25
|
// Port for login page to communicate with the CLI
|
|
27
26
|
const port = await (0, _getPort.default)();
|
|
@@ -70,7 +69,7 @@ async function loginBrowser(params) {
|
|
|
70
69
|
});
|
|
71
70
|
});
|
|
72
71
|
}
|
|
73
|
-
const loginQuestions = [{
|
|
72
|
+
const loginQuestions = exports.loginQuestions = [{
|
|
74
73
|
type: 'input',
|
|
75
74
|
name: 'email',
|
|
76
75
|
message: 'Enter your TakeShape email:',
|
|
@@ -82,7 +81,6 @@ const loginQuestions = [{
|
|
|
82
81
|
name: 'password',
|
|
83
82
|
message: 'Enter your TakeShape password:'
|
|
84
83
|
}];
|
|
85
|
-
exports.loginQuestions = loginQuestions;
|
|
86
84
|
async function attemptLogin(params) {
|
|
87
85
|
const answers = await (0, _prompt.prompt)(loginQuestions);
|
|
88
86
|
return (0, _auth.login)(params.endpoint, answers.email, answers.password);
|
package/dist/util/messages.js
CHANGED
|
@@ -26,22 +26,16 @@ function info(msg) {
|
|
|
26
26
|
(0, _log.default)(msg);
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
const waitingForLogin = info('Opening a web browser to log you in...');
|
|
30
|
-
exports.
|
|
31
|
-
const
|
|
32
|
-
exports.
|
|
33
|
-
const
|
|
34
|
-
exports.invalidLoginMsg = invalidLoginMsg;
|
|
35
|
-
const missingPasswordMsg = info('No password set in TakeShape. Follow the forgot password flow to set a password.');
|
|
36
|
-
exports.missingPasswordMsg = missingPasswordMsg;
|
|
37
|
-
const writingFilesMsg = info('Writing .takeshaperc, .graphqlconfig.');
|
|
38
|
-
exports.writingFilesMsg = writingFilesMsg;
|
|
29
|
+
const waitingForLogin = exports.waitingForLogin = info('Opening a web browser to log you in...');
|
|
30
|
+
const loginSuccess = exports.loginSuccess = info('Successfully logged in.');
|
|
31
|
+
const invalidLoginMsg = exports.invalidLoginMsg = info('Invalid email/password combination');
|
|
32
|
+
const missingPasswordMsg = exports.missingPasswordMsg = info('No password set in TakeShape. Follow the forgot password flow to set a password.');
|
|
33
|
+
const writingFilesMsg = exports.writingFilesMsg = info('Writing .takeshaperc, .graphqlconfig.');
|
|
39
34
|
const writingHomeConfigDoneMsg = path => {
|
|
40
35
|
(0, _log.default)(`Personal access token saved to ${path}`);
|
|
41
36
|
};
|
|
42
37
|
exports.writingHomeConfigDoneMsg = writingHomeConfigDoneMsg;
|
|
43
|
-
const consoleWarning = warning('**************************************************************************************************\n' + ' Add the following to your vcs ignore file: \n' + ' .takeshaperc \n' + ' .graphqlconfig \n' + '**************************************************************************************************');
|
|
44
|
-
exports.consoleWarning = consoleWarning;
|
|
38
|
+
const consoleWarning = exports.consoleWarning = warning('**************************************************************************************************\n' + ' Add the following to your vcs ignore file: \n' + ' .takeshaperc \n' + ' .graphqlconfig \n' + '**************************************************************************************************');
|
|
45
39
|
function forgotPasswordWarning(params) {
|
|
46
40
|
(0, _log.default)(`If you forgot your credentials please visit ${params.appUrl}/forgot-password`);
|
|
47
41
|
}
|
package/dist/util/spin.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takeshape/cli",
|
|
3
|
-
"version": "10.2.
|
|
3
|
+
"version": "10.2.24",
|
|
4
4
|
"description": "TakeShape CLI",
|
|
5
5
|
"homepage": "https://www.takeshape.io",
|
|
6
6
|
"repository": {
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"semver": "^6.3.0",
|
|
55
55
|
"stream-to-promise": "^2.2.0",
|
|
56
56
|
"tmp": "^0.0.33",
|
|
57
|
-
"@takeshape/branches": "10.2.
|
|
58
|
-
"@takeshape/ssg": "10.2.
|
|
59
|
-
"@takeshape/schema": "10.2.
|
|
60
|
-
"@takeshape/
|
|
61
|
-
"@takeshape/
|
|
57
|
+
"@takeshape/branches": "10.2.24",
|
|
58
|
+
"@takeshape/ssg": "10.2.24",
|
|
59
|
+
"@takeshape/schema": "10.2.24",
|
|
60
|
+
"@takeshape/streams": "10.2.24",
|
|
61
|
+
"@takeshape/util": "10.2.24"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@types/archiver": "^3.1.0",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"graphql": "16.6.0",
|
|
81
81
|
"nock": "^13.2.9",
|
|
82
82
|
"unzipper": "^0.10.11",
|
|
83
|
-
"@takeshape/typescript-jest-junit-reporter": "10.2.
|
|
83
|
+
"@takeshape/typescript-jest-junit-reporter": "10.2.24"
|
|
84
84
|
},
|
|
85
85
|
"engines": {
|
|
86
86
|
"node": ">=18"
|