@google/clasp 2.4.2 → 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 +253 -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 +54 -53
  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 -354
  47. package/build/src/intl.js +34 -0
  48. package/docs/README.md +1 -4
  49. package/docs/config-files.md +4 -5
  50. package/docs/run.md +26 -7
  51. package/package.json +87 -51
  52. package/CHANGELOG.md +0 -66
  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 -34
  59. package/build/src/auth.js +0 -295
  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 -91
  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 -59
  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 -14
  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 -318
  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 -81
  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,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,CAAC,CAAC;AAOL;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAA8D,EAAE,EAAE,CACnG,MAAM,CAA2C;IAC/C;QACE,OAAO;QACP,OAAO,EAAE,wBAAwB;QACjC,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,MAAM;KACb;CACF,CAAC,CAAC;AAEL;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE,CACpC,MAAM,CAAwB;IAC5B;QACE,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,GAAG,CAAC,gBAAgB;QAC7B,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,OAAO;KACd;CACF,CAAC,CAAC;AAOL,MAAM;AACN,uCAAuC;AACvC,mGAAmG;AACnG,MAAM;AACN,yCAAyC;AACzC,4BAA4B;AAC5B,QAAQ;AACR,0CAA0C;AAC1C,wBAAwB;AACxB,yBAAyB;AACzB,SAAS;AACT,QAAQ;AACR,mCAAmC;AACnC,2BAA2B;AAC3B,yBAAyB;AACzB,oEAAoE;AACpE,SAAS;AACT,QAAQ;AAER;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE,CAClC,MAAM,CAAuB;IAC3B;QACE,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,oEAAoE;QAC7E,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;KAChB;CACF,CAAC,CAAC;AAEL;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE,CAClC,MAAM,CAA+B;IACnC;QACE,OAAO,EAAE,GAAG,GAAG,CAAC,cAAc,EAAE;QAChC,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,OAAO;KACd;CACF,CAAC,CAAC;AAOL;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAgD,EAAE,EAAE,CACjF,MAAM,CAAqB;IACzB;QACE,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,GAAG,CAAC,qBAAqB;QAClC,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,MAAM;KACb;CACF,CAAC,CAAC;AAEL;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE,CACnC,MAAM,CAAiB;IACrB;QACE,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,YAAY,CAAC,GAAgC,CAAC,CAAC;QAC7F,OAAO,EAAE,GAAG,CAAC,sBAAsB;QACnC,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,MAAM;KACb;CACF,CAAC,CAAC"}
@@ -1,123 +0,0 @@
1
- /**
2
- * Checks if the rootDir appears to be a valid project.
3
- *
4
- * @param {string} rootDir dir to check.
5
- *
6
- * @return {boolean} True if valid project, false otherwise
7
- */
8
- export declare const manifestExists: (rootDir?: string | undefined) => boolean;
9
- /**
10
- * Reads the appsscript.json manifest file.
11
- * @returns {Promise<Manifest>} A promise to get the manifest file as object.
12
- * @see https://developers.google.com/apps-script/concepts/manifests
13
- */
14
- export declare const readManifest: () => Promise<Manifest>;
15
- /**
16
- * Returns true if the manifest is valid.
17
- */
18
- export declare const isValidManifest: (manifest?: Manifest | undefined) => Promise<boolean>;
19
- /**
20
- * Ensures the manifest is correct for running a function.
21
- * The manifest must include:
22
- * "executionApi": {
23
- * "access": "MYSELF"
24
- * }
25
- */
26
- export declare const isValidRunManifest: () => Promise<boolean>;
27
- /**
28
- * Reads manifest file from project root dir.
29
- * The manifest is valid if it:
30
- * - It exists in the project root.
31
- * - Is valid JSON.
32
- */
33
- export declare const getManifest: () => Promise<Manifest>;
34
- /**
35
- * Adds a list of scopes to the manifest.
36
- * @param {string[]} scopes The list of explicit scopes
37
- */
38
- export declare const addScopeToManifest: (scopes: readonly string[]) => Promise<void>;
39
- /**
40
- * Enables or disables an advanced service in the manifest.
41
- * @param serviceId {string} The id of the service that should be enabled or disabled.
42
- * @param enable {boolean} True if you want to enable a service. Disables otherwise.
43
- * @see PUBLIC_ADVANCED_SERVICES
44
- */
45
- export declare const enableOrDisableAdvanceServiceInManifest: (serviceId: string, enable: boolean) => Promise<void>;
46
- interface EnabledAdvancedService {
47
- userSymbol: string;
48
- serviceId: string;
49
- version: string;
50
- }
51
- interface Library {
52
- userSymbol: string;
53
- libraryId: string;
54
- version: string;
55
- developmentMode: boolean;
56
- }
57
- interface Dependencies {
58
- enabledAdvancedServices?: EnabledAdvancedService[];
59
- libraries?: Library[];
60
- }
61
- interface Webapp {
62
- access: string;
63
- executeAs: string;
64
- }
65
- interface ExecutionApi {
66
- access: string;
67
- }
68
- interface Unconditional {
69
- }
70
- interface ContextualTrigger {
71
- unconditional: Unconditional;
72
- onTriggerFunction: string;
73
- }
74
- interface SelectAction {
75
- text: string;
76
- runFunction: string;
77
- }
78
- interface ComposeTrigger {
79
- selectActions: SelectAction[];
80
- draftAccess: string;
81
- }
82
- interface UniversalAction {
83
- text: string;
84
- runFunction: string;
85
- openLink: string;
86
- }
87
- interface Gmail2 {
88
- name: string;
89
- logoUrl: string;
90
- primaryColor: string;
91
- secondaryColor: string;
92
- authorizationCheckFunction: string;
93
- contextualTriggers: ContextualTrigger[];
94
- composeTrigger: ComposeTrigger;
95
- openLinkUrlPrefixes: string[];
96
- universalActions: UniversalAction[];
97
- useLocaleFromApp: boolean;
98
- }
99
- interface Macro {
100
- menuName: string;
101
- functionName: string;
102
- defaultShortcut: string;
103
- }
104
- interface Sheets {
105
- macros: Macro[];
106
- }
107
- interface Gmail {
108
- oauthScopes: string[];
109
- urlFetchWhitelist: string[];
110
- gmail: Gmail2;
111
- sheets: Sheets;
112
- }
113
- interface Manifest {
114
- timeZone?: string;
115
- oauthScopes?: string[];
116
- dependencies?: Dependencies;
117
- exceptionLogging?: string;
118
- webapp?: Webapp;
119
- executionApi?: ExecutionApi;
120
- urlFetchWhitelist?: string[];
121
- gmail?: Gmail;
122
- }
123
- export {};
@@ -1,142 +0,0 @@
1
- import path from 'path';
2
- import is from '@sindresorhus/is';
3
- import fs from 'fs-extra';
4
- import { PUBLIC_ADVANCED_SERVICES as publicAdvancedServices } from './apis.js';
5
- import { ClaspError } from './clasp-error.js';
6
- import { Conf } from './conf.js';
7
- import { FS_OPTIONS, PROJECT_MANIFEST_FILENAME } from './constants.js';
8
- import { ERROR } from './messages.js';
9
- import { getProjectSettings, parseJsonOrDie } from './utils.js';
10
- const config = Conf.get();
11
- /** Gets the path to manifest for given `rootDir` */
12
- const getManifestPath = (rootDir) => path.join(rootDir, PROJECT_MANIFEST_FILENAME);
13
- /** Gets the `rootDir` from given project */
14
- const getRootDir = ({ rootDir }) => is.string(rootDir) ? rootDir : config.projectRootDirectory;
15
- /**
16
- * Checks if the rootDir appears to be a valid project.
17
- *
18
- * @param {string} rootDir dir to check.
19
- *
20
- * @return {boolean} True if valid project, false otherwise
21
- */
22
- export const manifestExists = (rootDir = config.projectRootDirectory) => rootDir !== undefined && fs.existsSync(getManifestPath(rootDir));
23
- /**
24
- * Reads the appsscript.json manifest file.
25
- * @returns {Promise<Manifest>} A promise to get the manifest file as object.
26
- * @see https://developers.google.com/apps-script/concepts/manifests
27
- */
28
- export const readManifest = async () => {
29
- const manifest = getManifestPath(getRootDir(await getProjectSettings()));
30
- try {
31
- return fs.readJsonSync(manifest, FS_OPTIONS);
32
- }
33
- catch (error) {
34
- if (error instanceof ClaspError) {
35
- throw error;
36
- }
37
- throw new ClaspError(ERROR.NO_MANIFEST(manifest));
38
- }
39
- };
40
- /**
41
- * Writes the appsscript.json manifest file.
42
- * @param {Manifest} manifest The new manifest to write.
43
- */
44
- const writeManifest = async (manifest) => {
45
- try {
46
- fs.writeJsonSync(getManifestPath(getRootDir(await getProjectSettings())), manifest, { encoding: 'utf8', spaces: 2 });
47
- }
48
- catch (error) {
49
- if (error instanceof ClaspError) {
50
- throw error;
51
- }
52
- throw new ClaspError(ERROR.FS_FILE_WRITE);
53
- }
54
- };
55
- /**
56
- * Returns true if the manifest is valid.
57
- */
58
- export const isValidManifest = async (manifest) => !is.nullOrUndefined(manifest !== null && manifest !== void 0 ? manifest : (await getManifest()));
59
- /**
60
- * Ensures the manifest is correct for running a function.
61
- * The manifest must include:
62
- * "executionApi": {
63
- * "access": "MYSELF"
64
- * }
65
- */
66
- export const isValidRunManifest = async () => {
67
- const value = await getManifest();
68
- return Boolean((await isValidManifest(value)) && value.executionApi && value.executionApi.access);
69
- };
70
- /**
71
- * Reads manifest file from project root dir.
72
- * The manifest is valid if it:
73
- * - It exists in the project root.
74
- * - Is valid JSON.
75
- */
76
- export const getManifest = async () => parseJsonOrDie(fs.readFileSync(getManifestPath(getRootDir(await getProjectSettings())), FS_OPTIONS));
77
- /**
78
- * Adds a list of scopes to the manifest.
79
- * @param {string[]} scopes The list of explicit scopes
80
- */
81
- export const addScopeToManifest = async (scopes) => {
82
- var _a;
83
- const manifest = await readManifest();
84
- manifest.oauthScopes = [...new Set([...((_a = manifest.oauthScopes) !== null && _a !== void 0 ? _a : []), ...scopes])];
85
- await writeManifest(manifest);
86
- };
87
- // /**
88
- // * Enables the Execution API in the Manifest.
89
- // * The Execution API requires the manifest to have the "executionApi.access" field set.
90
- // */
91
- // // TODO: currently unused. Check relevancy
92
- // export async function enableExecutionAPI() {
93
- // console.log('Writing manifest');
94
- // const manifest = await readManifest();
95
- // manifest.executionApi = manifest.executionApi ?? {
96
- // access: 'ANYONE',
97
- // };
98
- // await writeManifest(manifest);
99
- // console.log('Wrote manifest');
100
- // console.log('Checking Apps Script API');
101
- // if (!(await isEnabled('script'))) {
102
- // console.log('Apps Script API is currently disabled. Enabling…');
103
- // await enableOrDisableAPI('script', true);
104
- // }
105
- // console.log('Apps Script API is enabled.');
106
- // }
107
- /**
108
- * Enables or disables an advanced service in the manifest.
109
- * @param serviceId {string} The id of the service that should be enabled or disabled.
110
- * @param enable {boolean} True if you want to enable a service. Disables otherwise.
111
- * @see PUBLIC_ADVANCED_SERVICES
112
- */
113
- export const enableOrDisableAdvanceServiceInManifest = async (serviceId, enable) => {
114
- var _a;
115
- /**
116
- * "enabledAdvancedServices": [
117
- * {
118
- * "userSymbol": "string",
119
- * "serviceId": "string",
120
- * "version": "string",
121
- * }
122
- * ...
123
- * ],
124
- */
125
- const manifest = await readManifest();
126
- // Create objects if they don't exist.
127
- if (!manifest.dependencies) {
128
- manifest.dependencies = { enabledAdvancedServices: [] };
129
- }
130
- // Copy the list of advanced services:
131
- // Disable the service (even if we may enable it)
132
- const enabledServices = ((_a = manifest.dependencies.enabledAdvancedServices) !== null && _a !== void 0 ? _a : []).filter((service) => service.serviceId !== serviceId);
133
- // Enable the service
134
- if (enable) {
135
- // Add new service (get the first one from the public list)
136
- enabledServices.push(publicAdvancedServices.find(service => service.serviceId === serviceId));
137
- }
138
- // Overwrites the old list with the new list.
139
- manifest.dependencies.enabledAdvancedServices = enabledServices;
140
- await writeManifest(manifest);
141
- };
142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AC,YAAY,CAAC,uBAAuB,mCAAI,EAAE,CAAC,CAAC,MAAM,CAClF,CAAC,OAAyC,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,KAAK,SAAS,CAC/E,CAAC;IAEF,qBAAqB;IACrB,IAAI,MAAM,EAAE;QACV,2DAA2D;QAC3D,eAAe,CAAC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,KAAK,SAAS,CAAE,CAAC,CAAC;KAChG;IAED,6CAA6C;IAC7C,QAAQ,CAAC,YAAY,CAAC,uBAAuB,GAAG,eAAe,CAAC;IAChE,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC,CAAC"}
@@ -1,110 +0,0 @@
1
- import { script_v1 as scriptV1 } from 'googleapis';
2
- export declare const ERROR: {
3
- ACCESS_TOKEN: string;
4
- BAD_CREDENTIALS_FILE: string;
5
- BAD_REQUEST: (message: string) => string;
6
- BAD_MANIFEST: string;
7
- COMMAND_DNE: (command: string) => string;
8
- CONFLICTING_FILE_EXTENSION: (name: string) => string;
9
- CREATE_WITH_PARENT: string;
10
- CREATE: string;
11
- CREDENTIALS_DNE: (filename: string) => string;
12
- DEPLOYMENT_COUNT: string;
13
- DRIVE: string;
14
- EXECUTE_ENTITY_NOT_FOUND: string;
15
- FOLDER_EXISTS: () => string;
16
- FS_DIR_WRITE: string;
17
- FS_FILE_WRITE: string;
18
- INVALID_JSON: string;
19
- LOGGED_IN_LOCAL: string;
20
- LOGGED_IN_GLOBAL: string;
21
- LOGGED_OUT: string;
22
- LOGS_NODATA: string;
23
- LOGS_UNAVAILABLE: string;
24
- NO_API: (enable: boolean, api: string) => string;
25
- NO_CREDENTIALS: (local: boolean) => string;
26
- NO_FUNCTION_NAME: string;
27
- NO_GCLOUD_PROJECT: () => string;
28
- NO_PARENT_ID: () => string;
29
- NO_LOCAL_CREDENTIALS: string;
30
- NO_MANIFEST: (filename: string) => string;
31
- NO_NESTED_PROJECTS: string;
32
- NO_VERSIONED_DEPLOYMENTS: string;
33
- NO_WEBAPP: (deploymentId: string) => string;
34
- OFFLINE: string;
35
- ONE_DEPLOYMENT_CREATE: string;
36
- PAYLOAD_UNKNOWN: string;
37
- PERMISSION_DENIED_LOCAL: string;
38
- PERMISSION_DENIED: string;
39
- RATE_LIMIT: string;
40
- RUN_NODATA: string;
41
- READ_ONLY_DELETE: string;
42
- SCRIPT_ID_DNE: () => string;
43
- SCRIPT_ID_INCORRECT: (scriptId: string) => string;
44
- SCRIPT_ID: string;
45
- SETTINGS_DNE: () => string;
46
- UNAUTHENTICATED_LOCAL: string;
47
- UNAUTHENTICATED: string;
48
- UNKNOWN_KEY: (key: string) => string;
49
- PROJECT_ID_INCORRECT: (projectId: string) => string;
50
- };
51
- export declare const LOG: {
52
- ASK_PROJECT_ID: string;
53
- NOT_LOGGED_IN: string;
54
- LOGGED_IN_UNKNOWN: string;
55
- LOGGED_IN_AS: (email: string) => string;
56
- AUTH_CODE: string;
57
- AUTH_PAGE_SUCCESSFUL: string;
58
- AUTH_SUCCESSFUL: string;
59
- AUTHORIZE: (authUrl: string) => string;
60
- CLONE_SUCCESS: (fileCount: number) => string;
61
- CLONING: string;
62
- CLONE_SCRIPT_QUESTION: string;
63
- CREATE_SCRIPT_QUESTION: string;
64
- CREATE_DRIVE_FILE_FINISH: (filetype: string, fileid: string) => string;
65
- CREATE_DRIVE_FILE_START: (filetype: string) => string;
66
- CREATE_PROJECT_FINISH: (filetype: string, scriptId: string) => string;
67
- CREATE_PROJECT_START: (title: string) => string;
68
- CREDENTIALS_FOUND: string;
69
- CREDS_FROM_PROJECT: (projectId: string) => string;
70
- DEFAULT_CREDENTIALS: string;
71
- DEPLOYMENT_CREATE: string;
72
- DEPLOYMENT_DNE: string;
73
- DEPLOYMENT_LIST: (_scriptId: string) => string;
74
- DEPLOYMENT_START: (_scriptId: string) => string;
75
- FILES_TO_PUSH: string;
76
- FINDING_SCRIPTS_DNE: string;
77
- FINDING_SCRIPTS: string;
78
- GRAB_LOGS: string;
79
- GET_PROJECT_ID_INSTRUCTIONS: string;
80
- GIVE_DESCRIPTION: string;
81
- LOCAL_CREDS: () => string;
82
- LOGIN: (isLocal: boolean) => string;
83
- LOGS_SETUP: string;
84
- NO_GCLOUD_PROJECT: string;
85
- OPEN_CREDS: (projectId: string) => string;
86
- OPEN_LINK: (link: string) => string;
87
- OPEN_PROJECT: (scriptId: string) => string;
88
- OPEN_WEBAPP: (deploymentId?: string | undefined) => string;
89
- OPEN_FIRST_PARENT: (parentId: string) => string;
90
- FOUND_PARENT: (parentId: string) => string;
91
- PULLING: string;
92
- PUSH_FAILURE: string;
93
- PUSH_NO_FILES: string;
94
- PUSH_SUCCESS: (filesCount: number) => string;
95
- PUSH_WATCH_UPDATED: (filename: string) => string;
96
- PUSH_WATCH: string;
97
- PUSHING: string;
98
- SAVED_CREDS: (isLocalCreds: boolean) => string;
99
- SCRIPT_LINK: (scriptId: string) => string;
100
- STACKDRIVER_SETUP: string;
101
- STATUS_IGNORE: string;
102
- STATUS_PUSH: string;
103
- UNDEPLOYMENT_FINISH: (deploymentId: string) => string;
104
- UNDEPLOYMENT_ALL_FINISH: string;
105
- UNDEPLOYMENT_START: (deploymentId: string) => string;
106
- VERSION_CREATE: string;
107
- VERSION_CREATED: (versionNumber: number) => string;
108
- VERSION_DESCRIPTION: ({ versionNumber, description }: scriptV1.Schema$Version) => string;
109
- VERSION_NUM: (versionsCount: number) => string;
110
- };
@@ -1,161 +0,0 @@
1
- import { Conf } from './conf.js';
2
- import { PROJECT_MANIFEST_FILENAME, PROJECT_NAME } from './constants.js';
3
- import { URL } from './urls.js';
4
- const config = Conf.get();
5
- /** Human friendly Google Drive file type name */
6
- const fileTypeName = new Map([
7
- ['docs', 'Google Doc'],
8
- ['forms', 'Google Form'],
9
- ['sheets', 'Google Sheet'],
10
- ['slides', 'Google Slide'],
11
- ]);
12
- /**
13
- * Gets a human friendly Google Drive file type name.
14
- * @param {string} type The input file type. (i.e. docs, forms, sheets, slides)
15
- * @returns The name like "Google Docs".
16
- */
17
- const getFileTypeName = (type) => fileTypeName.get(type);
18
- /**
19
- * Gets a human friendly script type name.
20
- * @param {string} type The Apps Script project type. (i.e. docs, forms, sheets, slides)
21
- * @returns The script type (i.e. "Google Docs Add-on")
22
- */
23
- const getScriptTypeName = (type) => (fileTypeName.has(type) ? `${fileTypeName.get(type)}s Add-on` : type);
24
- // Error messages (some errors take required params)
25
- export const ERROR = {
26
- ACCESS_TOKEN: 'Error retrieving access token: ',
27
- BAD_CREDENTIALS_FILE: 'Incorrect credentials file format.',
28
- BAD_REQUEST: (message) => `Error: ${message}
29
- Your credentials may be invalid. Try logging in again.`,
30
- BAD_MANIFEST: `Error: Your ${PROJECT_MANIFEST_FILENAME} contains invalid JSON.`,
31
- COMMAND_DNE: (command) => `🤔 Unknown command "${PROJECT_NAME} ${command}"\n
32
- Forgot ${PROJECT_NAME} commands? Get help:\n ${PROJECT_NAME} --help`,
33
- CONFLICTING_FILE_EXTENSION: (name) => `File names: ${name}.js/${name}.gs conflict. Only keep one.`,
34
- CREATE_WITH_PARENT: 'Did you provide the correct parentId?',
35
- CREATE: 'Error creating script.',
36
- CREDENTIALS_DNE: (filename) => `Credentials file "${filename}" not found.`,
37
- DEPLOYMENT_COUNT: 'Unable to deploy; Scripts may only have up to 20 versioned deployments at a time.',
38
- DRIVE: 'Something went wrong with the Google Drive API',
39
- EXECUTE_ENTITY_NOT_FOUND: 'Script API executable not published/deployed.',
40
- FOLDER_EXISTS: () => `Project file (${config.projectConfig}) already exists.`,
41
- FS_DIR_WRITE: 'Could not create directory.',
42
- FS_FILE_WRITE: 'Could not write file.',
43
- INVALID_JSON: 'Input params not Valid JSON string. Please fix and try again',
44
- LOGGED_IN_LOCAL: 'Warning: You seem to already be logged in *locally*. You have a ./.clasprc.json',
45
- LOGGED_IN_GLOBAL: 'Warning: You seem to already be logged in *globally*. You have a ~/.clasprc.json',
46
- LOGGED_OUT: `\nCommand failed. Please login. (${PROJECT_NAME} login)`,
47
- LOGS_NODATA: 'StackDriver logs query returned no data.',
48
- LOGS_UNAVAILABLE: 'StackDriver logs are getting ready, try again soon.',
49
- NO_API: (enable, api) => `API ${api} doesn't exist. Try 'clasp apis ${enable ? 'enable' : 'disable'} sheets'.`,
50
- NO_CREDENTIALS: (local) => `Could not read API credentials. Are you logged in ${local ? 'locally' : 'globally'}?`,
51
- NO_FUNCTION_NAME: 'N/A',
52
- NO_GCLOUD_PROJECT: () => `No projectId found in your ${config.projectConfig} file.`,
53
- NO_PARENT_ID: () => `No parentId or empty parentId found in your ${config.projectConfig} file.`,
54
- NO_LOCAL_CREDENTIALS: `Requires local crendetials:\n\n ${PROJECT_NAME} login --creds <file.json>`,
55
- NO_MANIFEST: (filename) => `Manifest: ${filename} invalid. \`create\` or \`clone\` a project first.`,
56
- NO_NESTED_PROJECTS: '\nNested clasp projects are not supported.',
57
- NO_VERSIONED_DEPLOYMENTS: 'No versioned deployments found in project.',
58
- NO_WEBAPP: (deploymentId) => `Deployment "${deploymentId}" is not deployed as WebApp.`,
59
- OFFLINE: 'Error: Looks like you are offline.',
60
- ONE_DEPLOYMENT_CREATE: 'Currently just one deployment can be created at a time.',
61
- PAYLOAD_UNKNOWN: 'Unknown StackDriver payload.',
62
- PERMISSION_DENIED_LOCAL: `Error: Permission denied. Be sure that you have:
63
- - Added the necessary scopes needed for the API.
64
- - Enabled the Apps Script API.
65
- - Enable required APIs for project.`,
66
- PERMISSION_DENIED: `Error: Permission denied. Enable the Apps Script API:\n${URL.SCRIPT_API_USER}`,
67
- RATE_LIMIT: 'Rate limit exceeded. Check quota.',
68
- RUN_NODATA: 'Script execution API returned no data.',
69
- READ_ONLY_DELETE: 'Unable to delete read-only deployment.',
70
- SCRIPT_ID_DNE: () => `No scriptId found in your ${config.projectConfig} file.`,
71
- SCRIPT_ID_INCORRECT: (scriptId) => `The scriptId "${scriptId}" looks incorrect.
72
- Did you provide the correct scriptId?`,
73
- SCRIPT_ID: `Could not find script.
74
- Did you provide the correct scriptId?
75
- Are you logged in to the correct account with the script?`,
76
- SETTINGS_DNE: () => `
77
- No valid ${config.projectConfig} project file. You may need to \`create\` or \`clone\` a project first.`,
78
- UNAUTHENTICATED_LOCAL: 'Error: Local client credentials unauthenticated. Check scopes/authorization.',
79
- UNAUTHENTICATED: 'Error: Unauthenticated request: Please try again.',
80
- UNKNOWN_KEY: (key) => `Unknown key "${key}"`,
81
- PROJECT_ID_INCORRECT: (projectId) => `The projectId "${projectId}" looks incorrect.
82
- Did you provide the correct projectID?`,
83
- };
84
- // Log messages (some logs take required params)
85
- export const LOG = {
86
- ASK_PROJECT_ID: 'What is your GCP projectId?',
87
- NOT_LOGGED_IN: 'You are not logged in.',
88
- LOGGED_IN_UNKNOWN: 'You are logged in as an unknown user.',
89
- LOGGED_IN_AS: (email) => `You are logged in as ${email}.`,
90
- AUTH_CODE: 'Enter the code from that page here: ',
91
- // TODO: Make AUTH_PAGE_SUCCESSFUL show an HTML page with something useful!
92
- AUTH_PAGE_SUCCESSFUL: 'Logged in! You may close this page. ',
93
- AUTH_SUCCESSFUL: 'Authorization successful.',
94
- AUTHORIZE: (authUrl) => `🔑 Authorize ${PROJECT_NAME} by visiting this url:\n${authUrl}\n`,
95
- CLONE_SUCCESS: (fileCount) => `Warning: files in subfolder are not accounted for unless you set a '${config.ignore}' file.
96
- Cloned ${fileCount} ${fileCount === 1 ? 'file' : 'files'}.`,
97
- CLONING: 'Cloning files…',
98
- CLONE_SCRIPT_QUESTION: 'Clone which script?',
99
- CREATE_SCRIPT_QUESTION: 'Create which script?',
100
- CREATE_DRIVE_FILE_FINISH: (filetype, fileid) => { var _a; return `Created new ${(_a = getFileTypeName(filetype)) !== null && _a !== void 0 ? _a : '(unknown type)'}: ${URL.DRIVE(fileid)}`; },
101
- CREATE_DRIVE_FILE_START: (filetype) => { var _a; return `Creating new ${(_a = getFileTypeName(filetype)) !== null && _a !== void 0 ? _a : '(unknown type)'}…`; },
102
- CREATE_PROJECT_FINISH: (filetype, scriptId) => `Created new ${getScriptTypeName(filetype)} script: ${URL.SCRIPT(scriptId)}`,
103
- CREATE_PROJECT_START: (title) => `Creating new script: ${title}…`,
104
- CREDENTIALS_FOUND: 'Credentials found, using those to login…',
105
- CREDS_FROM_PROJECT: (projectId) => `Using credentials located here:\n${URL.CREDS(projectId)}\n`,
106
- DEFAULT_CREDENTIALS: 'No credentials given, continuing with default…',
107
- DEPLOYMENT_CREATE: 'Creating deployment…',
108
- DEPLOYMENT_DNE: 'No deployed versions of script.',
109
- DEPLOYMENT_LIST: (_scriptId) => 'Listing deployments…',
110
- DEPLOYMENT_START: (_scriptId) => 'Deploying project…',
111
- FILES_TO_PUSH: 'Files to push were:',
112
- FINDING_SCRIPTS_DNE: 'No script files found.',
113
- FINDING_SCRIPTS: 'Finding your scripts…',
114
- GRAB_LOGS: 'Grabbing logs…',
115
- GET_PROJECT_ID_INSTRUCTIONS: `Go to *Resource > Cloud Platform Project…* and copy your projectId
116
- (including "project-id-")`,
117
- GIVE_DESCRIPTION: 'Give a description: ',
118
- LOCAL_CREDS: () => `Using local credentials: ${config.authLocal} 🔐 `,
119
- LOGIN: (isLocal) => `Logging in ${isLocal ? 'locally' : 'globally'}…`,
120
- LOGS_SETUP: 'Finished setting up logs.\n',
121
- NO_GCLOUD_PROJECT: `No projectId found. Running ${PROJECT_NAME} logs --setup.`,
122
- OPEN_CREDS: (projectId) => `Opening credentials page: ${URL.CREDS(projectId)}`,
123
- OPEN_LINK: (link) => `Open this link: ${link}`,
124
- OPEN_PROJECT: (scriptId) => `Opening script: ${URL.SCRIPT(scriptId)}`,
125
- OPEN_WEBAPP: (deploymentId) => `Opening web application: ${deploymentId}`,
126
- OPEN_FIRST_PARENT: (parentId) => `Opening first parent: ${URL.DRIVE(parentId)}`,
127
- FOUND_PARENT: (parentId) => `Found parent: ${URL.DRIVE(parentId)}`,
128
- PULLING: 'Pulling files…',
129
- PUSH_FAILURE: 'Push failed. Errors:',
130
- PUSH_NO_FILES: 'No files to push.',
131
- PUSH_SUCCESS: (filesCount) => `Pushed ${filesCount} ${filesCount === 1 ? 'file' : 'files'}.`,
132
- PUSH_WATCH_UPDATED: (filename) => `- Updated: ${filename}`,
133
- PUSH_WATCH: 'Watching for changed files…\n',
134
- PUSHING: 'Pushing files…',
135
- SAVED_CREDS: (isLocalCreds) => isLocalCreds
136
- ? `Local credentials saved to: ${config.authLocal}.
137
- *Be sure to never commit this file!* It's basically a password.`
138
- : `Default credentials saved to: ${config.auth}.`,
139
- SCRIPT_LINK: (scriptId) => `https://script.google.com/d/${scriptId}/edit`,
140
- // SCRIPT_RUN: (functionName: string) => `Executing: ${functionName}`,
141
- STACKDRIVER_SETUP: 'Setting up StackDriver Logging.',
142
- STATUS_IGNORE: 'Ignored files:',
143
- STATUS_PUSH: 'Not ignored files:',
144
- UNDEPLOYMENT_FINISH: (deploymentId) => `Undeployed ${deploymentId}.`,
145
- UNDEPLOYMENT_ALL_FINISH: 'Undeployed all deployments.',
146
- UNDEPLOYMENT_START: (deploymentId) => `Undeploying ${deploymentId}…`,
147
- VERSION_CREATE: 'Creating a new version…',
148
- VERSION_CREATED: (versionNumber) => `Created version ${versionNumber}.`,
149
- VERSION_DESCRIPTION: ({ versionNumber, description }) => `${versionNumber} - ${description !== null && description !== void 0 ? description : '(no description)'}`,
150
- VERSION_NUM: (versionsCount) => `~ ${versionsCount} ${versionsCount === 1 ? 'Version' : 'Versions'} ~`,
151
- // SETUP_LOCAL_OAUTH: (projectId: string) => `1. Create a client ID and secret:
152
- // Open this link: ${chalk.blue(URL.CREDS(projectId))}
153
- // Click ${chalk.cyan('Create credentials')}, then select ${chalk.yellow('OAuth client ID')}.
154
- // Select ${chalk.yellow('Other')}.
155
- // Give the client a ${chalk.yellow('name')}.
156
- // Click ${chalk.cyan('Create')}.
157
- // Click ${chalk.cyan('Download JSON')} for the new client ID: ${chalk.yellow('name')} (right-hand side).
158
- // 2. Authenticate clasp with your credentials json file:
159
- // clasp login --creds <client_credentials.json>`,
160
- };
161
- //# sourceMappingURL=messages.js.map