firebase-tools 13.7.5 → 13.8.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 (88) hide show
  1. package/lib/api.js +9 -1
  2. package/lib/apiv2.js +19 -13
  3. package/lib/apphosting/app.js +4 -3
  4. package/lib/apphosting/githubConnections.js +1 -1
  5. package/lib/apphosting/index.js +42 -18
  6. package/lib/checkValidTargetFilters.js +8 -1
  7. package/lib/commands/apphosting-backends-create.js +3 -3
  8. package/lib/commands/apphosting-backends-delete.js +24 -17
  9. package/lib/commands/apphosting-backends-list.js +3 -3
  10. package/lib/commands/apphosting-secrets-grantaccess.js +9 -5
  11. package/lib/commands/dataconnect-list.js +64 -0
  12. package/lib/commands/dataconnect-sdk-generate.js +36 -0
  13. package/lib/commands/dataconnect-sql-diff.js +25 -0
  14. package/lib/commands/dataconnect-sql-migrate.js +41 -0
  15. package/lib/commands/deploy.js +27 -1
  16. package/lib/commands/index.js +10 -0
  17. package/lib/commands/init.js +7 -0
  18. package/lib/commands/setup-emulators-dataconnect.js +12 -0
  19. package/lib/config.js +1 -0
  20. package/lib/dataconnect/build.js +23 -0
  21. package/lib/dataconnect/checkIam.js +30 -0
  22. package/lib/dataconnect/client.js +115 -0
  23. package/lib/dataconnect/dataplaneClient.js +16 -0
  24. package/lib/dataconnect/ensureApis.js +12 -0
  25. package/lib/dataconnect/fileUtils.js +89 -0
  26. package/lib/dataconnect/filters.js +45 -0
  27. package/lib/dataconnect/freeTrial.js +23 -0
  28. package/lib/dataconnect/graphqlError.js +13 -0
  29. package/lib/dataconnect/load.js +40 -0
  30. package/lib/dataconnect/names.js +48 -0
  31. package/lib/dataconnect/prompts.js +20 -0
  32. package/lib/dataconnect/provisionCloudSql.js +91 -0
  33. package/lib/dataconnect/schemaMigration.js +137 -0
  34. package/lib/dataconnect/types.js +23 -0
  35. package/lib/deploy/dataconnect/deploy.js +84 -0
  36. package/lib/deploy/dataconnect/index.js +9 -0
  37. package/lib/deploy/dataconnect/prepare.js +30 -0
  38. package/lib/deploy/dataconnect/release.js +67 -0
  39. package/lib/deploy/functions/checkIam.js +4 -34
  40. package/lib/deploy/index.js +2 -0
  41. package/lib/downloadUtils.js +2 -2
  42. package/lib/emulator/constants.js +3 -0
  43. package/lib/emulator/controller.js +38 -12
  44. package/lib/emulator/dataconnectEmulator.js +86 -0
  45. package/lib/emulator/download.js +1 -1
  46. package/lib/emulator/downloadableEmulators.js +42 -3
  47. package/lib/emulator/portUtils.js +3 -2
  48. package/lib/emulator/registry.js +5 -0
  49. package/lib/emulator/types.js +3 -0
  50. package/lib/experiments.js +5 -0
  51. package/lib/extensions/emulator/specHelper.js +5 -39
  52. package/lib/gcp/apphosting.js +6 -1
  53. package/lib/gcp/cloudsql/cloudsqladmin.js +155 -0
  54. package/lib/gcp/cloudsql/connect.js +127 -0
  55. package/lib/gcp/cloudsql/fbToolsAuthClient.js +42 -0
  56. package/lib/gcp/cloudsql/types.js +2 -0
  57. package/lib/gcp/iam.js +33 -1
  58. package/lib/gcp/secretManager.js +1 -1
  59. package/lib/init/features/dataconnect/index.js +124 -0
  60. package/lib/init/features/emulators.js +13 -0
  61. package/lib/init/features/functions/index.js +15 -3
  62. package/lib/init/features/index.js +3 -1
  63. package/lib/init/index.js +1 -0
  64. package/lib/logger.js +22 -2
  65. package/lib/operation-poller.js +7 -1
  66. package/lib/rc.js +10 -1
  67. package/lib/requireAuth.js +1 -0
  68. package/lib/utils.js +51 -4
  69. package/package.json +6 -2
  70. package/schema/connector-yaml.json +54 -0
  71. package/schema/dataconnect-yaml.json +72 -0
  72. package/schema/firebase-config.json +103 -0
  73. package/templates/extensions/javascript/package.lint.json +2 -2
  74. package/templates/extensions/javascript/package.nolint.json +2 -2
  75. package/templates/extensions/typescript/package.lint.json +2 -2
  76. package/templates/extensions/typescript/package.nolint.json +2 -2
  77. package/templates/init/dataconnect/connector.yaml +2 -0
  78. package/templates/init/dataconnect/dataconnect.yaml +10 -0
  79. package/templates/init/dataconnect/mutations.gql +5 -0
  80. package/templates/init/dataconnect/queries.gql +7 -0
  81. package/templates/init/dataconnect/schema.gql +16 -0
  82. package/templates/init/functions/javascript/_gitignore +2 -1
  83. package/templates/init/functions/javascript/package.lint.json +2 -2
  84. package/templates/init/functions/javascript/package.nolint.json +2 -2
  85. package/templates/init/functions/python/_gitignore +1 -0
  86. package/templates/init/functions/typescript/_gitignore +1 -0
  87. package/templates/init/functions/typescript/package.lint.json +2 -2
  88. package/templates/init/functions/typescript/package.nolint.json +2 -2
@@ -0,0 +1,54 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "additionalProperties": false,
4
+ "definitions": {
5
+ "generatable": {
6
+ "additionalProperties": true,
7
+ "type": "object",
8
+ "properties": {
9
+ "outputDir": {
10
+ "type": "string",
11
+ "description": "Path to the directory where generated files should be written to."
12
+ }
13
+ }
14
+ }
15
+ },
16
+ "properties": {
17
+ "connectorId": {
18
+ "type": "string",
19
+ "description": "The ID of the Firebase Data Connect connector."
20
+ },
21
+ "authMode": {
22
+ "type": "string",
23
+ "description": "The authentication strategy to use for this connector"
24
+
25
+ },
26
+ "generate": {
27
+ "type": "object",
28
+ "additionalProperties": false,
29
+ "properties": {
30
+ "javascriptSdk": {
31
+ "type": "array",
32
+ "items": {
33
+ "$ref": "#/definitions/generatable"
34
+ },
35
+ "description": "Configuration for a generated Javascript SDK"
36
+ },
37
+ "kotlinSdk": {
38
+ "type": "array",
39
+ "items": {
40
+ "$ref": "#/definitions/generatable"
41
+ },
42
+ "description": "Configuration for a generated Kotlin SDK"
43
+ },
44
+ "swiftSdk": {
45
+ "type": "array",
46
+ "items": {
47
+ "$ref": "#/definitions/generatable"
48
+ },
49
+ "description": "Configuration for a generated Swift SDK"
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,72 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "additionalProperties": false,
4
+ "definitions": {
5
+ "postgresql": {
6
+ "additionalProperties": false,
7
+ "type": "object",
8
+ "properties": {
9
+ "database": {
10
+ "type": "string",
11
+ "description": "The name of the PostgreSQL database."
12
+ },
13
+ "cloudSql": {
14
+ "additionalProperties": false,
15
+ "type": "object",
16
+ "properties": {
17
+ "instanceId": {
18
+ "type": "string",
19
+ "description": "The ID of the CloudSQL instance for this database"
20
+ }
21
+ }
22
+ }
23
+ }
24
+ },
25
+ "dataSource": {
26
+ "oneOf": [
27
+ {
28
+ "additionalProperties": false,
29
+ "type": "object",
30
+ "properties": {
31
+ "postgresql": {
32
+ "$ref": "#/definitions/postgresql"
33
+ }
34
+ }
35
+ }
36
+ ]
37
+ },
38
+ "schema": {
39
+ "additionalProperties": false,
40
+ "type": "object",
41
+ "properties": {
42
+ "source": {
43
+ "type": "string",
44
+ "description": "Relative path to directory containing GQL files defining the schema. If omitted, defaults to ./schema."
45
+ },
46
+ "datasource": {
47
+ "$ref": "#/definitions/dataSource"
48
+ }
49
+ }
50
+ }
51
+ },
52
+ "properties": {
53
+ "specVersion": {
54
+ "type": "string",
55
+ "description": "The Firebase Data Connect API version to target. If omitted, defaults to the latest version"
56
+ },
57
+ "serviceId": {
58
+ "type": "string",
59
+ "description": "The ID of the Firebase Data Connect service."
60
+ },
61
+ "connectorDirs": {
62
+ "type": "array",
63
+ "items": {
64
+ "type": "string"
65
+ },
66
+ "description": "A list of directories containing conector.yaml files describing a connector to deploy."
67
+ },
68
+ "schema": {
69
+ "$ref": "#/definitions/schema"
70
+ }
71
+ }
72
+ }
@@ -271,6 +271,97 @@
271
271
  }
272
272
  ]
273
273
  },
274
+ "dataconnect": {
275
+ "anyOf": [
276
+ {
277
+ "additionalProperties": false,
278
+ "properties": {
279
+ "location": {
280
+ "type": "string"
281
+ },
282
+ "postdeploy": {
283
+ "anyOf": [
284
+ {
285
+ "items": {
286
+ "type": "string"
287
+ },
288
+ "type": "array"
289
+ },
290
+ {
291
+ "type": "string"
292
+ }
293
+ ]
294
+ },
295
+ "predeploy": {
296
+ "anyOf": [
297
+ {
298
+ "items": {
299
+ "type": "string"
300
+ },
301
+ "type": "array"
302
+ },
303
+ {
304
+ "type": "string"
305
+ }
306
+ ]
307
+ },
308
+ "source": {
309
+ "type": "string"
310
+ }
311
+ },
312
+ "required": [
313
+ "location",
314
+ "source"
315
+ ],
316
+ "type": "object"
317
+ },
318
+ {
319
+ "items": {
320
+ "additionalProperties": false,
321
+ "properties": {
322
+ "location": {
323
+ "type": "string"
324
+ },
325
+ "postdeploy": {
326
+ "anyOf": [
327
+ {
328
+ "items": {
329
+ "type": "string"
330
+ },
331
+ "type": "array"
332
+ },
333
+ {
334
+ "type": "string"
335
+ }
336
+ ]
337
+ },
338
+ "predeploy": {
339
+ "anyOf": [
340
+ {
341
+ "items": {
342
+ "type": "string"
343
+ },
344
+ "type": "array"
345
+ },
346
+ {
347
+ "type": "string"
348
+ }
349
+ ]
350
+ },
351
+ "source": {
352
+ "type": "string"
353
+ }
354
+ },
355
+ "required": [
356
+ "location",
357
+ "source"
358
+ ],
359
+ "type": "object"
360
+ },
361
+ "type": "array"
362
+ }
363
+ ]
364
+ },
274
365
  "emulators": {
275
366
  "additionalProperties": false,
276
367
  "properties": {
@@ -298,6 +389,18 @@
298
389
  },
299
390
  "type": "object"
300
391
  },
392
+ "dataconnect": {
393
+ "additionalProperties": false,
394
+ "properties": {
395
+ "host": {
396
+ "type": "string"
397
+ },
398
+ "port": {
399
+ "type": "number"
400
+ }
401
+ },
402
+ "type": "object"
403
+ },
301
404
  "eventarc": {
302
405
  "additionalProperties": false,
303
406
  "properties": {
@@ -3,8 +3,8 @@
3
3
  "description": "Greet the world",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
- "firebase-admin": "^11.5.0",
7
- "firebase-functions": "^4.2.0"
6
+ "firebase-admin": "^12.1.0",
7
+ "firebase-functions": "^5.0.0"
8
8
  },
9
9
  "devDependencies": {
10
10
  "eslint": "^8.15.1",
@@ -3,8 +3,8 @@
3
3
  "description": "Greet the world",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
- "firebase-admin": "^11.5.0",
7
- "firebase-functions": "^4.2.0"
6
+ "firebase-admin": "^12.1.0",
7
+ "firebase-functions": "^5.0.0"
8
8
  },
9
9
  "devDependencies": {
10
10
  "axios": "^1.3.2",
@@ -10,8 +10,8 @@
10
10
  },
11
11
  "main": "lib/index.js",
12
12
  "dependencies": {
13
- "firebase-admin": "^11.5.0",
14
- "firebase-functions": "^4.2.0"
13
+ "firebase-admin": "^12.1.0",
14
+ "firebase-functions": "^5.0.0"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@types/chai": "^4.3.4",
@@ -8,8 +8,8 @@
8
8
  },
9
9
  "main": "lib/index.js",
10
10
  "dependencies": {
11
- "firebase-admin": "^11.5.0",
12
- "firebase-functions": "^4.2.0"
11
+ "firebase-admin": "^12.1.0",
12
+ "firebase-functions": "^5.0.0"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@types/chai": "^4.3.4",
@@ -0,0 +1,2 @@
1
+ connectorId: "__connectorId__"
2
+ authMode: "PUBLIC"
@@ -0,0 +1,10 @@
1
+ specVersion: "v1alpha"
2
+ serviceId: "__serviceId__"
3
+ schema:
4
+ source: "./schema"
5
+ datasource:
6
+ postgresql:
7
+ database: "__cloudSqlDatabase__"
8
+ cloudSql:
9
+ instanceId: "__cloudSqlInstanceId__"
10
+ connectorDirs: ["./connector"]
@@ -0,0 +1,5 @@
1
+ # # Example mutations
2
+ # # TODO: Replace with a really good illustrative example from devrel!
3
+ # mutation createOrder($name: String!) {
4
+ # order_insert(data : {name: $name})
5
+ # }
@@ -0,0 +1,7 @@
1
+ # # Example query
2
+ # # TODO: Replace with a really good illustrative example from devrel!
3
+ # query listOrders {
4
+ # orders {
5
+ # name
6
+ # }
7
+ # }
@@ -0,0 +1,16 @@
1
+ # # Example schema
2
+ # # TODO: Replace with a really good illustrative example from devrel!
3
+ # type Product @table {
4
+ # name: String!
5
+ # price: Int!
6
+ # }
7
+
8
+ # type Order @table {
9
+ # name: String!
10
+ # }
11
+
12
+ # type OrderItem @table(key: ["order", "product"]) {
13
+ # order: Order!
14
+ # product: Product!
15
+ # quantity: Int!
16
+ # }
@@ -1 +1,2 @@
1
- node_modules/
1
+ node_modules/
2
+ *.local
@@ -14,8 +14,8 @@
14
14
  },
15
15
  "main": "index.js",
16
16
  "dependencies": {
17
- "firebase-admin": "^11.8.0",
18
- "firebase-functions": "^4.3.1"
17
+ "firebase-admin": "^12.1.0",
18
+ "firebase-functions": "^5.0.0"
19
19
  },
20
20
  "devDependencies": {
21
21
  "eslint": "^8.15.0",
@@ -13,8 +13,8 @@
13
13
  },
14
14
  "main": "index.js",
15
15
  "dependencies": {
16
- "firebase-admin": "^11.8.0",
17
- "firebase-functions": "^4.3.1"
16
+ "firebase-admin": "^12.1.0",
17
+ "firebase-functions": "^5.0.0"
18
18
  },
19
19
  "devDependencies": {
20
20
  "firebase-functions-test": "^3.1.0"
@@ -0,0 +1 @@
1
+ *.local
@@ -7,3 +7,4 @@ typings/
7
7
 
8
8
  # Node.js dependency directory
9
9
  node_modules/
10
+ *.local
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "main": "lib/index.js",
17
17
  "dependencies": {
18
- "firebase-admin": "^11.8.0",
19
- "firebase-functions": "^4.3.1"
18
+ "firebase-admin": "^12.1.0",
19
+ "firebase-functions": "^5.0.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@typescript-eslint/eslint-plugin": "^5.12.0",
@@ -14,8 +14,8 @@
14
14
  },
15
15
  "main": "lib/index.js",
16
16
  "dependencies": {
17
- "firebase-admin": "^11.8.0",
18
- "firebase-functions": "^4.3.1"
17
+ "firebase-admin": "^12.1.0",
18
+ "firebase-functions": "^5.0.0"
19
19
  },
20
20
  "devDependencies": {
21
21
  "typescript": "^4.9.0",