@google/clasp 2.5.0 → 3.0.1-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 +63 -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,181 +0,0 @@
1
- import is from '@sindresorhus/is';
2
- import chalk from 'chalk';
3
- import open from 'open';
4
- import { loadAPICredentials, logger } from '../auth.js';
5
- import { ClaspError } from '../clasp-error.js';
6
- import { DOTFILE } from '../dotfile.js';
7
- import { projectIdPrompt } from '../inquirer.js';
8
- import { ERROR, LOG } from '../messages.js';
9
- import { URL } from '../urls.js';
10
- import { getErrorMessage, getProjectSettings, isValidProjectId, spinner, stopSpinner } from '../utils.js';
11
- /**
12
- * Prints StackDriver logs from this Apps Script project.
13
- * @param options.json {boolean} If true, the command will output logs as json.
14
- * @param options.open {boolean} If true, the command will open the StackDriver logs website.
15
- * @param options.setup {boolean} If true, the command will help you setup logs.
16
- * @param options.watch {boolean} If true, the command will watch for logs and print them. Exit with ^C.
17
- * @param options.simplified {boolean} If true, the command will remove timestamps from the logs.
18
- */
19
- export default async (options) => {
20
- // Get project settings.
21
- const projectSettings = await getProjectSettings();
22
- let projectId = options.setup ? await setupLogs(projectSettings) : projectSettings.projectId;
23
- if (!projectId) {
24
- console.log(LOG.NO_GCLOUD_PROJECT);
25
- projectId = await setupLogs(projectSettings);
26
- console.log(LOG.LOGS_SETUP);
27
- }
28
- // If we're opening the logs, get the URL, open, then quit.
29
- if (options.open) {
30
- const url = URL.LOGS(projectId);
31
- console.log(`Opening logs: ${url}`);
32
- await open(url, { wait: false });
33
- return;
34
- }
35
- const { json, simplified } = options;
36
- // Otherwise, if not opening StackDriver, load StackDriver logs.
37
- if (options.watch) {
38
- const POLL_INTERVAL = 6000; // 6s
39
- setInterval(async () => {
40
- const startDate = new Date();
41
- startDate.setSeconds(startDate.getSeconds() - (10 * POLL_INTERVAL) / 1000);
42
- await fetchAndPrintLogs(json, simplified, projectId, startDate);
43
- }, POLL_INTERVAL);
44
- }
45
- else {
46
- await fetchAndPrintLogs(json, simplified, projectId);
47
- }
48
- };
49
- /**
50
- * This object holds all log IDs that have been printed to the user.
51
- * This prevents log entries from being printed multiple times.
52
- * StackDriver isn't super reliable, so it's easier to get generous chunk of logs and filter them
53
- * rather than filter server-side.
54
- * @see logs.data.entries[0].insertId
55
- */
56
- const logEntryCache = {};
57
- const severityColor = {
58
- ERROR: chalk.red,
59
- INFO: chalk.cyan,
60
- DEBUG: chalk.green,
61
- NOTICE: chalk.magenta,
62
- WARNING: chalk.yellow,
63
- };
64
- /**
65
- * Prints log entries
66
- * @param entries {any[]} StackDriver log entries.
67
- */
68
- const printLogs = (input = [], formatJson = false, simplified = false) => {
69
- const entries = [...input].reverse().slice(0, 50); // Print in syslog ascending order
70
- for (const entry of entries) {
71
- const { severity = '', timestamp = '', resource, insertId = '' } = entry;
72
- if (resource === null || resource === void 0 ? void 0 : resource.labels) {
73
- let { function_name: functionName = ERROR.NO_FUNCTION_NAME } = resource.labels;
74
- functionName = functionName.padEnd(15);
75
- let payloadData = '';
76
- if (formatJson) {
77
- payloadData = JSON.stringify(entry, null, 2);
78
- }
79
- else {
80
- const kludge = obscure(entry, functionName);
81
- payloadData = kludge.payloadData;
82
- functionName = kludge.functionName;
83
- }
84
- const coloredSeverity = `${severityColor[severity](severity) || severity}`.padEnd(20);
85
- // If we haven't logged this entry before, log it and mark the cache.
86
- if (!logEntryCache[insertId]) {
87
- console.log(simplified
88
- ? `${coloredSeverity} ${functionName} ${payloadData}`
89
- : `${coloredSeverity} ${timestamp} ${functionName} ${payloadData}`);
90
- logEntryCache[insertId] = true;
91
- }
92
- }
93
- }
94
- };
95
- const obscure = (entry, functionName) => {
96
- var _a;
97
- const { jsonPayload, protoPayload = {}, textPayload } = entry;
98
- // Chokes on unmatched json payloads
99
- // jsonPayload: jsonPayload ? jsonPayload.fields.message.stringValue : '',
100
- let payloadData = (_a = textPayload !== null && textPayload !== void 0 ? textPayload : ((jsonPayload ? JSON.stringify(jsonPayload).slice(0, 255) : '') || protoPayload)) !== null && _a !== void 0 ? _a : ERROR.PAYLOAD_UNKNOWN;
101
- if (!is.string(payloadData) && protoPayload['@type'] === 'type.googleapis.com/google.cloud.audit.AuditLog') {
102
- payloadData = LOG.STACKDRIVER_SETUP;
103
- functionName = protoPayload.methodName.padEnd(15);
104
- }
105
- if (is.string(payloadData)) {
106
- payloadData = payloadData.padEnd(20);
107
- }
108
- return { functionName, payloadData };
109
- };
110
- const setupLogs = async (projectSettings) => {
111
- try {
112
- console.log(`${LOG.OPEN_LINK(LOG.SCRIPT_LINK(projectSettings.scriptId))}\n`);
113
- console.log(`${LOG.GET_PROJECT_ID_INSTRUCTIONS}\n`);
114
- const dotfile = DOTFILE.PROJECT();
115
- if (!dotfile) {
116
- throw new ClaspError(ERROR.SETTINGS_DNE());
117
- }
118
- const settings = await dotfile.read();
119
- if (!settings.scriptId) {
120
- throw new ClaspError(ERROR.SCRIPT_ID_DNE());
121
- }
122
- const { projectId } = await projectIdPrompt();
123
- await dotfile.write({ ...settings, projectId });
124
- return projectId;
125
- }
126
- catch (error) {
127
- if (error instanceof ClaspError) {
128
- throw error;
129
- }
130
- throw new ClaspError(getErrorMessage(error)); // TODO get rid of type casting
131
- }
132
- };
133
- /**
134
- * Fetches the logs and prints the to the user.
135
- * @param startDate {Date?} Get logs from this date to now.
136
- */
137
- const fetchAndPrintLogs = async (formatJson = false, simplified = false, projectId, startDate) => {
138
- // Validate projectId
139
- if (!projectId) {
140
- throw new ClaspError(ERROR.NO_GCLOUD_PROJECT());
141
- }
142
- if (!isValidProjectId(projectId)) {
143
- throw new ClaspError(ERROR.PROJECT_ID_INCORRECT(projectId));
144
- }
145
- const { isLocalCreds } = await loadAPICredentials();
146
- spinner.start(`${isLocalCreds ? LOG.LOCAL_CREDS() : ''}${LOG.GRAB_LOGS}`);
147
- // Create a time filter (timestamp >= "2016-11-29T23:00:00Z")
148
- // https://cloud.google.com/logging/docs/view/advanced-filters#search-by-time
149
- const filter = startDate ? `timestamp >= "${startDate.toISOString()}"` : '';
150
- try {
151
- const logs = await logger.entries.list({
152
- requestBody: { resourceNames: [`projects/${projectId}`], filter, orderBy: 'timestamp desc' },
153
- });
154
- // We have an API response. Now, check the API response status.
155
- stopSpinner();
156
- // Only print filter if provided.
157
- if (filter.length > 0) {
158
- console.log(filter);
159
- }
160
- // Parse response and print logs or print error message.
161
- const { data, status, statusText } = logs;
162
- switch (status) {
163
- case 200:
164
- printLogs(data.entries, formatJson, simplified);
165
- break;
166
- case 401:
167
- throw new ClaspError(isLocalCreds ? ERROR.UNAUTHENTICATED_LOCAL : ERROR.UNAUTHENTICATED);
168
- case 403:
169
- throw new ClaspError(isLocalCreds ? ERROR.PERMISSION_DENIED_LOCAL : ERROR.PERMISSION_DENIED);
170
- default:
171
- throw new ClaspError(`(${status}) Error: ${statusText}`);
172
- }
173
- }
174
- catch (error) {
175
- if (error instanceof ClaspError) {
176
- throw error;
177
- }
178
- throw new ClaspError(ERROR.PROJECT_ID_INCORRECT(projectId));
179
- }
180
- };
181
- //# sourceMappingURL=logs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logs.js","sourceRoot":"","sources":["../../../src/commands/logs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAC,kBA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AM,EAAE,OAAO,EAAE,gBAAgB,EAAC;SAC3F,CAAC,CAAC;QAEH,+DAA+D;QAC/D,WAAW,EAAE,CAAC;QAEd,iCAAiC;QACjC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YACrB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;SACrB;QAED,wDAAwD;QACxD,MAAM,EAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAC,GAAG,IAAI,CAAC;QAExC,QAAQ,MAAM,EAAE;YACd,KAAK,GAAG;gBACN,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;gBAChD,MAAM;YACR,KAAK,GAAG;gBACN,MAAM,IAAI,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;YAC3F,KAAK,GAAG;gBACN,MAAM,IAAI,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;YAC/F;gBACE,MAAM,IAAI,UAAU,CAAC,IAAI,MAAM,YAAY,UAAU,EAAE,CAAC,CAAC;SAC5D;KACF;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,KAAK,YAAY,UAAU,EAAE;YAC/B,MAAM,KAAK,CAAC;SACb;QAED,MAAM,IAAI,UAAU,CAAC,KAAK,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC,CAAC;KAC7D;AACH,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- interface CommandOption {
2
- readonly webapp?: boolean;
3
- readonly creds?: boolean;
4
- readonly addon?: boolean;
5
- readonly deploymentId?: string;
6
- }
7
- declare const _default: (scriptId: string, options: CommandOption) => Promise<void>;
8
- /**
9
- * Opens an Apps Script project's script.google.com editor.
10
- * @param scriptId {string} The Apps Script project to open.
11
- * @param options.webapp {boolean} If true, the command will open the webapps URL.
12
- * @param options.creds {boolean} If true, the command will open the credentials URL.
13
- * @param options.deploymentId {string} Use custom deployment ID with webapp.
14
- */
15
- export default _default;
@@ -1,89 +0,0 @@
1
- import open from 'open';
2
- import { loadAPICredentials, script } from '../auth.js';
3
- import { ClaspError } from '../clasp-error.js';
4
- import { deploymentIdPrompt } from '../inquirer.js';
5
- import { ERROR, LOG } from '../messages.js';
6
- import { URL } from '../urls.js';
7
- import { ellipsize, getProjectSettings, getWebApplicationURL } from '../utils.js';
8
- const getDeploymentId = async (choices) => {
9
- const { deployment: { deploymentId }, } = await deploymentIdPrompt(choices);
10
- return deploymentId;
11
- };
12
- /**
13
- * Opens an Apps Script project's script.google.com editor.
14
- * @param scriptId {string} The Apps Script project to open.
15
- * @param options.webapp {boolean} If true, the command will open the webapps URL.
16
- * @param options.creds {boolean} If true, the command will open the credentials URL.
17
- * @param options.deploymentId {string} Use custom deployment ID with webapp.
18
- */
19
- export default async (scriptId, options) => {
20
- const projectSettings = await getProjectSettings();
21
- const currentScriptId = scriptId !== null && scriptId !== void 0 ? scriptId : projectSettings.scriptId;
22
- if (currentScriptId.length < 30) {
23
- throw new ClaspError(ERROR.SCRIPT_ID_INCORRECT(currentScriptId));
24
- }
25
- // We've specified to open creds.
26
- if (options.creds) {
27
- const { projectId } = projectSettings;
28
- if (!projectId) {
29
- throw new ClaspError(ERROR.NO_GCLOUD_PROJECT());
30
- }
31
- console.log(LOG.OPEN_CREDS(projectId));
32
- await open(URL.CREDS(projectId));
33
- return;
34
- }
35
- // We've specified to print addons and open the first one.
36
- if (options.addon) {
37
- await openAddon(projectSettings);
38
- return;
39
- }
40
- if (options.webapp) {
41
- await openWebApp(currentScriptId, options.deploymentId);
42
- return;
43
- }
44
- // If we're not a web app, open the script URL.
45
- console.log(LOG.OPEN_PROJECT(currentScriptId));
46
- await open(URL.SCRIPT(currentScriptId));
47
- };
48
- const openAddon = async (projectSettings) => {
49
- const { parentId: parentIdList = [] } = projectSettings;
50
- if (parentIdList.length === 0) {
51
- throw new ClaspError(ERROR.NO_PARENT_ID());
52
- }
53
- if (parentIdList.length > 1) {
54
- for (const id of parentIdList) {
55
- console.log(LOG.FOUND_PARENT(id));
56
- }
57
- }
58
- const parentId = parentIdList[0];
59
- console.log(LOG.OPEN_FIRST_PARENT(parentId));
60
- await open(URL.DRIVE(parentId));
61
- };
62
- const openWebApp = async (scriptId, optionsDeploymentId) => {
63
- // Web app: open the latest deployment.
64
- await loadAPICredentials();
65
- const { data: { deployments = [] }, status, statusText, } = await script.projects.deployments.list({ scriptId });
66
- if (status !== 200) {
67
- throw new ClaspError(statusText);
68
- }
69
- if (deployments.length === 0) {
70
- throw new ClaspError(ERROR.SCRIPT_ID_INCORRECT(scriptId));
71
- }
72
- // Order deployments by update time.
73
- const choices = [...deployments];
74
- choices.sort((a, b) => (a.updateTime && b.updateTime ? a.updateTime.localeCompare(b.updateTime) : 0));
75
- const prompts = choices.map(value => {
76
- const { description, versionNumber } = value.deploymentConfig;
77
- const name = `${ellipsize(description !== null && description !== void 0 ? description : '', 30)}@${`${versionNumber !== null && versionNumber !== void 0 ? versionNumber : 'HEAD'}`.padEnd(4)} - ${value.deploymentId}`;
78
- return { name, value };
79
- });
80
- const deploymentId = optionsDeploymentId !== null && optionsDeploymentId !== void 0 ? optionsDeploymentId : (await getDeploymentId(prompts));
81
- const deployment = await script.projects.deployments.get({ scriptId, deploymentId });
82
- console.log(LOG.OPEN_WEBAPP(deploymentId));
83
- const target = getWebApplicationURL(deployment.data);
84
- if (!target) {
85
- throw new ClaspError(`Could not open deployment: ${JSON.stringify(deployment)}`);
86
- }
87
- await open(target, { wait: false });
88
- };
89
- //# sourceMappingURL=open.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"open.js","sourceRoot":"","sources":["../../../src/commands/open.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAC,kBAAkB,EAAE,MAAM,EAAC,MAAM,YA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AE7E,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,EAAC,QAAQ,EAAE,YAAY,EAAC,CAAC,CAAC;IACnF,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC;IAC3C,MAAM,MAAM,GAAG,oBAAoB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACrD,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,IAAI,UAAU,CAAC,8BAA8B,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;KAClF;IAED,MAAM,IAAI,CAAC,MAAM,EAAE,EAAC,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC;AACpC,CAAC,CAAC"}
@@ -1,10 +0,0 @@
1
- interface CommandOption {
2
- readonly versionNumber?: number;
3
- }
4
- declare const _default: (options: CommandOption) => Promise<void>;
5
- /**
6
- * Force downloads all Apps Script project files into the local filesystem.
7
- * @param options.versionNumber {number} The version number of the project to retrieve.
8
- * If not provided, the project's HEAD version is returned.
9
- */
10
- export default _default;
@@ -1 +0,0 @@
1
- {"version":3,"file":"pull.js","sourceRoot":"","sources":["../../../src/commands/pull.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,iBAAiB,EAAC,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAC,GAAG,EAAC,MAAM,gBAAgB,CAAC;AACnC,OAAO,EAAC,kBAAkB,EAAE,OAAO,EAAE,WAAW,EAAC,MAAM,aAAa,CAAC;AAMrE;;;;GAIG;AACH,eAAe,KAAK,EAAE,OAAsB,EAAiB,EAAE;IAC7D,MAAM,EAAC,QAAQ,EAAE,OAAO,EAAC,GAAG,MAAM,kBAAkB,EAAE,CAAC;IACvD,IAAI,QAAQ,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAE3B,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;QAClE,MAAM,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAExC,WAAW,EAAE,CAAC;KACf;AACH,CAAC,CAAC"}
@@ -1,11 +0,0 @@
1
- interface CommandOption {
2
- readonly watch?: boolean;
3
- readonly force?: boolean;
4
- }
5
- declare const _default: (options: CommandOption) => Promise<void>;
6
- /**
7
- * Uploads all files into the script.google.com filesystem.
8
- * TODO: Only push the specific files that changed (rather than all files).
9
- * @param options.watch {boolean} If true, runs `clasp push` when any local file changes. Exit with ^C.
10
- */
11
- export default _default;
@@ -1 +0,0 @@
1
- {"version":3,"file":"push.js","sourceRoot":"","sources":["../../../src/commands/push.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,gBAAgB,MAAM,mBAAmB,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,WAAW,MAAM,UAAU,CAAC;AACnC,OAAO,EAAC,kBAAkB,EAAC,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAC,IAAI,EAAC,MAAM,YAAY,CAAC;AAChC,OAAO,EAAC,UAAU,EAAE,yBAAyB,EAAE,yBAAyB,EAAC,MAAM,iBAAiB,CAAC;AACjG,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AACtC,OAAO,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,aAAa,CAAC;AACpD,OAAO,EAAC,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAC,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAC,GAAG,EAAC,MAAM,gBAAgB,CAAC;AACnC,OAAO,EAAC,kBAAkB,EAAE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yB,CAAC,EAAE,UAAU,CAAC,CAAC;IAC/F,MAAM,WAAW,GAAG,MAAM,YAAY,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IAClE,MAAM,cAAc,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,yBAAyB,CAAC,CAAC;IACzF,IAAI,cAAc,EAAE;QAClB,OAAO,gBAAgB,CAAC,aAAa,CAAC,KAAK,gBAAgB,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;KACpF;IAED,MAAM,IAAI,UAAU,CAAC,0BAA0B,CAAC,CAAC;AACnD,CAAC,CAAC"}
@@ -1,14 +0,0 @@
1
- interface CommandOption {
2
- readonly nondev: boolean;
3
- readonly params: string;
4
- }
5
- declare const _default: (functionName: string, options: CommandOption) => Promise<void>;
6
- /**
7
- * Executes an Apps Script function. Requires clasp login --creds.
8
- * @param functionName {string} The function name within the Apps Script project.
9
- * @param options.nondev {boolean} If we want to run the last deployed version vs the latest code.
10
- * @param options.params {string} JSON string of parameters to be input to function.
11
- * @see https://developers.google.com/apps-script/api/how-tos/execute
12
- * @requires `clasp login --creds` to be run beforehand.
13
- */
14
- export default _default;
@@ -1,130 +0,0 @@
1
- import chalk from 'chalk';
2
- import readline from 'readline';
3
- import { getFunctionNames } from '../apiutils.js';
4
- import { getLocalScript, loadAPICredentials, script } from '../auth.js';
5
- import { ClaspError } from '../clasp-error.js';
6
- import { addScopeToManifest, isValidRunManifest } from '../manifest.js';
7
- import { ERROR } from '../messages.js';
8
- import { URL } from '../urls.js';
9
- import { getProjectSettings, parseJsonOrDie, spinner, stopSpinner } from '../utils.js';
10
- /**
11
- * Executes an Apps Script function. Requires clasp login --creds.
12
- * @param functionName {string} The function name within the Apps Script project.
13
- * @param options.nondev {boolean} If we want to run the last deployed version vs the latest code.
14
- * @param options.params {string} JSON string of parameters to be input to function.
15
- * @see https://developers.google.com/apps-script/api/how-tos/execute
16
- * @requires `clasp login --creds` to be run beforehand.
17
- */
18
- export default async (functionName, options) => {
19
- await loadAPICredentials();
20
- const { scriptId } = await getProjectSettings();
21
- const devMode = !options.nondev; // Defaults to true
22
- const { params: jsonString = '[]' } = options;
23
- const parameters = parseJsonOrDie(jsonString);
24
- await isValidRunManifest();
25
- // TODO COMMENT THIS. This uses a method that gives a HTML 404.
26
- // await enableExecutionAPI();
27
- // Pushes the latest code if in dev mode.
28
- // We need to update the manifest before executing to:
29
- // - Ensure the execution API is enabled.
30
- // - Ensure we can run functions that were developed locally but not pushed.
31
- if (devMode) {
32
- console.log('Running in dev mode.');
33
- // TODO enable this once we can properly await pushFiles
34
- // await pushFiles(true);
35
- }
36
- await runFunction(functionName !== null && functionName !== void 0 ? functionName : (await getFunctionNames(script, scriptId)), parameters, scriptId, devMode);
37
- };
38
- /**
39
- * Runs a function.
40
- * @see https://developers.google.com/apps-script/api/reference/rest/v1/scripts/run#response-body
41
- */
42
- const runFunction = async (functionName, parameters, scriptId, devMode) => {
43
- var _a;
44
- try {
45
- // Load local credentials.
46
- await loadAPICredentials(true);
47
- const localScript = await getLocalScript();
48
- spinner.start(`Running function: ${functionName}`);
49
- const apiResponse = await localScript.scripts.run({
50
- scriptId,
51
- requestBody: { function: functionName, parameters, devMode },
52
- });
53
- stopSpinner();
54
- if (!(apiResponse === null || apiResponse === void 0 ? void 0 : apiResponse.data.done)) {
55
- throw new ClaspError(ERROR.RUN_NODATA, 0); // Exit gracefully in case localhost server spun up for authorize
56
- }
57
- const { error, response } = apiResponse.data;
58
- // @see https://developers.google.com/apps-script/api/reference/rest/v1/scripts/run#response-body
59
- if (response) {
60
- console.log((_a = response.result) !== null && _a !== void 0 ? _a : chalk.red('No response.'));
61
- }
62
- else if (error === null || error === void 0 ? void 0 : error.details) {
63
- // @see https://developers.google.com/apps-script/api/reference/rest/v1/scripts/run#Status
64
- const { errorMessage, errorType, scriptStackTraceElements } = error.details[0];
65
- console.error(`${chalk.red('Exception:')}`, errorMessage, scriptStackTraceElements || []);
66
- throw new ClaspError(errorType);
67
- }
68
- }
69
- catch (error) {
70
- if (error instanceof ClaspError) {
71
- throw error;
72
- }
73
- stopSpinner();
74
- if (error) {
75
- // TODO move these to logError when stable?
76
- switch (error.code) {
77
- case 401:
78
- // The 401 is probably due to this error:
79
- // "Error: Local client credentials unauthenticated. Check scopes/authorization.""
80
- // This is probably due to the OAuth client not having authorized scopes.
81
- console.log(`Hey! It looks like you aren't authenticated for the scopes required by this script.
82
- Please enter the scopes by doing the following:
83
- 1. Open Your Script: ${URL.SCRIPT(scriptId)}
84
- 2. File > Project Properties > Scopes
85
- 3. Copy/Paste the list of scopes here:
86
- ~ Example ~
87
- https://mail.google.com/
88
- https://www.googleapis.com/auth/presentations
89
- ----(When you're done, press <Enter> 2x)----`);
90
- readScopesFromStdinAndAddToManifest();
91
- // We probably don't need to show the unauth error
92
- // since we always prompt the user to fix this now.
93
- // throw new ClaspError(ERROR.UNAUTHENTICATED_LOCAL);
94
- break;
95
- case 403:
96
- throw new ClaspError(ERROR.PERMISSION_DENIED_LOCAL);
97
- case 404:
98
- throw new ClaspError(ERROR.EXECUTE_ENTITY_NOT_FOUND);
99
- default:
100
- throw new ClaspError(`(${error.code}) Error: ${error.message}`);
101
- }
102
- }
103
- }
104
- };
105
- const readScopesFromStdinAndAddToManifest = () => {
106
- // Example scopes:
107
- // https://mail.google.com/
108
- // https://www.googleapis.com/auth/presentations
109
- // https://www.googleapis.com/auth/spreadsheets
110
- const scopes = [];
111
- const readlineInterface = readline.createInterface({ input: process.stdin, output: process.stdout, prompt: '' });
112
- const readScope = (input) => {
113
- if (input === '') {
114
- readlineInterface.close();
115
- }
116
- else {
117
- scopes.push(input);
118
- }
119
- };
120
- const addToManifest = async () => {
121
- await addScopeToManifest(scopes);
122
- const scopeCount = scopes.length;
123
- console.log(`Added ${scopeCount} ${scopeCount === 1 ? 'scope' : 'scopes'} to your appsscript.json' oauthScopes`);
124
- console.log('Please `clasp login --creds <file>` to log in with these new scopes.');
125
- };
126
- readlineInterface.prompt();
127
- readlineInterface.on('line', readScope);
128
- readlineInterface.on('close', addToManifest);
129
- };
130
- //# sourceMappingURL=run.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/commands/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAC,cAAc,EAAE,kBAAkB,EAAE,MAAM,EAAC,MAAM,YAAY,CAAC;AACtE,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAC,kBAAkB,EAAE,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAC,GAAG,EAAC,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAC,kBAAkB,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAC,MAAM,aAAa,CAAC;AAOrF;;;;;;;GAOG;AACH,eAAe,KAAK,EAAE,YAAoB,EAAE,OAAsB,EAAiB,EAAE;IACnF,MAAM,kBAAkB,EAAE,CAAC;IAC3B,MAAM,EAAC,QAAQ,EAAC,GAAG,MAAM,kBAAkB,EAAE,CAAC;IAC9C,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,mBAAmB;IACpD,MAAM,EAAC,MAAM,EAAE,UAAU,GAAG,IAAI,EAAC,GAAG,OAAO,CAAC;IAC5C,MAAM,UAAU,GAAG,cAAc,CAAW,UAAU,CAAC,CAAC;IAExD,MAAM,kBAAkB,EAAE,CAAC;IAE3B,+DAA+D;IAC/D,8BAA8B;IAE9B,yCAAyC;IACzC,sDAAsD;IACtD,yCAAyC;IACzC,4EAA4E;IAC5E,IAAI,OAAO,EAAE;QACX,OA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eAAe,CAAC,EAAC,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAC,CAAC,CAAC;IAE/G,MAAM,SAAS,GAA4B,CAAC,KAAa,EAAE,EAAE;QAC3D,IAAI,KAAK,KAAK,EAAE,EAAE;YAChB,iBAAiB,CAAC,KAAK,EAAE,CAAC;SAC3B;aAAM;YACL,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACpB;IACH,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,KAAK,IAAmB,EAAE;QAC9C,MAAM,kBAAkB,CAAC,MAAM,CAAC,CAAC;QACjC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;QACjC,OAAO,CAAC,GAAG,CAAC,SAAS,UAAU,IAAI,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,uCAAuC,CAAC,CAAC;QACjH,OAAO,CAAC,GAAG,CAAC,sEAAsE,CAAC,CAAC;IACtF,CAAC,CAAC;IAEF,iBAAiB,CAAC,MAAM,EAAE,CAAC;IAC3B,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACxC,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AAC/C,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- import { ProjectSettings } from '../dotfile.js';
2
- declare const _default: (settingKey?: keyof ProjectSettings | undefined, settingValue?: string | undefined) => Promise<void>;
3
- /**
4
- * Gets or sets a setting in .clasp.json
5
- * @param {keyof ProjectSettings} settingKey The key to set
6
- * @param {string?} settingValue Optional value to set the key to
7
- */
8
- export default _default;
@@ -1,53 +0,0 @@
1
- import { ClaspError } from '../clasp-error.js';
2
- import { ERROR } from '../messages.js';
3
- import { getProjectSettings, saveProject } from '../utils.js';
4
- /**
5
- * Gets or sets a setting in .clasp.json
6
- * @param {keyof ProjectSettings} settingKey The key to set
7
- * @param {string?} settingValue Optional value to set the key to
8
- */
9
- export default async (settingKey, settingValue) => {
10
- var _a;
11
- const currentSettings = await getProjectSettings();
12
- // Display all settings if ran `clasp setting`.
13
- if (!settingKey) {
14
- console.log(currentSettings);
15
- return;
16
- }
17
- // Make a new spinner piped to stdErr so we don't interfere with output
18
- if (!settingValue) {
19
- if (settingKey in currentSettings) {
20
- let keyValue = (_a = currentSettings[settingKey]) !== null && _a !== void 0 ? _a : '';
21
- if (Array.isArray(keyValue)) {
22
- keyValue = keyValue.toString();
23
- }
24
- // We don't use console.log as it automatically adds a new line
25
- // Which interferes with storing the value
26
- process.stdout.write(keyValue);
27
- }
28
- else {
29
- throw new ClaspError(ERROR.UNKNOWN_KEY(settingKey));
30
- }
31
- return;
32
- }
33
- try {
34
- const currentValue = settingKey in currentSettings ? currentSettings[settingKey] : '';
35
- // filePushOrder doesn't work since it requires an array.
36
- // const filePushOrder = settingKey === 'filePushOrder' ? settingValue : currentSettings.filePushOrder;
37
- if (['fileExtension', 'projectId', 'rootDir', 'scriptId'].includes(settingKey)) {
38
- Reflect.set(currentSettings, settingKey, settingValue);
39
- await saveProject(currentSettings, true);
40
- console.log(`Updated "${settingKey}": "${currentValue}" → "${settingValue}"`);
41
- }
42
- else {
43
- throw new ClaspError(ERROR.UNKNOWN_KEY(settingKey));
44
- }
45
- }
46
- catch (error) {
47
- if (error instanceof ClaspError) {
48
- throw error;
49
- }
50
- throw new ClaspError('Unable to update .clasp.json');
51
- }
52
- };
53
- //# sourceMappingURL=setting.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setting.js","sourceRoot":"","sources":["../../../src/commands/setting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAC,kBAAkB,EAAE,WAAW,EAAC,MAAM,aAAa,CAAC;AAE5D;;;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C,UAAU,CAAC,CAAC,CAAC;SACrD;KACF;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,KAAK,YAAY,UAAU,EAAE;YAC/B,MAAM,KAAK,CAAC;SACb;QAED,MAAM,IAAI,UAAU,CAAC,8BAA8B,CAAC,CAAC;KACtD;AACH,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- interface CommandOption {
2
- readonly json?: boolean;
3
- }
4
- declare const _default: ({ json }?: CommandOption) => Promise<void>;
5
- /**
6
- * Displays the status of which Apps Script files are ignored from .claspignore
7
- * @param options.json {boolean} Displays the status in json format.
8
- */
9
- export default _default;
@@ -1,25 +0,0 @@
1
- import { getAllProjectFiles, getOrderedProjectFiles, logFileList, splitProjectFiles } from '../files.js';
2
- import { LOG } from '../messages.js';
3
- import { getProjectSettings } from '../utils.js';
4
- /**
5
- * Displays the status of which Apps Script files are ignored from .claspignore
6
- * @param options.json {boolean} Displays the status in json format.
7
- */
8
- export default async ({ json } = { json: false }) => {
9
- const { filePushOrder, scriptId, rootDir } = await getProjectSettings();
10
- if (scriptId) {
11
- const [toPush, toIgnore] = splitProjectFiles(await getAllProjectFiles(rootDir));
12
- const filesToPush = getOrderedProjectFiles(toPush, filePushOrder).map(file => file.name);
13
- const untrackedFiles = toIgnore.map(file => file.name);
14
- if (json) {
15
- console.log(JSON.stringify({ filesToPush, untrackedFiles }));
16
- return;
17
- }
18
- console.log(LOG.STATUS_PUSH);
19
- logFileList(filesToPush);
20
- console.log(); // Separate Ignored files list.
21
- console.log(LOG.STATUS_IGNORE);
22
- logFileList(untrackedFiles);
23
- }
24
- };
25
- //# sourceMappingURL=status.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAE,sBAAsB,EAAE,WAAW,EAAE,iBAAiB,EAAC,MAAM,aAAa,CAAC;AACvG,OAAO,EAAC,GAAG,EAAC,MAAM,gBAAgB,CAAC;AACnC,OAAO,EAAC,kBAAkB,EAAC,MAAM,aAAa,CAAC;AAM/C;;;GAGG;AACH,eAAe,KAAK,EAAE,EAAC,IAAI,KAAmB,EAAC,IAAI,EAAE,KAAK,EAAC,EAAiB,EAAE;IAC5E,MAAM,EAAC,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAC,GAAG,MAAM,kBAAkB,EAAE,CAAC;IACtE,IAAI,QAAQ,EAAE;QACZ,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,iBAAiB,CAAC,MAAM,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;QAChF,MAAM,WAAW,GAAG,sBAAsB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzF,MAAM,cAAc,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEvD,IAAI,IAAI,EAAE;YACR,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAC,WAAW,EAAE,cAAc,EAAC,CAAC,CAAC,CAAC;YAC3D,OAAO;SACR;QAED,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC7B,WAAW,CAAC,WAAW,CAAC,CAAC;QACzB,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,+BAA+B;QAC9C,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC/B,WAAW,CAAC,cAAc,CAAC,CAAC;KAC7B;AACH,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- interface CommandOption {
2
- readonly all?: boolean;
3
- }
4
- declare const _default: (deploymentId: string | undefined, options: CommandOption) => Promise<void>;
5
- /**
6
- * Removes a deployment from the Apps Script project.
7
- * @param deploymentId {string} The deployment's ID
8
- */
9
- export default _default;