netlify-cli 17.38.0 → 17.38.1-rc-ds

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 (86) hide show
  1. package/bin/run.js +2 -2
  2. package/dist/commands/base-command.d.ts.map +1 -1
  3. package/dist/commands/base-command.js +3 -2
  4. package/dist/commands/completion/completion.d.ts.map +1 -1
  5. package/dist/commands/completion/completion.js +7 -0
  6. package/dist/commands/deploy/deploy.js +2 -2
  7. package/dist/commands/main.d.ts +0 -4
  8. package/dist/commands/main.d.ts.map +1 -1
  9. package/dist/commands/main.js +1 -6
  10. package/dist/commands/sites/sites-create-template.d.ts.map +1 -1
  11. package/dist/commands/sites/sites-create-template.js +3 -4
  12. package/dist/commands/sites/sites-create.d.ts.map +1 -1
  13. package/dist/commands/sites/sites-create.js +1 -2
  14. package/dist/commands/status/status.d.ts.map +1 -1
  15. package/dist/commands/status/status.js +2 -6
  16. package/dist/tsconfig.tsbuildinfo +1 -1
  17. package/dist/utils/addons/prepare.d.ts +0 -21
  18. package/dist/utils/addons/prepare.d.ts.map +1 -1
  19. package/dist/utils/addons/prepare.js +1 -85
  20. package/dist/utils/framework-server.js +1 -1
  21. package/dist/utils/headers.js +1 -1
  22. package/dist/utils/redirects.js +1 -1
  23. package/dist/utils/run-build.d.ts.map +1 -1
  24. package/dist/utils/run-build.js +6 -1
  25. package/dist/utils/types.d.ts +5 -11
  26. package/dist/utils/types.d.ts.map +1 -1
  27. package/functions-templates/javascript/scheduled-function/package.json +1 -1
  28. package/functions-templates/typescript/hello-world/package-lock.json +22 -22
  29. package/functions-templates/typescript/hello-world/package.json +1 -1
  30. package/functions-templates/typescript/scheduled-function/package.json +1 -1
  31. package/npm-shrinkwrap.json +872 -933
  32. package/package.json +13 -16
  33. package/dist/commands/addons/addons-auth.d.ts +0 -4
  34. package/dist/commands/addons/addons-auth.d.ts.map +0 -1
  35. package/dist/commands/addons/addons-auth.js +0 -22
  36. package/dist/commands/addons/addons-config.d.ts +0 -4
  37. package/dist/commands/addons/addons-config.d.ts.map +0 -1
  38. package/dist/commands/addons/addons-config.js +0 -144
  39. package/dist/commands/addons/addons-create.d.ts +0 -4
  40. package/dist/commands/addons/addons-create.d.ts.map +0 -1
  41. package/dist/commands/addons/addons-create.js +0 -89
  42. package/dist/commands/addons/addons-delete.d.ts +0 -4
  43. package/dist/commands/addons/addons-delete.d.ts.map +0 -1
  44. package/dist/commands/addons/addons-delete.js +0 -32
  45. package/dist/commands/addons/addons-list.d.ts +0 -4
  46. package/dist/commands/addons/addons-list.d.ts.map +0 -1
  47. package/dist/commands/addons/addons-list.js +0 -33
  48. package/dist/commands/addons/addons.d.ts +0 -3
  49. package/dist/commands/addons/addons.d.ts.map +0 -1
  50. package/dist/commands/addons/addons.js +0 -67
  51. package/dist/commands/addons/index.d.ts +0 -2
  52. package/dist/commands/addons/index.d.ts.map +0 -1
  53. package/dist/commands/addons/index.js +0 -1
  54. package/dist/commands/lm/index.d.ts +0 -2
  55. package/dist/commands/lm/index.d.ts.map +0 -1
  56. package/dist/commands/lm/index.js +0 -1
  57. package/dist/commands/lm/lm-info.d.ts +0 -5
  58. package/dist/commands/lm/lm-info.d.ts.map +0 -1
  59. package/dist/commands/lm/lm-info.js +0 -25
  60. package/dist/commands/lm/lm-install.d.ts +0 -3
  61. package/dist/commands/lm/lm-install.d.ts.map +0 -1
  62. package/dist/commands/lm/lm-install.js +0 -8
  63. package/dist/commands/lm/lm-setup.d.ts +0 -4
  64. package/dist/commands/lm/lm-setup.d.ts.map +0 -1
  65. package/dist/commands/lm/lm-setup.js +0 -79
  66. package/dist/commands/lm/lm-uninstall.d.ts +0 -5
  67. package/dist/commands/lm/lm-uninstall.d.ts.map +0 -1
  68. package/dist/commands/lm/lm-uninstall.js +0 -7
  69. package/dist/commands/lm/lm.d.ts +0 -3
  70. package/dist/commands/lm/lm.d.ts.map +0 -1
  71. package/dist/commands/lm/lm.js +0 -46
  72. package/dist/utils/addons/render.d.ts +0 -3
  73. package/dist/utils/addons/render.d.ts.map +0 -1
  74. package/dist/utils/addons/render.js +0 -36
  75. package/dist/utils/lm/install.d.ts +0 -11
  76. package/dist/utils/lm/install.d.ts.map +0 -1
  77. package/dist/utils/lm/install.js +0 -248
  78. package/dist/utils/lm/requirements.d.ts +0 -5
  79. package/dist/utils/lm/requirements.d.ts.map +0 -1
  80. package/dist/utils/lm/requirements.js +0 -56
  81. package/dist/utils/lm/steps.d.ts +0 -17
  82. package/dist/utils/lm/steps.d.ts.map +0 -1
  83. package/dist/utils/lm/steps.js +0 -35
  84. package/dist/utils/lm/ui.d.ts +0 -5
  85. package/dist/utils/lm/ui.d.ts.map +0 -1
  86. package/dist/utils/lm/ui.js +0 -17
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
3
  "description": "Netlify command line tool",
4
- "version": "17.38.0",
4
+ "version": "17.38.1-rc-ds",
5
5
  "author": "Netlify Inc.",
6
6
  "type": "module",
7
7
  "engines": {
@@ -38,13 +38,15 @@
38
38
  "@bugsnag/js": "7.25.0",
39
39
  "@fastify/static": "7.0.4",
40
40
  "@netlify/blobs": "8.1.0",
41
- "@netlify/build": "29.56.1",
42
- "@netlify/build-info": "7.15.2",
43
- "@netlify/config": "20.19.1",
44
- "@netlify/edge-bundler": "12.2.3",
41
+ "@netlify/build": "29.58.1",
42
+ "@netlify/build-info": "7.17.0",
43
+ "@netlify/config": "20.21.1",
44
+ "@netlify/edge-bundler": "12.3.1",
45
45
  "@netlify/edge-functions": "2.11.1",
46
+ "@netlify/headers-parser": "7.3.0",
46
47
  "@netlify/local-functions-proxy": "1.1.1",
47
- "@netlify/zip-it-and-ship-it": "9.41.1",
48
+ "@netlify/redirect-parser": "14.5.0",
49
+ "@netlify/zip-it-and-ship-it": "9.42.1",
48
50
  "@octokit/rest": "20.1.1",
49
51
  "@opentelemetry/api": "1.8.0",
50
52
  "ansi-escapes": "7.0.0",
@@ -68,12 +70,12 @@
68
70
  "debug": "4.3.7",
69
71
  "decache": "4.6.2",
70
72
  "dot-prop": "9.0.0",
71
- "dotenv": "16.4.5",
73
+ "dotenv": "16.4.7",
72
74
  "env-paths": "3.0.0",
73
75
  "envinfo": "7.14.0",
74
76
  "etag": "1.8.1",
75
77
  "execa": "5.1.1",
76
- "express": "4.21.1",
78
+ "express": "4.21.2",
77
79
  "express-logging": "1.1.1",
78
80
  "extract-zip": "2.0.1",
79
81
  "fastest-levenshtein": "1.0.16",
@@ -87,11 +89,10 @@
87
89
  "gh-release-fetch": "4.0.3",
88
90
  "git-repo-info": "2.1.1",
89
91
  "gitconfiglocal": "2.1.0",
90
- "hasbin": "1.2.3",
91
92
  "hasha": "5.2.2",
92
93
  "http-proxy": "1.18.1",
93
94
  "http-proxy-middleware": "2.0.7",
94
- "https-proxy-agent": "7.0.5",
95
+ "https-proxy-agent": "7.0.6",
95
96
  "inquirer": "6.5.2",
96
97
  "inquirer-autocomplete-prompt": "1.4.0",
97
98
  "ipx": "2.1.0",
@@ -103,7 +104,6 @@
103
104
  "jsonwebtoken": "9.0.2",
104
105
  "jwt-decode": "4.0.0",
105
106
  "lambda-local": "2.2.0",
106
- "listr2": "8.2.5",
107
107
  "locate-path": "7.2.0",
108
108
  "lodash": "4.17.21",
109
109
  "log-symbols": "6.0.0",
@@ -111,20 +111,17 @@
111
111
  "maxstache": "1.0.7",
112
112
  "maxstache-stream": "1.0.4",
113
113
  "multiparty": "4.2.3",
114
- "netlify": "13.1.21",
115
- "netlify-headers-parser": "7.1.4",
116
- "netlify-redirect-parser": "14.3.0",
114
+ "netlify": "13.2.0",
117
115
  "netlify-redirector": "0.5.0",
118
116
  "node-fetch": "3.3.2",
119
117
  "node-version-alias": "3.4.1",
120
118
  "ora": "8.1.1",
121
119
  "p-filter": "4.1.0",
122
- "p-map": "7.0.2",
120
+ "p-map": "7.0.3",
123
121
  "p-wait-for": "5.0.2",
124
122
  "parallel-transform": "1.2.0",
125
123
  "parse-github-url": "1.0.3",
126
124
  "parse-gitignore": "2.0.0",
127
- "path-key": "4.0.0",
128
125
  "prettyjson": "1.2.5",
129
126
  "pump": "3.0.2",
130
127
  "raw-body": "2.5.2",
@@ -1,4 +0,0 @@
1
- import { OptionValues } from 'commander';
2
- import BaseCommand from '../base-command.js';
3
- export declare const addonsAuth: (addonName: string, options: OptionValues, command: BaseCommand) => Promise<false | undefined>;
4
- //# sourceMappingURL=addons-auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addons-auth.d.ts","sourceRoot":"","sources":["../../../src/commands/addons/addons-auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAKxC,OAAO,WAAW,MAAM,oBAAoB,CAAA;AAE5C,eAAO,MAAM,UAAU,cAAqB,MAAM,WAAW,YAAY,WAAW,WAAW,+BAoB9F,CAAA"}
@@ -1,22 +0,0 @@
1
- import { ADDON_VALIDATION, prepareAddonCommand } from '../../utils/addons/prepare.js';
2
- import { exit, log } from '../../utils/command-helpers.js';
3
- import openBrowser from '../../utils/open-browser.js';
4
- export const addonsAuth = async (addonName, options, command) => {
5
- const { addon } = await prepareAddonCommand({
6
- command,
7
- addonName,
8
- validation: ADDON_VALIDATION.EXISTS,
9
- });
10
- if (!addon.auth_url) {
11
- log(`No Admin URL found for the "${addonName} add-on"`);
12
- return false;
13
- }
14
- log();
15
- log(`Opening ${addonName} add-on admin URL:`);
16
- log();
17
- log(addon.auth_url);
18
- log();
19
- // @ts-expect-error TS(2345) FIXME: Argument of type '{ url: any; }' is not assignable... Remove this comment to see the full error message
20
- await openBrowser({ url: addon.auth_url });
21
- exit();
22
- };
@@ -1,4 +0,0 @@
1
- import { OptionValues } from 'commander';
2
- import BaseCommand from '../base-command.js';
3
- export declare const addonsConfig: (addonName: string, options: OptionValues, command: BaseCommand) => Promise<false | undefined>;
4
- //# sourceMappingURL=addons-config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addons-config.d.ts","sourceRoot":"","sources":["../../../src/commands/addons/addons-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAYxC,OAAO,WAAW,MAAM,oBAAoB,CAAA;AA6B5C,eAAO,MAAM,YAAY,cAAqB,MAAM,WAAW,YAAY,WAAW,WAAW,+BAqHhG,CAAA"}
@@ -1,144 +0,0 @@
1
- import inquirer from 'inquirer';
2
- import isEmpty from 'lodash/isEmpty.js';
3
- import compare from '../../utils/addons/compare.js';
4
- import diffValues from '../../utils/addons/diffs/index.js';
5
- import { ADDON_VALIDATION, prepareAddonCommand } from '../../utils/addons/prepare.js';
6
- import generatePrompts from '../../utils/addons/prompts.js';
7
- import { renderConfigValues } from '../../utils/addons/render.js';
8
- import { missingConfigValues, requiredConfigValues, updateConfigValues } from '../../utils/addons/validation.js';
9
- import { chalk, error, log } from '../../utils/command-helpers.js';
10
- import { parseRawFlags } from '../../utils/parse-raw-flags.js';
11
- // @ts-expect-error TS(7031) FIXME: Binding element 'addonName' implicitly has an 'any... Remove this comment to see the full error message
12
- const update = async function ({ addonName, api, currentConfig, instanceId, newConfig, siteId }) {
13
- const codeDiff = diffValues(currentConfig, newConfig);
14
- if (!codeDiff) {
15
- log('No changes, exiting early');
16
- return false;
17
- }
18
- log();
19
- const msg = `Updating ${addonName} add-on config values...`;
20
- log(`${chalk.white.bold(msg)}`);
21
- log();
22
- log(`${codeDiff}\n`);
23
- log();
24
- try {
25
- await api.updateServiceInstance({
26
- siteId,
27
- addon: addonName,
28
- instanceId,
29
- body: { config: newConfig },
30
- });
31
- log(`Add-on "${addonName}" successfully updated`);
32
- }
33
- catch (error_) {
34
- error(error_.message);
35
- }
36
- };
37
- export const addonsConfig = async (addonName, options, command) => {
38
- const { addon, manifest, siteData } = await prepareAddonCommand({
39
- command,
40
- addonName,
41
- validation: ADDON_VALIDATION.EXISTS,
42
- });
43
- const { api, site } = command.netlify;
44
- const siteId = site.id;
45
- const hasConfig = !isEmpty(manifest.config);
46
- // Parse flags
47
- const rawFlags = parseRawFlags(command.args);
48
- // Get Existing Config
49
- const currentConfig = addon.config || {};
50
- const words = `Current "${addonName} add-on" Settings:`;
51
- log(` ${chalk.yellowBright.bold(words)}`);
52
- if (hasConfig) {
53
- if (!rawFlags.silent) {
54
- renderConfigValues(addonName, manifest.config, currentConfig);
55
- }
56
- }
57
- else {
58
- // For addons without manifest. TODO remove once we enforce manifests
59
- Object.keys(currentConfig).forEach((key) => {
60
- log(`${key} - ${currentConfig[key]}`);
61
- });
62
- }
63
- if (hasConfig) {
64
- const required = requiredConfigValues(manifest.config);
65
- const missingValues = missingConfigValues(required, rawFlags);
66
- /* Config set by command line flags */
67
- if (rawFlags && missingValues.length === 0) {
68
- const newConfig = updateConfigValues(manifest.config, currentConfig, rawFlags);
69
- await update({
70
- addonName,
71
- currentConfig,
72
- newConfig,
73
- siteId,
74
- instanceId: addon.id,
75
- api,
76
- });
77
- return false;
78
- }
79
- const updatePrompt = await inquirer.prompt([
80
- {
81
- type: 'confirm',
82
- name: 'updateNow',
83
- message: `Do you want to update config values?`,
84
- default: false,
85
- },
86
- ]);
87
- if (!updatePrompt.updateNow) {
88
- log('Sounds good! Exiting configuration...');
89
- return false;
90
- }
91
- log();
92
- log(` - Hit ${chalk.white.bold('enter')} to keep the existing value in (parentheses)`);
93
- log(` - Hit ${chalk.white.bold('down arrow')} to remove the value`);
94
- log(` - Hit ${chalk.white.bold('ctrl + C')} to cancel & exit configuration`);
95
- log();
96
- log(` You will need to verify the changed before we push them to your live site!`);
97
- log();
98
- const prompts = generatePrompts({
99
- config: manifest.config,
100
- configValues: currentConfig,
101
- });
102
- const userInput = await inquirer.prompt(prompts);
103
- // Merge user input with the flags specified
104
- const newConfig = updateConfigValues(manifest.config, currentConfig, userInput);
105
- const diffs = compare(currentConfig, newConfig);
106
- // log('compare', diffs)
107
- // @ts-expect-error TS(2339) FIXME: Property 'isEqual' does not exist on type 'string'... Remove this comment to see the full error message
108
- if (diffs.isEqual) {
109
- log(`No changes. exiting early`);
110
- return false;
111
- }
112
- log();
113
- log(`${chalk.yellowBright.bold.underline('Confirm your updates:')}`);
114
- log();
115
- // @ts-expect-error TS(2339) FIXME: Property 'keys' does not exist on type 'string'.
116
- diffs.keys.forEach((key) => {
117
- // @ts-expect-error TS(2339) FIXME: Property 'diffs' does not exist on type 'string'.
118
- const { newValue, oldValue } = diffs.diffs[key];
119
- const oldVal = oldValue || 'NO VALUE';
120
- log(`${chalk.cyan(key)} changed from ${chalk.whiteBright(oldVal)} to ${chalk.green(newValue)}`);
121
- });
122
- log();
123
- const confirmPrompt = await inquirer.prompt([
124
- {
125
- type: 'confirm',
126
- name: 'confirmChange',
127
- message: `Do you want to publish the updated "${addonName} add-on" settings for ${chalk.cyan(siteData.name)}?`,
128
- default: false,
129
- },
130
- ]);
131
- if (!confirmPrompt.confirmChange) {
132
- log('Canceling changes... You are good to go!');
133
- return false;
134
- }
135
- await update({
136
- addonName,
137
- currentConfig,
138
- newConfig,
139
- siteId,
140
- instanceId: addon.id,
141
- api,
142
- });
143
- }
144
- };
@@ -1,4 +0,0 @@
1
- import { OptionValues } from 'commander';
2
- import BaseCommand from '../base-command.js';
3
- export declare const addonsCreate: (addonName: string, options: OptionValues, command: BaseCommand) => Promise<false | undefined>;
4
- //# sourceMappingURL=addons-create.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addons-create.d.ts","sourceRoot":"","sources":["../../../src/commands/addons/addons-create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAUxC,OAAO,WAAW,MAAM,oBAAoB,CAAA;AAmB5C,eAAO,MAAM,YAAY,cAAqB,MAAM,WAAW,YAAY,WAAW,WAAW,+BA2EhG,CAAA"}
@@ -1,89 +0,0 @@
1
- import inquirer from 'inquirer';
2
- import isEmpty from 'lodash/isEmpty.js';
3
- import { ADDON_VALIDATION, prepareAddonCommand } from '../../utils/addons/prepare.js';
4
- import generatePrompts from '../../utils/addons/prompts.js';
5
- import { renderConfigValues, renderMissingValues } from '../../utils/addons/render.js';
6
- import { missingConfigValues, requiredConfigValues, updateConfigValues } from '../../utils/addons/validation.js';
7
- import { chalk, error, log } from '../../utils/command-helpers.js';
8
- import { parseRawFlags } from '../../utils/parse-raw-flags.js';
9
- // @ts-expect-error TS(7031) FIXME: Binding element 'addonName' implicitly has an 'any... Remove this comment to see the full error message
10
- const createAddon = async ({ addonName, api, config, siteData, siteId }) => {
11
- try {
12
- const response = await api.createServiceInstance({
13
- siteId,
14
- addon: addonName,
15
- body: { config },
16
- });
17
- log(`Add-on "${addonName}" created for ${siteData.name}`);
18
- if (response.config && response.config.message) {
19
- log();
20
- log(`${response.config.message}`);
21
- }
22
- }
23
- catch (error_) {
24
- error(error_.message);
25
- }
26
- };
27
- export const addonsCreate = async (addonName, options, command) => {
28
- const { manifest, siteData } = await prepareAddonCommand({
29
- command,
30
- addonName,
31
- validation: ADDON_VALIDATION.NOT_EXISTS,
32
- });
33
- const { api, site } = command.netlify;
34
- const siteId = site.id;
35
- // GET flags from `raw` data
36
- const rawFlags = parseRawFlags(command.args);
37
- const hasConfig = !isEmpty(manifest.config);
38
- let configValues = rawFlags;
39
- if (hasConfig) {
40
- const required = requiredConfigValues(manifest.config);
41
- const missingValues = missingConfigValues(required, rawFlags);
42
- log(`Starting the setup for "${addonName} add-on"`);
43
- log();
44
- if (Object.keys(rawFlags).length !== 0) {
45
- const newConfig = updateConfigValues(manifest.config, {}, rawFlags);
46
- if (missingValues.length !== 0) {
47
- /* Warn user of missing required values */
48
- log(`${chalk.redBright.underline.bold(`Error: Missing required configuration for "${addonName} add-on"`)}`);
49
- log();
50
- renderMissingValues(missingValues, manifest);
51
- log();
52
- const msg = `netlify addons:create ${addonName}`;
53
- log(`Please supply the configuration values as CLI flags`);
54
- log();
55
- log(`Alternatively, you can run ${chalk.cyan(msg)} with no flags to walk through the setup steps`);
56
- log();
57
- return false;
58
- }
59
- await createAddon({ api, siteId, addonName, config: newConfig, siteData });
60
- return false;
61
- }
62
- const words = `The ${addonName} add-on has the following configurable options:`;
63
- log(` ${chalk.yellowBright.bold(words)}`);
64
- // @ts-expect-error TS(2554) FIXME: Expected 3 arguments, but got 2.
65
- renderConfigValues(addonName, manifest.config);
66
- log();
67
- log(` ${chalk.greenBright.bold('Lets configure those!')}`);
68
- log();
69
- log(` - Hit ${chalk.white.bold('enter')} to confirm value or set empty value`);
70
- log(` - Hit ${chalk.white.bold('ctrl + C')} to cancel & exit configuration`);
71
- log();
72
- const prompts = generatePrompts({
73
- config: manifest.config,
74
- configValues: rawFlags,
75
- });
76
- const userInput = await inquirer.prompt(prompts);
77
- // Merge user input with the flags specified
78
- configValues = updateConfigValues(manifest.config, rawFlags, userInput);
79
- const missingRequiredValues = missingConfigValues(required, configValues);
80
- if (missingRequiredValues && missingRequiredValues.length !== 0) {
81
- // @ts-expect-error TS(7006) FIXME: Parameter 'val' implicitly has an 'any' type.
82
- missingRequiredValues.forEach((val) => {
83
- log(`Missing required value "${val}". Please run the command again`);
84
- });
85
- return false;
86
- }
87
- }
88
- await createAddon({ api, siteId, addonName, config: configValues, siteData });
89
- };
@@ -1,4 +0,0 @@
1
- import { OptionValues } from 'commander';
2
- import BaseCommand from '../base-command.js';
3
- export declare const addonsDelete: (addonName: string, options: OptionValues, command: BaseCommand) => Promise<void>;
4
- //# sourceMappingURL=addons-delete.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addons-delete.d.ts","sourceRoot":"","sources":["../../../src/commands/addons/addons-delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAKxC,OAAO,WAAW,MAAM,oBAAoB,CAAA;AAE5C,eAAO,MAAM,YAAY,cAAqB,MAAM,WAAW,YAAY,WAAW,WAAW,kBA4BhG,CAAA"}
@@ -1,32 +0,0 @@
1
- import inquirer from 'inquirer';
2
- import { ADDON_VALIDATION, prepareAddonCommand } from '../../utils/addons/prepare.js';
3
- import { error, exit, log } from '../../utils/command-helpers.js';
4
- export const addonsDelete = async (addonName, options, command) => {
5
- const { addon } = await prepareAddonCommand({
6
- command,
7
- addonName,
8
- validation: ADDON_VALIDATION.EXISTS,
9
- });
10
- if (!options.force && !options.f) {
11
- const { wantsToDelete } = await inquirer.prompt({
12
- type: 'confirm',
13
- name: 'wantsToDelete',
14
- message: `Are you sure you want to delete the ${addonName} add-on? (to skip this prompt, pass a --force flag)`,
15
- default: false,
16
- });
17
- if (!wantsToDelete) {
18
- exit();
19
- }
20
- }
21
- try {
22
- await command.netlify.api.deleteServiceInstance({
23
- siteId: command.netlify.site.id,
24
- addon: addonName,
25
- instanceId: addon.id,
26
- });
27
- log(`Addon "${addonName}" deleted`);
28
- }
29
- catch (error_) {
30
- error(error_.message);
31
- }
32
- };
@@ -1,4 +0,0 @@
1
- import { OptionValues } from 'commander';
2
- import BaseCommand from '../base-command.js';
3
- export declare const addonsList: (options: OptionValues, command: BaseCommand) => Promise<false | undefined>;
4
- //# sourceMappingURL=addons-list.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addons-list.d.ts","sourceRoot":"","sources":["../../../src/commands/addons/addons-list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAIxC,OAAO,WAAW,MAAM,oBAAoB,CAAA;AAE5C,eAAO,MAAM,UAAU,YAAmB,YAAY,WAAW,WAAW,+BAkC3E,CAAA"}
@@ -1,33 +0,0 @@
1
- import AsciiTable from 'ascii-table';
2
- import { prepareAddonCommand } from '../../utils/addons/prepare.js';
3
- import { log, logJson } from '../../utils/command-helpers.js';
4
- export const addonsList = async (options, command) => {
5
- // @ts-expect-error TS(2345) FIXME: Argument of type '{ command: any; }' is not assign... Remove this comment to see the full error message
6
- const { addons, siteData } = await prepareAddonCommand({ command });
7
- // Return json response for piping commands
8
- if (options.json) {
9
- logJson(addons);
10
- return false;
11
- }
12
- if (!addons || addons.length === 0) {
13
- log(`No addons currently installed for ${siteData.name}`);
14
- log(`> Run \`netlify addons:create addon-namespace\` to install an addon`);
15
- return false;
16
- }
17
- // @ts-expect-error TS(7006) FIXME: Parameter 'addon' implicitly has an 'any' type.
18
- const addonData = addons.map((addon) => ({
19
- namespace: addon.service_path.replace('/.netlify/', ''),
20
- name: addon.service_name,
21
- id: addon.id,
22
- }));
23
- // Build a table out of addons
24
- log(`site: ${siteData.name}`);
25
- const table = new AsciiTable(`Currently Installed addons`);
26
- table.setHeading('NameSpace', 'Name', 'Instance Id');
27
- // @ts-expect-error TS(7031) FIXME: Binding element 'id' implicitly has an 'any' type.
28
- addonData.forEach(({ id, name, namespace }) => {
29
- table.addRow(namespace, name, id);
30
- });
31
- // Log da addons
32
- log(table.toString());
33
- };
@@ -1,3 +0,0 @@
1
- import BaseCommand from '../base-command.js';
2
- export declare const createAddonsCommand: (program: BaseCommand) => BaseCommand;
3
- //# sourceMappingURL=addons.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addons.d.ts","sourceRoot":"","sources":["../../../src/commands/addons/addons.ts"],"names":[],"mappings":"AAEA,OAAO,WAAW,MAAM,oBAAoB,CAAA;AAM5C,eAAO,MAAM,mBAAmB,YAAa,WAAW,gBAwEvD,CAAA"}
@@ -1,67 +0,0 @@
1
- const addons = (options, command) => {
2
- command.help();
3
- };
4
- export const createAddonsCommand = (program) => {
5
- program
6
- .command('addons:auth', { hidden: true })
7
- .alias('addon:auth')
8
- .argument('<name>', 'Add-on slug')
9
- .description('Login to add-on provider')
10
- .action(async (addonName, options, command) => {
11
- const { addonsAuth } = await import('./addons-auth.js');
12
- await addonsAuth(addonName, options, command);
13
- });
14
- program
15
- .command('addons:config', { hidden: true })
16
- .alias('addon:config')
17
- .argument('<name>', 'Add-on namespace')
18
- .description('Configure add-on settings')
19
- // allow for any flags. Handy for variadic configuration options
20
- .allowUnknownOption(true)
21
- .action(async (addonName, options, command) => {
22
- const { addonsConfig } = await import('./addons-config.js');
23
- await addonsConfig(addonName, options, command);
24
- });
25
- program
26
- .command('addons:create', { hidden: true })
27
- .alias('addon:create')
28
- .argument('<name>', 'Add-on namespace')
29
- .description(`Add an add-on extension to your site
30
- Add-ons are a way to extend the functionality of your Netlify site`)
31
- // allow for any flags. Handy for variadic configuration options
32
- .allowUnknownOption(true)
33
- .action(async (addonName, options, command) => {
34
- const { addonsCreate } = await import('./addons-create.js');
35
- await addonsCreate(addonName, options, command);
36
- });
37
- program
38
- .command('addons:delete', { hidden: true })
39
- .alias('addon:delete')
40
- .argument('<name>', 'Add-on namespace')
41
- .description(`Remove an add-on extension to your site\nAdd-ons are a way to extend the functionality of your Netlify site`)
42
- .action(async (addonName, options, command) => {
43
- const { addonsDelete } = await import('./addons-delete.js');
44
- await addonsDelete(addonName, options, command);
45
- });
46
- program
47
- .command('addons:list', { hidden: true })
48
- .alias('addon:list')
49
- .description(`List currently installed add-ons for site`)
50
- .option('--json', 'Output add-on data as JSON')
51
- .action(async (options, command) => {
52
- const { addonsList } = await import('./addons-list.js');
53
- await addonsList(options, command);
54
- });
55
- return program
56
- .command('addons', { hidden: true })
57
- .alias('addon')
58
- .description('[Deprecated and will be removed from future versions] Manage Netlify Add-ons')
59
- .addExamples([
60
- 'netlify addons:create addon-xyz',
61
- 'netlify addons:list',
62
- 'netlify addons:config addon-xyz',
63
- 'netlify addons:delete addon-xyz',
64
- 'netlify addons:auth addon-xyz',
65
- ])
66
- .action(addons);
67
- };
@@ -1,2 +0,0 @@
1
- export { createAddonsCommand } from './addons.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/addons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA"}
@@ -1 +0,0 @@
1
- export { createAddonsCommand } from './addons.js';
@@ -1,2 +0,0 @@
1
- export { createLmCommand } from './lm.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/lm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA"}
@@ -1 +0,0 @@
1
- export { createLmCommand } from './lm.js';
@@ -1,5 +0,0 @@
1
- /**
2
- * The lm:info command
3
- */
4
- export declare const lmInfo: () => Promise<void>;
5
- //# sourceMappingURL=lm-info.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lm-info.d.ts","sourceRoot":"","sources":["../../../src/commands/lm/lm-info.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,eAAO,MAAM,MAAM,qBAmBlB,CAAA"}
@@ -1,25 +0,0 @@
1
- import { Listr } from 'listr2';
2
- import { checkGitLFSVersionStep, checkGitVersionStep, checkHelperVersionStep, checkLFSFiltersStep, } from '../../utils/lm/steps.js';
3
- /**
4
- * The lm:info command
5
- */
6
- export const lmInfo = async () => {
7
- const steps = [
8
- checkGitVersionStep,
9
- checkGitLFSVersionStep,
10
- // @ts-expect-error TS(7006) FIXME: Parameter 'ctx' implicitly has an 'any' type.
11
- checkLFSFiltersStep((ctx, task, installed) => {
12
- if (!installed) {
13
- throw new Error('Git LFS filters are not installed, run `git lfs install` to install them');
14
- }
15
- }),
16
- checkHelperVersionStep,
17
- ];
18
- const tasks = new Listr(steps, { concurrent: true, exitOnError: false });
19
- try {
20
- await tasks.run();
21
- }
22
- catch {
23
- // an error is already reported when a task fails
24
- }
25
- };
@@ -1,3 +0,0 @@
1
- import { OptionValues } from 'commander';
2
- export declare const lmInstall: ({ force }: OptionValues) => Promise<void>;
3
- //# sourceMappingURL=lm-install.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lm-install.d.ts","sourceRoot":"","sources":["../../../src/commands/lm/lm-install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAKxC,eAAO,MAAM,SAAS,cAAqB,YAAY,kBAKtD,CAAA"}
@@ -1,8 +0,0 @@
1
- import { installPlatform } from '../../utils/lm/install.js';
2
- import { printBanner } from '../../utils/lm/ui.js';
3
- export const lmInstall = async ({ force }) => {
4
- const installed = await installPlatform({ force });
5
- if (installed) {
6
- printBanner(force);
7
- }
8
- };
@@ -1,4 +0,0 @@
1
- import { OptionValues } from 'commander';
2
- import BaseCommand from '../base-command.js';
3
- export declare const lmSetup: (options: OptionValues, command: BaseCommand) => Promise<void>;
4
- //# sourceMappingURL=lm-setup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lm-setup.d.ts","sourceRoot":"","sources":["../../../src/commands/lm/lm-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAQxC,OAAO,WAAW,MAAM,oBAAoB,CAAA;AAiD5C,eAAO,MAAM,OAAO,YAAmB,YAAY,WAAW,WAAW,kBAiCxE,CAAA"}