@takeshape/cli 7.194.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.
Files changed (137) hide show
  1. package/README.md +9 -0
  2. package/lib/auth.d.ts +5 -0
  3. package/lib/auth.d.ts.map +1 -0
  4. package/lib/auth.js +76 -0
  5. package/lib/check-version.d.ts +2 -0
  6. package/lib/check-version.d.ts.map +1 -0
  7. package/lib/check-version.js +22 -0
  8. package/lib/commands/build-or-watch.d.ts +4 -0
  9. package/lib/commands/build-or-watch.d.ts.map +1 -0
  10. package/lib/commands/build-or-watch.js +69 -0
  11. package/lib/commands/deploy/index.d.ts +9 -0
  12. package/lib/commands/deploy/index.d.ts.map +1 -0
  13. package/lib/commands/deploy/index.js +74 -0
  14. package/lib/commands/deploy/zip.d.ts +18 -0
  15. package/lib/commands/deploy/zip.d.ts.map +1 -0
  16. package/lib/commands/deploy/zip.js +57 -0
  17. package/lib/commands/export/index.d.ts +6 -0
  18. package/lib/commands/export/index.d.ts.map +1 -0
  19. package/lib/commands/export/index.js +23 -0
  20. package/lib/commands/export/project-export.d.ts +13 -0
  21. package/lib/commands/export/project-export.d.ts.map +1 -0
  22. package/lib/commands/export/project-export.js +104 -0
  23. package/lib/commands/export/schema-export.d.ts +7 -0
  24. package/lib/commands/export/schema-export.d.ts.map +1 -0
  25. package/lib/commands/export/schema-export.js +80 -0
  26. package/lib/commands/import/index.d.ts +6 -0
  27. package/lib/commands/import/index.d.ts.map +1 -0
  28. package/lib/commands/import/index.js +23 -0
  29. package/lib/commands/import/project-import.d.ts +16 -0
  30. package/lib/commands/import/project-import.d.ts.map +1 -0
  31. package/lib/commands/import/project-import.js +167 -0
  32. package/lib/commands/import/schema-import.d.ts +7 -0
  33. package/lib/commands/import/schema-import.d.ts.map +1 -0
  34. package/lib/commands/import/schema-import.js +75 -0
  35. package/lib/commands/link.d.ts +3 -0
  36. package/lib/commands/link.d.ts.map +1 -0
  37. package/lib/commands/link.js +61 -0
  38. package/lib/commands/login.d.ts +4 -0
  39. package/lib/commands/login.d.ts.map +1 -0
  40. package/lib/commands/login.js +31 -0
  41. package/lib/commands/logout.d.ts +4 -0
  42. package/lib/commands/logout.d.ts.map +1 -0
  43. package/lib/commands/logout.js +29 -0
  44. package/lib/commands/schema.d.ts +3 -0
  45. package/lib/commands/schema.d.ts.map +1 -0
  46. package/lib/commands/schema.js +23 -0
  47. package/lib/commands/status.d.ts +3 -0
  48. package/lib/commands/status.d.ts.map +1 -0
  49. package/lib/commands/status.js +20 -0
  50. package/lib/commands/unlink.d.ts +4 -0
  51. package/lib/commands/unlink.d.ts.map +1 -0
  52. package/lib/commands/unlink.js +29 -0
  53. package/lib/config.d.ts +14 -0
  54. package/lib/config.d.ts.map +1 -0
  55. package/lib/config.js +161 -0
  56. package/lib/deprecated.d.ts +2 -0
  57. package/lib/deprecated.d.ts.map +1 -0
  58. package/lib/deprecated.js +9 -0
  59. package/lib/errors.d.ts +7 -0
  60. package/lib/errors.d.ts.map +1 -0
  61. package/lib/errors.js +36 -0
  62. package/lib/files.d.ts +5 -0
  63. package/lib/files.d.ts.map +1 -0
  64. package/lib/files.js +53 -0
  65. package/lib/graphql.d.ts +14 -0
  66. package/lib/graphql.d.ts.map +1 -0
  67. package/lib/graphql.js +94 -0
  68. package/lib/index.d.ts +3 -0
  69. package/lib/index.d.ts.map +1 -0
  70. package/lib/index.js +78 -0
  71. package/lib/log.d.ts +4 -0
  72. package/lib/log.d.ts.map +1 -0
  73. package/lib/log.js +21 -0
  74. package/lib/main.d.ts +2 -0
  75. package/lib/main.d.ts.map +1 -0
  76. package/lib/main.js +36 -0
  77. package/lib/prompt.d.ts +11 -0
  78. package/lib/prompt.d.ts.map +1 -0
  79. package/lib/prompt.js +39 -0
  80. package/lib/types.d.ts +45 -0
  81. package/lib/types.d.ts.map +1 -0
  82. package/lib/types.js +20 -0
  83. package/lib/util/api.d.ts +5 -0
  84. package/lib/util/api.d.ts.map +1 -0
  85. package/lib/util/api.js +66 -0
  86. package/lib/util/cached-connector.d.ts +5 -0
  87. package/lib/util/cached-connector.d.ts.map +1 -0
  88. package/lib/util/cached-connector.js +34 -0
  89. package/lib/util/connector.d.ts +7 -0
  90. package/lib/util/connector.d.ts.map +1 -0
  91. package/lib/util/connector.js +19 -0
  92. package/lib/util/data.d.ts +38 -0
  93. package/lib/util/data.d.ts.map +1 -0
  94. package/lib/util/data.js +156 -0
  95. package/lib/util/fatal-error.d.ts +2 -0
  96. package/lib/util/fatal-error.d.ts.map +1 -0
  97. package/lib/util/fatal-error.js +17 -0
  98. package/lib/util/format-error.d.ts +2 -0
  99. package/lib/util/format-error.d.ts.map +1 -0
  100. package/lib/util/format-error.js +10 -0
  101. package/lib/util/get-client-schema.d.ts +4 -0
  102. package/lib/util/get-client-schema.d.ts.map +1 -0
  103. package/lib/util/get-client-schema.js +28 -0
  104. package/lib/util/glitch.d.ts +5 -0
  105. package/lib/util/glitch.d.ts.map +1 -0
  106. package/lib/util/glitch.js +51 -0
  107. package/lib/util/linked-command.d.ts +4 -0
  108. package/lib/util/linked-command.d.ts.map +1 -0
  109. package/lib/util/linked-command.js +33 -0
  110. package/lib/util/login.d.ts +16 -0
  111. package/lib/util/login.d.ts.map +1 -0
  112. package/lib/util/login.js +123 -0
  113. package/lib/util/messages.d.ts +13 -0
  114. package/lib/util/messages.d.ts.map +1 -0
  115. package/lib/util/messages.js +57 -0
  116. package/lib/util/ora-wrapper.d.ts +2 -0
  117. package/lib/util/ora-wrapper.d.ts.map +1 -0
  118. package/lib/util/ora-wrapper.js +28 -0
  119. package/lib/util/pusher.d.ts +4 -0
  120. package/lib/util/pusher.d.ts.map +1 -0
  121. package/lib/util/pusher.js +45 -0
  122. package/lib/util/runner.d.ts +2 -0
  123. package/lib/util/runner.d.ts.map +1 -0
  124. package/lib/util/runner.js +44 -0
  125. package/lib/util/select-project.d.ts +4 -0
  126. package/lib/util/select-project.d.ts.map +1 -0
  127. package/lib/util/select-project.js +23 -0
  128. package/lib/util/spin.d.ts +7 -0
  129. package/lib/util/spin.d.ts.map +1 -0
  130. package/lib/util/spin.js +41 -0
  131. package/lib/util/upload.d.ts +5 -0
  132. package/lib/util/upload.d.ts.map +1 -0
  133. package/lib/util/upload.js +55 -0
  134. package/lib/util/watcher.d.ts +2 -0
  135. package/lib/util/watcher.d.ts.map +1 -0
  136. package/lib/util/watcher.js +30 -0
  137. package/package.json +90 -0
@@ -0,0 +1,16 @@
1
+ declare type ImportStrategy = 'uri' | 'zip' | 'dir';
2
+ export interface ProjectImportFlags {
3
+ project: true;
4
+ from: string;
5
+ name?: string;
6
+ }
7
+ export interface ProjectImport {
8
+ id: string;
9
+ status: string;
10
+ message: string;
11
+ projectId: string;
12
+ }
13
+ export declare function determineImportStrategy(path: string): Promise<ImportStrategy>;
14
+ declare const _default: import("../../types").Handler<ProjectImportFlags>;
15
+ export default _default;
16
+ //# sourceMappingURL=project-import.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-import.d.ts","sourceRoot":"","sources":["../../../../src/commands/import/project-import.ts"],"names":[],"mappings":"AAaA,aAAK,cAAc,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAO5C,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AA4BD,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAYnF;;AA6BD,wBAyCE"}
@@ -0,0 +1,167 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.determineImportStrategy = determineImportStrategy;
7
+ exports.default = void 0;
8
+
9
+ var _fsExtra = _interopRequireDefault(require("fs-extra"));
10
+
11
+ var _path = require("path");
12
+
13
+ var _archiver = _interopRequireDefault(require("archiver"));
14
+
15
+ var _streams = require("@takeshape/streams");
16
+
17
+ var _chalk = _interopRequireDefault(require("chalk"));
18
+
19
+ var _log = _interopRequireDefault(require("../../log"));
20
+
21
+ var _upload = require("../../util/upload");
22
+
23
+ var _spin = _interopRequireDefault(require("../../util/spin"));
24
+
25
+ var _graphql = require("../../graphql");
26
+
27
+ var _fatalError = require("../../util/fatal-error");
28
+
29
+ var _linkedCommand = require("../../util/linked-command");
30
+
31
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32
+
33
+ const startImport = (0, _graphql.graphQLQuery)(`
34
+ mutation ($uri: String!, $name: String) {
35
+ result: tsImportProject(uri: $uri, name: $name, origin: "@takeshape/cli")
36
+ }
37
+ `);
38
+ const getImport = (0, _graphql.graphQLQuery)(`
39
+ query ($importId: String!) {
40
+ result: tsGetProjectImport(id: $importId) {
41
+ id
42
+ status
43
+ message
44
+ projectId
45
+ }
46
+ }
47
+ `);
48
+ const getUploadUrl = (0, _graphql.graphQLQuery)(`
49
+ mutation ($filename: String!) {
50
+ result: tsUploadProject(name: $filename, type: "application/zip", origin: "@takeshape/cli") {
51
+ uri
52
+ importId
53
+ }
54
+ }
55
+ `);
56
+
57
+ async function determineImportStrategy(path) {
58
+ if (/^https?:\/\/.*/.exec(path) !== null) {
59
+ return 'uri';
60
+ }
61
+
62
+ if (/\.zip$/.exec(path) !== null) {
63
+ return 'zip';
64
+ }
65
+
66
+ await _fsExtra.default.access(path);
67
+
68
+ if (_fsExtra.default.statSync(path).isDirectory()) {
69
+ return 'dir';
70
+ }
71
+
72
+ throw Error('Unrecognized import path provided. Please provide a URI, zip path, or directory path');
73
+ }
74
+
75
+ async function listenForImportSuccess(client, importId) {
76
+ // Spin until we get a 'success' message or it throws an error
77
+ const spinQuery = getImport.bind(getImport, client, {
78
+ importId
79
+ });
80
+ await (0, _spin.default)(spinQuery); // Return the ID of the project created by the import
81
+
82
+ const {
83
+ projectId
84
+ } = await getImport(client, {
85
+ importId
86
+ });
87
+ return projectId;
88
+ }
89
+
90
+ async function uploadZipFile(client, filename, filePath) {
91
+ const {
92
+ uri,
93
+ importId
94
+ } = await getUploadUrl(client, {
95
+ filename
96
+ });
97
+ await (0, _upload.uploadFile)(filePath, uri);
98
+ return importId;
99
+ }
100
+ /*
101
+ takeshape import --project
102
+
103
+ Import a project from a path or URL.
104
+ The user must be logged in.
105
+
106
+ Flags:
107
+ --from Either a URI, zip file, or directory to import
108
+ --name Provides a name for the newly imported project.
109
+ Otherwise, the import will use the name in the pattern.yml file.
110
+ */
111
+
112
+
113
+ var _default = (0, _linkedCommand.loggedInCommand)(async (_, params, flags) => {
114
+ // we need to get a user token in order for the import to work
115
+ if (!flags || !flags.from) {
116
+ return (0, _fatalError.fatalError)('No flags provided.');
117
+ }
118
+
119
+ const client = (0, _graphql.createAdminConnector)(params, params.authToken);
120
+
121
+ try {
122
+ const {
123
+ from
124
+ } = flags;
125
+ const strategy = await determineImportStrategy(from);
126
+ let importId;
127
+
128
+ if (strategy === 'dir') {
129
+ (0, _log.default)(`Zipping up ${from}…`);
130
+ const dirName = (0, _path.basename)(from);
131
+ const [zipPath] = (0, _upload.createTempFile)(`${dirName}.zip`);
132
+
133
+ const output = _fsExtra.default.createWriteStream(zipPath);
134
+
135
+ const archive = (0, _archiver.default)('zip');
136
+ archive.directory(from, false);
137
+ await archive.finalize();
138
+ await (0, _streams.pump)(archive, output);
139
+ (0, _log.default)(`Starting import from ${dirName}.zip…\n`);
140
+ importId = await uploadZipFile(client, `${dirName}.zip`, zipPath);
141
+ }
142
+
143
+ if (strategy === 'zip') {
144
+ (0, _log.default)(`Starting import from ${from}…\n`);
145
+ const fileName = (0, _path.basename)(from);
146
+ importId = await uploadZipFile(client, fileName, from);
147
+ }
148
+
149
+ if (strategy === 'uri') {
150
+ (0, _log.default)(`Starting import from ${from}…\n`);
151
+ importId = await startImport(client, {
152
+ uri: from,
153
+ name: flags.name
154
+ });
155
+ }
156
+
157
+ if (importId) {
158
+ const projectId = await listenForImportSuccess(client, importId);
159
+ (0, _log.default)(_chalk.default.green(`Success!`), `Created project ${projectId} from import.`);
160
+ process.exit(0);
161
+ }
162
+ } catch (error) {
163
+ return (0, _fatalError.fatalError)(error.message);
164
+ }
165
+ });
166
+
167
+ exports.default = _default;
@@ -0,0 +1,7 @@
1
+ export interface SchemaImportFlags {
2
+ schema: true;
3
+ from: string;
4
+ }
5
+ declare const _default: import("../../types").Handler<SchemaImportFlags>;
6
+ export default _default;
7
+ //# sourceMappingURL=schema-import.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-import.d.ts","sourceRoot":"","sources":["../../../../src/commands/import/schema-import.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;;AAWD,wBAoCE"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _fsExtra = _interopRequireDefault(require("fs-extra"));
9
+
10
+ var _fatalError = require("../../util/fatal-error");
11
+
12
+ var _api = _interopRequireDefault(require("../../util/api"));
13
+
14
+ var _log = _interopRequireDefault(require("../../log"));
15
+
16
+ var _chalk = _interopRequireDefault(require("chalk"));
17
+
18
+ var _schema = require("@takeshape/schema");
19
+
20
+ var _linkedCommand = require("../../util/linked-command");
21
+
22
+ var _path = _interopRequireDefault(require("path"));
23
+
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
+
26
+ /*
27
+ takeshape import --schema --from ./path/to/schema.json
28
+
29
+ Replace your project's schema by uploading a new one
30
+
31
+ Flags:
32
+ --from Directory containing a schema.json or path to schema.json file
33
+ */
34
+ var _default = (0, _linkedCommand.linkedCommand)(async (_, params, flags) => {
35
+ const projectId = params.projectId;
36
+
37
+ if (!flags.from) {
38
+ return (0, _fatalError.fatalError)('No schema file provided. Use `--from path/to/file` or `--from directory`.');
39
+ }
40
+
41
+ if (!_fsExtra.default.existsSync(flags.from)) {
42
+ return (0, _fatalError.fatalError)(`${flags.from} does not exist`);
43
+ }
44
+
45
+ let file = flags.from;
46
+
47
+ if (!_fsExtra.default.lstatSync(file).isFile()) {
48
+ file = _path.default.join(flags.from, 'schema.json');
49
+
50
+ if (!_fsExtra.default.existsSync(file) || !_fsExtra.default.lstatSync(file).isFile()) {
51
+ return (0, _fatalError.fatalError)(`Schema file does not exist: ${file}`);
52
+ }
53
+ }
54
+
55
+ try {
56
+ const newSchema = JSON.parse(_fsExtra.default.readFileSync(file).toString());
57
+ const {
58
+ valid,
59
+ errors
60
+ } = (0, _schema.validateSchema)(newSchema);
61
+
62
+ if (!valid && errors) {
63
+ return (0, _fatalError.fatalError)(`Invalid schema:\n ${errors.map(e => `${e.type}: ${e.message} at ${e.path.join('/')}`).join('\n ')}`);
64
+ }
65
+
66
+ (0, _log.default)(`Uploading schema from ${file}…\n`);
67
+ const uploaded = await (0, _api.default)(params, 'POST', `/project/${projectId}/schema`, newSchema);
68
+ (0, _log.default)(_chalk.default.green(`Success!`), `Schema updated to version ${uploaded.version}.`);
69
+ process.exit(0);
70
+ } catch (e) {
71
+ return (0, _fatalError.fatalError)(e.message);
72
+ }
73
+ });
74
+
75
+ exports.default = _default;
@@ -0,0 +1,3 @@
1
+ declare const _default: import("../types").Handler<unknown>;
2
+ export default _default;
3
+ //# sourceMappingURL=link.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../src/commands/link.ts"],"names":[],"mappings":";AAQA,wBAiCG"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _log = _interopRequireDefault(require("../log"));
9
+
10
+ var _prompt = require("../prompt");
11
+
12
+ var _data = require("../util/data");
13
+
14
+ var _config = require("../config");
15
+
16
+ var _linkedCommand = require("../util/linked-command");
17
+
18
+ var _selectProject = require("../util/select-project");
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
22
+ var _default = (0, _linkedCommand.loggedInCommand)(async (_, params) => {
23
+ try {
24
+ const project = await (0, _selectProject.selectProject)(params);
25
+
26
+ if (!project) {
27
+ return;
28
+ }
29
+
30
+ const sites = await (0, _data.fetchSites)(params, project.value);
31
+ let site;
32
+
33
+ if (sites.length) {
34
+ var _site;
35
+
36
+ site = await (0, _prompt.promptList)('Select a site:', sites);
37
+
38
+ if (((_site = site) === null || _site === void 0 ? void 0 : _site.value) === 'NONE') {
39
+ site = undefined;
40
+ }
41
+ }
42
+
43
+ const isSameProject = params.projectId === project.value;
44
+ let linkedApiKey = params.linkedApiKey; // Clean up old API key
45
+
46
+ if (!isSameProject && params.linkedApiKey && params.projectId) {
47
+ await (0, _data.deleteApiKey)(params, params.projectId, params.linkedApiKey.id);
48
+ } // Only create a new API key if project has changed
49
+
50
+
51
+ if (!isSameProject || !linkedApiKey) {
52
+ linkedApiKey = await (0, _data.createReadOnlyApiKey)(params, project.value);
53
+ }
54
+
55
+ await (0, _config.writeLinkedProjectConfig)(params, linkedApiKey, project, site);
56
+ } catch (e) {
57
+ (0, _log.default)(e);
58
+ }
59
+ });
60
+
61
+ exports.default = _default;
@@ -0,0 +1,4 @@
1
+ import { CliConfig } from '../types';
2
+ declare const _default: (_: string, params: CliConfig) => Promise<void>;
3
+ export default _default;
4
+ //# sourceMappingURL=login.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/commands/login.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAC;4BAIV,MAAM,UAAU,SAAS,KAAG,QAAQ,IAAI,CAAC;AAAlE,wBAWE"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _log = _interopRequireDefault(require("../log"));
9
+
10
+ var _login = require("../util/login");
11
+
12
+ var _config = require("../config");
13
+
14
+ var _data = require("../util/data");
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ var _default = async (_, params) => {
19
+ try {
20
+ const userJwt = await (params.cliLogin ? (0, _login.loginCli)(params, 3) : (0, _login.loginBrowser)(params));
21
+
22
+ if (userJwt) {
23
+ const personalAccessToken = await (0, _data.createPersonalAccessToken)(params, userJwt);
24
+ await (0, _config.writeHomeConfig)(personalAccessToken);
25
+ }
26
+ } catch (e) {
27
+ (0, _log.default)(e);
28
+ }
29
+ };
30
+
31
+ exports.default = _default;
@@ -0,0 +1,4 @@
1
+ import { CliConfig } from '../types';
2
+ declare const _default: (_: string, params: CliConfig) => Promise<void>;
3
+ export default _default;
4
+ //# sourceMappingURL=logout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../../src/commands/logout.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAsB,MAAM,UAAU,CAAC;4BAI/B,MAAM,UAAU,SAAS,KAAG,QAAQ,IAAI,CAAC;AAAlE,wBASE"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _log = _interopRequireDefault(require("../log"));
9
+
10
+ var _types = require("../types");
11
+
12
+ var _config = require("../config");
13
+
14
+ var _data = require("../util/data");
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ var _default = async (_, params) => {
19
+ try {
20
+ if ((0, _types.isLoggedInCliConfig)(params)) {
21
+ await (0, _data.deletePersonalAccessToken)(params);
22
+ (0, _config.deleteHomeConfig)();
23
+ }
24
+ } catch (e) {
25
+ (0, _log.default)(e);
26
+ }
27
+ };
28
+
29
+ exports.default = _default;
@@ -0,0 +1,3 @@
1
+ declare var _default: import("../types").Handler<any>;
2
+ export default _default;
3
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/commands/schema.js"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _linkedCommand = require("../util/linked-command");
9
+
10
+ var _connector = require("../util/connector");
11
+
12
+ var _getClientSchema = _interopRequireDefault(require("../util/get-client-schema"));
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ var _default = (0, _linkedCommand.linkedCommand)((command, params) => {
17
+ const connector = (0, _connector.createConnector)(params, {
18
+ cache: false
19
+ });
20
+ void (0, _getClientSchema.default)(connector);
21
+ });
22
+
23
+ exports.default = _default;
@@ -0,0 +1,3 @@
1
+ declare var _default: import("../types").Handler<any>;
2
+ export default _default;
3
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/status.js"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _linkedCommand = require("../util/linked-command");
9
+
10
+ var _log = _interopRequireDefault(require("../log"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ var _default = (0, _linkedCommand.linkedCommand)((command, params) => {
15
+ var _params$siteName;
16
+
17
+ (0, _log.default)(`Project: ${params.projectName} \nStatic Site: ${(_params$siteName = params.siteName) !== null && _params$siteName !== void 0 ? _params$siteName : 'not configured'}`);
18
+ });
19
+
20
+ exports.default = _default;
@@ -0,0 +1,4 @@
1
+ import { CliConfig } from '../types';
2
+ declare const _default: (_: string, params: CliConfig) => Promise<void>;
3
+ export default _default;
4
+ //# sourceMappingURL=unlink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unlink.d.ts","sourceRoot":"","sources":["../../../src/commands/unlink.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAA4B,MAAM,UAAU,CAAC;4BAIrC,MAAM,UAAU,SAAS,KAAG,QAAQ,IAAI,CAAC;AAAlE,wBASE"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _log = _interopRequireDefault(require("../log"));
9
+
10
+ var _types = require("../types");
11
+
12
+ var _config = require("../config");
13
+
14
+ var _data = require("../util/data");
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ var _default = async (_, params) => {
19
+ try {
20
+ if ((0, _types.isLoggedInAndLinkedConfig)(params)) {
21
+ await (0, _data.deleteApiKey)(params, params.projectId, params.linkedApiKey.id);
22
+ (0, _config.deleteLinkedConfig)();
23
+ }
24
+ } catch (e) {
25
+ (0, _log.default)(e);
26
+ }
27
+ };
28
+
29
+ exports.default = _default;
@@ -0,0 +1,14 @@
1
+ import { CliConfig } from './types';
2
+ import { Choice } from './prompt';
3
+ import { ApiKey, PersonalAccessToken } from './util/data';
4
+ export declare const TAKESHAPE_CONFIG_FILENAME = ".takeshaperc";
5
+ export declare const GRAPHQL_CONFIG_FILENAME = ".graphqlconfig";
6
+ export declare function getHomeConfigPath(): string;
7
+ export declare function loadConfig(cwd: string, cli: {
8
+ flags: Record<string, string | undefined>;
9
+ }): CliConfig;
10
+ export declare function writeLinkedProjectConfig(params: CliConfig, linkedApiKey: ApiKey, project: Choice, site: Choice | undefined): Promise<void>;
11
+ export declare function deleteLinkedConfig(): void;
12
+ export declare function writeHomeConfig(accessToken: PersonalAccessToken): Promise<void>;
13
+ export declare function deleteHomeConfig(): void;
14
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAOlC,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,MAAM,EAAE,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAGxD,eAAO,MAAM,yBAAyB,iBAAiB,CAAC;AACxD,eAAO,MAAM,uBAAuB,mBAAmB,CAAC;AAExD,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;CAAC,GAAG,SAAS,CA8BnG;AAUD,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,SAAS,EACjB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,OAAO,CAAC,IAAI,CAAC,CA6Cf;AAED,wBAAgB,kBAAkB,SAOjC;AAED,wBAAsB,eAAe,CAAC,WAAW,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAIrF;AAED,wBAAgB,gBAAgB,SAK/B"}