firebase-tools 11.30.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/lib/api.js +4 -2
  2. package/lib/commands/ext-configure.js +2 -1
  3. package/lib/commands/ext-dev-deprecate.js +24 -20
  4. package/lib/commands/ext-dev-list.js +12 -11
  5. package/lib/commands/ext-dev-publish.js +13 -47
  6. package/lib/commands/ext-dev-register.js +8 -5
  7. package/lib/commands/ext-dev-undeprecate.js +4 -4
  8. package/lib/commands/ext-dev-upload.js +88 -0
  9. package/lib/commands/ext-dev-usage.js +3 -3
  10. package/lib/commands/ext-install.js +5 -10
  11. package/lib/commands/ext-uninstall.js +0 -1
  12. package/lib/commands/ext-update.js +4 -10
  13. package/lib/commands/index.js +9 -19
  14. package/lib/deploy/extensions/planner.js +13 -7
  15. package/lib/deploy/extensions/prepare.js +16 -32
  16. package/lib/emulator/storage/rules/config.js +17 -7
  17. package/lib/experiments.js +7 -6
  18. package/lib/extensions/extensionsApi.js +24 -151
  19. package/lib/extensions/extensionsHelper.js +282 -145
  20. package/lib/extensions/manifest.js +1 -8
  21. package/lib/extensions/publisherApi.js +215 -0
  22. package/lib/extensions/refs.js +1 -1
  23. package/lib/extensions/resolveSource.js +1 -18
  24. package/lib/extensions/tos.js +78 -0
  25. package/lib/extensions/warnings.js +21 -41
  26. package/lib/frameworks/angular/index.js +67 -185
  27. package/lib/frameworks/angular/interfaces.js +2 -0
  28. package/lib/frameworks/angular/utils.js +274 -0
  29. package/lib/frameworks/constants.js +5 -2
  30. package/lib/frameworks/index.js +60 -28
  31. package/lib/frameworks/next/index.js +86 -40
  32. package/lib/frameworks/next/utils.js +29 -12
  33. package/lib/frameworks/utils.js +11 -4
  34. package/lib/functions/python.js +1 -1
  35. package/lib/hosting/api.js +32 -1
  36. package/package.json +2 -2
  37. package/templates/extensions/POSTINSTALL.md +2 -2
  38. package/templates/extensions/PREINSTALL.md +1 -1
  39. package/templates/extensions/extension.yaml +10 -6
  40. package/templates/extensions/javascript/WELCOME.md +1 -1
  41. package/templates/extensions/typescript/WELCOME.md +1 -1
  42. package/templates/extensions/typescript/index.ts +1 -1
  43. package/templates/init/functions/javascript/index.js +16 -6
  44. package/templates/init/functions/javascript/package.lint.json +4 -4
  45. package/templates/init/functions/javascript/package.nolint.json +4 -4
  46. package/templates/init/functions/typescript/index.ts +16 -6
  47. package/templates/init/functions/typescript/package.lint.json +4 -4
  48. package/templates/init/functions/typescript/package.nolint.json +4 -4
  49. package/lib/commands/ext-dev-emulators-exec.js +0 -27
  50. package/lib/commands/ext-dev-emulators-start.js +0 -24
  51. package/lib/commands/ext-dev-extension-delete.js +0 -45
  52. package/lib/commands/ext-dev-unpublish.js +0 -49
  53. package/lib/commands/ext-sources-create.js +0 -24
  54. package/lib/extensions/askUserForConsent.js +0 -33
  55. package/npm-shrinkwrap.json +0 -12368
@@ -4,10 +4,10 @@ This file provides your users an overview of how to use your extension after the
4
4
  Include instructions for using the extension and any important functional details. Also include **detailed descriptions** for any additional post-installation setup required by the user.
5
5
 
6
6
  Reference values for the extension instance using the ${param:PARAMETER_NAME} or ${function:VARIABLE_NAME} syntax.
7
- Learn more in the docs: https://firebase.google.com/docs/extensions/alpha/create-user-docs#reference-in-postinstall
7
+ Learn more in the docs: https://firebase.google.com/docs/extensions/publishers/user-documentation#reference-in-postinstall
8
8
 
9
9
  Learn more about writing a POSTINSTALL.md file in the docs:
10
- https://firebase.google.com/docs/extensions/alpha/create-user-docs#writing-postinstall
10
+ https://firebase.google.com/docs/extensions/publishers/user-documentation#writing-postinstall
11
11
  -->
12
12
 
13
13
  # See it in action
@@ -4,7 +4,7 @@ This file provides your users an overview of your extension. All content is opti
4
4
  Include any important functional details as well as a brief description for any additional setup required by the user (both pre- and post-installation).
5
5
 
6
6
  Learn more about writing a PREINSTALL.md file in the docs:
7
- https://firebase.google.com/docs/extensions/alpha/create-user-docs#writing-preinstall
7
+ https://firebase.google.com/docs/extensions/publishers/user-documentation#writing-preinstall
8
8
  -->
9
9
 
10
10
  Use this extension to send a friendly greeting.
@@ -1,5 +1,5 @@
1
1
  # Learn detailed information about the fields of an extension.yaml file in the docs:
2
- # https://firebase.google.com/docs/extensions/alpha/ref-extension-yaml
2
+ # https://firebase.google.com/docs/extensions/reference/extension-yaml
3
3
 
4
4
  name: greet-the-world # Identifier for your extension
5
5
  version: 0.0.1 # Follow semver versioning
@@ -18,18 +18,21 @@ license: Apache-2.0 # https://spdx.org/licenses/
18
18
  sourceUrl: https://github.com/firebase/firebase-tools/tree/master/templates/extensions
19
19
 
20
20
  # Specify whether a paid-tier billing plan is required to use your extension.
21
- # Learn more in the docs: https://firebase.google.com/docs/extensions/alpha/ref-extension-yaml#billing-required-field
21
+ # Learn more in the docs: https://firebase.google.com/docs/extensions/reference/extension-yaml#billing-required-field
22
22
  billingRequired: false
23
23
 
24
24
  # In an `apis` field, list any Google APIs (like Cloud Translation, BigQuery, etc.)
25
25
  # required for your extension to operate.
26
- # Learn more in the docs: https://firebase.google.com/docs/extensions/alpha/ref-extension-yaml#apis-field
26
+ # Learn more in the docs:
27
+ # https://firebase.google.com/docs/extensions/reference/extension-yaml#apis-field
27
28
 
28
29
  # In a `roles` field, list any IAM access roles required for your extension to operate.
29
- # Learn more in the docs: https://firebase.google.com/docs/extensions/alpha/ref-extension-yaml#roles-field
30
+ # Learn more in the docs:
31
+ # https://firebase.google.com/docs/extensions/reference/extension-yaml#roles-field
30
32
 
31
33
  # In the `resources` field, list each of your extension's functions, including the trigger for each function.
32
- # Learn more in the docs: https://firebase.google.com/docs/extensions/alpha/ref-extension-yaml#resources-field
34
+ # Learn more in the docs:
35
+ # https://firebase.google.com/docs/extensions/reference/extension-yaml#resources-field
33
36
  resources:
34
37
  - name: greetTheWorld
35
38
  type: firebaseextensions.v1beta.function
@@ -43,7 +46,8 @@ resources:
43
46
  runtime: "nodejs16"
44
47
 
45
48
  # In the `params` field, set up your extension's user-configured parameters.
46
- # Learn more in the docs: https://firebase.google.com/docs/extensions/alpha/ref-extension-yaml#params-field
49
+ # Learn more in the docs:
50
+ # https://firebase.google.com/docs/extensions/reference/extension-yaml#params-field
47
51
  params:
48
52
  - param: GREETING
49
53
  label: Greeting for the world
@@ -15,4 +15,4 @@ If you want to deploy your extension to test on a real project, go to a Firebase
15
15
  `firebase ext:install ./path/to/extension/directory --project=<project-id>`
16
16
  `firebase deploy --only extensions`
17
17
 
18
- You can find more information about building extensions in the publisher docs: https://firebase.google.com/docs/extensions/alpha/overview-build-extensions
18
+ You can find more information about building extensions in the publisher docs: https://firebase.google.com/docs/extensions/publishers/get-started
@@ -19,4 +19,4 @@ If you want to deploy your extension to test on a real project, go to a Firebase
19
19
  `firebase ext:install ./path/to/extension/directory --project=<project-id>`
20
20
  `firebase deploy --only extensions`
21
21
 
22
- You can find more information about building extensions in the publisher docs: https://firebase.google.com/docs/extensions/alpha/overview-build-extensions
22
+ You can find more information about building extensions in the publisher docs: https://firebase.google.com/docs/extensions/publishers/get-started
@@ -5,7 +5,7 @@
5
5
  * Reference PARAMETERS in your functions code with:
6
6
  * `process.env.<parameter-name>`
7
7
  * Learn more about building extensions in the docs:
8
- * https://firebase.google.com/docs/extensions/alpha/overview
8
+ * https://firebase.google.com/docs/extensions/publishers
9
9
  */
10
10
 
11
11
  import * as functions from "firebase-functions";
@@ -1,9 +1,19 @@
1
- const functions = require("firebase-functions");
1
+ /**
2
+ * Import function triggers from their respective submodules:
3
+ *
4
+ * const {onCall} = require("firebase-functions/v2/https");
5
+ * const {onDocumentWritten} = require("firebase-functions/v2/firestore");
6
+ *
7
+ * See a full list of supported triggers at https://firebase.google.com/docs/functions
8
+ */
2
9
 
3
- // // Create and deploy your first functions
4
- // // https://firebase.google.com/docs/functions/get-started
5
- //
6
- // exports.helloWorld = functions.https.onRequest((request, response) => {
7
- // functions.logger.info("Hello logs!", {structuredData: true});
10
+ const {onRequest} = require("firebase-functions/v2/https");
11
+ const logger = require("firebase-functions/logger");
12
+
13
+ // Create and deploy your first functions
14
+ // https://firebase.google.com/docs/functions/get-started
15
+
16
+ // exports.helloWorld = onRequest((request, response) => {
17
+ // logger.info("Hello logs!", {structuredData: true});
8
18
  // response.send("Hello from Firebase!");
9
19
  // });
@@ -10,17 +10,17 @@
10
10
  "logs": "firebase functions:log"
11
11
  },
12
12
  "engines": {
13
- "node": "16"
13
+ "node": "18"
14
14
  },
15
15
  "main": "index.js",
16
16
  "dependencies": {
17
- "firebase-admin": "^11.5.0",
18
- "firebase-functions": "^4.2.0"
17
+ "firebase-admin": "^11.8.0",
18
+ "firebase-functions": "^4.3.1"
19
19
  },
20
20
  "devDependencies": {
21
21
  "eslint": "^8.15.0",
22
22
  "eslint-config-google": "^0.14.0",
23
- "firebase-functions-test": "^3.0.0"
23
+ "firebase-functions-test": "^3.1.0"
24
24
  },
25
25
  "private": true
26
26
  }
@@ -9,15 +9,15 @@
9
9
  "logs": "firebase functions:log"
10
10
  },
11
11
  "engines": {
12
- "node": "16"
12
+ "node": "18"
13
13
  },
14
14
  "main": "index.js",
15
15
  "dependencies": {
16
- "firebase-admin": "^11.5.0",
17
- "firebase-functions": "^4.2.0"
16
+ "firebase-admin": "^11.8.0",
17
+ "firebase-functions": "^4.3.1"
18
18
  },
19
19
  "devDependencies": {
20
- "firebase-functions-test": "^3.0.0"
20
+ "firebase-functions-test": "^3.1.0"
21
21
  },
22
22
  "private": true
23
23
  }
@@ -1,9 +1,19 @@
1
- import * as functions from "firebase-functions";
1
+ /**
2
+ * Import function triggers from their respective submodules:
3
+ *
4
+ * import {onCall} from "firebase-functions/v2/https";
5
+ * import {onDocumentWritten} from "firebase-functions/v2/firestore";
6
+ *
7
+ * See a full list of supported triggers at https://firebase.google.com/docs/functions
8
+ */
2
9
 
3
- // // Start writing functions
4
- // // https://firebase.google.com/docs/functions/typescript
5
- //
6
- // export const helloWorld = functions.https.onRequest((request, response) => {
7
- // functions.logger.info("Hello logs!", {structuredData: true});
10
+ import {onRequest} from "firebase-functions/v2/https";
11
+ import * as logger from "firebase-functions/logger";
12
+
13
+ // Start writing functions
14
+ // https://firebase.google.com/docs/functions/typescript
15
+
16
+ // export const helloWorld = onRequest((request, response) => {
17
+ // logger.info("Hello logs!", {structuredData: true});
8
18
  // response.send("Hello from Firebase!");
9
19
  // });
@@ -11,12 +11,12 @@
11
11
  "logs": "firebase functions:log"
12
12
  },
13
13
  "engines": {
14
- "node": "16"
14
+ "node": "18"
15
15
  },
16
16
  "main": "lib/index.js",
17
17
  "dependencies": {
18
- "firebase-admin": "^11.5.0",
19
- "firebase-functions": "^4.2.0"
18
+ "firebase-admin": "^11.8.0",
19
+ "firebase-functions": "^4.3.1"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@typescript-eslint/eslint-plugin": "^5.12.0",
@@ -24,7 +24,7 @@
24
24
  "eslint": "^8.9.0",
25
25
  "eslint-config-google": "^0.14.0",
26
26
  "eslint-plugin-import": "^2.25.4",
27
- "firebase-functions-test": "^3.0.0",
27
+ "firebase-functions-test": "^3.1.0",
28
28
  "typescript": "^4.9.0"
29
29
  },
30
30
  "private": true
@@ -10,16 +10,16 @@
10
10
  "logs": "firebase functions:log"
11
11
  },
12
12
  "engines": {
13
- "node": "16"
13
+ "node": "18"
14
14
  },
15
15
  "main": "lib/index.js",
16
16
  "dependencies": {
17
- "firebase-admin": "^11.5.0",
18
- "firebase-functions": "^4.2.0"
17
+ "firebase-admin": "^11.8.0",
18
+ "firebase-functions": "^4.3.1"
19
19
  },
20
20
  "devDependencies": {
21
21
  "typescript": "^4.9.0",
22
- "firebase-functions-test": "^3.0.0"
22
+ "firebase-functions-test": "^3.1.0"
23
23
  },
24
24
  "private": true
25
25
  }
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.command = void 0;
4
- const clc = require("colorette");
5
- const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
6
- const command_1 = require("../command");
7
- const error_1 = require("../error");
8
- const commandUtils = require("../emulator/commandUtils");
9
- exports.command = new command_1.Command("ext:dev:emulators:exec <script>")
10
- .description("deprecated: please use `firebase emulators:exec` instead")
11
- .before(commandUtils.setExportOnExitOptions)
12
- .option(commandUtils.FLAG_INSPECT_FUNCTIONS, commandUtils.DESC_INSPECT_FUNCTIONS)
13
- .option(commandUtils.FLAG_TEST_CONFIG, commandUtils.DESC_TEST_CONFIG)
14
- .option(commandUtils.FLAG_TEST_PARAMS, commandUtils.DESC_TEST_PARAMS)
15
- .option(commandUtils.FLAG_IMPORT, commandUtils.DESC_IMPORT)
16
- .option(commandUtils.FLAG_EXPORT_ON_EXIT, commandUtils.DESC_EXPORT_ON_EXIT)
17
- .option(commandUtils.FLAG_UI, commandUtils.DESC_UI)
18
- .before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extDevMinVersion")
19
- .action((script) => {
20
- const localInstallCommand = `firebase ext:install ${process.cwd()}`;
21
- const emulatorsExecCommand = `firebase emulators:exec '${script}`;
22
- throw new error_1.FirebaseError("ext:dev:emulators:exec is no longer supported. " +
23
- "Instead, navigate to a Firebase project directory and add this extension to the extensions manifest by running:\n" +
24
- clc.bold(localInstallCommand) +
25
- "\nThen, you can emulate this extension as part of that project by running:\n" +
26
- clc.bold(emulatorsExecCommand));
27
- });
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.command = void 0;
4
- const clc = require("colorette");
5
- const command_1 = require("../command");
6
- const commandUtils = require("../emulator/commandUtils");
7
- const error_1 = require("../error");
8
- exports.command = new command_1.Command("ext:dev:emulators:start")
9
- .description("deprecated: please use `firebase emulators:start`")
10
- .before(commandUtils.setExportOnExitOptions)
11
- .option(commandUtils.FLAG_INSPECT_FUNCTIONS, commandUtils.DESC_INSPECT_FUNCTIONS)
12
- .option(commandUtils.FLAG_TEST_CONFIG, commandUtils.DESC_TEST_CONFIG)
13
- .option(commandUtils.FLAG_TEST_PARAMS, commandUtils.DESC_TEST_PARAMS)
14
- .option(commandUtils.FLAG_IMPORT, commandUtils.DESC_IMPORT)
15
- .option(commandUtils.FLAG_EXPORT_ON_EXIT, commandUtils.DESC_EXPORT_ON_EXIT)
16
- .action(() => {
17
- const localInstallCommand = `firebase ext:install ${process.cwd()}`;
18
- const emulatorsStartCommand = "firebase emulators:start";
19
- throw new error_1.FirebaseError("ext:dev:emulators:start is no longer supported. " +
20
- "Instead, navigate to a Firebase project directory and add this extension to the extensions manifest by running:\n" +
21
- clc.bold(localInstallCommand) +
22
- "\nThen, you can emulate this extension as part of that project by running:\n" +
23
- clc.bold(emulatorsStartCommand));
24
- });
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.command = void 0;
4
- const utils = require("../utils");
5
- const clc = require("colorette");
6
- const command_1 = require("../command");
7
- const extensionsHelper_1 = require("../extensions/extensionsHelper");
8
- const extensionsApi_1 = require("../extensions/extensionsApi");
9
- const refs = require("../extensions/refs");
10
- const prompt_1 = require("../prompt");
11
- const requireAuth_1 = require("../requireAuth");
12
- const error_1 = require("../error");
13
- const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
14
- exports.command = new command_1.Command("ext:dev:delete <extensionRef>")
15
- .description("delete an extension")
16
- .help("use this command to delete an extension, and make it unavailable for developers to install or reconfigure. " +
17
- "Specify the extension you want to delete using the format '<publisherId>/<extensionId>.")
18
- .before(requireAuth_1.requireAuth)
19
- .before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extDevMinVersion")
20
- .action(async (extensionRef) => {
21
- const { publisherId, extensionId, version } = refs.parse(extensionRef);
22
- if (version) {
23
- throw new error_1.FirebaseError(`Deleting a single version is not currently supported. You can only delete ${clc.bold("ALL versions")} of an extension. To delete all versions, please remove the version from the reference.`);
24
- }
25
- utils.logLabeledWarning(extensionsHelper_1.logPrefix, "If you delete this extension, developers won't be able to install it. " +
26
- "For developers who currently have this extension installed, " +
27
- "it will continue to run and will appear as unpublished when " +
28
- "listed in the Firebase console or Firebase CLI.");
29
- utils.logLabeledWarning("This is a permanent action", `Once deleted, you may never use the extension name '${clc.bold(extensionId)}' again.`);
30
- await (0, extensionsApi_1.getExtension)(extensionRef);
31
- const consent = await confirmDelete(publisherId, extensionId);
32
- if (!consent) {
33
- throw new error_1.FirebaseError("deletion cancelled.");
34
- }
35
- await (0, extensionsApi_1.deleteExtension)(extensionRef);
36
- utils.logLabeledSuccess(extensionsHelper_1.logPrefix, "successfully deleted all versions of this extension.");
37
- });
38
- async function confirmDelete(publisherId, extensionId) {
39
- const message = `You are about to delete ALL versions of ${clc.green(`${publisherId}/${extensionId}`)}.\nDo you wish to continue? `;
40
- return (0, prompt_1.promptOnce)({
41
- type: "confirm",
42
- message,
43
- default: false,
44
- });
45
- }
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.command = void 0;
4
- const command_1 = require("../command");
5
- const extensionsHelper_1 = require("../extensions/extensionsHelper");
6
- const extensionsApi_1 = require("../extensions/extensionsApi");
7
- const utils = require("../utils");
8
- const refs = require("../extensions/refs");
9
- const prompt_1 = require("../prompt");
10
- const clc = require("colorette");
11
- const requireAuth_1 = require("../requireAuth");
12
- const error_1 = require("../error");
13
- const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
14
- exports.command = new command_1.Command("ext:dev:unpublish <extensionRef>")
15
- .description("unpublish an extension")
16
- .withForce()
17
- .help("use this command to unpublish an extension, and make it unavailable for developers to install or reconfigure. " +
18
- "Specify the extension you want to unpublish using the format '<publisherId>/<extensionId>.")
19
- .before(requireAuth_1.requireAuth)
20
- .before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extDevMinVersion")
21
- .action(async (extensionRef, options) => {
22
- const { publisherId, extensionId, version } = refs.parse(extensionRef);
23
- utils.logLabeledWarning(extensionsHelper_1.logPrefix, "If you unpublish this extension, developers won't be able to install it. For developers who currently have this extension installed, it will continue to run and will appear as unpublished when listed in the Firebase console or Firebase CLI.");
24
- utils.logLabeledWarning("This is a permanent action", `Once unpublished, you may never use the extension name '${clc.bold(extensionId)}' again.`);
25
- if (version) {
26
- throw new error_1.FirebaseError(`Unpublishing a single version is not currently supported. You can only unpublish ${clc.bold("ALL versions")} of an extension. To unpublish all versions, please remove the version from the reference.`);
27
- }
28
- await (0, extensionsApi_1.getExtension)(extensionRef);
29
- const consent = await comfirmUnpublish(publisherId, extensionId, options);
30
- if (!consent) {
31
- throw new error_1.FirebaseError("unpublishing cancelled.");
32
- }
33
- await (0, extensionsApi_1.unpublishExtension)(extensionRef);
34
- utils.logLabeledSuccess(extensionsHelper_1.logPrefix, "successfully unpublished all versions of this extension.");
35
- });
36
- async function comfirmUnpublish(publisherId, extensionId, options) {
37
- if (options.nonInteractive && !options.force) {
38
- throw new error_1.FirebaseError("Pass the --force flag to use this command in non-interactive mode");
39
- }
40
- if (options.nonInteractive && options.force) {
41
- return true;
42
- }
43
- const message = `You are about to unpublish ALL versions of ${clc.green(`${publisherId}/${extensionId}`)}.\nDo you wish to continue? `;
44
- return (0, prompt_1.promptOnce)({
45
- type: "confirm",
46
- message,
47
- default: false,
48
- });
49
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.command = void 0;
4
- const checkMinRequiredVersion_1 = require("../checkMinRequiredVersion");
5
- const command_1 = require("../command");
6
- const projectUtils_1 = require("../projectUtils");
7
- const logger_1 = require("../logger");
8
- const extensionsHelper_1 = require("../extensions/extensionsHelper");
9
- const requirePermissions_1 = require("../requirePermissions");
10
- exports.command = new command_1.Command("ext:sources:create <sourceLocation>")
11
- .description(`create a extension source from sourceLocation`)
12
- .help("sourceLocation can be a local directory containing an extension, or URL pointing to a zipped extension. " +
13
- 'If using a URL, you can specify a root folder for the extension by adding "#<extensionRoot>". ' +
14
- "For example, if your extension.yaml is in the my/extension directory of the archive, " +
15
- "you should use sourceUrl#my/extension. If no extensionRoot is specified, / is assumed.")
16
- .before(requirePermissions_1.requirePermissions, ["firebaseextensions.sources.create"])
17
- .before(extensionsHelper_1.ensureExtensionsApiEnabled)
18
- .before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extDevMinVersion")
19
- .action(async (sourceLocation, options) => {
20
- const projectId = (0, projectUtils_1.needProjectId)(options);
21
- const res = await (0, extensionsHelper_1.createSourceFromLocation)(projectId, sourceLocation);
22
- logger_1.logger.info(`Extension source creation successful for ${res.spec.name}! Your new source is ${res.name}`);
23
- return res;
24
- });
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.promptForPublisherTOS = void 0;
4
- const marked_1 = require("marked");
5
- const TerminalRenderer = require("marked-terminal");
6
- const error_1 = require("../error");
7
- const extensionsHelper_1 = require("../extensions/extensionsHelper");
8
- const prompt_1 = require("../prompt");
9
- const utils = require("../utils");
10
- marked_1.marked.setOptions({
11
- renderer: new TerminalRenderer(),
12
- });
13
- async function promptForPublisherTOS() {
14
- const termsOfServiceMsg = "By registering as a publisher, you confirm that you have read the Firebase Extensions Publisher Terms and Conditions (linked below) and you, on behalf of yourself and the organization you represent, agree to comply with it. Here is a brief summary of the highlights of our terms and conditions:\n" +
15
- " - You ensure extensions you publish comply with all laws and regulations; do not include any viruses, spyware, Trojan horses, or other malicious code; and do not violate any person’s rights, including intellectual property, privacy, and security rights.\n" +
16
- " - You will not engage in any activity that interferes with or accesses in an unauthorized manner the properties or services of Google, Google’s affiliates, or any third party.\n" +
17
- " - If you become aware or should be aware of a critical security issue in your extension, you will provide either a resolution or a written resolution plan within 48 hours.\n" +
18
- " - If Google requests a critical security matter to be patched for your extension, you will respond to Google within 48 hours with either a resolution or a written resolution plan.\n" +
19
- " - Google may remove your extension or terminate the agreement, if you violate any terms.";
20
- utils.logLabeledBullet(extensionsHelper_1.logPrefix, (0, marked_1.marked)(termsOfServiceMsg));
21
- const consented = await (0, prompt_1.promptOnce)({
22
- name: "consent",
23
- type: "confirm",
24
- message: (0, marked_1.marked)("Do you accept the [Firebase Extensions Publisher Terms and Conditions](https://firebase.google.com/docs/extensions/alpha/terms-of-service) and acknowledge that your information will be used in accordance with [Google's Privacy Policy](https://policies.google.com/privacy?hl=en)?"),
25
- default: false,
26
- });
27
- if (!consented) {
28
- throw new error_1.FirebaseError("You must agree to the terms of service to register a publisher ID.", {
29
- exit: 1,
30
- });
31
- }
32
- }
33
- exports.promptForPublisherTOS = promptForPublisherTOS;