firebase-admin 9.3.0 → 9.5.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 (82) hide show
  1. package/lib/auth/action-code-settings-builder.js +1 -1
  2. package/lib/auth/auth-api-request.js +98 -25
  3. package/lib/auth/auth-config.js +15 -15
  4. package/lib/auth/auth.js +82 -61
  5. package/lib/auth/identifier.js +3 -2
  6. package/lib/auth/index.d.ts +1868 -0
  7. package/lib/{credential/credential-interfaces.js → auth/index.js} +1 -1
  8. package/lib/auth/tenant-manager.js +1 -1
  9. package/lib/auth/tenant.js +7 -1
  10. package/lib/auth/token-generator.js +6 -4
  11. package/lib/auth/token-verifier.js +32 -36
  12. package/lib/auth/user-import-builder.js +18 -15
  13. package/lib/auth/user-record.js +4 -4
  14. package/lib/credential/credential-internal.js +1 -2
  15. package/lib/credential/credential.js +8 -122
  16. package/lib/credential/index.d.ts +169 -0
  17. package/lib/credential/index.js +5 -17
  18. package/lib/database/database-internal.js +19 -26
  19. package/lib/database/index.d.ts +89 -0
  20. package/lib/database/index.js +12 -28
  21. package/lib/default-namespace.js +2 -1
  22. package/lib/firebase-app.js +26 -48
  23. package/lib/firebase-namespace-api.d.ts +238 -0
  24. package/lib/{firebase-service.js → firebase-namespace-api.js} +2 -2
  25. package/lib/{database/database.js → firebase-namespace.d.ts} +14 -7
  26. package/lib/firebase-namespace.js +22 -92
  27. package/lib/firestore/firestore-internal.js +2 -19
  28. package/lib/firestore/index.d.ts +50 -0
  29. package/lib/firestore/index.js +28 -43
  30. package/lib/index.d.ts +3 -932
  31. package/lib/index.js +2 -1
  32. package/lib/instance-id/index.d.ts +81 -0
  33. package/lib/instance-id/index.js +1 -10
  34. package/lib/instance-id/instance-id-request-internal.js +2 -1
  35. package/lib/instance-id/instance-id.js +1 -19
  36. package/lib/machine-learning/index.d.ts +249 -0
  37. package/lib/{messaging/messaging-types.js → machine-learning/index.js} +2 -2
  38. package/lib/machine-learning/machine-learning-api-client.js +1 -1
  39. package/lib/machine-learning/machine-learning-utils.js +1 -1
  40. package/lib/machine-learning/machine-learning.js +3 -22
  41. package/lib/messaging/batch-request-internal.js +1 -1
  42. package/lib/messaging/index.d.ts +1174 -0
  43. package/lib/messaging/index.js +1 -24
  44. package/lib/messaging/messaging-api-request-internal.js +2 -1
  45. package/lib/messaging/messaging-errors-internal.js +1 -1
  46. package/lib/messaging/messaging-internal.js +1 -1
  47. package/lib/messaging/messaging.js +21 -25
  48. package/lib/project-management/android-app.js +7 -6
  49. package/lib/project-management/index.d.ts +363 -0
  50. package/lib/project-management/index.js +23 -25
  51. package/lib/project-management/ios-app.js +5 -4
  52. package/lib/project-management/project-management-api-request-internal.js +5 -5
  53. package/lib/project-management/project-management.js +9 -26
  54. package/lib/remote-config/index.d.ts +359 -0
  55. package/lib/remote-config/index.js +1 -26
  56. package/lib/remote-config/remote-config-api-client-internal.js +3 -3
  57. package/lib/remote-config/remote-config.js +15 -32
  58. package/lib/security-rules/index.d.ts +216 -0
  59. package/lib/security-rules/index.js +1 -24
  60. package/lib/security-rules/security-rules-api-client-internal.js +1 -1
  61. package/lib/security-rules/security-rules-internal.js +1 -1
  62. package/lib/security-rules/security-rules.js +6 -15
  63. package/lib/storage/index.d.ts +60 -0
  64. package/lib/storage/index.js +1 -10
  65. package/lib/storage/storage.js +2 -19
  66. package/lib/utils/api-request.js +10 -3
  67. package/lib/utils/deep-copy.js +2 -1
  68. package/lib/utils/error.js +2 -1
  69. package/lib/utils/index.js +6 -5
  70. package/lib/utils/validator.js +2 -1
  71. package/package.json +15 -12
  72. package/lib/auth.d.ts +0 -2016
  73. package/lib/credential.d.ts +0 -150
  74. package/lib/database.d.ts +0 -1663
  75. package/lib/instance-id.d.ts +0 -37
  76. package/lib/messaging.d.ts +0 -1341
  77. package/lib/project-management/app-metadata.js +0 -37
  78. package/lib/project-management.d.ts +0 -361
  79. package/lib/remote-config/remote-config-api-client.js +0 -36
  80. package/lib/remote-config.d.ts +0 -350
  81. package/lib/security-rules.d.ts +0 -192
  82. package/lib/storage.d.ts +0 -40
@@ -1,150 +0,0 @@
1
- /*! firebase-admin v9.3.0 */
2
- import * as _admin from './index.d';
3
- import { Agent } from 'http';
4
-
5
- export namespace admin.credential {
6
- /**
7
- * Interface that provides Google OAuth2 access tokens used to authenticate
8
- * with Firebase services.
9
- *
10
- * In most cases, you will not need to implement this yourself and can instead
11
- * use the default implementations provided by
12
- * {@link admin.credential `admin.credential`}.
13
- */
14
- interface Credential {
15
-
16
- /**
17
- * Returns a Google OAuth2 access token object used to authenticate with
18
- * Firebase services.
19
- *
20
- * This object contains the following properties:
21
- * * `access_token` (`string`): The actual Google OAuth2 access token.
22
- * * `expires_in` (`number`): The number of seconds from when the token was
23
- * issued that it expires.
24
- *
25
- * @return A Google OAuth2 access token object.
26
- */
27
- getAccessToken(): Promise<_admin.GoogleOAuthAccessToken>;
28
- }
29
-
30
-
31
- /**
32
- * Returns a credential created from the
33
- * {@link
34
- * https://developers.google.com/identity/protocols/application-default-credentials
35
- * Google Application Default Credentials}
36
- * that grants admin access to Firebase services. This credential can be used
37
- * in the call to
38
- * {@link
39
- * https://firebase.google.com/docs/reference/admin/node/admin#.initializeApp
40
- * `admin.initializeApp()`}.
41
- *
42
- * Google Application Default Credentials are available on any Google
43
- * infrastructure, such as Google App Engine and Google Compute Engine.
44
- *
45
- * See
46
- * {@link
47
- * https://firebase.google.com/docs/admin/setup#initialize_the_sdk
48
- * Initialize the SDK}
49
- * for more details.
50
- *
51
- * @example
52
- * ```javascript
53
- * admin.initializeApp({
54
- * credential: admin.credential.applicationDefault(),
55
- * databaseURL: "https://<DATABASE_NAME>.firebaseio.com"
56
- * });
57
- * ```
58
- *
59
- * @param {!Object=} httpAgent Optional [HTTP Agent](https://nodejs.org/api/http.html#http_class_http_agent)
60
- * to be used when retrieving access tokens from Google token servers.
61
- *
62
- * @return {!admin.credential.Credential} A credential authenticated via Google
63
- * Application Default Credentials that can be used to initialize an app.
64
- */
65
- function applicationDefault(httpAgent?: Agent): admin.credential.Credential;
66
-
67
- /**
68
- * Returns a credential created from the provided service account that grants
69
- * admin access to Firebase services. This credential can be used in the call
70
- * to
71
- * {@link
72
- * https://firebase.google.com/docs/reference/admin/node/admin#.initializeApp
73
- * `admin.initializeApp()`}.
74
- *
75
- * See
76
- * {@link
77
- * https://firebase.google.com/docs/admin/setup#initialize_the_sdk
78
- * Initialize the SDK}
79
- * for more details.
80
- *
81
- * @example
82
- * ```javascript
83
- * // Providing a path to a service account key JSON file
84
- * var serviceAccount = require("path/to/serviceAccountKey.json");
85
- * admin.initializeApp({
86
- * credential: admin.credential.cert(serviceAccount),
87
- * databaseURL: "https://<DATABASE_NAME>.firebaseio.com"
88
- * });
89
- * ```
90
- *
91
- * @example
92
- * ```javascript
93
- * // Providing a service account object inline
94
- * admin.initializeApp({
95
- * credential: admin.credential.cert({
96
- * projectId: "<PROJECT_ID>",
97
- * clientEmail: "foo@<PROJECT_ID>.iam.gserviceaccount.com",
98
- * privateKey: "-----BEGIN PRIVATE KEY-----<KEY>-----END PRIVATE KEY-----\n"
99
- * }),
100
- * databaseURL: "https://<DATABASE_NAME>.firebaseio.com"
101
- * });
102
- * ```
103
- *
104
- * @param serviceAccountPathOrObject The path to a service
105
- * account key JSON file or an object representing a service account key.
106
- * @param httpAgent Optional [HTTP Agent](https://nodejs.org/api/http.html#http_class_http_agent)
107
- * to be used when retrieving access tokens from Google token servers.
108
- *
109
- * @return A credential authenticated via the
110
- * provided service account that can be used to initialize an app.
111
- */
112
- function cert(
113
- serviceAccountPathOrObject: string | _admin.ServiceAccount,
114
- httpAgent?: Agent): admin.credential.Credential;
115
-
116
- /**
117
- * Returns a credential created from the provided refresh token that grants
118
- * admin access to Firebase services. This credential can be used in the call
119
- * to
120
- * {@link
121
- * https://firebase.google.com/docs/reference/admin/node/admin#.initializeApp
122
- * `admin.initializeApp()`}.
123
- *
124
- * See
125
- * {@link
126
- * https://firebase.google.com/docs/admin/setup#initialize_the_sdk
127
- * Initialize the SDK}
128
- * for more details.
129
- *
130
- * @example
131
- * ```javascript
132
- * // Providing a path to a refresh token JSON file
133
- * var refreshToken = require("path/to/refreshToken.json");
134
- * admin.initializeApp({
135
- * credential: admin.credential.refreshToken(refreshToken),
136
- * databaseURL: "https://<DATABASE_NAME>.firebaseio.com"
137
- * });
138
- * ```
139
- *
140
- * @param refreshTokenPathOrObject The path to a Google
141
- * OAuth2 refresh token JSON file or an object representing a Google OAuth2
142
- * refresh token.
143
- * @param httpAgent Optional [HTTP Agent](https://nodejs.org/api/http.html#http_class_http_agent)
144
- * to be used when retrieving access tokens from Google token servers.
145
- *
146
- * @return A credential authenticated via the
147
- * provided service account that can be used to initialize an app.
148
- */
149
- function refreshToken(refreshTokenPathOrObject: string | object, httpAgent?: Agent): admin.credential.Credential;
150
- }