firebase-tools 10.1.2 → 10.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.
Files changed (65) hide show
  1. package/lib/api.js +1 -0
  2. package/lib/apiv2.js +92 -48
  3. package/lib/archiveDirectory.js +63 -73
  4. package/lib/auth.js +62 -25
  5. package/lib/commands/ext-configure.js +1 -0
  6. package/lib/commands/ext-dev-usage.js +3 -8
  7. package/lib/commands/ext-install.js +1 -0
  8. package/lib/commands/ext-uninstall.js +1 -0
  9. package/lib/commands/ext-update.js +1 -0
  10. package/lib/commands/functions-secrets-access.js +17 -0
  11. package/lib/commands/functions-secrets-destroy.js +40 -0
  12. package/lib/commands/functions-secrets-get.js +21 -0
  13. package/lib/commands/functions-secrets-prune.js +50 -0
  14. package/lib/commands/functions-secrets-set.js +46 -0
  15. package/lib/commands/index.js +7 -3
  16. package/lib/commands/login.js +1 -1
  17. package/lib/database/metadata.js +16 -24
  18. package/lib/deploy/functions/backend.js +11 -1
  19. package/lib/deploy/functions/ensure.js +112 -0
  20. package/lib/deploy/functions/ensureCloudBuildEnabled.js +0 -49
  21. package/lib/deploy/functions/prepare.js +13 -19
  22. package/lib/deploy/functions/release/fabricator.js +4 -1
  23. package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +1 -0
  24. package/lib/deploy/functions/runtimes/node/parseTriggers.js +12 -0
  25. package/lib/deploy/functions/validate.js +83 -1
  26. package/lib/deploy/hosting/convertConfig.js +45 -24
  27. package/lib/deploy/hosting/prepare.js +1 -1
  28. package/lib/emulator/controller.js +3 -1
  29. package/lib/emulator/emulatorLogger.js +7 -0
  30. package/lib/emulator/functionsEmulator.js +113 -79
  31. package/lib/emulator/functionsEmulatorRuntime.js +100 -83
  32. package/lib/emulator/functionsEmulatorShared.js +51 -1
  33. package/lib/emulator/functionsEmulatorShell.js +1 -2
  34. package/lib/emulator/functionsRuntimeWorker.js +1 -1
  35. package/lib/emulator/storage/apis/gcloud.js +2 -2
  36. package/lib/emulator/storage/files.js +8 -3
  37. package/lib/extensions/askUserForParam.js +1 -1
  38. package/lib/extensions/diagnose.js +56 -0
  39. package/lib/extensions/extensionsApi.js +0 -1
  40. package/lib/extensions/extensionsHelper.js +10 -17
  41. package/lib/extensions/resolveSource.js +1 -53
  42. package/lib/extensions/secretsUtils.js +1 -1
  43. package/lib/extensions/updateHelper.js +0 -14
  44. package/lib/extensions/utils.js +4 -2
  45. package/lib/functions/env.js +5 -7
  46. package/lib/functions/secrets.js +112 -0
  47. package/lib/gcp/cloudbilling.js +8 -19
  48. package/lib/gcp/cloudfunctions.js +24 -48
  49. package/lib/gcp/cloudlogging.js +8 -11
  50. package/lib/gcp/cloudmonitoring.js +8 -5
  51. package/lib/gcp/cloudscheduler.js +7 -18
  52. package/lib/gcp/firedata.js +5 -4
  53. package/lib/gcp/firestore.js +5 -5
  54. package/lib/gcp/iam.js +18 -33
  55. package/lib/gcp/resourceManager.js +8 -13
  56. package/lib/gcp/runtimeconfig.js +31 -53
  57. package/lib/gcp/secretManager.js +137 -77
  58. package/lib/gcp/storage.js +25 -29
  59. package/lib/previews.js +1 -1
  60. package/lib/serve/functions.js +2 -2
  61. package/lib/utils.js +6 -1
  62. package/npm-shrinkwrap.json +962 -987
  63. package/package.json +5 -3
  64. package/schema/firebase-config.json +387 -12
  65. package/templates/init/hosting/index.html +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase-tools",
3
- "version": "10.1.2",
3
+ "version": "10.2.0",
4
4
  "description": "Command-Line Interface for Firebase",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {
@@ -30,6 +30,7 @@
30
30
  "test:extensions-emulator": "./scripts/extensions-emulator-tests/run.sh",
31
31
  "test:hosting": "./scripts/hosting-tests/run.sh",
32
32
  "test:triggers-end-to-end": "./scripts/triggers-end-to-end-tests/run.sh",
33
+ "test:storage-deploy": "./scripts/storage-deploy-tests/run.sh",
33
34
  "test:storage-emulator-integration": "./scripts/storage-emulator-integration/run.sh"
34
35
  },
35
36
  "files": [
@@ -125,6 +126,7 @@
125
126
  "progress": "^2.0.3",
126
127
  "proxy-agent": "^5.0.0",
127
128
  "request": "^2.87.0",
129
+ "retry": "^0.13.1",
128
130
  "rimraf": "^3.0.0",
129
131
  "semver": "^5.7.1",
130
132
  "stream-chain": "^2.2.4",
@@ -135,7 +137,7 @@
135
137
  "tmp": "0.0.33",
136
138
  "triple-beam": "^1.3.0",
137
139
  "tweetsodium": "0.0.5",
138
- "universal-analytics": "^0.4.16",
140
+ "universal-analytics": "^0.5.3",
139
141
  "unzipper": "^0.10.10",
140
142
  "update-notifier": "^5.1.0",
141
143
  "uuid": "^8.3.2",
@@ -174,6 +176,7 @@
174
176
  "@types/progress": "^2.0.3",
175
177
  "@types/puppeteer": "^5.4.2",
176
178
  "@types/request": "^2.48.1",
179
+ "@types/retry": "^0.12.1",
177
180
  "@types/rimraf": "^2.0.3",
178
181
  "@types/semver": "^6.0.0",
179
182
  "@types/sinon": "^9.0.10",
@@ -186,7 +189,6 @@
186
189
  "@types/triple-beam": "^1.3.0",
187
190
  "@types/unzipper": "^0.10.0",
188
191
  "@types/uuid": "^8.3.1",
189
- "@types/winston": "^2.4.4",
190
192
  "@types/ws": "^7.2.3",
191
193
  "@typescript-eslint/eslint-plugin": "^5.9.0",
192
194
  "@typescript-eslint/parser": "^5.9.0",
@@ -384,6 +384,38 @@
384
384
  "headers": {
385
385
  "items": {
386
386
  "anyOf": [
387
+ {
388
+ "additionalProperties": false,
389
+ "properties": {
390
+ "glob": {
391
+ "type": "string"
392
+ },
393
+ "headers": {
394
+ "items": {
395
+ "additionalProperties": false,
396
+ "properties": {
397
+ "key": {
398
+ "type": "string"
399
+ },
400
+ "value": {
401
+ "type": "string"
402
+ }
403
+ },
404
+ "required": [
405
+ "key",
406
+ "value"
407
+ ],
408
+ "type": "object"
409
+ },
410
+ "type": "array"
411
+ }
412
+ },
413
+ "required": [
414
+ "glob",
415
+ "headers"
416
+ ],
417
+ "type": "object"
418
+ },
387
419
  {
388
420
  "additionalProperties": false,
389
421
  "properties": {
@@ -502,6 +534,25 @@
502
534
  "redirects": {
503
535
  "items": {
504
536
  "anyOf": [
537
+ {
538
+ "additionalProperties": false,
539
+ "properties": {
540
+ "destination": {
541
+ "type": "string"
542
+ },
543
+ "glob": {
544
+ "type": "string"
545
+ },
546
+ "type": {
547
+ "type": "number"
548
+ }
549
+ },
550
+ "required": [
551
+ "destination",
552
+ "glob"
553
+ ],
554
+ "type": "object"
555
+ },
505
556
  {
506
557
  "additionalProperties": false,
507
558
  "properties": {
@@ -517,8 +568,7 @@
517
568
  },
518
569
  "required": [
519
570
  "destination",
520
- "source",
521
- "type"
571
+ "source"
522
572
  ],
523
573
  "type": "object"
524
574
  },
@@ -537,8 +587,7 @@
537
587
  },
538
588
  "required": [
539
589
  "destination",
540
- "regex",
541
- "type"
590
+ "regex"
542
591
  ],
543
592
  "type": "object"
544
593
  }
@@ -549,6 +598,82 @@
549
598
  "rewrites": {
550
599
  "items": {
551
600
  "anyOf": [
601
+ {
602
+ "additionalProperties": false,
603
+ "properties": {
604
+ "destination": {
605
+ "type": "string"
606
+ },
607
+ "glob": {
608
+ "type": "string"
609
+ }
610
+ },
611
+ "required": [
612
+ "destination",
613
+ "glob"
614
+ ],
615
+ "type": "object"
616
+ },
617
+ {
618
+ "additionalProperties": false,
619
+ "properties": {
620
+ "function": {
621
+ "type": "string"
622
+ },
623
+ "glob": {
624
+ "type": "string"
625
+ }
626
+ },
627
+ "required": [
628
+ "function",
629
+ "glob"
630
+ ],
631
+ "type": "object"
632
+ },
633
+ {
634
+ "additionalProperties": false,
635
+ "properties": {
636
+ "glob": {
637
+ "type": "string"
638
+ },
639
+ "run": {
640
+ "additionalProperties": false,
641
+ "properties": {
642
+ "region": {
643
+ "type": "string"
644
+ },
645
+ "serviceId": {
646
+ "type": "string"
647
+ }
648
+ },
649
+ "required": [
650
+ "serviceId"
651
+ ],
652
+ "type": "object"
653
+ }
654
+ },
655
+ "required": [
656
+ "glob",
657
+ "run"
658
+ ],
659
+ "type": "object"
660
+ },
661
+ {
662
+ "additionalProperties": false,
663
+ "properties": {
664
+ "dynamicLinks": {
665
+ "type": "boolean"
666
+ },
667
+ "glob": {
668
+ "type": "string"
669
+ }
670
+ },
671
+ "required": [
672
+ "dynamicLinks",
673
+ "glob"
674
+ ],
675
+ "type": "object"
676
+ },
552
677
  {
553
678
  "additionalProperties": false,
554
679
  "properties": {
@@ -732,6 +857,38 @@
732
857
  "headers": {
733
858
  "items": {
734
859
  "anyOf": [
860
+ {
861
+ "additionalProperties": false,
862
+ "properties": {
863
+ "glob": {
864
+ "type": "string"
865
+ },
866
+ "headers": {
867
+ "items": {
868
+ "additionalProperties": false,
869
+ "properties": {
870
+ "key": {
871
+ "type": "string"
872
+ },
873
+ "value": {
874
+ "type": "string"
875
+ }
876
+ },
877
+ "required": [
878
+ "key",
879
+ "value"
880
+ ],
881
+ "type": "object"
882
+ },
883
+ "type": "array"
884
+ }
885
+ },
886
+ "required": [
887
+ "glob",
888
+ "headers"
889
+ ],
890
+ "type": "object"
891
+ },
735
892
  {
736
893
  "additionalProperties": false,
737
894
  "properties": {
@@ -850,6 +1007,25 @@
850
1007
  "redirects": {
851
1008
  "items": {
852
1009
  "anyOf": [
1010
+ {
1011
+ "additionalProperties": false,
1012
+ "properties": {
1013
+ "destination": {
1014
+ "type": "string"
1015
+ },
1016
+ "glob": {
1017
+ "type": "string"
1018
+ },
1019
+ "type": {
1020
+ "type": "number"
1021
+ }
1022
+ },
1023
+ "required": [
1024
+ "destination",
1025
+ "glob"
1026
+ ],
1027
+ "type": "object"
1028
+ },
853
1029
  {
854
1030
  "additionalProperties": false,
855
1031
  "properties": {
@@ -865,8 +1041,7 @@
865
1041
  },
866
1042
  "required": [
867
1043
  "destination",
868
- "source",
869
- "type"
1044
+ "source"
870
1045
  ],
871
1046
  "type": "object"
872
1047
  },
@@ -885,8 +1060,7 @@
885
1060
  },
886
1061
  "required": [
887
1062
  "destination",
888
- "regex",
889
- "type"
1063
+ "regex"
890
1064
  ],
891
1065
  "type": "object"
892
1066
  }
@@ -897,6 +1071,82 @@
897
1071
  "rewrites": {
898
1072
  "items": {
899
1073
  "anyOf": [
1074
+ {
1075
+ "additionalProperties": false,
1076
+ "properties": {
1077
+ "destination": {
1078
+ "type": "string"
1079
+ },
1080
+ "glob": {
1081
+ "type": "string"
1082
+ }
1083
+ },
1084
+ "required": [
1085
+ "destination",
1086
+ "glob"
1087
+ ],
1088
+ "type": "object"
1089
+ },
1090
+ {
1091
+ "additionalProperties": false,
1092
+ "properties": {
1093
+ "function": {
1094
+ "type": "string"
1095
+ },
1096
+ "glob": {
1097
+ "type": "string"
1098
+ }
1099
+ },
1100
+ "required": [
1101
+ "function",
1102
+ "glob"
1103
+ ],
1104
+ "type": "object"
1105
+ },
1106
+ {
1107
+ "additionalProperties": false,
1108
+ "properties": {
1109
+ "glob": {
1110
+ "type": "string"
1111
+ },
1112
+ "run": {
1113
+ "additionalProperties": false,
1114
+ "properties": {
1115
+ "region": {
1116
+ "type": "string"
1117
+ },
1118
+ "serviceId": {
1119
+ "type": "string"
1120
+ }
1121
+ },
1122
+ "required": [
1123
+ "serviceId"
1124
+ ],
1125
+ "type": "object"
1126
+ }
1127
+ },
1128
+ "required": [
1129
+ "glob",
1130
+ "run"
1131
+ ],
1132
+ "type": "object"
1133
+ },
1134
+ {
1135
+ "additionalProperties": false,
1136
+ "properties": {
1137
+ "dynamicLinks": {
1138
+ "type": "boolean"
1139
+ },
1140
+ "glob": {
1141
+ "type": "string"
1142
+ }
1143
+ },
1144
+ "required": [
1145
+ "dynamicLinks",
1146
+ "glob"
1147
+ ],
1148
+ "type": "object"
1149
+ },
900
1150
  {
901
1151
  "additionalProperties": false,
902
1152
  "properties": {
@@ -1080,6 +1330,38 @@
1080
1330
  "headers": {
1081
1331
  "items": {
1082
1332
  "anyOf": [
1333
+ {
1334
+ "additionalProperties": false,
1335
+ "properties": {
1336
+ "glob": {
1337
+ "type": "string"
1338
+ },
1339
+ "headers": {
1340
+ "items": {
1341
+ "additionalProperties": false,
1342
+ "properties": {
1343
+ "key": {
1344
+ "type": "string"
1345
+ },
1346
+ "value": {
1347
+ "type": "string"
1348
+ }
1349
+ },
1350
+ "required": [
1351
+ "key",
1352
+ "value"
1353
+ ],
1354
+ "type": "object"
1355
+ },
1356
+ "type": "array"
1357
+ }
1358
+ },
1359
+ "required": [
1360
+ "glob",
1361
+ "headers"
1362
+ ],
1363
+ "type": "object"
1364
+ },
1083
1365
  {
1084
1366
  "additionalProperties": false,
1085
1367
  "properties": {
@@ -1198,6 +1480,25 @@
1198
1480
  "redirects": {
1199
1481
  "items": {
1200
1482
  "anyOf": [
1483
+ {
1484
+ "additionalProperties": false,
1485
+ "properties": {
1486
+ "destination": {
1487
+ "type": "string"
1488
+ },
1489
+ "glob": {
1490
+ "type": "string"
1491
+ },
1492
+ "type": {
1493
+ "type": "number"
1494
+ }
1495
+ },
1496
+ "required": [
1497
+ "destination",
1498
+ "glob"
1499
+ ],
1500
+ "type": "object"
1501
+ },
1201
1502
  {
1202
1503
  "additionalProperties": false,
1203
1504
  "properties": {
@@ -1213,8 +1514,7 @@
1213
1514
  },
1214
1515
  "required": [
1215
1516
  "destination",
1216
- "source",
1217
- "type"
1517
+ "source"
1218
1518
  ],
1219
1519
  "type": "object"
1220
1520
  },
@@ -1233,8 +1533,7 @@
1233
1533
  },
1234
1534
  "required": [
1235
1535
  "destination",
1236
- "regex",
1237
- "type"
1536
+ "regex"
1238
1537
  ],
1239
1538
  "type": "object"
1240
1539
  }
@@ -1245,6 +1544,82 @@
1245
1544
  "rewrites": {
1246
1545
  "items": {
1247
1546
  "anyOf": [
1547
+ {
1548
+ "additionalProperties": false,
1549
+ "properties": {
1550
+ "destination": {
1551
+ "type": "string"
1552
+ },
1553
+ "glob": {
1554
+ "type": "string"
1555
+ }
1556
+ },
1557
+ "required": [
1558
+ "destination",
1559
+ "glob"
1560
+ ],
1561
+ "type": "object"
1562
+ },
1563
+ {
1564
+ "additionalProperties": false,
1565
+ "properties": {
1566
+ "function": {
1567
+ "type": "string"
1568
+ },
1569
+ "glob": {
1570
+ "type": "string"
1571
+ }
1572
+ },
1573
+ "required": [
1574
+ "function",
1575
+ "glob"
1576
+ ],
1577
+ "type": "object"
1578
+ },
1579
+ {
1580
+ "additionalProperties": false,
1581
+ "properties": {
1582
+ "glob": {
1583
+ "type": "string"
1584
+ },
1585
+ "run": {
1586
+ "additionalProperties": false,
1587
+ "properties": {
1588
+ "region": {
1589
+ "type": "string"
1590
+ },
1591
+ "serviceId": {
1592
+ "type": "string"
1593
+ }
1594
+ },
1595
+ "required": [
1596
+ "serviceId"
1597
+ ],
1598
+ "type": "object"
1599
+ }
1600
+ },
1601
+ "required": [
1602
+ "glob",
1603
+ "run"
1604
+ ],
1605
+ "type": "object"
1606
+ },
1607
+ {
1608
+ "additionalProperties": false,
1609
+ "properties": {
1610
+ "dynamicLinks": {
1611
+ "type": "boolean"
1612
+ },
1613
+ "glob": {
1614
+ "type": "string"
1615
+ }
1616
+ },
1617
+ "required": [
1618
+ "dynamicLinks",
1619
+ "glob"
1620
+ ],
1621
+ "type": "object"
1622
+ },
1248
1623
  {
1249
1624
  "additionalProperties": false,
1250
1625
  "properties": {
@@ -79,7 +79,7 @@
79
79
  'performance',
80
80
  ].filter(feature => typeof app[feature] === 'function');
81
81
  loadEl.textContent = `Firebase SDK loaded with ${features.join(', ')}`;
82
- } catch (e: any) {
82
+ } catch (e) {
83
83
  console.error(e);
84
84
  loadEl.textContent = 'Error loading the Firebase SDK, check the console.';
85
85
  }