@google/clasp 2.5.0 → 3.0.0-alpha1

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 (149) hide show
  1. package/README.md +251 -196
  2. package/build/src/auth/auth.js +176 -0
  3. package/build/src/auth/auth_code_flow.js +36 -0
  4. package/build/src/auth/credential_store.js +1 -0
  5. package/build/src/auth/file_credential_store.js +82 -0
  6. package/build/src/auth/localhost_auth_code_flow.js +62 -0
  7. package/build/src/auth/serverless_auth_code_flow.js +32 -0
  8. package/build/src/commands/clone-script.js +71 -0
  9. package/build/src/commands/create-deployment.js +33 -0
  10. package/build/src/commands/create-script.js +75 -0
  11. package/build/src/commands/create-version.js +31 -0
  12. package/build/src/commands/delete-deployment.js +71 -0
  13. package/build/src/commands/disable-api.js +19 -0
  14. package/build/src/commands/enable-api.js +31 -0
  15. package/build/src/commands/list-apis.js +23 -0
  16. package/build/src/commands/list-deployments.js +30 -0
  17. package/build/src/commands/list-scripts.js +28 -0
  18. package/build/src/commands/list-versions.js +29 -0
  19. package/build/src/commands/login.js +53 -54
  20. package/build/src/commands/logout.js +15 -15
  21. package/build/src/commands/open-apis.js +11 -0
  22. package/build/src/commands/open-container.js +15 -0
  23. package/build/src/commands/open-credentials.js +11 -0
  24. package/build/src/commands/open-logs.js +11 -0
  25. package/build/src/commands/open-script.js +18 -0
  26. package/build/src/commands/open-webapp.js +56 -0
  27. package/build/src/commands/program.js +108 -0
  28. package/build/src/commands/pull.js +19 -18
  29. package/build/src/commands/push.js +64 -74
  30. package/build/src/commands/run-function.js +61 -0
  31. package/build/src/commands/setup-logs.js +12 -0
  32. package/build/src/commands/show-authorized-user.js +18 -0
  33. package/build/src/commands/show-file-status.js +34 -0
  34. package/build/src/commands/tail-logs.js +92 -0
  35. package/build/src/commands/utils.js +82 -0
  36. package/build/src/constants.js +0 -3
  37. package/build/src/{apis.js → core/apis.js} +90 -92
  38. package/build/src/core/clasp.js +171 -0
  39. package/build/src/core/files.js +359 -0
  40. package/build/src/core/functions.js +51 -0
  41. package/build/src/core/logs.js +41 -0
  42. package/build/src/core/manifest.js +1 -0
  43. package/build/src/core/project.js +313 -0
  44. package/build/src/core/services.js +179 -0
  45. package/build/src/core/utils.js +121 -0
  46. package/build/src/index.js +16 -355
  47. package/build/src/intl.js +34 -0
  48. package/docs/README.md +0 -5
  49. package/docs/config-files.md +0 -1
  50. package/docs/run.md +2 -2
  51. package/package.json +86 -51
  52. package/CHANGELOG.md +0 -79
  53. package/build/src/apis.d.ts +0 -34
  54. package/build/src/apis.js.map +0 -1
  55. package/build/src/apiutils.d.ts +0 -16
  56. package/build/src/apiutils.js +0 -81
  57. package/build/src/apiutils.js.map +0 -1
  58. package/build/src/auth.d.ts +0 -37
  59. package/build/src/auth.js +0 -310
  60. package/build/src/auth.js.map +0 -1
  61. package/build/src/clasp-error.d.ts +0 -3
  62. package/build/src/clasp-error.js +0 -10
  63. package/build/src/clasp-error.js.map +0 -1
  64. package/build/src/commands/apis.d.ts +0 -10
  65. package/build/src/commands/apis.js +0 -90
  66. package/build/src/commands/apis.js.map +0 -1
  67. package/build/src/commands/clone.d.ts +0 -13
  68. package/build/src/commands/clone.js +0 -60
  69. package/build/src/commands/clone.js.map +0 -1
  70. package/build/src/commands/create.d.ts +0 -16
  71. package/build/src/commands/create.js +0 -81
  72. package/build/src/commands/create.js.map +0 -1
  73. package/build/src/commands/default.d.ts +0 -8
  74. package/build/src/commands/default.js +0 -10
  75. package/build/src/commands/default.js.map +0 -1
  76. package/build/src/commands/deploy.d.ts +0 -13
  77. package/build/src/commands/deploy.js +0 -51
  78. package/build/src/commands/deploy.js.map +0 -1
  79. package/build/src/commands/deployments.d.ts +0 -5
  80. package/build/src/commands/deployments.js +0 -29
  81. package/build/src/commands/deployments.js.map +0 -1
  82. package/build/src/commands/list.d.ts +0 -9
  83. package/build/src/commands/list.js +0 -34
  84. package/build/src/commands/list.js.map +0 -1
  85. package/build/src/commands/login.d.ts +0 -15
  86. package/build/src/commands/login.js.map +0 -1
  87. package/build/src/commands/logout.d.ts +0 -5
  88. package/build/src/commands/logout.js.map +0 -1
  89. package/build/src/commands/logs.d.ts +0 -17
  90. package/build/src/commands/logs.js +0 -181
  91. package/build/src/commands/logs.js.map +0 -1
  92. package/build/src/commands/open.d.ts +0 -15
  93. package/build/src/commands/open.js +0 -89
  94. package/build/src/commands/open.js.map +0 -1
  95. package/build/src/commands/pull.d.ts +0 -10
  96. package/build/src/commands/pull.js.map +0 -1
  97. package/build/src/commands/push.d.ts +0 -11
  98. package/build/src/commands/push.js.map +0 -1
  99. package/build/src/commands/run.d.ts +0 -14
  100. package/build/src/commands/run.js +0 -130
  101. package/build/src/commands/run.js.map +0 -1
  102. package/build/src/commands/setting.d.ts +0 -8
  103. package/build/src/commands/setting.js +0 -53
  104. package/build/src/commands/setting.js.map +0 -1
  105. package/build/src/commands/status.d.ts +0 -9
  106. package/build/src/commands/status.js +0 -25
  107. package/build/src/commands/status.js.map +0 -1
  108. package/build/src/commands/undeploy.d.ts +0 -9
  109. package/build/src/commands/undeploy.js +0 -55
  110. package/build/src/commands/undeploy.js.map +0 -1
  111. package/build/src/commands/version.d.ts +0 -5
  112. package/build/src/commands/version.js +0 -22
  113. package/build/src/commands/version.js.map +0 -1
  114. package/build/src/commands/versions.d.ts +0 -5
  115. package/build/src/commands/versions.js +0 -41
  116. package/build/src/commands/versions.js.map +0 -1
  117. package/build/src/conf.d.ts +0 -40
  118. package/build/src/conf.js +0 -100
  119. package/build/src/conf.js.map +0 -1
  120. package/build/src/constants.d.ts +0 -6
  121. package/build/src/constants.js.map +0 -1
  122. package/build/src/dotfile.d.ts +0 -50
  123. package/build/src/dotfile.js +0 -71
  124. package/build/src/dotfile.js.map +0 -1
  125. package/build/src/files.d.ts +0 -70
  126. package/build/src/files.js +0 -364
  127. package/build/src/files.js.map +0 -1
  128. package/build/src/index.d.ts +0 -18
  129. package/build/src/index.js.map +0 -1
  130. package/build/src/inquirer.d.ts +0 -82
  131. package/build/src/inquirer.js +0 -111
  132. package/build/src/inquirer.js.map +0 -1
  133. package/build/src/manifest.d.ts +0 -123
  134. package/build/src/manifest.js +0 -142
  135. package/build/src/manifest.js.map +0 -1
  136. package/build/src/messages.d.ts +0 -110
  137. package/build/src/messages.js +0 -161
  138. package/build/src/messages.js.map +0 -1
  139. package/build/src/urls.d.ts +0 -21
  140. package/build/src/urls.js +0 -33
  141. package/build/src/urls.js.map +0 -1
  142. package/build/src/utils.d.ts +0 -102
  143. package/build/src/utils.js +0 -232
  144. package/build/src/utils.js.map +0 -1
  145. package/docs/develop.md +0 -94
  146. package/docs/esmodules.md +0 -81
  147. package/docs/running-locally.md +0 -31
  148. package/docs/settings.md +0 -56
  149. package/docs/typescript.md +0 -354
@@ -1,364 +0,0 @@
1
- import chalk from 'chalk';
2
- import fs from 'fs-extra';
3
- import makeDir from 'make-dir';
4
- import multimatch from 'multimatch';
5
- import path from 'path';
6
- import pMap from 'p-map';
7
- import recursive from 'recursive-readdir';
8
- import typescript from 'typescript';
9
- import { GaxiosError } from 'gaxios';
10
- import { loadAPICredentials, script } from './auth.js';
11
- import { ClaspError } from './clasp-error.js';
12
- import { Conf } from './conf.js';
13
- import { FS_OPTIONS, PROJECT_MANIFEST_FILENAME } from './constants.js';
14
- import { DOTFILE } from './dotfile.js';
15
- import { ERROR, LOG } from './messages.js';
16
- import { getApiFileType, getErrorMessage, getProjectSettings, spinner, stopSpinner } from './utils.js';
17
- const { parseConfigFileTextToJson } = typescript;
18
- const config = Conf.get();
19
- async function transpile(source, transpileOptions) {
20
- const ts2gas = await import('ts2gas');
21
- return ts2gas.default(source, transpileOptions);
22
- }
23
- async function projectFileWithContent(file, transpileOptions) {
24
- const content = await fs.readFile(file.name);
25
- let source = content.toString();
26
- let type = getApiFileType(file.name);
27
- if (type === 'TS') {
28
- source = await transpile(source, transpileOptions);
29
- type = 'SERVER_JS';
30
- }
31
- return { ...file, source, type };
32
- }
33
- const ignoredProjectFile = (file) => ({ ...file, source: '', isIgnored: true, type: '' });
34
- const isValidFactory = (rootDir) => {
35
- const validManifestPath = rootDir ? path.join(rootDir, PROJECT_MANIFEST_FILENAME) : PROJECT_MANIFEST_FILENAME;
36
- /**
37
- * Validates a file:
38
- *
39
- * - is a manifest file
40
- * - type is either `SERVER_JS` or `HTML` @see https://developers.google.com/apps-script/api/reference/rest/v1/File
41
- */
42
- return (file) => Boolean(file.type === 'JSON' // Has a type or is appsscript.json
43
- ? (rootDir ? path.normalize(file.name) : file.name) === validManifestPath
44
- : file.type === 'SERVER_JS' || file.type === 'HTML');
45
- };
46
- /**
47
- * Return an array of `ProjectFile` objects
48
- *
49
- * Recursively finds all files that are part of the current project, including those that are ignored by .claspignore
50
- *
51
- * > Note: content for each file is not returned. Use `getContentOfProjectFiles()` on the resulting array.
52
- *
53
- * @param rootDir the project's `rootDir`
54
- */
55
- export const getAllProjectFiles = async (rootDir = path.join('.', '/')) => {
56
- try {
57
- const ignorePatterns = await DOTFILE.IGNORE();
58
- const isIgnored = (file) => multimatch(path.relative(rootDir, file), ignorePatterns, { dot: true }).length > 0;
59
- const isValid = isValidFactory(rootDir);
60
- // Read all filenames as a flattened tree
61
- // Note: filePaths contain relative paths such as "test/bar.ts", "../../src/foo.js"
62
- const files = (await recursive(rootDir)).map((filename) => {
63
- // Replace OS specific path separator to common '/' char for console output
64
- const name = filename.replace(/\\/g, '/');
65
- return { source: '', isIgnored: isIgnored(name), name, type: '' };
66
- });
67
- files.sort((a, b) => a.name.localeCompare(b.name));
68
- const filesWithContent = await getContentOfProjectFiles(files);
69
- return filesWithContent.map((file) => {
70
- // Loop through files that are not ignored from `.claspignore`
71
- if (!file.isIgnored) {
72
- // Prevent node_modules/@types/
73
- if (file.name.includes('node_modules/@types')) {
74
- return ignoredProjectFile(file);
75
- }
76
- // Check if there are files that will conflict if renamed .gs to .js.
77
- // When pushing to Apps Script, these files will overwrite each other.
78
- const parsed = path.parse(file.name);
79
- if (parsed.ext === '.gs') {
80
- const jsFile = `${parsed.dir}/${parsed.name}.js`;
81
- // Can't rename, conflicting files
82
- // Only print error once (for .gs)
83
- if (files.findIndex(otherFile => !otherFile.isIgnored && otherFile.name === jsFile) !== -1) {
84
- throw new ClaspError(ERROR.CONFLICTING_FILE_EXTENSION(`${parsed.dir}/${parsed.name}`));
85
- }
86
- }
87
- return isValid(file) ? file : ignoredProjectFile(file);
88
- }
89
- return file;
90
- });
91
- }
92
- catch (error) {
93
- if (error instanceof ClaspError) {
94
- throw error;
95
- }
96
- // TODO improve error handling
97
- throw error;
98
- }
99
- };
100
- export const splitProjectFiles = (files) => [
101
- files.filter(file => !file.isIgnored),
102
- files.filter(file => file.isIgnored),
103
- ];
104
- async function getContentOfProjectFiles(files) {
105
- const transpileOptions = getTranspileOptions();
106
- const getContent = (file) => (file.isIgnored ? file : projectFileWithContent(file, transpileOptions));
107
- return Promise.all(files.map(getContent));
108
- }
109
- async function getAppsScriptFilesFromProjectFiles(files, rootDir) {
110
- const filesWithContent = await getContentOfProjectFiles(files);
111
- return filesWithContent.map(file => {
112
- const { name, source, type } = file;
113
- return {
114
- name: getAppsScriptFileName(rootDir, name),
115
- source,
116
- type, // The file extension
117
- };
118
- });
119
- }
120
- // This statement customizes the order in which the files are pushed.
121
- // It puts the files in the setting's filePushOrder first.
122
- // This is needed because Apps Script blindly executes files in order of creation time.
123
- // The Apps Script API updates the creation time of files.
124
- export const getOrderedProjectFiles = (files, filePushOrder) => {
125
- const orderedFiles = [...files];
126
- if (filePushOrder && filePushOrder.length > 0) {
127
- // stopSpinner();
128
- console.log('Detected filePushOrder setting. Pushing these files first:');
129
- logFileList(filePushOrder);
130
- console.log('');
131
- orderedFiles.sort((a, b) => {
132
- // Get the file order index
133
- const indexA = filePushOrder.indexOf(a.name);
134
- const indexB = filePushOrder.indexOf(b.name);
135
- // If a file path isn't in the filePushOrder array, set the order to +∞.
136
- return (indexA > -1 ? indexA : Number.POSITIVE_INFINITY) - (indexB > -1 ? indexB : Number.POSITIVE_INFINITY);
137
- });
138
- }
139
- return orderedFiles;
140
- };
141
- // // Used to receive files tracked by current project
142
- // type FilesCallback = (error: Error | boolean, result: [string[], string[]], files: Array<AppsScriptFile>) => void;
143
- /**
144
- * Gets the local file type from the API FileType.
145
- * @param {string} type The file type returned by Apps Script
146
- * @return {string} The file type
147
- * @see https://developers.google.com/apps-script/api/reference/rest/v1/File#FileType
148
- */
149
- export const getLocalFileType = (type, fileExtension) => type === 'SERVER_JS' ? fileExtension !== null && fileExtension !== void 0 ? fileExtension : 'js' : type.toLowerCase();
150
- /**
151
- * Returns true if the user has a clasp project.
152
- * @returns {boolean} If .clasp.json exists.
153
- */
154
- export const hasProject = () => config.projectConfig !== undefined && fs.existsSync(config.projectConfig);
155
- /**
156
- * Returns in tsconfig.json.
157
- * @returns {TranspileOptions} if tsconfig.json not exists, return an empty object.
158
- */
159
- const getTranspileOptions = () => {
160
- const tsconfigPath = path.join(config.projectRootDirectory, 'tsconfig.json');
161
- return fs.existsSync(tsconfigPath)
162
- ? {
163
- compilerOptions: parseConfigFileTextToJson(tsconfigPath, fs.readFileSync(tsconfigPath, FS_OPTIONS)).config
164
- .compilerOptions,
165
- }
166
- : {};
167
- };
168
- // /**
169
- // * Recursively finds all files that are part of the current project, and those that are ignored
170
- // * by .claspignore and calls the passed callback function with the file lists.
171
- // * @param {string} rootDir The project's root directory
172
- // * @param {FilesCallBack} callback The callback will be called with the following parameters
173
- // * error: Error if there's an error, otherwise null
174
- // * result: string[][], array of two lists of strings, ie. [validFilePaths,ignoredFilePaths]
175
- // * files?: Array<AppsScriptFile> Array of AppsScriptFile objects used by clasp push
176
- // * @todo Make this function actually return a Promise that can be awaited.
177
- // */
178
- // export const getProjectFiles = async (rootDir: string = path.join('.', '/'), callback: FilesCallback) => {
179
- // try {
180
- // const {filePushOrder} = await getProjectSettings();
181
- // const allFiles = await getAllProjectFiles(rootDir);
182
- // const [filesToPush, filesToIgnore] = splitProjectFiles(allFiles);
183
- // const orderedFiles = getOrderedProjectFiles(filesToPush, filePushOrder);
184
- // callback(
185
- // false,
186
- // [orderedFiles.map(file => file.name), filesToIgnore.map(file => file.name)],
187
- // getAppsScriptFilesFromProjectFiles(orderedFiles, rootDir)
188
- // );
189
- // } catch (error) {
190
- // return callback(error, [[], []], []);
191
- // }
192
- // };
193
- /**
194
- * @deprecated If the file is valid, add it to our file list.
195
- * We generally want to allow for all file types, including files in node_modules/.
196
- * However, node_modules/@types/ files should be ignored.
197
- */
198
- export const isValidFileName = (name, type, rootDir, _normalizedName, ignoreMatches) => {
199
- const isValid = isValidFactory(rootDir);
200
- return Boolean(!name.includes('node_modules/@types') && // Prevent node_modules/@types/
201
- isValid({ source: '', isIgnored: false, name, type }) &&
202
- !ignoreMatches.includes(name) // Must be SERVER_JS or HTML. https://developers.google.com/apps-script/api/reference/rest/v1/File
203
- );
204
- };
205
- /**
206
- * Gets the name of the file for Apps Script.
207
- * Formats rootDir/appsscript.json to appsscript.json.
208
- * Preserves subdirectory names in rootDir
209
- * (rootDir/foo/Code.js becomes foo/Code.js)
210
- * @param {string} rootDir The directory to save the project files to.
211
- * @param {string} filePath Path of file that is part of the current project
212
- */
213
- export const getAppsScriptFileName = (rootDir, filePath) => {
214
- const nameWithoutExt = filePath.slice(0, -path.extname(filePath).length);
215
- // Replace OS specific path separator to common '/' char
216
- return (rootDir ? path.relative(rootDir, nameWithoutExt) : nameWithoutExt).replace(/\\/g, '/');
217
- };
218
- /**
219
- * Fetches the files for a project from the server
220
- * @param {string} scriptId The project script id
221
- * @param {number?} versionNumber The version of files to fetch.
222
- * @returns {AppsScriptFile[]} Fetched files
223
- */
224
- export const fetchProject = async (scriptId, versionNumber, silent = false) => {
225
- await loadAPICredentials();
226
- spinner.start();
227
- let response;
228
- try {
229
- response = await script.projects.getContent({ scriptId, versionNumber });
230
- }
231
- catch (error) {
232
- if (error instanceof ClaspError) {
233
- throw error;
234
- }
235
- if (error.statusCode === 404) {
236
- throw new ClaspError(ERROR.SCRIPT_ID_INCORRECT(scriptId));
237
- }
238
- throw new ClaspError(ERROR.SCRIPT_ID);
239
- }
240
- stopSpinner();
241
- const { files } = response.data;
242
- if (!files) {
243
- throw new ClaspError(ERROR.SCRIPT_ID_INCORRECT(scriptId));
244
- }
245
- if (!silent) {
246
- console.log(LOG.CLONE_SUCCESS(files.length));
247
- }
248
- return files;
249
- };
250
- /**
251
- * Writes files locally to `pwd` with dots converted to subdirectories.
252
- * @param {AppsScriptFile[]} Files to write
253
- * @param {string?} rootDir The directory to save the project files to. Defaults to `pwd`
254
- */
255
- export const writeProjectFiles = async (files, rootDir = '') => {
256
- var _a;
257
- try {
258
- const { fileExtension } = await getProjectSettings();
259
- const mapper = async (file) => {
260
- var _a;
261
- const filePath = `${file.name}.${getLocalFileType(file.type, fileExtension)}`;
262
- const truePath = `${rootDir || '.'}/${filePath}`;
263
- try {
264
- await makeDir(path.dirname(truePath));
265
- await fs.writeFile(truePath, file.source);
266
- }
267
- catch (error) {
268
- throw new ClaspError((_a = getErrorMessage(error)) !== null && _a !== void 0 ? _a : ERROR.FS_FILE_WRITE);
269
- }
270
- // Log only filename if pulling to root (Code.gs vs ./Code.gs)
271
- console.log(`└─ ${rootDir ? truePath : filePath}`);
272
- };
273
- const fileList = files.filter(file => file.source); // Disallow empty files
274
- fileList.sort((a, b) => a.name.localeCompare(b.name));
275
- await pMap(fileList, mapper);
276
- }
277
- catch (error) {
278
- if (error instanceof ClaspError) {
279
- throw error;
280
- }
281
- throw new ClaspError((_a = getErrorMessage(error)) !== null && _a !== void 0 ? _a : ERROR.FS_DIR_WRITE);
282
- }
283
- };
284
- /**
285
- * Pushes project files to script.google.com.
286
- * @param {boolean} silent If true, doesn't console.log any success message.
287
- */
288
- export const pushFiles = async (silent = false) => {
289
- var _a;
290
- const { filePushOrder, scriptId, rootDir } = await getProjectSettings();
291
- if (scriptId) {
292
- const [toPush] = splitProjectFiles(await getAllProjectFiles(rootDir));
293
- if (toPush.length > 0) {
294
- const orderedFiles = getOrderedProjectFiles(toPush, filePushOrder);
295
- const files = await getAppsScriptFilesFromProjectFiles(orderedFiles, rootDir !== null && rootDir !== void 0 ? rootDir : path.join('.', '/'));
296
- const filenames = orderedFiles.map(file => file.name);
297
- // Start pushing.
298
- try {
299
- await script.projects.updateContent({ scriptId, requestBody: { scriptId, files } });
300
- // No error
301
- stopSpinner();
302
- if (!silent) {
303
- logFileList(filenames);
304
- console.log(LOG.PUSH_SUCCESS(filenames.length));
305
- }
306
- }
307
- catch (error) {
308
- stopSpinner();
309
- console.error(LOG.PUSH_FAILURE);
310
- if (error instanceof GaxiosError) {
311
- let message = error.message;
312
- let snippet = '';
313
- const re = /Syntax error: (.+) line: (\d+) file: (.+)/;
314
- const [, errorName, lineNum, fileName] = (_a = re.exec(error.message)) !== null && _a !== void 0 ? _a : [];
315
- if (fileName !== undefined) {
316
- let filePath = path.resolve(rootDir !== null && rootDir !== void 0 ? rootDir : '.', fileName);
317
- const parsedFilePath = path.parse(filePath);
318
- // Check if the file exists locally as any supported type
319
- const { fileExtension } = await getProjectSettings();
320
- const extensions = ['gs', 'js', 'ts'];
321
- if (fileExtension !== undefined)
322
- extensions.push(fileExtension);
323
- for (const ext of extensions) {
324
- const filePath_ext = path.join(parsedFilePath.dir, `${parsedFilePath.name}.${ext}`);
325
- if (fs.existsSync(filePath_ext)) {
326
- filePath = filePath_ext;
327
- break;
328
- }
329
- }
330
- message = `${errorName} - "${filePath}:${lineNum}"`;
331
- // Get formatted code snippet
332
- const contextCount = 4;
333
- const parsedFileName = path.parse(fileName);
334
- const fileNameKey = path.join(parsedFileName.dir, parsedFileName.name);
335
- const reqFiles = JSON.parse(error.config.body).files;
336
- const errFile = reqFiles.find((x) => x.name === fileNameKey && x.type === 'SERVER_JS');
337
- if (errFile !== undefined) {
338
- const srcLines = errFile.source.split('\n');
339
- const errIndex = Math.max(parseInt(lineNum) - 1, 0);
340
- const preIndex = Math.max(errIndex - contextCount, 0);
341
- const postIndex = Math.min(errIndex + contextCount + 1, srcLines.length);
342
- const preLines = chalk.dim(` ${srcLines.slice(preIndex, errIndex).join('\n ')}`);
343
- const errLine = chalk.bold(`⇒ ${srcLines[errIndex]}`);
344
- const postLines = chalk.dim(` ${srcLines.slice(errIndex + 1, postIndex).join('\n ')}`);
345
- snippet = preLines + '\n' + errLine + '\n' + postLines;
346
- }
347
- }
348
- console.error(chalk.red(message));
349
- console.log(snippet);
350
- }
351
- else {
352
- console.error(error);
353
- }
354
- throw error;
355
- }
356
- }
357
- else {
358
- stopSpinner();
359
- console.log(LOG.PUSH_NO_FILES);
360
- }
361
- }
362
- };
363
- export const logFileList = (files) => console.log(files.map(file => `└─ ${file}`).join('\n'));
364
- //# sourceMappingURL=files.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,OAAO,MAAM,UAAU,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,OAAO,CAAC;AACzB,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,WAAW,EAAC,MAAM,QAAQ,CAAC;AAEnC,OAAO,EAAC,kBAAkB,EAAE,MAAM,EAAC,MAAM,WAAW,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAC,UAAU,EAAE,yBAAyB,EAAC,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EAAC,KAAK,EAAE,GAAG,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,cAAc,EAAE,eAAe,EAA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AC,CAAC;4BACnF,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;4BACtD,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;4BAEzF,OAAO,GAAG,QAAQ,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;yBACxD;qBACF;oBACD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;oBAClC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;iBACtB;qBAAM;oBACL,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;iBACtB;gBACD,MAAM,KAAK,CAAC;aACb;SACF;aAAM;YACL,WAAW,EAAE,CAAC;YACd,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;SAChC;KACF;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAwB,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC"}
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * @license
4
- * Copyright Google Inc.
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * https://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;GAeG;AAEH;;GAEG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,OAAO,EAAC,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAC,iBAAiB,EAAC,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAC,aAAa,EAAC,MAAM,KAAK,CAAC;AAClC,OAAO,EAAE,MAAM,UAAU,CAAC;AAE1B,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,QAAQ,MAAM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CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACvC,WAAW,EAAE,CAAC;KACf;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,IAAI,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,UAAU,EAAE;YAC/B,sCAAsC;YACtC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SAC9B;aAAM,IAAI,KAAK,YAAY,KAAK,EAAE;YACjC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SAC9B;aAAM;YACL,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;SACvC;KACF;IAED,OAAO,CAAC,KAAK,EAAE,CAAC;AAClB,CAAC,CAAC,EAAE,CAAC"}
@@ -1,82 +0,0 @@
1
- import { script_v1 as scriptV1 } from 'googleapis';
2
- import type { ReadonlyDeep } from 'type-fest';
3
- export declare type functionNameSource = (answers: {
4
- readonly functionName: string;
5
- }, input?: string | undefined) => Promise<string[]>;
6
- /**
7
- * Inquirer prompt for a functionName.
8
- * @returns {Promise<{ functionName: string }>} A promise for an object with the `functionName` property.
9
- */
10
- export declare const functionNamePrompt: (source: functionNameSource) => Promise<{
11
- functionName: string;
12
- }> & {
13
- ui: import("inquirer/lib/ui/prompt");
14
- };
15
- export interface DeploymentIdPromptChoice {
16
- name: string;
17
- value: scriptV1.Schema$Deployment;
18
- }
19
- /**
20
- * Inquirer prompt for a deployment Id.
21
- * @param {DeploymentIdChoice[]} choices An array of `DeploymentIdChoice` objects.
22
- * @returns {Promise<{ deploymentId: string }>} A promise for an object with the `deploymentId` property.
23
- */
24
- export declare const deploymentIdPrompt: (choices: ReadonlyArray<ReadonlyDeep<DeploymentIdPromptChoice>>) => Promise<{
25
- deployment: scriptV1.Schema$Deployment;
26
- }> & {
27
- ui: import("inquirer/lib/ui/prompt");
28
- };
29
- /**
30
- * Inquirer prompt for a project description.
31
- * @returns {Promise<{ description: string }>} A promise for an object with the `description` property.
32
- */
33
- export declare const descriptionPrompt: () => Promise<{
34
- description: string;
35
- }> & {
36
- ui: import("inquirer/lib/ui/prompt");
37
- };
38
- export interface PromptAnswers {
39
- doAuth: boolean;
40
- localhost: boolean;
41
- }
42
- /**
43
- * Inquirer prompt for overwriting a manifest.
44
- * @returns {Promise<{ overwrite: boolean }>} A promise for an object with the `overwrite` property.
45
- */
46
- export declare const overwritePrompt: () => Promise<{
47
- overwrite: boolean;
48
- }> & {
49
- ui: import("inquirer/lib/ui/prompt");
50
- };
51
- /**
52
- * Inquirer prompt for project Id.
53
- * @returns {Promise<{ projectId: string }>} A promise for an object with the `projectId` property.
54
- */
55
- export declare const projectIdPrompt: () => Promise<{
56
- readonly projectId: string;
57
- }> & {
58
- ui: import("inquirer/lib/ui/prompt");
59
- };
60
- export interface ScriptIdPrompt {
61
- name: string;
62
- value: string;
63
- }
64
- /**
65
- * Inquirer prompt for script Id.
66
- * @param {ScriptIdPrompt[]} fileIds An array of `ScriptIdPrompt` objects.
67
- * @returns {Promise<{scriptId: string;}>} A promise for an object with the `scriptId` property.
68
- */
69
- export declare const scriptIdPrompt: (fileIds: ReadonlyArray<Readonly<ScriptIdPrompt>>) => Promise<{
70
- scriptId: string;
71
- }> & {
72
- ui: import("inquirer/lib/ui/prompt");
73
- };
74
- /**
75
- * Inquirer prompt for script type.
76
- * @returns {Promise<{ type: string }>} A promise for an object with the `type` property.
77
- */
78
- export declare const scriptTypePrompt: () => Promise<{
79
- type: string;
80
- }> & {
81
- ui: import("inquirer/lib/ui/prompt");
82
- };
@@ -1,111 +0,0 @@
1
- import inquirer from 'inquirer';
2
- import autocomplete from 'inquirer-autocomplete-prompt-ipt';
3
- import { SCRIPT_TYPES } from './apis.js';
4
- import { LOG } from './messages.js';
5
- const { prompt, registerPrompt } = inquirer;
6
- registerPrompt('autocomplete', autocomplete);
7
- /**
8
- * Inquirer prompt for a functionName.
9
- * @returns {Promise<{ functionName: string }>} A promise for an object with the `functionName` property.
10
- */
11
- export const functionNamePrompt = (source) => prompt([
12
- {
13
- name: 'functionName',
14
- message: 'Select a functionName',
15
- type: 'autocomplete',
16
- source,
17
- },
18
- ]);
19
- /**
20
- * Inquirer prompt for a deployment Id.
21
- * @param {DeploymentIdChoice[]} choices An array of `DeploymentIdChoice` objects.
22
- * @returns {Promise<{ deploymentId: string }>} A promise for an object with the `deploymentId` property.
23
- */
24
- export const deploymentIdPrompt = (choices) => prompt([
25
- {
26
- choices,
27
- message: 'Open which deployment?',
28
- name: 'deployment',
29
- type: 'list',
30
- },
31
- ]);
32
- /**
33
- * Inquirer prompt for a project description.
34
- * @returns {Promise<{ description: string }>} A promise for an object with the `description` property.
35
- */
36
- export const descriptionPrompt = () => prompt([
37
- {
38
- default: '',
39
- message: LOG.GIVE_DESCRIPTION,
40
- name: 'description',
41
- type: 'input',
42
- },
43
- ]);
44
- // /**
45
- // * Inquirer prompt for oauth scopes.
46
- // * @returns {Promise<PromptAnswers>} A promise for an object with the `PromptAnswers` interface.
47
- // */
48
- // export const oauthScopesPrompt = () =>
49
- // prompt<PromptAnswers>([
50
- // {
51
- // message: 'Authorize new scopes?',
52
- // name: 'doAuth',
53
- // type: 'confirm',
54
- // },
55
- // {
56
- // message: 'Use localhost?',
57
- // name: 'localhost',
58
- // type: 'confirm',
59
- // when: (answers: Readonly<PromptAnswers>) => answers.doAuth,
60
- // },
61
- // ]);
62
- /**
63
- * Inquirer prompt for overwriting a manifest.
64
- * @returns {Promise<{ overwrite: boolean }>} A promise for an object with the `overwrite` property.
65
- */
66
- export const overwritePrompt = () => prompt([
67
- {
68
- default: false,
69
- message: 'Manifest file has been updated. Do you want to push and overwrite?',
70
- name: 'overwrite',
71
- type: 'confirm',
72
- },
73
- ]);
74
- /**
75
- * Inquirer prompt for project Id.
76
- * @returns {Promise<{ projectId: string }>} A promise for an object with the `projectId` property.
77
- */
78
- export const projectIdPrompt = () => prompt([
79
- {
80
- message: `${LOG.ASK_PROJECT_ID}`,
81
- name: 'projectId',
82
- type: 'input',
83
- },
84
- ]);
85
- /**
86
- * Inquirer prompt for script Id.
87
- * @param {ScriptIdPrompt[]} fileIds An array of `ScriptIdPrompt` objects.
88
- * @returns {Promise<{scriptId: string;}>} A promise for an object with the `scriptId` property.
89
- */
90
- export const scriptIdPrompt = (fileIds) => prompt([
91
- {
92
- choices: fileIds,
93
- message: LOG.CLONE_SCRIPT_QUESTION,
94
- name: 'scriptId',
95
- pageSize: 30,
96
- type: 'list',
97
- },
98
- ]);
99
- /**
100
- * Inquirer prompt for script type.
101
- * @returns {Promise<{ type: string }>} A promise for an object with the `type` property.
102
- */
103
- export const scriptTypePrompt = () => prompt([
104
- {
105
- choices: Object.keys(SCRIPT_TYPES).map(key => SCRIPT_TYPES[key]),
106
- message: LOG.CREATE_SCRIPT_QUESTION,
107
- name: 'type',
108
- type: 'list',
109
- },
110
- ]);
111
- //# sourceMappingURL=inquirer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inquirer.js","sourceRoot":"","sources":["../../src/inquirer.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,YAAY,MAAM,kCAAkC,CAAC;AAG5D,OAAO,EAAC,YAAY,EAAC,MAAM,WAAW,CAAC;AACvC,OAAO,EAAC,GAAG,EAAC,MAAM,eAAe,CAAC;AAElC,MAAM,EAAC,MAAM,EAAE,cAAc,EAAC,GAAG,QAAQ,CAAC;AAE1C,cAAc,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AAO7C;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAA0B,EAAE,EAAE,CAC/D,MAAM,CAAyB;IAC7B;QACE,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,uBAAuB;QAChC,IAAI,EAAE,cAAc;QACpB,MAAM;KACP;CACF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