netlify-cli 15.1.1 → 15.2.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.
- package/npm-shrinkwrap.json +147 -138
- package/package.json +4 -4
- package/src/commands/base-command.mjs +17 -3
- package/src/commands/deploy/deploy.mjs +6 -28
- package/src/commands/functions/functions-list.mjs +5 -25
- package/src/commands/link/link.mjs +5 -9
- package/src/commands/open/open-admin.mjs +7 -33
- package/src/commands/open/open-site.mjs +7 -25
- package/src/commands/status/status-hooks.mjs +12 -29
- package/src/commands/unlink/unlink.mjs +2 -8
- package/src/functions-templates/javascript/auth-fetch/package-lock.json +6 -6
- package/src/functions-templates/javascript/google-analytics/package-lock.json +7 -7
- package/src/utils/get-site.mjs +16 -0
- package/src/utils/hooks/requires-site-info.mjs +29 -0
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify-cli",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.2.0",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "netlify-cli",
|
|
9
|
-
"version": "15.
|
|
9
|
+
"version": "15.2.0",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@bugsnag/js": "7.20.2",
|
|
14
14
|
"@fastify/static": "6.10.1",
|
|
15
|
-
"@netlify/build": "29.11.
|
|
15
|
+
"@netlify/build": "29.11.6",
|
|
16
16
|
"@netlify/build-info": "7.0.2",
|
|
17
17
|
"@netlify/config": "20.4.3",
|
|
18
|
-
"@netlify/edge-bundler": "8.
|
|
18
|
+
"@netlify/edge-bundler": "8.15.0",
|
|
19
19
|
"@netlify/framework-info": "9.8.7",
|
|
20
20
|
"@netlify/local-functions-proxy": "1.1.1",
|
|
21
21
|
"@netlify/zip-it-and-ship-it": "9.6.0",
|
|
22
|
-
"@octokit/rest": "19.0.
|
|
22
|
+
"@octokit/rest": "19.0.11",
|
|
23
23
|
"@skn0tt/lambda-local": "2.0.3",
|
|
24
24
|
"ansi-escapes": "6.2.0",
|
|
25
25
|
"ansi-styles": "6.2.1",
|
|
@@ -210,9 +210,9 @@
|
|
|
210
210
|
}
|
|
211
211
|
},
|
|
212
212
|
"node_modules/@babel/parser": {
|
|
213
|
-
"version": "7.21.
|
|
214
|
-
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.
|
|
215
|
-
"integrity": "sha512-
|
|
213
|
+
"version": "7.21.9",
|
|
214
|
+
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.9.tgz",
|
|
215
|
+
"integrity": "sha512-q5PNg/Bi1OpGgx5jYlvWZwAorZepEudDMCLtj967aeS7WMont7dUZI46M2XwcIQqvUlMxWfdLFu4S/qSxeUu5g==",
|
|
216
216
|
"bin": {
|
|
217
217
|
"parser": "bin/babel-parser.js"
|
|
218
218
|
},
|
|
@@ -662,14 +662,14 @@
|
|
|
662
662
|
"integrity": "sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw=="
|
|
663
663
|
},
|
|
664
664
|
"node_modules/@netlify/build": {
|
|
665
|
-
"version": "29.11.
|
|
666
|
-
"resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.11.
|
|
667
|
-
"integrity": "sha512-
|
|
665
|
+
"version": "29.11.6",
|
|
666
|
+
"resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.11.6.tgz",
|
|
667
|
+
"integrity": "sha512-rzxHZlgg2Jp/RngWSsXF78c81tOmfx2cBLnDa92wTLuR5TQeUy9mrKjrw6WGzPy9ON0ZL7ZiD3l4+GLmh6hc+w==",
|
|
668
668
|
"dependencies": {
|
|
669
669
|
"@bugsnag/js": "^7.0.0",
|
|
670
670
|
"@netlify/cache-utils": "^5.1.5",
|
|
671
671
|
"@netlify/config": "^20.4.3",
|
|
672
|
-
"@netlify/edge-bundler": "8.
|
|
672
|
+
"@netlify/edge-bundler": "8.15.0",
|
|
673
673
|
"@netlify/framework-info": "^9.8.7",
|
|
674
674
|
"@netlify/functions-utils": "^5.2.8",
|
|
675
675
|
"@netlify/git-utils": "^5.1.1",
|
|
@@ -799,11 +799,12 @@
|
|
|
799
799
|
}
|
|
800
800
|
},
|
|
801
801
|
"node_modules/@netlify/build-info/node_modules/yaml": {
|
|
802
|
-
"version": "2.
|
|
803
|
-
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.
|
|
804
|
-
"integrity": "sha512-
|
|
802
|
+
"version": "2.3.0",
|
|
803
|
+
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.0.tgz",
|
|
804
|
+
"integrity": "sha512-8/1wgzdKc7bc9E6my5wZjmdavHLvO/QOmLG1FBugblEvY4IXrLjlViIOmL24HthU042lWTDRO90Fz1Yp66UnMw==",
|
|
805
805
|
"engines": {
|
|
806
|
-
"node": ">= 14"
|
|
806
|
+
"node": ">= 14",
|
|
807
|
+
"npm": ">= 7"
|
|
807
808
|
}
|
|
808
809
|
},
|
|
809
810
|
"node_modules/@netlify/build/node_modules/@sindresorhus/is": {
|
|
@@ -1468,9 +1469,9 @@
|
|
|
1468
1469
|
}
|
|
1469
1470
|
},
|
|
1470
1471
|
"node_modules/@netlify/edge-bundler": {
|
|
1471
|
-
"version": "8.
|
|
1472
|
-
"resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-8.
|
|
1473
|
-
"integrity": "sha512-
|
|
1472
|
+
"version": "8.15.0",
|
|
1473
|
+
"resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-8.15.0.tgz",
|
|
1474
|
+
"integrity": "sha512-5OKUEtVyzxV1pVYyyt64MqmILjICrUxPG7aVT1TDCqrGmPSECx7xSmguaQH8LVmxLykrgA+g1vLTDzmlySi3Eg==",
|
|
1474
1475
|
"dependencies": {
|
|
1475
1476
|
"@import-maps/resolve": "^1.0.1",
|
|
1476
1477
|
"ajv": "^8.11.2",
|
|
@@ -2642,9 +2643,9 @@
|
|
|
2642
2643
|
}
|
|
2643
2644
|
},
|
|
2644
2645
|
"node_modules/@netlify/zip-it-and-ship-it/node_modules/minimatch": {
|
|
2645
|
-
"version": "9.0.
|
|
2646
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.
|
|
2647
|
-
"integrity": "sha512-
|
|
2646
|
+
"version": "9.0.1",
|
|
2647
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.1.tgz",
|
|
2648
|
+
"integrity": "sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==",
|
|
2648
2649
|
"dependencies": {
|
|
2649
2650
|
"brace-expansion": "^2.0.1"
|
|
2650
2651
|
},
|
|
@@ -2746,15 +2747,15 @@
|
|
|
2746
2747
|
}
|
|
2747
2748
|
},
|
|
2748
2749
|
"node_modules/@octokit/core": {
|
|
2749
|
-
"version": "4.1
|
|
2750
|
-
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.1.
|
|
2751
|
-
"integrity": "sha512-
|
|
2750
|
+
"version": "4.2.1",
|
|
2751
|
+
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.2.1.tgz",
|
|
2752
|
+
"integrity": "sha512-tEDxFx8E38zF3gT7sSMDrT1tGumDgsw5yPG6BBh/X+5ClIQfMH/Yqocxz1PnHx6CHyF6pxmovUTOfZAUvQ0Lvw==",
|
|
2752
2753
|
"dependencies": {
|
|
2753
2754
|
"@octokit/auth-token": "^3.0.0",
|
|
2754
2755
|
"@octokit/graphql": "^5.0.0",
|
|
2755
2756
|
"@octokit/request": "^6.0.0",
|
|
2756
2757
|
"@octokit/request-error": "^3.0.0",
|
|
2757
|
-
"@octokit/types": "^
|
|
2758
|
+
"@octokit/types": "^9.0.0",
|
|
2758
2759
|
"before-after-hook": "^2.2.0",
|
|
2759
2760
|
"universal-user-agent": "^6.0.0"
|
|
2760
2761
|
},
|
|
@@ -2763,16 +2764,16 @@
|
|
|
2763
2764
|
}
|
|
2764
2765
|
},
|
|
2765
2766
|
"node_modules/@octokit/core/node_modules/@octokit/openapi-types": {
|
|
2766
|
-
"version": "
|
|
2767
|
-
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-
|
|
2768
|
-
"integrity": "sha512-
|
|
2767
|
+
"version": "17.2.0",
|
|
2768
|
+
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-17.2.0.tgz",
|
|
2769
|
+
"integrity": "sha512-MazrFNx4plbLsGl+LFesMo96eIXkFgEtaKbnNpdh4aQ0VM10aoylFsTYP1AEjkeoRNZiiPe3T6Gl2Hr8dJWdlQ=="
|
|
2769
2770
|
},
|
|
2770
2771
|
"node_modules/@octokit/core/node_modules/@octokit/types": {
|
|
2771
|
-
"version": "
|
|
2772
|
-
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-
|
|
2773
|
-
"integrity": "sha512-
|
|
2772
|
+
"version": "9.2.3",
|
|
2773
|
+
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.2.3.tgz",
|
|
2774
|
+
"integrity": "sha512-MMeLdHyFIALioycq+LFcA71v0S2xpQUX2cw6pPbHQjaibcHYwLnmK/kMZaWuGfGfjBJZ3wRUq+dOaWsvrPJVvA==",
|
|
2774
2775
|
"dependencies": {
|
|
2775
|
-
"@octokit/openapi-types": "^
|
|
2776
|
+
"@octokit/openapi-types": "^17.2.0"
|
|
2776
2777
|
}
|
|
2777
2778
|
},
|
|
2778
2779
|
"node_modules/@octokit/endpoint": {
|
|
@@ -2807,11 +2808,12 @@
|
|
|
2807
2808
|
"integrity": "sha512-4EuKSk3N95UBWFau3Bz9b3pheQ8jQYbKmBL5+GSuY8YDPDwu03J4BjI+66yNi8aaX/3h1qDpb0mbBkLdr+cfGQ=="
|
|
2808
2809
|
},
|
|
2809
2810
|
"node_modules/@octokit/plugin-paginate-rest": {
|
|
2810
|
-
"version": "6.1.
|
|
2811
|
-
"resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-6.1.
|
|
2812
|
-
"integrity": "sha512-
|
|
2811
|
+
"version": "6.1.2",
|
|
2812
|
+
"resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-6.1.2.tgz",
|
|
2813
|
+
"integrity": "sha512-qhrmtQeHU/IivxucOV1bbI/xZyC/iOBhclokv7Sut5vnejAIAEXVcGQeRpQlU39E0WwK9lNvJHphHri/DB6lbQ==",
|
|
2813
2814
|
"dependencies": {
|
|
2814
|
-
"@octokit/
|
|
2815
|
+
"@octokit/tsconfig": "^1.0.2",
|
|
2816
|
+
"@octokit/types": "^9.2.3"
|
|
2815
2817
|
},
|
|
2816
2818
|
"engines": {
|
|
2817
2819
|
"node": ">= 14"
|
|
@@ -2826,11 +2828,11 @@
|
|
|
2826
2828
|
"integrity": "sha512-MazrFNx4plbLsGl+LFesMo96eIXkFgEtaKbnNpdh4aQ0VM10aoylFsTYP1AEjkeoRNZiiPe3T6Gl2Hr8dJWdlQ=="
|
|
2827
2829
|
},
|
|
2828
2830
|
"node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": {
|
|
2829
|
-
"version": "9.2.
|
|
2830
|
-
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.2.
|
|
2831
|
-
"integrity": "sha512-
|
|
2831
|
+
"version": "9.2.3",
|
|
2832
|
+
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.2.3.tgz",
|
|
2833
|
+
"integrity": "sha512-MMeLdHyFIALioycq+LFcA71v0S2xpQUX2cw6pPbHQjaibcHYwLnmK/kMZaWuGfGfjBJZ3wRUq+dOaWsvrPJVvA==",
|
|
2832
2834
|
"dependencies": {
|
|
2833
|
-
"@octokit/openapi-types": "^17.
|
|
2835
|
+
"@octokit/openapi-types": "^17.2.0"
|
|
2834
2836
|
}
|
|
2835
2837
|
},
|
|
2836
2838
|
"node_modules/@octokit/plugin-request-log": {
|
|
@@ -2842,11 +2844,11 @@
|
|
|
2842
2844
|
}
|
|
2843
2845
|
},
|
|
2844
2846
|
"node_modules/@octokit/plugin-rest-endpoint-methods": {
|
|
2845
|
-
"version": "7.1.
|
|
2846
|
-
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-7.1.
|
|
2847
|
-
"integrity": "sha512-
|
|
2847
|
+
"version": "7.1.2",
|
|
2848
|
+
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-7.1.2.tgz",
|
|
2849
|
+
"integrity": "sha512-R0oJ7j6f/AdqPLtB9qRXLO+wjI9pctUn8Ka8UGfGaFCcCv3Otx14CshQ89K4E88pmyYZS8p0rNTiprML/81jig==",
|
|
2848
2850
|
"dependencies": {
|
|
2849
|
-
"@octokit/types": "^9.2.
|
|
2851
|
+
"@octokit/types": "^9.2.3",
|
|
2850
2852
|
"deprecation": "^2.3.1"
|
|
2851
2853
|
},
|
|
2852
2854
|
"engines": {
|
|
@@ -2862,11 +2864,11 @@
|
|
|
2862
2864
|
"integrity": "sha512-MazrFNx4plbLsGl+LFesMo96eIXkFgEtaKbnNpdh4aQ0VM10aoylFsTYP1AEjkeoRNZiiPe3T6Gl2Hr8dJWdlQ=="
|
|
2863
2865
|
},
|
|
2864
2866
|
"node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": {
|
|
2865
|
-
"version": "9.2.
|
|
2866
|
-
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.2.
|
|
2867
|
-
"integrity": "sha512-
|
|
2867
|
+
"version": "9.2.3",
|
|
2868
|
+
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.2.3.tgz",
|
|
2869
|
+
"integrity": "sha512-MMeLdHyFIALioycq+LFcA71v0S2xpQUX2cw6pPbHQjaibcHYwLnmK/kMZaWuGfGfjBJZ3wRUq+dOaWsvrPJVvA==",
|
|
2868
2870
|
"dependencies": {
|
|
2869
|
-
"@octokit/openapi-types": "^17.
|
|
2871
|
+
"@octokit/openapi-types": "^17.2.0"
|
|
2870
2872
|
}
|
|
2871
2873
|
},
|
|
2872
2874
|
"node_modules/@octokit/request": {
|
|
@@ -2899,19 +2901,24 @@
|
|
|
2899
2901
|
}
|
|
2900
2902
|
},
|
|
2901
2903
|
"node_modules/@octokit/rest": {
|
|
2902
|
-
"version": "19.0.
|
|
2903
|
-
"resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.
|
|
2904
|
-
"integrity": "sha512
|
|
2904
|
+
"version": "19.0.11",
|
|
2905
|
+
"resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.11.tgz",
|
|
2906
|
+
"integrity": "sha512-m2a9VhaP5/tUw8FwfnW2ICXlXpLPIqxtg3XcAiGMLj/Xhw3RSBfZ8le/466ktO1Gcjr8oXudGnHhxV1TXJgFxw==",
|
|
2905
2907
|
"dependencies": {
|
|
2906
|
-
"@octokit/core": "^4.1
|
|
2907
|
-
"@octokit/plugin-paginate-rest": "^6.1.
|
|
2908
|
+
"@octokit/core": "^4.2.1",
|
|
2909
|
+
"@octokit/plugin-paginate-rest": "^6.1.2",
|
|
2908
2910
|
"@octokit/plugin-request-log": "^1.0.4",
|
|
2909
|
-
"@octokit/plugin-rest-endpoint-methods": "^7.1.
|
|
2911
|
+
"@octokit/plugin-rest-endpoint-methods": "^7.1.2"
|
|
2910
2912
|
},
|
|
2911
2913
|
"engines": {
|
|
2912
2914
|
"node": ">= 14"
|
|
2913
2915
|
}
|
|
2914
2916
|
},
|
|
2917
|
+
"node_modules/@octokit/tsconfig": {
|
|
2918
|
+
"version": "1.0.2",
|
|
2919
|
+
"resolved": "https://registry.npmjs.org/@octokit/tsconfig/-/tsconfig-1.0.2.tgz",
|
|
2920
|
+
"integrity": "sha512-I0vDR0rdtP8p2lGMzvsJzbhdOWy405HcGovrspJ8RRibHnyRgggUSNO5AIox5LmqiwmatHKYsvj6VGFHkqS7lA=="
|
|
2921
|
+
},
|
|
2915
2922
|
"node_modules/@octokit/types": {
|
|
2916
2923
|
"version": "7.5.1",
|
|
2917
2924
|
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.5.1.tgz",
|
|
@@ -5783,9 +5790,9 @@
|
|
|
5783
5790
|
}
|
|
5784
5791
|
},
|
|
5785
5792
|
"node_modules/detective-typescript/node_modules/@typescript-eslint/types": {
|
|
5786
|
-
"version": "5.59.
|
|
5787
|
-
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.
|
|
5788
|
-
"integrity": "sha512-
|
|
5793
|
+
"version": "5.59.7",
|
|
5794
|
+
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.7.tgz",
|
|
5795
|
+
"integrity": "sha512-UnVS2MRRg6p7xOSATscWkKjlf/NDKuqo5TdbWck6rIRZbmKpVNTLALzNvcjIfHBE7736kZOFc/4Z3VcZwuOM/A==",
|
|
5789
5796
|
"engines": {
|
|
5790
5797
|
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
|
5791
5798
|
},
|
|
@@ -5795,12 +5802,12 @@
|
|
|
5795
5802
|
}
|
|
5796
5803
|
},
|
|
5797
5804
|
"node_modules/detective-typescript/node_modules/@typescript-eslint/typescript-estree": {
|
|
5798
|
-
"version": "5.59.
|
|
5799
|
-
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.
|
|
5800
|
-
"integrity": "sha512-
|
|
5805
|
+
"version": "5.59.7",
|
|
5806
|
+
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.7.tgz",
|
|
5807
|
+
"integrity": "sha512-4A1NtZ1I3wMN2UGDkU9HMBL+TIQfbrh4uS0WDMMpf3xMRursDbqEf1ahh6vAAe3mObt8k3ZATnezwG4pdtWuUQ==",
|
|
5801
5808
|
"dependencies": {
|
|
5802
|
-
"@typescript-eslint/types": "5.59.
|
|
5803
|
-
"@typescript-eslint/visitor-keys": "5.59.
|
|
5809
|
+
"@typescript-eslint/types": "5.59.7",
|
|
5810
|
+
"@typescript-eslint/visitor-keys": "5.59.7",
|
|
5804
5811
|
"debug": "^4.3.4",
|
|
5805
5812
|
"globby": "^11.1.0",
|
|
5806
5813
|
"is-glob": "^4.0.3",
|
|
@@ -5821,11 +5828,11 @@
|
|
|
5821
5828
|
}
|
|
5822
5829
|
},
|
|
5823
5830
|
"node_modules/detective-typescript/node_modules/@typescript-eslint/visitor-keys": {
|
|
5824
|
-
"version": "5.59.
|
|
5825
|
-
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.
|
|
5826
|
-
"integrity": "sha512-
|
|
5831
|
+
"version": "5.59.7",
|
|
5832
|
+
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.7.tgz",
|
|
5833
|
+
"integrity": "sha512-tyN+X2jvMslUszIiYbF0ZleP+RqQsFVpGrKI6e0Eet1w8WmhsAtmzaqm8oM8WJQ1ysLwhnsK/4hYHJjOgJVfQQ==",
|
|
5827
5834
|
"dependencies": {
|
|
5828
|
-
"@typescript-eslint/types": "5.59.
|
|
5835
|
+
"@typescript-eslint/types": "5.59.7",
|
|
5829
5836
|
"eslint-visitor-keys": "^3.3.0"
|
|
5830
5837
|
},
|
|
5831
5838
|
"engines": {
|
|
@@ -13180,17 +13187,14 @@
|
|
|
13180
13187
|
}
|
|
13181
13188
|
},
|
|
13182
13189
|
"node_modules/type-fest": {
|
|
13183
|
-
"version": "3.
|
|
13184
|
-
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.
|
|
13185
|
-
"integrity": "sha512-
|
|
13190
|
+
"version": "3.11.0",
|
|
13191
|
+
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.11.0.tgz",
|
|
13192
|
+
"integrity": "sha512-JaPw5U9ixP0XcpUbQoVSbxSDcK/K4nww20C3kjm9yE6cDRRhptU28AH60VWf9ltXmCrIfIbtt9J+2OUk2Uqiaw==",
|
|
13186
13193
|
"engines": {
|
|
13187
13194
|
"node": ">=14.16"
|
|
13188
13195
|
},
|
|
13189
13196
|
"funding": {
|
|
13190
13197
|
"url": "https://github.com/sponsors/sindresorhus"
|
|
13191
|
-
},
|
|
13192
|
-
"peerDependencies": {
|
|
13193
|
-
"typescript": ">=4.7.0"
|
|
13194
13198
|
}
|
|
13195
13199
|
},
|
|
13196
13200
|
"node_modules/type-is": {
|
|
@@ -14020,9 +14024,9 @@
|
|
|
14020
14024
|
}
|
|
14021
14025
|
},
|
|
14022
14026
|
"@babel/parser": {
|
|
14023
|
-
"version": "7.21.
|
|
14024
|
-
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.
|
|
14025
|
-
"integrity": "sha512-
|
|
14027
|
+
"version": "7.21.9",
|
|
14028
|
+
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.9.tgz",
|
|
14029
|
+
"integrity": "sha512-q5PNg/Bi1OpGgx5jYlvWZwAorZepEudDMCLtj967aeS7WMont7dUZI46M2XwcIQqvUlMxWfdLFu4S/qSxeUu5g=="
|
|
14026
14030
|
},
|
|
14027
14031
|
"@babel/parser_latest": {
|
|
14028
14032
|
"version": "npm:@babel/parser@7.21.8",
|
|
@@ -14380,14 +14384,14 @@
|
|
|
14380
14384
|
"integrity": "sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw=="
|
|
14381
14385
|
},
|
|
14382
14386
|
"@netlify/build": {
|
|
14383
|
-
"version": "29.11.
|
|
14384
|
-
"resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.11.
|
|
14385
|
-
"integrity": "sha512-
|
|
14387
|
+
"version": "29.11.6",
|
|
14388
|
+
"resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.11.6.tgz",
|
|
14389
|
+
"integrity": "sha512-rzxHZlgg2Jp/RngWSsXF78c81tOmfx2cBLnDa92wTLuR5TQeUy9mrKjrw6WGzPy9ON0ZL7ZiD3l4+GLmh6hc+w==",
|
|
14386
14390
|
"requires": {
|
|
14387
14391
|
"@bugsnag/js": "^7.0.0",
|
|
14388
14392
|
"@netlify/cache-utils": "^5.1.5",
|
|
14389
14393
|
"@netlify/config": "^20.4.3",
|
|
14390
|
-
"@netlify/edge-bundler": "8.
|
|
14394
|
+
"@netlify/edge-bundler": "8.15.0",
|
|
14391
14395
|
"@netlify/framework-info": "^9.8.7",
|
|
14392
14396
|
"@netlify/functions-utils": "^5.2.8",
|
|
14393
14397
|
"@netlify/git-utils": "^5.1.1",
|
|
@@ -14719,9 +14723,9 @@
|
|
|
14719
14723
|
"integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA=="
|
|
14720
14724
|
},
|
|
14721
14725
|
"yaml": {
|
|
14722
|
-
"version": "2.
|
|
14723
|
-
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.
|
|
14724
|
-
"integrity": "sha512-
|
|
14726
|
+
"version": "2.3.0",
|
|
14727
|
+
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.0.tgz",
|
|
14728
|
+
"integrity": "sha512-8/1wgzdKc7bc9E6my5wZjmdavHLvO/QOmLG1FBugblEvY4IXrLjlViIOmL24HthU042lWTDRO90Fz1Yp66UnMw=="
|
|
14725
14729
|
}
|
|
14726
14730
|
}
|
|
14727
14731
|
},
|
|
@@ -14894,9 +14898,9 @@
|
|
|
14894
14898
|
}
|
|
14895
14899
|
},
|
|
14896
14900
|
"@netlify/edge-bundler": {
|
|
14897
|
-
"version": "8.
|
|
14898
|
-
"resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-8.
|
|
14899
|
-
"integrity": "sha512-
|
|
14901
|
+
"version": "8.15.0",
|
|
14902
|
+
"resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-8.15.0.tgz",
|
|
14903
|
+
"integrity": "sha512-5OKUEtVyzxV1pVYyyt64MqmILjICrUxPG7aVT1TDCqrGmPSECx7xSmguaQH8LVmxLykrgA+g1vLTDzmlySi3Eg==",
|
|
14900
14904
|
"requires": {
|
|
14901
14905
|
"@import-maps/resolve": "^1.0.1",
|
|
14902
14906
|
"ajv": "^8.11.2",
|
|
@@ -15570,9 +15574,9 @@
|
|
|
15570
15574
|
"integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA=="
|
|
15571
15575
|
},
|
|
15572
15576
|
"minimatch": {
|
|
15573
|
-
"version": "9.0.
|
|
15574
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.
|
|
15575
|
-
"integrity": "sha512-
|
|
15577
|
+
"version": "9.0.1",
|
|
15578
|
+
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.1.tgz",
|
|
15579
|
+
"integrity": "sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==",
|
|
15576
15580
|
"requires": {
|
|
15577
15581
|
"brace-expansion": "^2.0.1"
|
|
15578
15582
|
}
|
|
@@ -15637,30 +15641,30 @@
|
|
|
15637
15641
|
}
|
|
15638
15642
|
},
|
|
15639
15643
|
"@octokit/core": {
|
|
15640
|
-
"version": "4.1
|
|
15641
|
-
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.1.
|
|
15642
|
-
"integrity": "sha512-
|
|
15644
|
+
"version": "4.2.1",
|
|
15645
|
+
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.2.1.tgz",
|
|
15646
|
+
"integrity": "sha512-tEDxFx8E38zF3gT7sSMDrT1tGumDgsw5yPG6BBh/X+5ClIQfMH/Yqocxz1PnHx6CHyF6pxmovUTOfZAUvQ0Lvw==",
|
|
15643
15647
|
"requires": {
|
|
15644
15648
|
"@octokit/auth-token": "^3.0.0",
|
|
15645
15649
|
"@octokit/graphql": "^5.0.0",
|
|
15646
15650
|
"@octokit/request": "^6.0.0",
|
|
15647
15651
|
"@octokit/request-error": "^3.0.0",
|
|
15648
|
-
"@octokit/types": "^
|
|
15652
|
+
"@octokit/types": "^9.0.0",
|
|
15649
15653
|
"before-after-hook": "^2.2.0",
|
|
15650
15654
|
"universal-user-agent": "^6.0.0"
|
|
15651
15655
|
},
|
|
15652
15656
|
"dependencies": {
|
|
15653
15657
|
"@octokit/openapi-types": {
|
|
15654
|
-
"version": "
|
|
15655
|
-
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-
|
|
15656
|
-
"integrity": "sha512-
|
|
15658
|
+
"version": "17.2.0",
|
|
15659
|
+
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-17.2.0.tgz",
|
|
15660
|
+
"integrity": "sha512-MazrFNx4plbLsGl+LFesMo96eIXkFgEtaKbnNpdh4aQ0VM10aoylFsTYP1AEjkeoRNZiiPe3T6Gl2Hr8dJWdlQ=="
|
|
15657
15661
|
},
|
|
15658
15662
|
"@octokit/types": {
|
|
15659
|
-
"version": "
|
|
15660
|
-
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-
|
|
15661
|
-
"integrity": "sha512-
|
|
15663
|
+
"version": "9.2.3",
|
|
15664
|
+
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.2.3.tgz",
|
|
15665
|
+
"integrity": "sha512-MMeLdHyFIALioycq+LFcA71v0S2xpQUX2cw6pPbHQjaibcHYwLnmK/kMZaWuGfGfjBJZ3wRUq+dOaWsvrPJVvA==",
|
|
15662
15666
|
"requires": {
|
|
15663
|
-
"@octokit/openapi-types": "^
|
|
15667
|
+
"@octokit/openapi-types": "^17.2.0"
|
|
15664
15668
|
}
|
|
15665
15669
|
}
|
|
15666
15670
|
}
|
|
@@ -15691,11 +15695,12 @@
|
|
|
15691
15695
|
"integrity": "sha512-4EuKSk3N95UBWFau3Bz9b3pheQ8jQYbKmBL5+GSuY8YDPDwu03J4BjI+66yNi8aaX/3h1qDpb0mbBkLdr+cfGQ=="
|
|
15692
15696
|
},
|
|
15693
15697
|
"@octokit/plugin-paginate-rest": {
|
|
15694
|
-
"version": "6.1.
|
|
15695
|
-
"resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-6.1.
|
|
15696
|
-
"integrity": "sha512-
|
|
15698
|
+
"version": "6.1.2",
|
|
15699
|
+
"resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-6.1.2.tgz",
|
|
15700
|
+
"integrity": "sha512-qhrmtQeHU/IivxucOV1bbI/xZyC/iOBhclokv7Sut5vnejAIAEXVcGQeRpQlU39E0WwK9lNvJHphHri/DB6lbQ==",
|
|
15697
15701
|
"requires": {
|
|
15698
|
-
"@octokit/
|
|
15702
|
+
"@octokit/tsconfig": "^1.0.2",
|
|
15703
|
+
"@octokit/types": "^9.2.3"
|
|
15699
15704
|
},
|
|
15700
15705
|
"dependencies": {
|
|
15701
15706
|
"@octokit/openapi-types": {
|
|
@@ -15704,11 +15709,11 @@
|
|
|
15704
15709
|
"integrity": "sha512-MazrFNx4plbLsGl+LFesMo96eIXkFgEtaKbnNpdh4aQ0VM10aoylFsTYP1AEjkeoRNZiiPe3T6Gl2Hr8dJWdlQ=="
|
|
15705
15710
|
},
|
|
15706
15711
|
"@octokit/types": {
|
|
15707
|
-
"version": "9.2.
|
|
15708
|
-
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.2.
|
|
15709
|
-
"integrity": "sha512-
|
|
15712
|
+
"version": "9.2.3",
|
|
15713
|
+
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.2.3.tgz",
|
|
15714
|
+
"integrity": "sha512-MMeLdHyFIALioycq+LFcA71v0S2xpQUX2cw6pPbHQjaibcHYwLnmK/kMZaWuGfGfjBJZ3wRUq+dOaWsvrPJVvA==",
|
|
15710
15715
|
"requires": {
|
|
15711
|
-
"@octokit/openapi-types": "^17.
|
|
15716
|
+
"@octokit/openapi-types": "^17.2.0"
|
|
15712
15717
|
}
|
|
15713
15718
|
}
|
|
15714
15719
|
}
|
|
@@ -15720,11 +15725,11 @@
|
|
|
15720
15725
|
"requires": {}
|
|
15721
15726
|
},
|
|
15722
15727
|
"@octokit/plugin-rest-endpoint-methods": {
|
|
15723
|
-
"version": "7.1.
|
|
15724
|
-
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-7.1.
|
|
15725
|
-
"integrity": "sha512-
|
|
15728
|
+
"version": "7.1.2",
|
|
15729
|
+
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-7.1.2.tgz",
|
|
15730
|
+
"integrity": "sha512-R0oJ7j6f/AdqPLtB9qRXLO+wjI9pctUn8Ka8UGfGaFCcCv3Otx14CshQ89K4E88pmyYZS8p0rNTiprML/81jig==",
|
|
15726
15731
|
"requires": {
|
|
15727
|
-
"@octokit/types": "^9.2.
|
|
15732
|
+
"@octokit/types": "^9.2.3",
|
|
15728
15733
|
"deprecation": "^2.3.1"
|
|
15729
15734
|
},
|
|
15730
15735
|
"dependencies": {
|
|
@@ -15734,11 +15739,11 @@
|
|
|
15734
15739
|
"integrity": "sha512-MazrFNx4plbLsGl+LFesMo96eIXkFgEtaKbnNpdh4aQ0VM10aoylFsTYP1AEjkeoRNZiiPe3T6Gl2Hr8dJWdlQ=="
|
|
15735
15740
|
},
|
|
15736
15741
|
"@octokit/types": {
|
|
15737
|
-
"version": "9.2.
|
|
15738
|
-
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.2.
|
|
15739
|
-
"integrity": "sha512-
|
|
15742
|
+
"version": "9.2.3",
|
|
15743
|
+
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.2.3.tgz",
|
|
15744
|
+
"integrity": "sha512-MMeLdHyFIALioycq+LFcA71v0S2xpQUX2cw6pPbHQjaibcHYwLnmK/kMZaWuGfGfjBJZ3wRUq+dOaWsvrPJVvA==",
|
|
15740
15745
|
"requires": {
|
|
15741
|
-
"@octokit/openapi-types": "^17.
|
|
15746
|
+
"@octokit/openapi-types": "^17.2.0"
|
|
15742
15747
|
}
|
|
15743
15748
|
}
|
|
15744
15749
|
}
|
|
@@ -15767,16 +15772,21 @@
|
|
|
15767
15772
|
}
|
|
15768
15773
|
},
|
|
15769
15774
|
"@octokit/rest": {
|
|
15770
|
-
"version": "19.0.
|
|
15771
|
-
"resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.
|
|
15772
|
-
"integrity": "sha512
|
|
15775
|
+
"version": "19.0.11",
|
|
15776
|
+
"resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-19.0.11.tgz",
|
|
15777
|
+
"integrity": "sha512-m2a9VhaP5/tUw8FwfnW2ICXlXpLPIqxtg3XcAiGMLj/Xhw3RSBfZ8le/466ktO1Gcjr8oXudGnHhxV1TXJgFxw==",
|
|
15773
15778
|
"requires": {
|
|
15774
|
-
"@octokit/core": "^4.1
|
|
15775
|
-
"@octokit/plugin-paginate-rest": "^6.1.
|
|
15779
|
+
"@octokit/core": "^4.2.1",
|
|
15780
|
+
"@octokit/plugin-paginate-rest": "^6.1.2",
|
|
15776
15781
|
"@octokit/plugin-request-log": "^1.0.4",
|
|
15777
|
-
"@octokit/plugin-rest-endpoint-methods": "^7.1.
|
|
15782
|
+
"@octokit/plugin-rest-endpoint-methods": "^7.1.2"
|
|
15778
15783
|
}
|
|
15779
15784
|
},
|
|
15785
|
+
"@octokit/tsconfig": {
|
|
15786
|
+
"version": "1.0.2",
|
|
15787
|
+
"resolved": "https://registry.npmjs.org/@octokit/tsconfig/-/tsconfig-1.0.2.tgz",
|
|
15788
|
+
"integrity": "sha512-I0vDR0rdtP8p2lGMzvsJzbhdOWy405HcGovrspJ8RRibHnyRgggUSNO5AIox5LmqiwmatHKYsvj6VGFHkqS7lA=="
|
|
15789
|
+
},
|
|
15780
15790
|
"@octokit/types": {
|
|
15781
15791
|
"version": "7.5.1",
|
|
15782
15792
|
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.5.1.tgz",
|
|
@@ -17957,17 +17967,17 @@
|
|
|
17957
17967
|
},
|
|
17958
17968
|
"dependencies": {
|
|
17959
17969
|
"@typescript-eslint/types": {
|
|
17960
|
-
"version": "5.59.
|
|
17961
|
-
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.
|
|
17962
|
-
"integrity": "sha512-
|
|
17970
|
+
"version": "5.59.7",
|
|
17971
|
+
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.7.tgz",
|
|
17972
|
+
"integrity": "sha512-UnVS2MRRg6p7xOSATscWkKjlf/NDKuqo5TdbWck6rIRZbmKpVNTLALzNvcjIfHBE7736kZOFc/4Z3VcZwuOM/A=="
|
|
17963
17973
|
},
|
|
17964
17974
|
"@typescript-eslint/typescript-estree": {
|
|
17965
|
-
"version": "5.59.
|
|
17966
|
-
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.
|
|
17967
|
-
"integrity": "sha512-
|
|
17975
|
+
"version": "5.59.7",
|
|
17976
|
+
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.7.tgz",
|
|
17977
|
+
"integrity": "sha512-4A1NtZ1I3wMN2UGDkU9HMBL+TIQfbrh4uS0WDMMpf3xMRursDbqEf1ahh6vAAe3mObt8k3ZATnezwG4pdtWuUQ==",
|
|
17968
17978
|
"requires": {
|
|
17969
|
-
"@typescript-eslint/types": "5.59.
|
|
17970
|
-
"@typescript-eslint/visitor-keys": "5.59.
|
|
17979
|
+
"@typescript-eslint/types": "5.59.7",
|
|
17980
|
+
"@typescript-eslint/visitor-keys": "5.59.7",
|
|
17971
17981
|
"debug": "^4.3.4",
|
|
17972
17982
|
"globby": "^11.1.0",
|
|
17973
17983
|
"is-glob": "^4.0.3",
|
|
@@ -17976,11 +17986,11 @@
|
|
|
17976
17986
|
}
|
|
17977
17987
|
},
|
|
17978
17988
|
"@typescript-eslint/visitor-keys": {
|
|
17979
|
-
"version": "5.59.
|
|
17980
|
-
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.
|
|
17981
|
-
"integrity": "sha512-
|
|
17989
|
+
"version": "5.59.7",
|
|
17990
|
+
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.7.tgz",
|
|
17991
|
+
"integrity": "sha512-tyN+X2jvMslUszIiYbF0ZleP+RqQsFVpGrKI6e0Eet1w8WmhsAtmzaqm8oM8WJQ1ysLwhnsK/4hYHJjOgJVfQQ==",
|
|
17982
17992
|
"requires": {
|
|
17983
|
-
"@typescript-eslint/types": "5.59.
|
|
17993
|
+
"@typescript-eslint/types": "5.59.7",
|
|
17984
17994
|
"eslint-visitor-keys": "^3.3.0"
|
|
17985
17995
|
}
|
|
17986
17996
|
},
|
|
@@ -23340,10 +23350,9 @@
|
|
|
23340
23350
|
}
|
|
23341
23351
|
},
|
|
23342
23352
|
"type-fest": {
|
|
23343
|
-
"version": "3.
|
|
23344
|
-
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.
|
|
23345
|
-
"integrity": "sha512-
|
|
23346
|
-
"requires": {}
|
|
23353
|
+
"version": "3.11.0",
|
|
23354
|
+
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.11.0.tgz",
|
|
23355
|
+
"integrity": "sha512-JaPw5U9ixP0XcpUbQoVSbxSDcK/K4nww20C3kjm9yE6cDRRhptU28AH60VWf9ltXmCrIfIbtt9J+2OUk2Uqiaw=="
|
|
23347
23356
|
},
|
|
23348
23357
|
"type-is": {
|
|
23349
23358
|
"version": "1.6.18",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify-cli",
|
|
3
3
|
"description": "Netlify command line tool",
|
|
4
|
-
"version": "15.
|
|
4
|
+
"version": "15.2.0",
|
|
5
5
|
"author": "Netlify Inc.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@bugsnag/js": "7.20.2",
|
|
46
46
|
"@fastify/static": "6.10.1",
|
|
47
|
-
"@netlify/build": "29.11.
|
|
47
|
+
"@netlify/build": "29.11.6",
|
|
48
48
|
"@netlify/build-info": "7.0.2",
|
|
49
49
|
"@netlify/config": "20.4.3",
|
|
50
|
-
"@netlify/edge-bundler": "8.
|
|
50
|
+
"@netlify/edge-bundler": "8.15.0",
|
|
51
51
|
"@netlify/framework-info": "9.8.7",
|
|
52
52
|
"@netlify/local-functions-proxy": "1.1.1",
|
|
53
53
|
"@netlify/zip-it-and-ship-it": "9.6.0",
|
|
54
|
-
"@octokit/rest": "19.0.
|
|
54
|
+
"@octokit/rest": "19.0.11",
|
|
55
55
|
"@skn0tt/lambda-local": "2.0.3",
|
|
56
56
|
"ansi-escapes": "6.2.0",
|
|
57
57
|
"ansi-styles": "6.2.1",
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
warn,
|
|
25
25
|
} from '../utils/command-helpers.mjs'
|
|
26
26
|
import getGlobalConfig from '../utils/get-global-config.mjs'
|
|
27
|
+
import { getSiteByName } from '../utils/get-site.mjs'
|
|
27
28
|
import openBrowser from '../utils/open-browser.mjs'
|
|
28
29
|
import StateConfig from '../utils/state-config.mjs'
|
|
29
30
|
import { identify, track } from '../utils/telemetry/index.mjs'
|
|
@@ -440,11 +441,24 @@ export default class BaseCommand extends Command {
|
|
|
440
441
|
certificateFile: options.httpProxyCertificateFilename,
|
|
441
442
|
})
|
|
442
443
|
const apiOpts = { ...apiUrlOpts, agent }
|
|
444
|
+
const api = new NetlifyAPI(token || '', apiOpts)
|
|
445
|
+
|
|
446
|
+
// If a user passes a site name as an option instead of a site ID to options.site, the siteInfo object
|
|
447
|
+
// will only have the property siteInfo.id. Checking for one of the other properties ensures that we can do
|
|
448
|
+
// a re-call of the api.getSite() that is done in @netlify/config so we have the proper site object in all
|
|
449
|
+
// commands.
|
|
450
|
+
// options.site as a site name (and not just site id) was introduced for the deploy command, so users could
|
|
451
|
+
// deploy by name along with by id
|
|
452
|
+
let siteData = siteInfo
|
|
453
|
+
if (!siteData.url && options.site) {
|
|
454
|
+
siteData = await getSiteByName(api, options.site)
|
|
455
|
+
}
|
|
456
|
+
|
|
443
457
|
const globalConfig = await getGlobalConfig()
|
|
444
458
|
|
|
445
459
|
actionCommand.netlify = {
|
|
446
460
|
// api methods
|
|
447
|
-
api
|
|
461
|
+
api,
|
|
448
462
|
apiOpts,
|
|
449
463
|
repositoryRoot,
|
|
450
464
|
// current site context
|
|
@@ -458,8 +472,8 @@ export default class BaseCommand extends Command {
|
|
|
458
472
|
state.set('siteId', id)
|
|
459
473
|
},
|
|
460
474
|
},
|
|
461
|
-
// Site information retrieved using the API
|
|
462
|
-
siteInfo,
|
|
475
|
+
// Site information retrieved using the API (api.getSite())
|
|
476
|
+
siteInfo: siteData,
|
|
463
477
|
// Configuration from netlify.[toml/yml]
|
|
464
478
|
config: normalizedConfig,
|
|
465
479
|
// Used to avoid calling @netlify/config again
|
|
@@ -7,6 +7,7 @@ import { runCoreSteps } from '@netlify/build'
|
|
|
7
7
|
import { restoreConfig, updateConfig } from '@netlify/config'
|
|
8
8
|
import { Option } from 'commander'
|
|
9
9
|
import inquirer from 'inquirer'
|
|
10
|
+
import isEmpty from 'lodash/isEmpty.js'
|
|
10
11
|
import isObject from 'lodash/isObject.js'
|
|
11
12
|
import prettyjson from 'prettyjson'
|
|
12
13
|
|
|
@@ -488,7 +489,7 @@ const printResults = ({ deployToProduction, json, results, runBuildCommand }) =>
|
|
|
488
489
|
* @param {import('../base-command.mjs').default} command
|
|
489
490
|
*/
|
|
490
491
|
const deploy = async (options, command) => {
|
|
491
|
-
const { api, site } = command.netlify
|
|
492
|
+
const { api, site, siteInfo } = command.netlify
|
|
492
493
|
const alias = options.alias || options.branch
|
|
493
494
|
|
|
494
495
|
command.setAnalyticsPayload({ open: options.open, prod: options.prod, json: options.json, alias: Boolean(alias) })
|
|
@@ -503,35 +504,12 @@ const deploy = async (options, command) => {
|
|
|
503
504
|
|
|
504
505
|
await command.authenticate(options.auth)
|
|
505
506
|
|
|
506
|
-
let siteId =
|
|
507
|
+
let siteId = site.id || options.site
|
|
507
508
|
|
|
508
509
|
let siteData = {}
|
|
509
|
-
if (siteId) {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
api
|
|
513
|
-
.getSite({ siteId })
|
|
514
|
-
.then((data) => ({ siteFoundById: data }))
|
|
515
|
-
.catch((error_) => ({ siteError: error_ })),
|
|
516
|
-
api.listSites({ name: options.site, filter: 'all' }),
|
|
517
|
-
])
|
|
518
|
-
const siteFoundByName = sites.find((filteredSite) => filteredSite.name === options.site)
|
|
519
|
-
if (siteFoundById) {
|
|
520
|
-
siteData = siteFoundById
|
|
521
|
-
} else if (siteFoundByName) {
|
|
522
|
-
siteData = siteFoundByName
|
|
523
|
-
siteId = siteFoundByName.id
|
|
524
|
-
} else {
|
|
525
|
-
throw siteError
|
|
526
|
-
}
|
|
527
|
-
} catch (error_) {
|
|
528
|
-
// TODO specifically handle known cases (e.g. no account access)
|
|
529
|
-
if (error_.status === 404) {
|
|
530
|
-
error('Site not found')
|
|
531
|
-
} else {
|
|
532
|
-
error(error_.message)
|
|
533
|
-
}
|
|
534
|
-
}
|
|
510
|
+
if (siteId && !isEmpty(siteInfo)) {
|
|
511
|
+
siteData = siteInfo
|
|
512
|
+
siteId = siteData.id
|
|
535
513
|
} else {
|
|
536
514
|
log("This folder isn't linked to a site yet")
|
|
537
515
|
const NEW_SITE = '+ Create & configure a new site'
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
import AsciiTable from 'ascii-table'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { exit, log, logJson } from '../../utils/command-helpers.mjs'
|
|
5
5
|
import { getFunctions, getFunctionsDir } from '../../utils/functions/index.mjs'
|
|
6
|
+
import requiresSiteInfo from '../../utils/hooks/requires-site-info.mjs'
|
|
6
7
|
|
|
7
8
|
const normalizeFunction = function (deployedFunctions, { name, urlPath: url }) {
|
|
8
9
|
const isDeployed = deployedFunctions.some((deployedFunction) => deployedFunction.n === name)
|
|
@@ -15,31 +16,9 @@ const normalizeFunction = function (deployedFunctions, { name, urlPath: url }) {
|
|
|
15
16
|
* @param {import('../base-command.mjs').default} command
|
|
16
17
|
*/
|
|
17
18
|
const functionsList = async (options, command) => {
|
|
18
|
-
const {
|
|
19
|
+
const { config, siteInfo } = command.netlify
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
// copied from `netlify status`
|
|
22
|
-
const siteId = site.id
|
|
23
|
-
if (!siteId) {
|
|
24
|
-
warn('Did you run `netlify link` yet?')
|
|
25
|
-
error(`You don't appear to be in a folder that is linked to a site`)
|
|
26
|
-
}
|
|
27
|
-
let siteData
|
|
28
|
-
try {
|
|
29
|
-
siteData = await api.getSite({ siteId })
|
|
30
|
-
} catch (error_) {
|
|
31
|
-
// unauthorized
|
|
32
|
-
if (error_.status === 401) {
|
|
33
|
-
warn(`Log in with a different account or re-link to a site you have permission for`)
|
|
34
|
-
error(`Not authorized to view the currently linked site (${siteId})`)
|
|
35
|
-
}
|
|
36
|
-
// missing
|
|
37
|
-
if (error_.status === 404) {
|
|
38
|
-
error(`The site this folder is linked to can't be found`)
|
|
39
|
-
}
|
|
40
|
-
error(error_)
|
|
41
|
-
}
|
|
42
|
-
const deploy = siteData.published_deploy || {}
|
|
21
|
+
const deploy = siteInfo.published_deploy || {}
|
|
43
22
|
const deployedFunctions = deploy.available_functions || []
|
|
44
23
|
|
|
45
24
|
const functionsDir = getFunctionsDir({ options, config })
|
|
@@ -91,4 +70,5 @@ NOT the same as listing the functions that have been deployed. For that info you
|
|
|
91
70
|
)
|
|
92
71
|
.option('-f, --functions <dir>', 'Specify a functions directory to list')
|
|
93
72
|
.option('--json', 'Output function data as JSON')
|
|
73
|
+
.hook('preAction', requiresSiteInfo)
|
|
94
74
|
.action(functionsList)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
import { Option } from 'commander'
|
|
3
3
|
import inquirer from 'inquirer'
|
|
4
|
+
import isEmpty from 'lodash/isEmpty.js'
|
|
4
5
|
|
|
5
6
|
import { listSites } from '../../lib/api.mjs'
|
|
6
7
|
import { chalk, error, exit, log } from '../../utils/command-helpers.mjs'
|
|
@@ -250,28 +251,23 @@ export const link = async (options, command) => {
|
|
|
250
251
|
api,
|
|
251
252
|
repositoryRoot,
|
|
252
253
|
site: { id: siteId },
|
|
254
|
+
siteInfo,
|
|
253
255
|
state,
|
|
254
256
|
} = command.netlify
|
|
255
257
|
|
|
256
|
-
let siteData
|
|
257
|
-
try {
|
|
258
|
-
// @ts-ignore types from API are wrong they cannot recognize `getSite` of API
|
|
259
|
-
siteData = await api.getSite({ siteId })
|
|
260
|
-
} catch {
|
|
261
|
-
// silent api error
|
|
262
|
-
}
|
|
258
|
+
let siteData = siteInfo
|
|
263
259
|
|
|
264
260
|
// Add .netlify to .gitignore file
|
|
265
261
|
await ensureNetlifyIgnore(repositoryRoot)
|
|
266
262
|
|
|
267
263
|
// Site id is incorrect
|
|
268
|
-
if (siteId &&
|
|
264
|
+
if (siteId && isEmpty(siteData)) {
|
|
269
265
|
log(`"${siteId}" was not found in your Netlify account.`)
|
|
270
266
|
log(`Please double check your siteID and which account you are logged into via \`netlify status\`.`)
|
|
271
267
|
return exit()
|
|
272
268
|
}
|
|
273
269
|
|
|
274
|
-
if (
|
|
270
|
+
if (!isEmpty(siteInfo)) {
|
|
275
271
|
// If already linked to site. exit and prompt for unlink
|
|
276
272
|
log(`Site already linked to "${siteData.name}"`)
|
|
277
273
|
log(`Admin url: ${siteData.admin_url}`)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { exit, log } from '../../utils/command-helpers.mjs'
|
|
2
|
+
import requiresSiteInfo from '../../utils/hooks/requires-site-info.mjs'
|
|
2
3
|
import openBrowser from '../../utils/open-browser.mjs'
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -7,42 +8,14 @@ import openBrowser from '../../utils/open-browser.mjs'
|
|
|
7
8
|
* @param {import('../base-command.mjs').default} command
|
|
8
9
|
*/
|
|
9
10
|
export const openAdmin = async (options, command) => {
|
|
10
|
-
const {
|
|
11
|
+
const { siteInfo } = command.netlify
|
|
11
12
|
|
|
12
13
|
await command.authenticate()
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
log(`Opening "${siteInfo.name}" site admin UI:`)
|
|
16
|
+
log(`> ${siteInfo.admin_url}`)
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
warn(`No Site ID found in current directory.
|
|
18
|
-
Run \`netlify link\` to connect to this folder to a site`)
|
|
19
|
-
return false
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
let siteData
|
|
23
|
-
try {
|
|
24
|
-
siteData = await api.getSite({ siteId })
|
|
25
|
-
log(`Opening "${siteData.name}" site admin UI:`)
|
|
26
|
-
log(`> ${siteData.admin_url}`)
|
|
27
|
-
} catch (error_) {
|
|
28
|
-
// unauthorized
|
|
29
|
-
if (error_.status === 401) {
|
|
30
|
-
warn(`Log in with a different account or re-link to a site you have permission for`)
|
|
31
|
-
error(`Not authorized to view the currently linked site (${siteId})`)
|
|
32
|
-
}
|
|
33
|
-
// site not found
|
|
34
|
-
if (error_.status === 404) {
|
|
35
|
-
log()
|
|
36
|
-
log('Please double check this ID and verify you are logged in with the correct account')
|
|
37
|
-
log()
|
|
38
|
-
log('To fix this, run `netlify unlink` then `netlify link` to reconnect to the correct site ID')
|
|
39
|
-
log()
|
|
40
|
-
error(`Site "${siteId}" not found in account`)
|
|
41
|
-
}
|
|
42
|
-
error(error_)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
await openBrowser({ url: siteData.admin_url })
|
|
18
|
+
await openBrowser({ url: siteInfo.admin_url })
|
|
46
19
|
exit()
|
|
47
20
|
}
|
|
48
21
|
|
|
@@ -56,4 +29,5 @@ export const createOpenAdminCommand = (program) =>
|
|
|
56
29
|
.command('open:admin')
|
|
57
30
|
.description('Opens current site admin UI in Netlify')
|
|
58
31
|
.addExamples(['netlify open:admin'])
|
|
32
|
+
.hook('preAction', requiresSiteInfo)
|
|
59
33
|
.action(openAdmin)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { exit, log } from '../../utils/command-helpers.mjs'
|
|
2
|
+
import requiresSiteInfo from '../../utils/hooks/requires-site-info.mjs'
|
|
2
3
|
import openBrowser from '../../utils/open-browser.mjs'
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -7,33 +8,13 @@ import openBrowser from '../../utils/open-browser.mjs'
|
|
|
7
8
|
* @param {import('../base-command.mjs').default} command
|
|
8
9
|
*/
|
|
9
10
|
export const openSite = async (options, command) => {
|
|
10
|
-
const {
|
|
11
|
+
const { siteInfo } = command.netlify
|
|
11
12
|
|
|
12
13
|
await command.authenticate()
|
|
13
14
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
warn(`No Site ID found in current directory.
|
|
18
|
-
Run \`netlify link\` to connect to this folder to a site`)
|
|
19
|
-
return false
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
let siteData
|
|
23
|
-
let url
|
|
24
|
-
try {
|
|
25
|
-
siteData = await api.getSite({ siteId })
|
|
26
|
-
url = siteData.ssl_url || siteData.url
|
|
27
|
-
log(`Opening "${siteData.name}" site url:`)
|
|
28
|
-
log(`> ${url}`)
|
|
29
|
-
} catch (error_) {
|
|
30
|
-
// unauthorized
|
|
31
|
-
if (error_.status === 401) {
|
|
32
|
-
warn(`Log in with a different account or re-link to a site you have permission for`)
|
|
33
|
-
error(`Not authorized to view the currently linked site (${siteId})`)
|
|
34
|
-
}
|
|
35
|
-
error(error_)
|
|
36
|
-
}
|
|
15
|
+
const url = siteInfo.ssl_url || siteInfo.url
|
|
16
|
+
log(`Opening "${siteInfo.name}" site url:`)
|
|
17
|
+
log(`> ${url}`)
|
|
37
18
|
|
|
38
19
|
await openBrowser({ url })
|
|
39
20
|
exit()
|
|
@@ -49,4 +30,5 @@ export const createOpenSiteCommand = (program) =>
|
|
|
49
30
|
.command('open:site')
|
|
50
31
|
.description('Opens current site url in browser')
|
|
51
32
|
.addExamples(['netlify open:site'])
|
|
33
|
+
.hook('preAction', requiresSiteInfo)
|
|
52
34
|
.action(openSite)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
import prettyjson from 'prettyjson'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { log } from '../../utils/command-helpers.mjs'
|
|
5
|
+
import requiresSiteInfo from '../../utils/hooks/requires-site-info.mjs'
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* The status:hooks command
|
|
@@ -9,35 +10,13 @@ import { error, log, warn } from '../../utils/command-helpers.mjs'
|
|
|
9
10
|
* @param {import('../base-command.mjs').default} command
|
|
10
11
|
*/
|
|
11
12
|
const statusHooks = async (options, command) => {
|
|
12
|
-
const { api,
|
|
13
|
+
const { api, siteInfo } = command.netlify
|
|
13
14
|
|
|
14
15
|
await command.authenticate()
|
|
15
16
|
|
|
16
|
-
const
|
|
17
|
-
if (!siteId) {
|
|
18
|
-
warn('Did you run `netlify link` yet?')
|
|
19
|
-
error(`You don't appear to be in a folder that is linked to a site`)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
let siteData
|
|
23
|
-
try {
|
|
24
|
-
siteData = await api.getSite({ siteId })
|
|
25
|
-
} catch (error_) {
|
|
26
|
-
// unauthorized
|
|
27
|
-
if (error_.status === 401) {
|
|
28
|
-
warn(`Log in with a different account or re-link to a site you have permission for`)
|
|
29
|
-
error(`Not authorized to view the currently linked site (${siteId})`)
|
|
30
|
-
}
|
|
31
|
-
// missing
|
|
32
|
-
if (error_.status === 404) {
|
|
33
|
-
error(`The site this folder is linked to can't be found`)
|
|
34
|
-
}
|
|
35
|
-
error(error_)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const ntlHooks = await api.listHooksBySiteId({ siteId: siteData.id })
|
|
17
|
+
const ntlHooks = await api.listHooksBySiteId({ siteId: siteInfo.id })
|
|
39
18
|
const data = {
|
|
40
|
-
site:
|
|
19
|
+
site: siteInfo.name,
|
|
41
20
|
hooks: {},
|
|
42
21
|
}
|
|
43
22
|
ntlHooks.forEach((hook) => {
|
|
@@ -47,8 +26,8 @@ const statusHooks = async (options, command) => {
|
|
|
47
26
|
id: hook.id,
|
|
48
27
|
disabled: hook.disabled,
|
|
49
28
|
}
|
|
50
|
-
if (
|
|
51
|
-
data.hooks[hook.id].repo_url =
|
|
29
|
+
if (siteInfo.build_settings?.repo_url) {
|
|
30
|
+
data.hooks[hook.id].repo_url = siteInfo.build_settings.repo_url
|
|
52
31
|
}
|
|
53
32
|
})
|
|
54
33
|
log(`─────────────────┐
|
|
@@ -63,4 +42,8 @@ Site Hook Status │
|
|
|
63
42
|
* @returns
|
|
64
43
|
*/
|
|
65
44
|
export const createStatusHooksCommand = (program) =>
|
|
66
|
-
program
|
|
45
|
+
program
|
|
46
|
+
.command('status:hooks')
|
|
47
|
+
.description('Print hook information of the linked site')
|
|
48
|
+
.hook('preAction', requiresSiteInfo)
|
|
49
|
+
.action(statusHooks)
|
|
@@ -8,7 +8,7 @@ import { track } from '../../utils/telemetry/index.mjs'
|
|
|
8
8
|
* @param {import('../base-command.mjs').default} command
|
|
9
9
|
*/
|
|
10
10
|
const unlink = async (options, command) => {
|
|
11
|
-
const { site, state } = command.netlify
|
|
11
|
+
const { site, siteInfo, state } = command.netlify
|
|
12
12
|
const siteId = site.id
|
|
13
13
|
|
|
14
14
|
if (!siteId) {
|
|
@@ -16,13 +16,7 @@ const unlink = async (options, command) => {
|
|
|
16
16
|
return exit()
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
try {
|
|
21
|
-
// @ts-ignore types from API are wrong they cannot recognize `getSite` of API
|
|
22
|
-
siteData = await command.netlify.api.getSite({ siteId })
|
|
23
|
-
} catch {
|
|
24
|
-
// ignore errors if we can't get the site
|
|
25
|
-
}
|
|
19
|
+
const siteData = siteInfo
|
|
26
20
|
|
|
27
21
|
state.delete('siteId')
|
|
28
22
|
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"node_modules/node-fetch": {
|
|
16
|
-
"version": "2.6.
|
|
17
|
-
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.
|
|
18
|
-
"integrity": "sha512-
|
|
16
|
+
"version": "2.6.11",
|
|
17
|
+
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz",
|
|
18
|
+
"integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==",
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"whatwg-url": "^5.0.0"
|
|
21
21
|
},
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"node-fetch": {
|
|
56
|
-
"version": "2.6.
|
|
57
|
-
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.
|
|
58
|
-
"integrity": "sha512-
|
|
56
|
+
"version": "2.6.11",
|
|
57
|
+
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz",
|
|
58
|
+
"integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==",
|
|
59
59
|
"requires": {
|
|
60
60
|
"whatwg-url": "^5.0.0"
|
|
61
61
|
}
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
"uuid": "^9.0.0"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
|
-
"node": "^14.
|
|
16
|
+
"node": "^14.18.0 || >=16.0.0"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"node_modules/node-fetch": {
|
|
20
|
-
"version": "2.6.
|
|
21
|
-
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.
|
|
22
|
-
"integrity": "sha512-
|
|
20
|
+
"version": "2.6.11",
|
|
21
|
+
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz",
|
|
22
|
+
"integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"whatwg-url": "^5.0.0"
|
|
25
25
|
},
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"node-fetch": {
|
|
68
|
-
"version": "2.6.
|
|
69
|
-
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.
|
|
70
|
-
"integrity": "sha512-
|
|
68
|
+
"version": "2.6.11",
|
|
69
|
+
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz",
|
|
70
|
+
"integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==",
|
|
71
71
|
"requires": {
|
|
72
72
|
"whatwg-url": "^5.0.0"
|
|
73
73
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { error } from './command-helpers.mjs'
|
|
2
|
+
|
|
3
|
+
export const getSiteByName = async (api, siteName) => {
|
|
4
|
+
try {
|
|
5
|
+
const sites = await api.listSites({ name: siteName, filter: 'all' })
|
|
6
|
+
const siteFoundByName = sites.find((filteredSite) => filteredSite.name === siteName)
|
|
7
|
+
|
|
8
|
+
if (!siteFoundByName) {
|
|
9
|
+
throw Error
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return siteFoundByName
|
|
13
|
+
} catch {
|
|
14
|
+
error('Site not found. Please rerun "netlify link"')
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { error, warn } from '../command-helpers.mjs'
|
|
2
|
+
/**
|
|
3
|
+
* A preAction hook that errors out if siteInfo is an empty object
|
|
4
|
+
* @param {*} command
|
|
5
|
+
*/
|
|
6
|
+
const requiresSiteInfo = async (command) => {
|
|
7
|
+
const { api, site } = command.netlify
|
|
8
|
+
const siteId = site.id
|
|
9
|
+
if (!siteId) {
|
|
10
|
+
warn('Did you run `netlify link` yet?')
|
|
11
|
+
return error(`You don't appear to be in a folder that is linked to a site`)
|
|
12
|
+
}
|
|
13
|
+
try {
|
|
14
|
+
await api.getSite({ siteId })
|
|
15
|
+
} catch (error_) {
|
|
16
|
+
// unauthorized
|
|
17
|
+
if (error_.status === 401) {
|
|
18
|
+
warn(`Log in with a different account or re-link to a site you have permission for`)
|
|
19
|
+
return error(`Not authorized to view the currently linked site (${siteId})`)
|
|
20
|
+
}
|
|
21
|
+
// missing
|
|
22
|
+
if (error_.status === 404) {
|
|
23
|
+
return error(`The site this folder is linked to can't be found`)
|
|
24
|
+
}
|
|
25
|
+
return error(error_)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default requiresSiteInfo
|