netlify-cli 10.17.4 → 10.17.7
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 +99 -170
- package/package.json +6 -5
- package/src/commands/graph/graph-handler.js +4 -1
- package/src/commands/graph/graph-init.js +50 -38
- package/src/commands/sites/sites-create.js +14 -4
- package/src/functions-templates/javascript/scheduled-function/package.json +1 -1
- package/src/functions-templates/typescript/hello-world/package-lock.json +7 -7
- package/src/functions-templates/typescript/hello-world/package.json +1 -1
- package/src/functions-templates/typescript/scheduled-function/package.json +1 -1
- package/src/lib/one-graph/cli-client.js +13 -29
- package/src/lib/one-graph/cli-netlify-graph.js +12 -6
- package/src/utils/proxy.js +3 -4
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify-cli",
|
|
3
|
-
"version": "10.17.
|
|
3
|
+
"version": "10.17.7",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "netlify-cli",
|
|
9
|
-
"version": "10.17.
|
|
9
|
+
"version": "10.17.7",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@netlify/build": "^27.11.
|
|
13
|
+
"@netlify/build": "^27.11.5",
|
|
14
14
|
"@netlify/config": "^18.1.4",
|
|
15
15
|
"@netlify/edge-bundler": "^1.12.1",
|
|
16
16
|
"@netlify/framework-info": "^9.2.0",
|
|
17
17
|
"@netlify/local-functions-proxy": "^1.1.1",
|
|
18
18
|
"@netlify/plugins-list": "^6.39.0",
|
|
19
|
-
"@netlify/zip-it-and-ship-it": "^5.13.
|
|
19
|
+
"@netlify/zip-it-and-ship-it": "^5.13.5",
|
|
20
20
|
"@octokit/rest": "^18.0.0",
|
|
21
21
|
"@sindresorhus/slugify": "^1.1.0",
|
|
22
22
|
"ansi-escapes": "^5.0.0",
|
|
@@ -79,9 +79,9 @@
|
|
|
79
79
|
"memoize-one": "^6.0.0",
|
|
80
80
|
"minimist": "^1.2.5",
|
|
81
81
|
"multiparty": "^4.2.1",
|
|
82
|
-
"netlify": "^12.0.
|
|
82
|
+
"netlify": "^12.0.1",
|
|
83
83
|
"netlify-headers-parser": "^6.0.2",
|
|
84
|
-
"netlify-onegraph-internal": "0.8.
|
|
84
|
+
"netlify-onegraph-internal": "0.8.7",
|
|
85
85
|
"netlify-redirect-parser": "^13.0.5",
|
|
86
86
|
"netlify-redirector": "^0.2.1",
|
|
87
87
|
"node-fetch": "^2.6.0",
|
|
@@ -1189,19 +1189,19 @@
|
|
|
1189
1189
|
"integrity": "sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw=="
|
|
1190
1190
|
},
|
|
1191
1191
|
"node_modules/@netlify/build": {
|
|
1192
|
-
"version": "27.11.
|
|
1193
|
-
"resolved": "https://registry.npmjs.org/@netlify/build/-/build-27.11.
|
|
1194
|
-
"integrity": "sha512-
|
|
1192
|
+
"version": "27.11.5",
|
|
1193
|
+
"resolved": "https://registry.npmjs.org/@netlify/build/-/build-27.11.5.tgz",
|
|
1194
|
+
"integrity": "sha512-d/EqdcVZzi/EA0rJ21xKvHqugDx2gl3h1mpzk/HQpAmvGtgv+Tkj9W4oVYKyd8L2Pyx/oiFBNyhfNXdCEk3wbA==",
|
|
1195
1195
|
"dependencies": {
|
|
1196
1196
|
"@bugsnag/js": "^7.0.0",
|
|
1197
1197
|
"@netlify/cache-utils": "^4.0.0",
|
|
1198
1198
|
"@netlify/config": "^18.1.4",
|
|
1199
1199
|
"@netlify/edge-bundler": "^1.12.1",
|
|
1200
|
-
"@netlify/functions-utils": "^4.2.
|
|
1200
|
+
"@netlify/functions-utils": "^4.2.4",
|
|
1201
1201
|
"@netlify/git-utils": "^4.0.0",
|
|
1202
1202
|
"@netlify/plugins-list": "^6.36.0",
|
|
1203
1203
|
"@netlify/run-utils": "^4.0.0",
|
|
1204
|
-
"@netlify/zip-it-and-ship-it": "5.13.
|
|
1204
|
+
"@netlify/zip-it-and-ship-it": "^5.13.5",
|
|
1205
1205
|
"@sindresorhus/slugify": "^2.0.0",
|
|
1206
1206
|
"@types/node": "^16.0.0",
|
|
1207
1207
|
"ajv": "^8.11.0",
|
|
@@ -3242,11 +3242,11 @@
|
|
|
3242
3242
|
}
|
|
3243
3243
|
},
|
|
3244
3244
|
"node_modules/@netlify/functions-utils": {
|
|
3245
|
-
"version": "4.2.
|
|
3246
|
-
"resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-4.2.
|
|
3247
|
-
"integrity": "sha512
|
|
3245
|
+
"version": "4.2.4",
|
|
3246
|
+
"resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-4.2.4.tgz",
|
|
3247
|
+
"integrity": "sha512-+Uw9qO6lIshJrcieriAluGhjFM8JsyNFe5TGxkTssfUeel/+RIrIG5RMslrBoEk8HUKL+4HQDbZRoI6DtWlwsw==",
|
|
3248
3248
|
"dependencies": {
|
|
3249
|
-
"@netlify/zip-it-and-ship-it": "5.13.
|
|
3249
|
+
"@netlify/zip-it-and-ship-it": "^5.13.5",
|
|
3250
3250
|
"cpy": "^8.1.0",
|
|
3251
3251
|
"path-exists": "^5.0.0"
|
|
3252
3252
|
},
|
|
@@ -3587,9 +3587,9 @@
|
|
|
3587
3587
|
}
|
|
3588
3588
|
},
|
|
3589
3589
|
"node_modules/@netlify/open-api": {
|
|
3590
|
-
"version": "2.
|
|
3591
|
-
"resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.
|
|
3592
|
-
"integrity": "sha512-
|
|
3590
|
+
"version": "2.12.0",
|
|
3591
|
+
"resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.12.0.tgz",
|
|
3592
|
+
"integrity": "sha512-1n9VvO/9qM7cRB5f7NgSNqeUrovM7j9WVAY7ZQ4LtQuXSquFmO9Fku7WrV3zAUC6v2Y62fxGyJ0fRllYz5uXLw=="
|
|
3593
3593
|
},
|
|
3594
3594
|
"node_modules/@netlify/plugins-list": {
|
|
3595
3595
|
"version": "6.39.0",
|
|
@@ -3702,9 +3702,9 @@
|
|
|
3702
3702
|
}
|
|
3703
3703
|
},
|
|
3704
3704
|
"node_modules/@netlify/zip-it-and-ship-it": {
|
|
3705
|
-
"version": "5.13.
|
|
3706
|
-
"resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-5.13.
|
|
3707
|
-
"integrity": "sha512-
|
|
3705
|
+
"version": "5.13.5",
|
|
3706
|
+
"resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-5.13.5.tgz",
|
|
3707
|
+
"integrity": "sha512-oVXGtGwUQqEDBRApwKgqfauuzD+FhyxKGcwERF2fZLOiH24NoBcskaNDW6TCJmBj3hKiVCgmp69hapvjMVibFQ==",
|
|
3708
3708
|
"dependencies": {
|
|
3709
3709
|
"@babel/parser": "7.16.8",
|
|
3710
3710
|
"@netlify/binary-info": "^1.0.0",
|
|
@@ -3756,66 +3756,6 @@
|
|
|
3756
3756
|
"node": ">=6.0.0"
|
|
3757
3757
|
}
|
|
3758
3758
|
},
|
|
3759
|
-
"node_modules/@netlify/zip-it-and-ship-it/node_modules/@vercel/nft": {
|
|
3760
|
-
"version": "0.21.0",
|
|
3761
|
-
"resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.21.0.tgz",
|
|
3762
|
-
"integrity": "sha512-hFCAETfI5cG8l5iAiLhMC2bReC5K7SIybzrxGorv+eGspIbIFsVw7Vg85GovXm/LxA08pIDrAlrhR6GN36XB/Q==",
|
|
3763
|
-
"dependencies": {
|
|
3764
|
-
"@mapbox/node-pre-gyp": "^1.0.5",
|
|
3765
|
-
"acorn": "^8.6.0",
|
|
3766
|
-
"async-sema": "^3.1.1",
|
|
3767
|
-
"bindings": "^1.4.0",
|
|
3768
|
-
"estree-walker": "2.0.2",
|
|
3769
|
-
"glob": "^7.1.3",
|
|
3770
|
-
"graceful-fs": "^4.2.9",
|
|
3771
|
-
"micromatch": "^4.0.2",
|
|
3772
|
-
"node-gyp-build": "^4.2.2",
|
|
3773
|
-
"resolve-from": "^5.0.0",
|
|
3774
|
-
"rollup-pluginutils": "^2.8.2"
|
|
3775
|
-
},
|
|
3776
|
-
"bin": {
|
|
3777
|
-
"nft": "out/cli.js"
|
|
3778
|
-
}
|
|
3779
|
-
},
|
|
3780
|
-
"node_modules/@netlify/zip-it-and-ship-it/node_modules/@vercel/nft/node_modules/brace-expansion": {
|
|
3781
|
-
"version": "1.1.11",
|
|
3782
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
|
3783
|
-
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
|
3784
|
-
"dependencies": {
|
|
3785
|
-
"balanced-match": "^1.0.0",
|
|
3786
|
-
"concat-map": "0.0.1"
|
|
3787
|
-
}
|
|
3788
|
-
},
|
|
3789
|
-
"node_modules/@netlify/zip-it-and-ship-it/node_modules/@vercel/nft/node_modules/glob": {
|
|
3790
|
-
"version": "7.2.3",
|
|
3791
|
-
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
|
3792
|
-
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
|
|
3793
|
-
"dependencies": {
|
|
3794
|
-
"fs.realpath": "^1.0.0",
|
|
3795
|
-
"inflight": "^1.0.4",
|
|
3796
|
-
"inherits": "2",
|
|
3797
|
-
"minimatch": "^3.1.1",
|
|
3798
|
-
"once": "^1.3.0",
|
|
3799
|
-
"path-is-absolute": "^1.0.0"
|
|
3800
|
-
},
|
|
3801
|
-
"engines": {
|
|
3802
|
-
"node": "*"
|
|
3803
|
-
},
|
|
3804
|
-
"funding": {
|
|
3805
|
-
"url": "https://github.com/sponsors/isaacs"
|
|
3806
|
-
}
|
|
3807
|
-
},
|
|
3808
|
-
"node_modules/@netlify/zip-it-and-ship-it/node_modules/@vercel/nft/node_modules/minimatch": {
|
|
3809
|
-
"version": "3.1.2",
|
|
3810
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
|
3811
|
-
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
|
3812
|
-
"dependencies": {
|
|
3813
|
-
"brace-expansion": "^1.1.7"
|
|
3814
|
-
},
|
|
3815
|
-
"engines": {
|
|
3816
|
-
"node": "*"
|
|
3817
|
-
}
|
|
3818
|
-
},
|
|
3819
3759
|
"node_modules/@netlify/zip-it-and-ship-it/node_modules/brace-expansion": {
|
|
3820
3760
|
"version": "2.0.1",
|
|
3821
3761
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
|
@@ -3824,11 +3764,6 @@
|
|
|
3824
3764
|
"balanced-match": "^1.0.0"
|
|
3825
3765
|
}
|
|
3826
3766
|
},
|
|
3827
|
-
"node_modules/@netlify/zip-it-and-ship-it/node_modules/es-module-lexer": {
|
|
3828
|
-
"version": "1.0.2",
|
|
3829
|
-
"resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.0.2.tgz",
|
|
3830
|
-
"integrity": "sha512-W6d+UibP+MDkF0+uUqj2sZTiyqA6v9f7/hDPqrxNYntp+NFMilA9Zr+qF9IZ7F4lcHQqw0toMlwxJxY2qm30uQ=="
|
|
3831
|
-
},
|
|
3832
3767
|
"node_modules/@netlify/zip-it-and-ship-it/node_modules/glob": {
|
|
3833
3768
|
"version": "8.0.3",
|
|
3834
3769
|
"resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz",
|
|
@@ -4642,6 +4577,27 @@
|
|
|
4642
4577
|
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
|
4643
4578
|
}
|
|
4644
4579
|
},
|
|
4580
|
+
"node_modules/@vercel/nft": {
|
|
4581
|
+
"version": "0.21.0",
|
|
4582
|
+
"resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.21.0.tgz",
|
|
4583
|
+
"integrity": "sha512-hFCAETfI5cG8l5iAiLhMC2bReC5K7SIybzrxGorv+eGspIbIFsVw7Vg85GovXm/LxA08pIDrAlrhR6GN36XB/Q==",
|
|
4584
|
+
"dependencies": {
|
|
4585
|
+
"@mapbox/node-pre-gyp": "^1.0.5",
|
|
4586
|
+
"acorn": "^8.6.0",
|
|
4587
|
+
"async-sema": "^3.1.1",
|
|
4588
|
+
"bindings": "^1.4.0",
|
|
4589
|
+
"estree-walker": "2.0.2",
|
|
4590
|
+
"glob": "^7.1.3",
|
|
4591
|
+
"graceful-fs": "^4.2.9",
|
|
4592
|
+
"micromatch": "^4.0.2",
|
|
4593
|
+
"node-gyp-build": "^4.2.2",
|
|
4594
|
+
"resolve-from": "^5.0.0",
|
|
4595
|
+
"rollup-pluginutils": "^2.8.2"
|
|
4596
|
+
},
|
|
4597
|
+
"bin": {
|
|
4598
|
+
"nft": "out/cli.js"
|
|
4599
|
+
}
|
|
4600
|
+
},
|
|
4645
4601
|
"node_modules/@verdaccio/commons-api": {
|
|
4646
4602
|
"version": "10.2.0",
|
|
4647
4603
|
"resolved": "https://registry.npmjs.org/@verdaccio/commons-api/-/commons-api-10.2.0.tgz",
|
|
@@ -9591,6 +9547,11 @@
|
|
|
9591
9547
|
"url": "https://github.com/sponsors/ljharb"
|
|
9592
9548
|
}
|
|
9593
9549
|
},
|
|
9550
|
+
"node_modules/es-module-lexer": {
|
|
9551
|
+
"version": "1.0.3",
|
|
9552
|
+
"resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.0.3.tgz",
|
|
9553
|
+
"integrity": "sha512-iC67eXHToclrlVhQfpRawDiF8D8sQxNxmbqw5oebegOaJkyx/w9C/k57/5e6yJR2zIByRt9OXdqX50DV2t6ZKw=="
|
|
9554
|
+
},
|
|
9594
9555
|
"node_modules/es-to-primitive": {
|
|
9595
9556
|
"version": "1.2.1",
|
|
9596
9557
|
"resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz",
|
|
@@ -15923,11 +15884,11 @@
|
|
|
15923
15884
|
"integrity": "sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug=="
|
|
15924
15885
|
},
|
|
15925
15886
|
"node_modules/netlify": {
|
|
15926
|
-
"version": "12.0.
|
|
15927
|
-
"resolved": "https://registry.npmjs.org/netlify/-/netlify-12.0.
|
|
15928
|
-
"integrity": "sha512-
|
|
15887
|
+
"version": "12.0.1",
|
|
15888
|
+
"resolved": "https://registry.npmjs.org/netlify/-/netlify-12.0.1.tgz",
|
|
15889
|
+
"integrity": "sha512-nv16ofE2zHBbB8jQia8+opfdLmVYGrOaorhpInVz5Mkx3kVgJd7Q9c3+dVmSl4VA/4MHX6e4N7X4cH+9sj8Zhw==",
|
|
15929
15890
|
"dependencies": {
|
|
15930
|
-
"@netlify/open-api": "^2.
|
|
15891
|
+
"@netlify/open-api": "^2.12.0",
|
|
15931
15892
|
"lodash.camelcase": "^4.3.0",
|
|
15932
15893
|
"micro-api-client": "^3.3.0",
|
|
15933
15894
|
"node-fetch": "^3.0.0",
|
|
@@ -15996,9 +15957,9 @@
|
|
|
15996
15957
|
}
|
|
15997
15958
|
},
|
|
15998
15959
|
"node_modules/netlify-onegraph-internal": {
|
|
15999
|
-
"version": "0.8.
|
|
16000
|
-
"resolved": "https://registry.npmjs.org/netlify-onegraph-internal/-/netlify-onegraph-internal-0.8.
|
|
16001
|
-
"integrity": "sha512-
|
|
15960
|
+
"version": "0.8.7",
|
|
15961
|
+
"resolved": "https://registry.npmjs.org/netlify-onegraph-internal/-/netlify-onegraph-internal-0.8.7.tgz",
|
|
15962
|
+
"integrity": "sha512-FDHQes/GP7UjlzAwJ+qwKfhESBo9NQDN9Ed6U+9a5CW5o2j8Lr23P9Ac1MKp7jDP5h0uAq73r9P86J9Kl1yzLQ==",
|
|
16002
15963
|
"dependencies": {
|
|
16003
15964
|
"graphql": "16.5.0",
|
|
16004
15965
|
"node-fetch": "^2.6.0",
|
|
@@ -23384,19 +23345,19 @@
|
|
|
23384
23345
|
"integrity": "sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw=="
|
|
23385
23346
|
},
|
|
23386
23347
|
"@netlify/build": {
|
|
23387
|
-
"version": "27.11.
|
|
23388
|
-
"resolved": "https://registry.npmjs.org/@netlify/build/-/build-27.11.
|
|
23389
|
-
"integrity": "sha512-
|
|
23348
|
+
"version": "27.11.5",
|
|
23349
|
+
"resolved": "https://registry.npmjs.org/@netlify/build/-/build-27.11.5.tgz",
|
|
23350
|
+
"integrity": "sha512-d/EqdcVZzi/EA0rJ21xKvHqugDx2gl3h1mpzk/HQpAmvGtgv+Tkj9W4oVYKyd8L2Pyx/oiFBNyhfNXdCEk3wbA==",
|
|
23390
23351
|
"requires": {
|
|
23391
23352
|
"@bugsnag/js": "^7.0.0",
|
|
23392
23353
|
"@netlify/cache-utils": "^4.0.0",
|
|
23393
23354
|
"@netlify/config": "^18.1.4",
|
|
23394
23355
|
"@netlify/edge-bundler": "^1.12.1",
|
|
23395
|
-
"@netlify/functions-utils": "^4.2.
|
|
23356
|
+
"@netlify/functions-utils": "^4.2.4",
|
|
23396
23357
|
"@netlify/git-utils": "^4.0.0",
|
|
23397
23358
|
"@netlify/plugins-list": "^6.36.0",
|
|
23398
23359
|
"@netlify/run-utils": "^4.0.0",
|
|
23399
|
-
"@netlify/zip-it-and-ship-it": "5.13.
|
|
23360
|
+
"@netlify/zip-it-and-ship-it": "^5.13.5",
|
|
23400
23361
|
"@sindresorhus/slugify": "^2.0.0",
|
|
23401
23362
|
"@types/node": "^16.0.0",
|
|
23402
23363
|
"ajv": "^8.11.0",
|
|
@@ -24586,11 +24547,11 @@
|
|
|
24586
24547
|
}
|
|
24587
24548
|
},
|
|
24588
24549
|
"@netlify/functions-utils": {
|
|
24589
|
-
"version": "4.2.
|
|
24590
|
-
"resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-4.2.
|
|
24591
|
-
"integrity": "sha512
|
|
24550
|
+
"version": "4.2.4",
|
|
24551
|
+
"resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-4.2.4.tgz",
|
|
24552
|
+
"integrity": "sha512-+Uw9qO6lIshJrcieriAluGhjFM8JsyNFe5TGxkTssfUeel/+RIrIG5RMslrBoEk8HUKL+4HQDbZRoI6DtWlwsw==",
|
|
24592
24553
|
"requires": {
|
|
24593
|
-
"@netlify/zip-it-and-ship-it": "5.13.
|
|
24554
|
+
"@netlify/zip-it-and-ship-it": "^5.13.5",
|
|
24594
24555
|
"cpy": "^8.1.0",
|
|
24595
24556
|
"path-exists": "^5.0.0"
|
|
24596
24557
|
},
|
|
@@ -24770,9 +24731,9 @@
|
|
|
24770
24731
|
"optional": true
|
|
24771
24732
|
},
|
|
24772
24733
|
"@netlify/open-api": {
|
|
24773
|
-
"version": "2.
|
|
24774
|
-
"resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.
|
|
24775
|
-
"integrity": "sha512-
|
|
24734
|
+
"version": "2.12.0",
|
|
24735
|
+
"resolved": "https://registry.npmjs.org/@netlify/open-api/-/open-api-2.12.0.tgz",
|
|
24736
|
+
"integrity": "sha512-1n9VvO/9qM7cRB5f7NgSNqeUrovM7j9WVAY7ZQ4LtQuXSquFmO9Fku7WrV3zAUC6v2Y62fxGyJ0fRllYz5uXLw=="
|
|
24776
24737
|
},
|
|
24777
24738
|
"@netlify/plugins-list": {
|
|
24778
24739
|
"version": "6.39.0",
|
|
@@ -24842,9 +24803,9 @@
|
|
|
24842
24803
|
}
|
|
24843
24804
|
},
|
|
24844
24805
|
"@netlify/zip-it-and-ship-it": {
|
|
24845
|
-
"version": "5.13.
|
|
24846
|
-
"resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-5.13.
|
|
24847
|
-
"integrity": "sha512-
|
|
24806
|
+
"version": "5.13.5",
|
|
24807
|
+
"resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-5.13.5.tgz",
|
|
24808
|
+
"integrity": "sha512-oVXGtGwUQqEDBRApwKgqfauuzD+FhyxKGcwERF2fZLOiH24NoBcskaNDW6TCJmBj3hKiVCgmp69hapvjMVibFQ==",
|
|
24848
24809
|
"requires": {
|
|
24849
24810
|
"@babel/parser": "7.16.8",
|
|
24850
24811
|
"@netlify/binary-info": "^1.0.0",
|
|
@@ -24884,56 +24845,6 @@
|
|
|
24884
24845
|
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.8.tgz",
|
|
24885
24846
|
"integrity": "sha512-i7jDUfrVBWc+7OKcBzEe5n7fbv3i2fWtxKzzCvOjnzSxMfWMigAhtfJ7qzZNGFNMsCCd67+uz553dYKWXPvCKw=="
|
|
24886
24847
|
},
|
|
24887
|
-
"@vercel/nft": {
|
|
24888
|
-
"version": "0.21.0",
|
|
24889
|
-
"resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.21.0.tgz",
|
|
24890
|
-
"integrity": "sha512-hFCAETfI5cG8l5iAiLhMC2bReC5K7SIybzrxGorv+eGspIbIFsVw7Vg85GovXm/LxA08pIDrAlrhR6GN36XB/Q==",
|
|
24891
|
-
"requires": {
|
|
24892
|
-
"@mapbox/node-pre-gyp": "^1.0.5",
|
|
24893
|
-
"acorn": "^8.6.0",
|
|
24894
|
-
"async-sema": "^3.1.1",
|
|
24895
|
-
"bindings": "^1.4.0",
|
|
24896
|
-
"estree-walker": "2.0.2",
|
|
24897
|
-
"glob": "^7.1.3",
|
|
24898
|
-
"graceful-fs": "^4.2.9",
|
|
24899
|
-
"micromatch": "^4.0.2",
|
|
24900
|
-
"node-gyp-build": "^4.2.2",
|
|
24901
|
-
"resolve-from": "^5.0.0",
|
|
24902
|
-
"rollup-pluginutils": "^2.8.2"
|
|
24903
|
-
},
|
|
24904
|
-
"dependencies": {
|
|
24905
|
-
"brace-expansion": {
|
|
24906
|
-
"version": "1.1.11",
|
|
24907
|
-
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
|
24908
|
-
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
|
24909
|
-
"requires": {
|
|
24910
|
-
"balanced-match": "^1.0.0",
|
|
24911
|
-
"concat-map": "0.0.1"
|
|
24912
|
-
}
|
|
24913
|
-
},
|
|
24914
|
-
"glob": {
|
|
24915
|
-
"version": "7.2.3",
|
|
24916
|
-
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
|
24917
|
-
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
|
|
24918
|
-
"requires": {
|
|
24919
|
-
"fs.realpath": "^1.0.0",
|
|
24920
|
-
"inflight": "^1.0.4",
|
|
24921
|
-
"inherits": "2",
|
|
24922
|
-
"minimatch": "^3.1.1",
|
|
24923
|
-
"once": "^1.3.0",
|
|
24924
|
-
"path-is-absolute": "^1.0.0"
|
|
24925
|
-
}
|
|
24926
|
-
},
|
|
24927
|
-
"minimatch": {
|
|
24928
|
-
"version": "3.1.2",
|
|
24929
|
-
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
|
24930
|
-
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
|
24931
|
-
"requires": {
|
|
24932
|
-
"brace-expansion": "^1.1.7"
|
|
24933
|
-
}
|
|
24934
|
-
}
|
|
24935
|
-
}
|
|
24936
|
-
},
|
|
24937
24848
|
"brace-expansion": {
|
|
24938
24849
|
"version": "2.0.1",
|
|
24939
24850
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
|
@@ -24942,11 +24853,6 @@
|
|
|
24942
24853
|
"balanced-match": "^1.0.0"
|
|
24943
24854
|
}
|
|
24944
24855
|
},
|
|
24945
|
-
"es-module-lexer": {
|
|
24946
|
-
"version": "1.0.2",
|
|
24947
|
-
"resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.0.2.tgz",
|
|
24948
|
-
"integrity": "sha512-W6d+UibP+MDkF0+uUqj2sZTiyqA6v9f7/hDPqrxNYntp+NFMilA9Zr+qF9IZ7F4lcHQqw0toMlwxJxY2qm30uQ=="
|
|
24949
|
-
},
|
|
24950
24856
|
"glob": {
|
|
24951
24857
|
"version": "8.0.3",
|
|
24952
24858
|
"resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz",
|
|
@@ -25605,6 +25511,24 @@
|
|
|
25605
25511
|
}
|
|
25606
25512
|
}
|
|
25607
25513
|
},
|
|
25514
|
+
"@vercel/nft": {
|
|
25515
|
+
"version": "0.21.0",
|
|
25516
|
+
"resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.21.0.tgz",
|
|
25517
|
+
"integrity": "sha512-hFCAETfI5cG8l5iAiLhMC2bReC5K7SIybzrxGorv+eGspIbIFsVw7Vg85GovXm/LxA08pIDrAlrhR6GN36XB/Q==",
|
|
25518
|
+
"requires": {
|
|
25519
|
+
"@mapbox/node-pre-gyp": "^1.0.5",
|
|
25520
|
+
"acorn": "^8.6.0",
|
|
25521
|
+
"async-sema": "^3.1.1",
|
|
25522
|
+
"bindings": "^1.4.0",
|
|
25523
|
+
"estree-walker": "2.0.2",
|
|
25524
|
+
"glob": "^7.1.3",
|
|
25525
|
+
"graceful-fs": "^4.2.9",
|
|
25526
|
+
"micromatch": "^4.0.2",
|
|
25527
|
+
"node-gyp-build": "^4.2.2",
|
|
25528
|
+
"resolve-from": "^5.0.0",
|
|
25529
|
+
"rollup-pluginutils": "^2.8.2"
|
|
25530
|
+
}
|
|
25531
|
+
},
|
|
25608
25532
|
"@verdaccio/commons-api": {
|
|
25609
25533
|
"version": "10.2.0",
|
|
25610
25534
|
"resolved": "https://registry.npmjs.org/@verdaccio/commons-api/-/commons-api-10.2.0.tgz",
|
|
@@ -29430,6 +29354,11 @@
|
|
|
29430
29354
|
"unbox-primitive": "^1.0.1"
|
|
29431
29355
|
}
|
|
29432
29356
|
},
|
|
29357
|
+
"es-module-lexer": {
|
|
29358
|
+
"version": "1.0.3",
|
|
29359
|
+
"resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.0.3.tgz",
|
|
29360
|
+
"integrity": "sha512-iC67eXHToclrlVhQfpRawDiF8D8sQxNxmbqw5oebegOaJkyx/w9C/k57/5e6yJR2zIByRt9OXdqX50DV2t6ZKw=="
|
|
29361
|
+
},
|
|
29433
29362
|
"es-to-primitive": {
|
|
29434
29363
|
"version": "1.2.1",
|
|
29435
29364
|
"resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz",
|
|
@@ -34156,11 +34085,11 @@
|
|
|
34156
34085
|
"integrity": "sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug=="
|
|
34157
34086
|
},
|
|
34158
34087
|
"netlify": {
|
|
34159
|
-
"version": "12.0.
|
|
34160
|
-
"resolved": "https://registry.npmjs.org/netlify/-/netlify-12.0.
|
|
34161
|
-
"integrity": "sha512-
|
|
34088
|
+
"version": "12.0.1",
|
|
34089
|
+
"resolved": "https://registry.npmjs.org/netlify/-/netlify-12.0.1.tgz",
|
|
34090
|
+
"integrity": "sha512-nv16ofE2zHBbB8jQia8+opfdLmVYGrOaorhpInVz5Mkx3kVgJd7Q9c3+dVmSl4VA/4MHX6e4N7X4cH+9sj8Zhw==",
|
|
34162
34091
|
"requires": {
|
|
34163
|
-
"@netlify/open-api": "^2.
|
|
34092
|
+
"@netlify/open-api": "^2.12.0",
|
|
34164
34093
|
"lodash.camelcase": "^4.3.0",
|
|
34165
34094
|
"micro-api-client": "^3.3.0",
|
|
34166
34095
|
"node-fetch": "^3.0.0",
|
|
@@ -34229,9 +34158,9 @@
|
|
|
34229
34158
|
}
|
|
34230
34159
|
},
|
|
34231
34160
|
"netlify-onegraph-internal": {
|
|
34232
|
-
"version": "0.8.
|
|
34233
|
-
"resolved": "https://registry.npmjs.org/netlify-onegraph-internal/-/netlify-onegraph-internal-0.8.
|
|
34234
|
-
"integrity": "sha512-
|
|
34161
|
+
"version": "0.8.7",
|
|
34162
|
+
"resolved": "https://registry.npmjs.org/netlify-onegraph-internal/-/netlify-onegraph-internal-0.8.7.tgz",
|
|
34163
|
+
"integrity": "sha512-FDHQes/GP7UjlzAwJ+qwKfhESBo9NQDN9Ed6U+9a5CW5o2j8Lr23P9Ac1MKp7jDP5h0uAq73r9P86J9Kl1yzLQ==",
|
|
34235
34164
|
"requires": {
|
|
34236
34165
|
"graphql": "16.5.0",
|
|
34237
34166
|
"node-fetch": "^2.6.0",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify-cli",
|
|
3
3
|
"description": "Netlify command line tool",
|
|
4
|
-
"version": "10.17.
|
|
4
|
+
"version": "10.17.7",
|
|
5
5
|
"author": "Netlify Inc.",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"@whitep4nth3r (https://twitter.com/whitep4nth3r)",
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
"Liran Tal <liran.tal@gmail.com> (https://twitter.com/liran_tal)",
|
|
82
82
|
"Louis DeScioli (https://twitter.com/descioli)",
|
|
83
83
|
"Lukas Holzer <lukas.holzer@netlify.com> (https://twitter.com/luka5c0m)",
|
|
84
|
+
"Lxxyx <Lxxyxzj@gmail.com> (https://twitter.com/Lxxyx_)",
|
|
84
85
|
"Marc Littlemore (https://twitter.com/marclittlemore)",
|
|
85
86
|
"Marcus Weiner",
|
|
86
87
|
"Mark Bello <mark@markbello.dev> (https://markbello.dev)",
|
|
@@ -221,13 +222,13 @@
|
|
|
221
222
|
"prettier": "--ignore-path .gitignore --loglevel=warn \"{src,tools,scripts,site,tests,.github}/**/*.{mjs,cjs,js,md,yml,json,html}\" \"*.{mjs,cjs,js,yml,json,html}\" \".*.{mjs,cjs,js,yml,json,html}\" \"!CHANGELOG.md\" \"!npm-shrinkwrap.json\" \"!**/*/package-lock.json\" \"!.github/**/*.md\""
|
|
222
223
|
},
|
|
223
224
|
"dependencies": {
|
|
224
|
-
"@netlify/build": "^27.11.
|
|
225
|
+
"@netlify/build": "^27.11.5",
|
|
225
226
|
"@netlify/config": "^18.1.4",
|
|
226
227
|
"@netlify/edge-bundler": "^1.12.1",
|
|
227
228
|
"@netlify/framework-info": "^9.2.0",
|
|
228
229
|
"@netlify/local-functions-proxy": "^1.1.1",
|
|
229
230
|
"@netlify/plugins-list": "^6.39.0",
|
|
230
|
-
"@netlify/zip-it-and-ship-it": "^5.13.
|
|
231
|
+
"@netlify/zip-it-and-ship-it": "^5.13.5",
|
|
231
232
|
"@octokit/rest": "^18.0.0",
|
|
232
233
|
"@sindresorhus/slugify": "^1.1.0",
|
|
233
234
|
"ansi-escapes": "^5.0.0",
|
|
@@ -290,9 +291,9 @@
|
|
|
290
291
|
"memoize-one": "^6.0.0",
|
|
291
292
|
"minimist": "^1.2.5",
|
|
292
293
|
"multiparty": "^4.2.1",
|
|
293
|
-
"netlify": "^12.0.
|
|
294
|
+
"netlify": "^12.0.1",
|
|
294
295
|
"netlify-headers-parser": "^6.0.2",
|
|
295
|
-
"netlify-onegraph-internal": "0.8.
|
|
296
|
+
"netlify-onegraph-internal": "0.8.7",
|
|
296
297
|
"netlify-redirect-parser": "^13.0.5",
|
|
297
298
|
"netlify-redirector": "^0.2.1",
|
|
298
299
|
"node-fetch": "^2.6.0",
|
|
@@ -36,6 +36,8 @@ const graphHandler = async (args, options, command) => {
|
|
|
36
36
|
const userOperationName = args.operationName
|
|
37
37
|
const userCodegenId = options.codegen
|
|
38
38
|
|
|
39
|
+
const handlerOptions = options.data ? JSON.parse(options.data) : {}
|
|
40
|
+
|
|
39
41
|
let operationName = userOperationName
|
|
40
42
|
if (!operationName) {
|
|
41
43
|
operationName = await autocompleteOperationNames({ netlifyGraphConfig })
|
|
@@ -70,7 +72,7 @@ const graphHandler = async (args, options, command) => {
|
|
|
70
72
|
netlifyGraphConfig,
|
|
71
73
|
schema,
|
|
72
74
|
operationName,
|
|
73
|
-
handlerOptions
|
|
75
|
+
handlerOptions,
|
|
74
76
|
})
|
|
75
77
|
} else {
|
|
76
78
|
error(`Failed to parse Netlify GraphQL schema`)
|
|
@@ -87,6 +89,7 @@ const createGraphHandlerCommand = (program) =>
|
|
|
87
89
|
.command('graph:handler')
|
|
88
90
|
.argument('[name]', 'Operation name')
|
|
89
91
|
.option('-c, --codegen <id>', 'The id of the specific code generator to use')
|
|
92
|
+
.option("-d, --data '<json>'", 'Optional data to pass along to the code generator')
|
|
90
93
|
.description(
|
|
91
94
|
'Generate a handler for a Graph operation given its name. See `graph:operations` for a list of operations.',
|
|
92
95
|
)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
const { Buffer } = require('buffer')
|
|
3
|
+
const process = require('process')
|
|
3
4
|
|
|
4
5
|
const { OneGraphClient } = require('netlify-onegraph-internal')
|
|
5
6
|
const { v4: uuidv4 } = require('uuid')
|
|
6
7
|
|
|
7
8
|
const { OneGraphCliClient, ensureCLISession } = require('../../lib/one-graph/cli-client')
|
|
8
9
|
const { getNetlifyGraphConfig } = require('../../lib/one-graph/cli-netlify-graph')
|
|
9
|
-
const { NETLIFYDEVERR, chalk, error, exit, getToken, log } = require('../../utils')
|
|
10
|
-
const { msg } = require('../login/login')
|
|
10
|
+
const { NETLIFYDEVERR, chalk, error, exit, getToken, log, translateFromEnvelopeToMongo } = require('../../utils')
|
|
11
11
|
|
|
12
12
|
const { ensureAppForSite, executeCreateApiTokenMutation } = OneGraphCliClient
|
|
13
13
|
|
|
@@ -18,7 +18,8 @@ const { ensureAppForSite, executeCreateApiTokenMutation } = OneGraphCliClient
|
|
|
18
18
|
* @returns
|
|
19
19
|
*/
|
|
20
20
|
const graphInit = async (options, command) => {
|
|
21
|
-
const { api, config, site, state } = command.netlify
|
|
21
|
+
const { api, config, site, siteInfo, state } = command.netlify
|
|
22
|
+
const accountId = siteInfo.account_slug
|
|
22
23
|
const siteId = site.id
|
|
23
24
|
|
|
24
25
|
if (!siteId) {
|
|
@@ -29,30 +30,11 @@ const graphInit = async (options, command) => {
|
|
|
29
30
|
)
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
let [netlifyToken
|
|
33
|
+
let [netlifyToken] = await getToken()
|
|
33
34
|
if (!netlifyToken) {
|
|
34
35
|
netlifyToken = await command.authenticate()
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
let siteData = null
|
|
38
|
-
try {
|
|
39
|
-
// @ts-ignore: we need better types for our api object
|
|
40
|
-
siteData = await api.getSite({ siteId })
|
|
41
|
-
} catch (error_) {
|
|
42
|
-
if (netlifyToken && error_.status === 401) {
|
|
43
|
-
log(`Already logged in ${msg(loginLocation)}`)
|
|
44
|
-
log()
|
|
45
|
-
log(`Run ${chalk.cyanBright('netlify status')} for account details`)
|
|
46
|
-
log()
|
|
47
|
-
log(`or run ${chalk.cyanBright('netlify switch')} to switch accounts`)
|
|
48
|
-
log()
|
|
49
|
-
log(`To see all available commands run: ${chalk.cyanBright('netlify help')}`)
|
|
50
|
-
log()
|
|
51
|
-
return exit()
|
|
52
|
-
}
|
|
53
|
-
throw error_
|
|
54
|
-
}
|
|
55
|
-
|
|
56
38
|
if (netlifyToken == null) {
|
|
57
39
|
error(
|
|
58
40
|
`${NETLIFYDEVERR} Error: Unable to start Netlify Graph without a login. To enable, run ${chalk.yellow(
|
|
@@ -65,21 +47,27 @@ const graphInit = async (options, command) => {
|
|
|
65
47
|
await ensureAppForSite(netlifyToken, siteId)
|
|
66
48
|
|
|
67
49
|
const netlifyGraphConfig = await getNetlifyGraphConfig({ command, options })
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
50
|
+
|
|
51
|
+
if (process.env.NODE_ENV !== 'test') {
|
|
52
|
+
await ensureCLISession({
|
|
53
|
+
config,
|
|
54
|
+
metadata: {},
|
|
55
|
+
netlifyToken,
|
|
56
|
+
site,
|
|
57
|
+
state,
|
|
58
|
+
netlifyGraphConfig,
|
|
59
|
+
})
|
|
60
|
+
}
|
|
76
61
|
|
|
77
62
|
let envChanged = false
|
|
78
63
|
|
|
79
64
|
// Get current environment variables set in the UI
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
65
|
+
let env = (siteInfo.build_settings && siteInfo.build_settings.env) || {}
|
|
66
|
+
const isUsingEnvelope = siteInfo.use_envelope
|
|
67
|
+
if (isUsingEnvelope) {
|
|
68
|
+
const envelopeVariables = await api.getEnvVars({ accountId, siteId })
|
|
69
|
+
env = translateFromEnvelopeToMongo(envelopeVariables)
|
|
70
|
+
}
|
|
83
71
|
|
|
84
72
|
const newEnv = {
|
|
85
73
|
...env,
|
|
@@ -120,8 +108,32 @@ const graphInit = async (options, command) => {
|
|
|
120
108
|
}
|
|
121
109
|
}
|
|
122
110
|
|
|
123
|
-
if (envChanged) {
|
|
124
|
-
|
|
111
|
+
if (!envChanged) {
|
|
112
|
+
log(`Graph-related environment variables already set for site ${siteInfo.name}`)
|
|
113
|
+
return true
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Apply environment variable updates
|
|
117
|
+
|
|
118
|
+
// eslint-disable-next-line unicorn/prefer-ternary
|
|
119
|
+
if (isUsingEnvelope) {
|
|
120
|
+
await api.createEnvVars({
|
|
121
|
+
accountId,
|
|
122
|
+
siteId,
|
|
123
|
+
body: [
|
|
124
|
+
!env.NETLIFY_GRAPH_WEBHOOK_SECRET && {
|
|
125
|
+
key: 'NETLIFY_GRAPH_WEBHOOK_SECRET',
|
|
126
|
+
scopes: ['functions'],
|
|
127
|
+
values: [{ context: 'all', value: newEnv.NETLIFY_GRAPH_WEBHOOK_SECRET }],
|
|
128
|
+
},
|
|
129
|
+
!env.NETLIFY_GRAPH_PERSIST_QUERY_TOKEN && {
|
|
130
|
+
key: 'NETLIFY_GRAPH_PERSIST_QUERY_TOKEN',
|
|
131
|
+
scopes: ['builds', 'functions'],
|
|
132
|
+
values: [{ context: 'all', value: newEnv.NETLIFY_GRAPH_PERSIST_QUERY_TOKEN }],
|
|
133
|
+
},
|
|
134
|
+
].filter(Boolean),
|
|
135
|
+
})
|
|
136
|
+
} else {
|
|
125
137
|
// @ts-ignore
|
|
126
138
|
await api.updateSite({
|
|
127
139
|
siteId,
|
|
@@ -131,9 +143,9 @@ const graphInit = async (options, command) => {
|
|
|
131
143
|
},
|
|
132
144
|
},
|
|
133
145
|
})
|
|
134
|
-
|
|
135
|
-
log(`Finished updating Graph-related environment variables for site ${siteData.name}`)
|
|
136
146
|
}
|
|
147
|
+
|
|
148
|
+
log(`Finished updating Graph-related environment variables for site ${siteInfo.name}`)
|
|
137
149
|
}
|
|
138
150
|
|
|
139
151
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
3
|
const slugify = require('@sindresorhus/slugify')
|
|
4
|
+
const { InvalidArgumentError } = require('commander')
|
|
4
5
|
const inquirer = require('inquirer')
|
|
5
6
|
const pick = require('lodash/pick')
|
|
6
7
|
const sample = require('lodash/sample')
|
|
@@ -84,7 +85,6 @@ const sitesCreate = async (options, command) => {
|
|
|
84
85
|
accountSlug = accountSlugInput
|
|
85
86
|
}
|
|
86
87
|
|
|
87
|
-
const { name: nameFlag } = options
|
|
88
88
|
let user
|
|
89
89
|
let site
|
|
90
90
|
|
|
@@ -110,7 +110,7 @@ const sitesCreate = async (options, command) => {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
await inputSiteName(
|
|
113
|
+
await inputSiteName(options.name)
|
|
114
114
|
|
|
115
115
|
log()
|
|
116
116
|
log(chalk.greenBright.bold.underline(`Site Created`))
|
|
@@ -175,6 +175,16 @@ const sitesCreate = async (options, command) => {
|
|
|
175
175
|
return site
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
+
const MAX_SITE_NAME_LENGTH = 63
|
|
179
|
+
const validateName = function (value) {
|
|
180
|
+
// netlify sites:create --name <A string of more than 63 words>
|
|
181
|
+
if (typeof value === 'string' && value.length > MAX_SITE_NAME_LENGTH) {
|
|
182
|
+
throw new InvalidArgumentError(`--name should be less than 64 characters, input length: ${value.length}`)
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return value
|
|
186
|
+
}
|
|
187
|
+
|
|
178
188
|
/**
|
|
179
189
|
* Creates the `netlify sites:create` command
|
|
180
190
|
* @param {import('../base-command').BaseCommand} program
|
|
@@ -187,8 +197,8 @@ const createSitesCreateCommand = (program) =>
|
|
|
187
197
|
`Create an empty site (advanced)
|
|
188
198
|
Create a blank site that isn't associated with any git remote. Will link the site to the current working directory.`,
|
|
189
199
|
)
|
|
190
|
-
.option('-n, --name
|
|
191
|
-
.option('-a, --account-slug
|
|
200
|
+
.option('-n, --name <name>', 'name of site', validateName)
|
|
201
|
+
.option('-a, --account-slug <slug>', 'account slug to create the site under')
|
|
192
202
|
.option('-c, --with-ci', 'initialize CI hooks during site creation')
|
|
193
203
|
.option('-m, --manual', 'force manual CI setup. Used --with-ci flag')
|
|
194
204
|
.option('--disable-linking', 'create the site without linking it to current directory')
|
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
"version": "1.0.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@netlify/functions": "^1.
|
|
12
|
+
"@netlify/functions": "^1.1.0",
|
|
13
13
|
"@types/node": "^14.0.0",
|
|
14
14
|
"typescript": "^4.0.0"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"node_modules/@netlify/functions": {
|
|
18
|
-
"version": "1.
|
|
19
|
-
"resolved": "https://registry.npmjs.org/@netlify/functions/-/functions-1.
|
|
20
|
-
"integrity": "sha512-
|
|
18
|
+
"version": "1.1.0",
|
|
19
|
+
"resolved": "https://registry.npmjs.org/@netlify/functions/-/functions-1.1.0.tgz",
|
|
20
|
+
"integrity": "sha512-XUFC5nt4iLMrDK+6WjYrDOW9h6XGIQlEk3o++xglFbDKc6dsP+k6rjfz3vl0w8S9Oiosxj3uLaPW18szJc1UgA==",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"is-promise": "^4.0.0"
|
|
23
23
|
},
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@netlify/functions": {
|
|
53
|
-
"version": "1.
|
|
54
|
-
"resolved": "https://registry.npmjs.org/@netlify/functions/-/functions-1.
|
|
55
|
-
"integrity": "sha512-
|
|
53
|
+
"version": "1.1.0",
|
|
54
|
+
"resolved": "https://registry.npmjs.org/@netlify/functions/-/functions-1.1.0.tgz",
|
|
55
|
+
"integrity": "sha512-XUFC5nt4iLMrDK+6WjYrDOW9h6XGIQlEk3o++xglFbDKc6dsP+k6rjfz3vl0w8S9Oiosxj3uLaPW18szJc1UgA==",
|
|
56
56
|
"requires": {
|
|
57
57
|
"is-promise": "^4.0.0"
|
|
58
58
|
}
|
|
@@ -780,10 +780,9 @@ const getCLISessionMetadata = async ({ jwt, oneGraphSessionId, siteId }) => {
|
|
|
780
780
|
* Look at the current project, filesystem, etc. and determine relevant metadata for a cli session
|
|
781
781
|
* @param {object} input
|
|
782
782
|
* @param {string} input.siteRoot The root file path for the site
|
|
783
|
-
* @param {object} input.config The parsed netlify.toml config file
|
|
784
783
|
* @returns {Promise<CliEventHelper.DetectedLocalCLISessionMetadata>} Any locally detected facts that are relevant to include in the cli session metadata
|
|
785
784
|
*/
|
|
786
|
-
const detectLocalCLISessionMetadata = async ({
|
|
785
|
+
const detectLocalCLISessionMetadata = async ({ siteRoot }) => {
|
|
787
786
|
// @ts-ignore
|
|
788
787
|
const { listFrameworks } = await frameworkInfoPromise
|
|
789
788
|
|
|
@@ -806,25 +805,6 @@ const detectLocalCLISessionMetadata = async ({ config, siteRoot }) => {
|
|
|
806
805
|
|
|
807
806
|
const editor = process.env.EDITOR || null
|
|
808
807
|
|
|
809
|
-
/** @type {CodegenHelpers.CodegenModuleMeta | null} */
|
|
810
|
-
let codegen = null
|
|
811
|
-
|
|
812
|
-
const codegenModule = await getCodegenModule({ config })
|
|
813
|
-
|
|
814
|
-
if (codegenModule) {
|
|
815
|
-
codegen = {
|
|
816
|
-
id: codegenModule.id,
|
|
817
|
-
version: codegenModule.id,
|
|
818
|
-
generators: codegenModule.generators.map((generator) => ({
|
|
819
|
-
id: generator.id,
|
|
820
|
-
name: generator.name,
|
|
821
|
-
options: generator.generateHandlerOptions || null,
|
|
822
|
-
supportedDefinitionTypes: generator.supportedDefinitionTypes,
|
|
823
|
-
version: generator.version,
|
|
824
|
-
})),
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
|
|
828
808
|
const detectedMetadata = {
|
|
829
809
|
gitBranch: branch,
|
|
830
810
|
hostname,
|
|
@@ -835,8 +815,8 @@ const detectLocalCLISessionMetadata = async ({ config, siteRoot }) => {
|
|
|
835
815
|
platform,
|
|
836
816
|
arch,
|
|
837
817
|
nodeVersion: process.version,
|
|
838
|
-
codegen,
|
|
839
818
|
framework,
|
|
819
|
+
codegen: null,
|
|
840
820
|
}
|
|
841
821
|
|
|
842
822
|
return detectedMetadata
|
|
@@ -847,13 +827,12 @@ const detectLocalCLISessionMetadata = async ({ config, siteRoot }) => {
|
|
|
847
827
|
* @param {object} input
|
|
848
828
|
* @param {string} input.jwt The GraphJWT string
|
|
849
829
|
* @param {string} input.sessionId The id of the cli session to fetch the current metadata for
|
|
850
|
-
* @param {object} input.config The parsed netlify.toml config file
|
|
851
830
|
* @param {string} input.siteRoot Path to the root of the project
|
|
852
831
|
* @param {string} input.docId The GraphQL operations document id to fetch
|
|
853
832
|
* @param {string} input.schemaId The GraphQL schemaId to use when generating code
|
|
854
833
|
*/
|
|
855
|
-
const publishCliSessionMetadataPublishEvent = async ({
|
|
856
|
-
const detectedMetadata = await detectLocalCLISessionMetadata({
|
|
834
|
+
const publishCliSessionMetadataPublishEvent = async ({ docId, jwt, schemaId, sessionId, siteRoot }) => {
|
|
835
|
+
const detectedMetadata = await detectLocalCLISessionMetadata({ siteRoot })
|
|
857
836
|
|
|
858
837
|
/** @type {CliEventHelper.OneGraphNetlifyCliSessionMetadataPublishEvent} */
|
|
859
838
|
const event = {
|
|
@@ -901,13 +880,13 @@ const publishCliSessionMetadataPublishEvent = async ({ config, docId, jwt, schem
|
|
|
901
880
|
* @param {object} input.newMetadata The metadata to merge into (with priority) the existing metadata
|
|
902
881
|
* @returns {Promise<object>}
|
|
903
882
|
*/
|
|
904
|
-
const upsertMergeCLISessionMetadata = async ({
|
|
883
|
+
const upsertMergeCLISessionMetadata = async ({ jwt, newMetadata, oneGraphSessionId, siteId, siteRoot }) => {
|
|
905
884
|
const { errors, metadata } = await getCLISessionMetadata({ jwt, oneGraphSessionId, siteId })
|
|
906
885
|
if (errors) {
|
|
907
886
|
warn(`Error fetching cli session metadata: ${JSON.stringify(errors, null, 2)}`)
|
|
908
887
|
}
|
|
909
888
|
|
|
910
|
-
const detectedMetadata = await detectLocalCLISessionMetadata({
|
|
889
|
+
const detectedMetadata = await detectLocalCLISessionMetadata({ siteRoot })
|
|
911
890
|
|
|
912
891
|
// @ts-ignore
|
|
913
892
|
const finalMetadata = { ...metadata, ...detectedMetadata, ...newMetadata }
|
|
@@ -992,7 +971,13 @@ const persistNewOperationsDocForSession = async ({
|
|
|
992
971
|
})
|
|
993
972
|
|
|
994
973
|
if (!result || result.errors) {
|
|
995
|
-
warn(
|
|
974
|
+
warn(
|
|
975
|
+
`Unable to update session metadata with updated operations docId="${persistedDoc.id}": ${JSON.stringify(
|
|
976
|
+
result && result.errors,
|
|
977
|
+
null,
|
|
978
|
+
2,
|
|
979
|
+
)}`,
|
|
980
|
+
)
|
|
996
981
|
} else if (lockfile != null) {
|
|
997
982
|
// Now that we've persisted the document, lock it in the lockfile
|
|
998
983
|
const currentOperationsDoc = readGraphQLOperationsSourceFile(netlifyGraphConfig)
|
|
@@ -1336,7 +1321,6 @@ const ensureCLISession = async (input) => {
|
|
|
1336
1321
|
// If we can't access the session in the state.json or it doesn't exist, create a new one
|
|
1337
1322
|
const sessionName = generateSessionName()
|
|
1338
1323
|
const detectedMetadata = await detectLocalCLISessionMetadata({
|
|
1339
|
-
config,
|
|
1340
1324
|
siteRoot: site.root,
|
|
1341
1325
|
})
|
|
1342
1326
|
const newSessionMetadata = parentCliSessionId ? { parentCliSessionId } : {}
|
|
@@ -459,7 +459,7 @@ const generateFunctionsFile = async ({ config, netlifyGraphConfig, operationsDoc
|
|
|
459
459
|
|
|
460
460
|
const codegenModule = await getCodegenModule({ config })
|
|
461
461
|
if (!codegenModule) {
|
|
462
|
-
|
|
462
|
+
warn(
|
|
463
463
|
`No Netlify Graph codegen module specified in netlify.toml under the [graph] header. Please specify 'codeGenerator' field and try again.`,
|
|
464
464
|
)
|
|
465
465
|
return
|
|
@@ -685,13 +685,19 @@ const generateHandlerByOperationName = ({
|
|
|
685
685
|
}
|
|
686
686
|
|
|
687
687
|
const parsedDoc = parse(currentOperationsDoc)
|
|
688
|
-
const { functions } = extractFunctionsFromOperationDoc(GraphQL, parsedDoc)
|
|
688
|
+
const { fragments, functions } = extractFunctionsFromOperationDoc(GraphQL, parsedDoc)
|
|
689
689
|
|
|
690
|
-
const
|
|
691
|
-
(
|
|
690
|
+
const functionDefinition = Object.values(functions).find(
|
|
691
|
+
(potentialDefinition) => potentialDefinition.operationName === operationName,
|
|
692
692
|
)
|
|
693
693
|
|
|
694
|
-
|
|
694
|
+
const fragmentDefinition = Object.values(fragments).find(
|
|
695
|
+
(potentialDefinition) => potentialDefinition.fragmentName === operationName,
|
|
696
|
+
)
|
|
697
|
+
|
|
698
|
+
const definition = functionDefinition || fragmentDefinition
|
|
699
|
+
|
|
700
|
+
if (!definition) {
|
|
695
701
|
warn(`No operation named ${operationName} was found in the operations doc`)
|
|
696
702
|
return
|
|
697
703
|
}
|
|
@@ -701,7 +707,7 @@ const generateHandlerByOperationName = ({
|
|
|
701
707
|
generate,
|
|
702
708
|
netlifyGraphConfig,
|
|
703
709
|
schema,
|
|
704
|
-
operationId:
|
|
710
|
+
operationId: definition.id,
|
|
705
711
|
handlerOptions,
|
|
706
712
|
})
|
|
707
713
|
}
|
package/src/utils/proxy.js
CHANGED
|
@@ -201,10 +201,9 @@ const serveRedirect = async function ({ match, options, proxy, req, res }) {
|
|
|
201
201
|
// construct destination URL from redirect rule match
|
|
202
202
|
const dest = new URL(match.to, `${reqUrl.protocol}//${reqUrl.host}`)
|
|
203
203
|
|
|
204
|
-
// We pass through request params
|
|
205
|
-
//
|
|
206
|
-
|
|
207
|
-
if ([...dest.searchParams].length === 0 || isFunction(options.functionsPort, stripOrigin(dest))) {
|
|
204
|
+
// We pass through request params if the redirect rule
|
|
205
|
+
// doesn't have any query params
|
|
206
|
+
if ([...dest.searchParams].length === 0) {
|
|
208
207
|
dest.searchParams.forEach((_, key) => {
|
|
209
208
|
dest.searchParams.delete(key)
|
|
210
209
|
})
|