firebase-admin 9.12.0 → 10.0.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 (189) hide show
  1. package/README.md +7 -3
  2. package/lib/app/core.d.ts +188 -0
  3. package/lib/app/core.js +19 -0
  4. package/lib/app/credential-factory.d.ts +123 -0
  5. package/lib/app/credential-factory.js +150 -0
  6. package/lib/app/credential-internal.d.ts +90 -0
  7. package/lib/{credential → app}/credential-internal.js +15 -13
  8. package/lib/app/credential.d.ts +45 -0
  9. package/lib/app/credential.js +19 -0
  10. package/lib/app/firebase-app.d.ts +51 -0
  11. package/lib/{firebase-app.js → app/firebase-app.js} +26 -156
  12. package/lib/app/firebase-namespace.d.ts +163 -0
  13. package/lib/{firebase-namespace.js → app/firebase-namespace.js} +99 -111
  14. package/lib/app/index.d.ts +27 -0
  15. package/lib/app/index.js +31 -0
  16. package/lib/app/lifecycle.d.ts +60 -0
  17. package/lib/app/lifecycle.js +165 -0
  18. package/lib/app-check/app-check-api-client-internal.d.ts +32 -0
  19. package/lib/app-check/app-check-api-client-internal.js +10 -10
  20. package/lib/app-check/app-check-api.d.ts +95 -0
  21. package/lib/app-check/app-check-api.js +19 -0
  22. package/lib/app-check/app-check-namespace.d.ts +65 -0
  23. package/lib/app-check/app-check-namespace.js +18 -0
  24. package/lib/app-check/app-check.d.ts +49 -0
  25. package/lib/app-check/app-check.js +13 -10
  26. package/lib/app-check/index.d.ts +19 -126
  27. package/lib/app-check/index.js +45 -1
  28. package/lib/app-check/token-generator.d.ts +25 -0
  29. package/lib/app-check/token-generator.js +9 -9
  30. package/lib/app-check/token-verifier.d.ts +17 -0
  31. package/lib/app-check/token-verifier.js +6 -6
  32. package/lib/auth/action-code-settings-builder.d.ts +87 -0
  33. package/lib/auth/action-code-settings-builder.js +4 -2
  34. package/lib/auth/auth-api-request.d.ts +174 -0
  35. package/lib/auth/auth-api-request.js +197 -124
  36. package/lib/auth/auth-config.d.ts +575 -0
  37. package/lib/auth/auth-config.js +43 -34
  38. package/lib/auth/auth-namespace.d.ts +255 -0
  39. package/lib/auth/auth-namespace.js +18 -0
  40. package/lib/auth/auth.d.ts +40 -0
  41. package/lib/auth/auth.js +12 -772
  42. package/lib/auth/base-auth.d.ts +613 -0
  43. package/lib/auth/base-auth.js +951 -0
  44. package/lib/auth/identifier.d.ts +57 -0
  45. package/lib/auth/identifier.js +1 -1
  46. package/lib/auth/index.d.ts +25 -1897
  47. package/lib/auth/index.js +54 -1
  48. package/lib/auth/tenant-manager.d.ts +146 -0
  49. package/lib/auth/tenant-manager.js +151 -39
  50. package/lib/auth/tenant.d.ts +130 -0
  51. package/lib/auth/tenant.js +62 -16
  52. package/lib/auth/token-generator.d.ts +44 -0
  53. package/lib/auth/token-generator.js +11 -9
  54. package/lib/auth/token-verifier.d.ts +150 -0
  55. package/lib/auth/token-verifier.js +27 -15
  56. package/lib/auth/user-import-builder.d.ts +322 -0
  57. package/lib/auth/user-import-builder.js +9 -9
  58. package/lib/auth/user-record.d.ts +265 -0
  59. package/lib/auth/user-record.js +80 -45
  60. package/lib/credential/index.d.ts +24 -66
  61. package/lib/credential/index.js +101 -1
  62. package/lib/database/database-namespace.d.ts +95 -0
  63. package/lib/database/database-namespace.js +23 -0
  64. package/lib/database/database.d.ts +66 -0
  65. package/lib/database/{database-internal.js → database.js} +16 -9
  66. package/lib/database/index.d.ts +55 -54
  67. package/lib/database/index.js +84 -13
  68. package/lib/{firebase-namespace.d.ts → default-namespace.d.ts} +7 -14
  69. package/lib/default-namespace.js +4 -5
  70. package/lib/esm/app/index.js +10 -0
  71. package/lib/esm/app-check/index.js +4 -0
  72. package/lib/esm/auth/index.js +14 -0
  73. package/lib/esm/database/index.js +6 -0
  74. package/lib/esm/firestore/index.js +23 -0
  75. package/lib/esm/installations/index.js +4 -0
  76. package/lib/esm/instance-id/index.js +4 -0
  77. package/lib/esm/machine-learning/index.js +5 -0
  78. package/lib/esm/messaging/index.js +4 -0
  79. package/lib/esm/package.json +1 -0
  80. package/lib/esm/project-management/index.js +8 -0
  81. package/lib/esm/remote-config/index.js +4 -0
  82. package/lib/esm/security-rules/index.js +6 -0
  83. package/lib/esm/storage/index.js +4 -0
  84. package/lib/firebase-namespace-api.d.ts +34 -186
  85. package/lib/firebase-namespace-api.js +37 -2
  86. package/lib/firestore/firestore-internal.d.ts +32 -0
  87. package/lib/firestore/firestore-internal.js +3 -3
  88. package/lib/firestore/firestore-namespace.d.ts +50 -0
  89. package/lib/firestore/firestore-namespace.js +47 -0
  90. package/lib/firestore/index.d.ts +37 -35
  91. package/lib/firestore/index.js +61 -30
  92. package/lib/index.d.ts +2 -2
  93. package/lib/index.js +1 -1
  94. package/lib/installations/index.d.ts +34 -63
  95. package/lib/installations/index.js +45 -1
  96. package/lib/installations/installations-namespace.d.ts +55 -0
  97. package/lib/installations/installations-namespace.js +18 -0
  98. package/lib/installations/installations-request-handler.d.ts +43 -0
  99. package/lib/installations/installations-request-handler.js +4 -4
  100. package/lib/installations/installations.d.ts +38 -0
  101. package/lib/installations/installations.js +6 -5
  102. package/lib/instance-id/index.d.ts +23 -45
  103. package/lib/instance-id/index.js +54 -1
  104. package/lib/instance-id/instance-id-namespace.d.ts +38 -0
  105. package/lib/instance-id/instance-id-namespace.js +3 -0
  106. package/lib/instance-id/instance-id.d.ts +47 -0
  107. package/lib/instance-id/instance-id.js +14 -19
  108. package/lib/machine-learning/index.d.ts +19 -216
  109. package/lib/machine-learning/index.js +46 -1
  110. package/lib/machine-learning/machine-learning-api-client.d.ts +102 -0
  111. package/lib/machine-learning/machine-learning-api-client.js +6 -6
  112. package/lib/machine-learning/machine-learning-namespace.d.ts +85 -0
  113. package/lib/machine-learning/machine-learning-namespace.js +18 -0
  114. package/lib/machine-learning/machine-learning-utils.d.ts +22 -0
  115. package/lib/machine-learning/machine-learning-utils.js +1 -1
  116. package/lib/machine-learning/machine-learning.d.ts +181 -0
  117. package/lib/machine-learning/machine-learning.js +72 -37
  118. package/lib/messaging/batch-request-internal.d.ts +55 -0
  119. package/lib/messaging/batch-request-internal.js +9 -9
  120. package/lib/messaging/index.d.ts +18 -1140
  121. package/lib/messaging/index.js +45 -1
  122. package/lib/messaging/messaging-api-request-internal.d.ts +50 -0
  123. package/lib/messaging/messaging-api-request-internal.js +8 -8
  124. package/lib/messaging/messaging-api.d.ts +980 -0
  125. package/lib/messaging/messaging-api.js +19 -0
  126. package/lib/messaging/messaging-errors-internal.d.ts +31 -0
  127. package/lib/messaging/messaging-errors-internal.js +7 -7
  128. package/lib/messaging/messaging-internal.d.ts +27 -0
  129. package/lib/messaging/messaging-internal.js +2 -2
  130. package/lib/messaging/messaging-namespace.d.ts +181 -0
  131. package/lib/messaging/messaging-namespace.js +18 -0
  132. package/lib/messaging/messaging.d.ts +269 -0
  133. package/lib/messaging/messaging.js +83 -91
  134. package/lib/project-management/android-app.d.ts +110 -0
  135. package/lib/project-management/android-app.js +24 -15
  136. package/lib/project-management/app-metadata.d.ts +85 -0
  137. package/lib/project-management/app-metadata.js +37 -0
  138. package/lib/project-management/index.d.ts +21 -331
  139. package/lib/project-management/index.js +51 -24
  140. package/lib/project-management/ios-app.d.ts +66 -0
  141. package/lib/project-management/ios-app.js +15 -8
  142. package/lib/project-management/project-management-api-request-internal.d.ts +17 -0
  143. package/lib/project-management/project-management-api-request-internal.js +15 -15
  144. package/lib/project-management/project-management-namespace.d.ts +82 -0
  145. package/lib/project-management/project-management-namespace.js +18 -0
  146. package/lib/project-management/project-management.d.ts +115 -0
  147. package/lib/project-management/project-management.js +22 -25
  148. package/lib/remote-config/index.d.ts +19 -336
  149. package/lib/remote-config/index.js +45 -1
  150. package/lib/remote-config/remote-config-api-client-internal.d.ts +28 -0
  151. package/lib/remote-config/remote-config-api-client-internal.js +3 -3
  152. package/lib/remote-config/remote-config-api.d.ts +258 -0
  153. package/lib/remote-config/remote-config-api.js +18 -0
  154. package/lib/remote-config/remote-config-namespace.d.ts +105 -0
  155. package/lib/remote-config/remote-config-namespace.js +18 -0
  156. package/lib/remote-config/remote-config.d.ts +94 -0
  157. package/lib/remote-config/remote-config.js +27 -26
  158. package/lib/security-rules/index.d.ts +18 -184
  159. package/lib/security-rules/index.js +46 -1
  160. package/lib/security-rules/security-rules-api-client-internal.d.ts +73 -0
  161. package/lib/security-rules/security-rules-api-client-internal.js +1 -1
  162. package/lib/security-rules/security-rules-internal.d.ts +21 -0
  163. package/lib/security-rules/security-rules-internal.js +1 -1
  164. package/lib/security-rules/security-rules-namespace.d.ts +69 -0
  165. package/lib/security-rules/security-rules-namespace.js +18 -0
  166. package/lib/security-rules/security-rules.d.ts +196 -0
  167. package/lib/security-rules/security-rules.js +73 -55
  168. package/lib/storage/index.d.ts +16 -32
  169. package/lib/storage/index.js +38 -1
  170. package/lib/storage/storage-namespace.d.ts +45 -0
  171. package/lib/storage/storage-namespace.js +18 -0
  172. package/lib/storage/storage.d.ts +42 -0
  173. package/lib/storage/storage.js +9 -6
  174. package/lib/utils/api-request.d.ts +230 -0
  175. package/lib/utils/api-request.js +25 -25
  176. package/lib/utils/crypto-signer.d.ts +128 -0
  177. package/lib/utils/crypto-signer.js +9 -9
  178. package/lib/utils/deep-copy.d.ts +40 -0
  179. package/lib/utils/deep-copy.js +6 -6
  180. package/lib/utils/error.d.ts +650 -0
  181. package/lib/utils/error.js +34 -34
  182. package/lib/utils/index.d.ts +105 -0
  183. package/lib/utils/index.js +22 -21
  184. package/lib/utils/jwt.d.ts +131 -0
  185. package/lib/utils/jwt.js +11 -11
  186. package/lib/utils/validator.d.ts +144 -0
  187. package/lib/utils/validator.js +37 -37
  188. package/package.json +110 -8
  189. package/lib/credential/credential.js +0 -44
@@ -0,0 +1,144 @@
1
+ /*! firebase-admin v10.0.0 */
2
+ /*!
3
+ * @license
4
+ * Copyright 2017 Google Inc.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ /// <reference types="node" />
19
+ /**
20
+ * Validates that a value is a byte buffer.
21
+ *
22
+ * @param value - The value to validate.
23
+ * @returns Whether the value is byte buffer or not.
24
+ */
25
+ export declare function isBuffer(value: any): value is Buffer;
26
+ /**
27
+ * Validates that a value is an array.
28
+ *
29
+ * @param value - The value to validate.
30
+ * @returns Whether the value is an array or not.
31
+ */
32
+ export declare function isArray<T>(value: any): value is T[];
33
+ /**
34
+ * Validates that a value is a non-empty array.
35
+ *
36
+ * @param value - The value to validate.
37
+ * @returns Whether the value is a non-empty array or not.
38
+ */
39
+ export declare function isNonEmptyArray<T>(value: any): value is T[];
40
+ /**
41
+ * Validates that a value is a boolean.
42
+ *
43
+ * @param value - The value to validate.
44
+ * @returns Whether the value is a boolean or not.
45
+ */
46
+ export declare function isBoolean(value: any): boolean;
47
+ /**
48
+ * Validates that a value is a number.
49
+ *
50
+ * @param value - The value to validate.
51
+ * @returns Whether the value is a number or not.
52
+ */
53
+ export declare function isNumber(value: any): boolean;
54
+ /**
55
+ * Validates that a value is a string.
56
+ *
57
+ * @param value - The value to validate.
58
+ * @returns Whether the value is a string or not.
59
+ */
60
+ export declare function isString(value: any): value is string;
61
+ /**
62
+ * Validates that a value is a base64 string.
63
+ *
64
+ * @param value - The value to validate.
65
+ * @returns Whether the value is a base64 string or not.
66
+ */
67
+ export declare function isBase64String(value: any): boolean;
68
+ /**
69
+ * Validates that a value is a non-empty string.
70
+ *
71
+ * @param value - The value to validate.
72
+ * @returns Whether the value is a non-empty string or not.
73
+ */
74
+ export declare function isNonEmptyString(value: any): value is string;
75
+ /**
76
+ * Validates that a value is a nullable object.
77
+ *
78
+ * @param value - The value to validate.
79
+ * @returns Whether the value is an object or not.
80
+ */
81
+ export declare function isObject(value: any): boolean;
82
+ /**
83
+ * Validates that a value is a non-null object.
84
+ *
85
+ * @param value - The value to validate.
86
+ * @returns Whether the value is a non-null object or not.
87
+ */
88
+ export declare function isNonNullObject<T>(value: T | null | undefined): value is T;
89
+ /**
90
+ * Validates that a string is a valid Firebase Auth uid.
91
+ *
92
+ * @param uid - The string to validate.
93
+ * @returns Whether the string is a valid Firebase Auth uid.
94
+ */
95
+ export declare function isUid(uid: any): boolean;
96
+ /**
97
+ * Validates that a string is a valid Firebase Auth password.
98
+ *
99
+ * @param password - The password string to validate.
100
+ * @returns Whether the string is a valid Firebase Auth password.
101
+ */
102
+ export declare function isPassword(password: any): boolean;
103
+ /**
104
+ * Validates that a string is a valid email.
105
+ *
106
+ * @param email - The string to validate.
107
+ * @returns Whether the string is valid email or not.
108
+ */
109
+ export declare function isEmail(email: any): boolean;
110
+ /**
111
+ * Validates that a string is a valid phone number.
112
+ *
113
+ * @param phoneNumber - The string to validate.
114
+ * @returns Whether the string is a valid phone number or not.
115
+ */
116
+ export declare function isPhoneNumber(phoneNumber: any): boolean;
117
+ /**
118
+ * Validates that a string is a valid ISO date string.
119
+ *
120
+ * @param dateString - The string to validate.
121
+ * @returns Whether the string is a valid ISO date string.
122
+ */
123
+ export declare function isISODateString(dateString: any): boolean;
124
+ /**
125
+ * Validates that a string is a valid UTC date string.
126
+ *
127
+ * @param dateString - The string to validate.
128
+ * @returns Whether the string is a valid UTC date string.
129
+ */
130
+ export declare function isUTCDateString(dateString: any): boolean;
131
+ /**
132
+ * Validates that a string is a valid web URL.
133
+ *
134
+ * @param urlStr - The string to validate.
135
+ * @returns Whether the string is valid web URL or not.
136
+ */
137
+ export declare function isURL(urlStr: any): boolean;
138
+ /**
139
+ * Validates that the provided topic is a valid FCM topic name.
140
+ *
141
+ * @param topic - The topic to validate.
142
+ * @returns Whether the provided topic is a valid FCM topic name.
143
+ */
144
+ export declare function isTopic(topic: any): boolean;
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v9.12.0 */
1
+ /*! firebase-admin v10.0.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -22,8 +22,8 @@ var url = require("url");
22
22
  /**
23
23
  * Validates that a value is a byte buffer.
24
24
  *
25
- * @param {any} value The value to validate.
26
- * @return {boolean} Whether the value is byte buffer or not.
25
+ * @param value - The value to validate.
26
+ * @returns Whether the value is byte buffer or not.
27
27
  */
28
28
  function isBuffer(value) {
29
29
  return value instanceof Buffer;
@@ -32,8 +32,8 @@ exports.isBuffer = isBuffer;
32
32
  /**
33
33
  * Validates that a value is an array.
34
34
  *
35
- * @param {any} value The value to validate.
36
- * @return {boolean} Whether the value is an array or not.
35
+ * @param value - The value to validate.
36
+ * @returns Whether the value is an array or not.
37
37
  */
38
38
  function isArray(value) {
39
39
  return Array.isArray(value);
@@ -42,8 +42,8 @@ exports.isArray = isArray;
42
42
  /**
43
43
  * Validates that a value is a non-empty array.
44
44
  *
45
- * @param {any} value The value to validate.
46
- * @return {boolean} Whether the value is a non-empty array or not.
45
+ * @param value - The value to validate.
46
+ * @returns Whether the value is a non-empty array or not.
47
47
  */
48
48
  function isNonEmptyArray(value) {
49
49
  return isArray(value) && value.length !== 0;
@@ -52,8 +52,8 @@ exports.isNonEmptyArray = isNonEmptyArray;
52
52
  /**
53
53
  * Validates that a value is a boolean.
54
54
  *
55
- * @param {any} value The value to validate.
56
- * @return {boolean} Whether the value is a boolean or not.
55
+ * @param value - The value to validate.
56
+ * @returns Whether the value is a boolean or not.
57
57
  */
58
58
  function isBoolean(value) {
59
59
  return typeof value === 'boolean';
@@ -62,8 +62,8 @@ exports.isBoolean = isBoolean;
62
62
  /**
63
63
  * Validates that a value is a number.
64
64
  *
65
- * @param {any} value The value to validate.
66
- * @return {boolean} Whether the value is a number or not.
65
+ * @param value - The value to validate.
66
+ * @returns Whether the value is a number or not.
67
67
  */
68
68
  function isNumber(value) {
69
69
  return typeof value === 'number' && !isNaN(value);
@@ -72,8 +72,8 @@ exports.isNumber = isNumber;
72
72
  /**
73
73
  * Validates that a value is a string.
74
74
  *
75
- * @param {any} value The value to validate.
76
- * @return {boolean} Whether the value is a string or not.
75
+ * @param value - The value to validate.
76
+ * @returns Whether the value is a string or not.
77
77
  */
78
78
  function isString(value) {
79
79
  return typeof value === 'string';
@@ -82,8 +82,8 @@ exports.isString = isString;
82
82
  /**
83
83
  * Validates that a value is a base64 string.
84
84
  *
85
- * @param {any} value The value to validate.
86
- * @return {boolean} Whether the value is a base64 string or not.
85
+ * @param value - The value to validate.
86
+ * @returns Whether the value is a base64 string or not.
87
87
  */
88
88
  function isBase64String(value) {
89
89
  if (!isString(value)) {
@@ -95,8 +95,8 @@ exports.isBase64String = isBase64String;
95
95
  /**
96
96
  * Validates that a value is a non-empty string.
97
97
  *
98
- * @param {any} value The value to validate.
99
- * @return {boolean} Whether the value is a non-empty string or not.
98
+ * @param value - The value to validate.
99
+ * @returns Whether the value is a non-empty string or not.
100
100
  */
101
101
  function isNonEmptyString(value) {
102
102
  return isString(value) && value !== '';
@@ -105,8 +105,8 @@ exports.isNonEmptyString = isNonEmptyString;
105
105
  /**
106
106
  * Validates that a value is a nullable object.
107
107
  *
108
- * @param {any} value The value to validate.
109
- * @return {boolean} Whether the value is an object or not.
108
+ * @param value - The value to validate.
109
+ * @returns Whether the value is an object or not.
110
110
  */
111
111
  function isObject(value) {
112
112
  return typeof value === 'object' && !isArray(value);
@@ -115,8 +115,8 @@ exports.isObject = isObject;
115
115
  /**
116
116
  * Validates that a value is a non-null object.
117
117
  *
118
- * @param {any} value The value to validate.
119
- * @return {boolean} Whether the value is a non-null object or not.
118
+ * @param value - The value to validate.
119
+ * @returns Whether the value is a non-null object or not.
120
120
  */
121
121
  function isNonNullObject(value) {
122
122
  return isObject(value) && value !== null;
@@ -125,8 +125,8 @@ exports.isNonNullObject = isNonNullObject;
125
125
  /**
126
126
  * Validates that a string is a valid Firebase Auth uid.
127
127
  *
128
- * @param {any} uid The string to validate.
129
- * @return {boolean} Whether the string is a valid Firebase Auth uid.
128
+ * @param uid - The string to validate.
129
+ * @returns Whether the string is a valid Firebase Auth uid.
130
130
  */
131
131
  function isUid(uid) {
132
132
  return typeof uid === 'string' && uid.length > 0 && uid.length <= 128;
@@ -135,8 +135,8 @@ exports.isUid = isUid;
135
135
  /**
136
136
  * Validates that a string is a valid Firebase Auth password.
137
137
  *
138
- * @param {any} password The password string to validate.
139
- * @return {boolean} Whether the string is a valid Firebase Auth password.
138
+ * @param password - The password string to validate.
139
+ * @returns Whether the string is a valid Firebase Auth password.
140
140
  */
141
141
  function isPassword(password) {
142
142
  // A password must be a string of at least 6 characters.
@@ -146,8 +146,8 @@ exports.isPassword = isPassword;
146
146
  /**
147
147
  * Validates that a string is a valid email.
148
148
  *
149
- * @param {any} email The string to validate.
150
- * @return {boolean} Whether the string is valid email or not.
149
+ * @param email - The string to validate.
150
+ * @returns Whether the string is valid email or not.
151
151
  */
152
152
  function isEmail(email) {
153
153
  if (typeof email !== 'string') {
@@ -161,8 +161,8 @@ exports.isEmail = isEmail;
161
161
  /**
162
162
  * Validates that a string is a valid phone number.
163
163
  *
164
- * @param {any} phoneNumber The string to validate.
165
- * @return {boolean} Whether the string is a valid phone number or not.
164
+ * @param phoneNumber - The string to validate.
165
+ * @returns Whether the string is a valid phone number or not.
166
166
  */
167
167
  function isPhoneNumber(phoneNumber) {
168
168
  if (typeof phoneNumber !== 'string') {
@@ -180,8 +180,8 @@ exports.isPhoneNumber = isPhoneNumber;
180
180
  /**
181
181
  * Validates that a string is a valid ISO date string.
182
182
  *
183
- * @param dateString The string to validate.
184
- * @return Whether the string is a valid ISO date string.
183
+ * @param dateString - The string to validate.
184
+ * @returns Whether the string is a valid ISO date string.
185
185
  */
186
186
  function isISODateString(dateString) {
187
187
  try {
@@ -196,8 +196,8 @@ exports.isISODateString = isISODateString;
196
196
  /**
197
197
  * Validates that a string is a valid UTC date string.
198
198
  *
199
- * @param dateString The string to validate.
200
- * @return Whether the string is a valid UTC date string.
199
+ * @param dateString - The string to validate.
200
+ * @returns Whether the string is a valid UTC date string.
201
201
  */
202
202
  function isUTCDateString(dateString) {
203
203
  try {
@@ -212,8 +212,8 @@ exports.isUTCDateString = isUTCDateString;
212
212
  /**
213
213
  * Validates that a string is a valid web URL.
214
214
  *
215
- * @param {any} urlStr The string to validate.
216
- * @return {boolean} Whether the string is valid web URL or not.
215
+ * @param urlStr - The string to validate.
216
+ * @returns Whether the string is valid web URL or not.
217
217
  */
218
218
  function isURL(urlStr) {
219
219
  if (typeof urlStr !== 'string') {
@@ -258,8 +258,8 @@ exports.isURL = isURL;
258
258
  /**
259
259
  * Validates that the provided topic is a valid FCM topic name.
260
260
  *
261
- * @param {any} topic The topic to validate.
262
- * @return {boolean} Whether the provided topic is a valid FCM topic name.
261
+ * @param topic - The topic to validate.
262
+ * @returns Whether the provided topic is a valid FCM topic name.
263
263
  */
264
264
  function isTopic(topic) {
265
265
  if (typeof topic !== 'string') {
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "firebase-admin",
3
- "version": "9.12.0",
3
+ "version": "10.0.0",
4
4
  "description": "Firebase admin SDK for Node.js",
5
5
  "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
6
6
  "license": "Apache-2.0",
7
7
  "homepage": "https://firebase.google.com/",
8
8
  "engines": {
9
- "node": ">=10.13.0"
9
+ "node": ">=12.7.0"
10
10
  },
11
11
  "scripts": {
12
12
  "build": "gulp build",
13
13
  "build:tests": "gulp compile_test",
14
- "prepare": "npm run build",
14
+ "prepare": "npm run build && npm run esm-wrap",
15
15
  "lint": "run-p lint:src lint:test",
16
16
  "test": "run-s lint test:unit",
17
17
  "integration": "run-s build test:integration",
@@ -20,9 +20,14 @@
20
20
  "test:coverage": "nyc npm run test:unit",
21
21
  "lint:src": "eslint src/ --ext .ts",
22
22
  "lint:test": "eslint test/ --ext .ts",
23
- "apidocs": "node docgen/generate-docs.js --api node",
24
- "api-extractor": "api-extractor run",
25
- "api-extractor:local": "api-extractor run --local"
23
+ "apidocs": "run-s api-extractor:local api-documenter",
24
+ "api-extractor": "node generate-reports.js",
25
+ "api-extractor:local": "npm run build && node generate-reports.js --local",
26
+ "esm-wrap": "node generate-esm-wrapper.js",
27
+ "api-documenter": "run-s api-documenter:markdown api-documenter:toc api-documenter:post",
28
+ "api-documenter:markdown": "api-documenter-fire markdown --input temp --output docgen/markdown -s",
29
+ "api-documenter:toc": "api-documenter-fire toc --input temp --output docgen/markdown -p /docs/reference/admin/node -s",
30
+ "api-documenter:post": "node docgen/post-process.js"
26
31
  },
27
32
  "nyc": {
28
33
  "extension": [
@@ -55,6 +60,104 @@
55
60
  "package.json"
56
61
  ],
57
62
  "types": "./lib/index.d.ts",
63
+ "typesVersions": {
64
+ "*": {
65
+ "app": [
66
+ "lib/app"
67
+ ],
68
+ "app-check": [
69
+ "lib/app-check"
70
+ ],
71
+ "auth": [
72
+ "lib/auth"
73
+ ],
74
+ "database": [
75
+ "lib/database"
76
+ ],
77
+ "firestore": [
78
+ "lib/firestore"
79
+ ],
80
+ "installations": [
81
+ "lib/installations"
82
+ ],
83
+ "instance-id": [
84
+ "lib/instance-id"
85
+ ],
86
+ "machine-learning": [
87
+ "lib/machine-learning"
88
+ ],
89
+ "messaging": [
90
+ "lib/messaging"
91
+ ],
92
+ "project-management": [
93
+ "lib/project-management"
94
+ ],
95
+ "remote-config": [
96
+ "lib/remote-config"
97
+ ],
98
+ "security-rules": [
99
+ "lib/security-rules"
100
+ ],
101
+ "storage": [
102
+ "lib/storage"
103
+ ]
104
+ }
105
+ },
106
+ "exports": {
107
+ ".": "./lib/index.js",
108
+ "./app": {
109
+ "require": "./lib/app/index.js",
110
+ "import": "./lib/esm/app/index.js"
111
+ },
112
+ "./app-check": {
113
+ "require": "./lib/app-check/index.js",
114
+ "import": "./lib/esm/app-check/index.js"
115
+ },
116
+ "./auth": {
117
+ "require": "./lib/auth/index.js",
118
+ "import": "./lib/esm/auth/index.js"
119
+ },
120
+ "./database": {
121
+ "require": "./lib/database/index.js",
122
+ "import": "./lib/esm/database/index.js"
123
+ },
124
+ "./firestore": {
125
+ "require": "./lib/firestore/index.js",
126
+ "import": "./lib/esm/firestore/index.js"
127
+ },
128
+ "./installations": {
129
+ "require": "./lib/installations/index.js",
130
+ "import": "./lib/esm/installations/index.js"
131
+ },
132
+ "./instance-id": {
133
+ "require": "./lib/instance-id/index.js",
134
+ "import": "./lib/esm/instance-id/index.js"
135
+ },
136
+ "./machine-learning": {
137
+ "require": "./lib/machine-learning/index.js",
138
+ "import": "./lib/esm/machine-learning/index.js"
139
+ },
140
+ "./messaging": {
141
+ "require": "./lib/messaging/index.js",
142
+ "import": "./lib/esm/messaging/index.js"
143
+ },
144
+ "./project-management": {
145
+ "require": "./lib/project-management/index.js",
146
+ "import": "./lib/esm/project-management/index.js"
147
+ },
148
+ "./remote-config": {
149
+ "require": "./lib/remote-config/index.js",
150
+ "import": "./lib/esm/remote-config/index.js"
151
+ },
152
+ "./security-rules": {
153
+ "require": "./lib/security-rules/index.js",
154
+ "import": "./lib/esm/security-rules/index.js"
155
+ },
156
+ "./storage": {
157
+ "require": "./lib/storage/index.js",
158
+ "import": "./lib/esm/storage/index.js"
159
+ }
160
+ },
58
161
  "dependencies": {
59
162
  "@firebase/database-compat": "^0.1.1",
60
163
  "@firebase/database-types": "^0.7.2",
@@ -69,6 +172,7 @@
69
172
  "@google-cloud/storage": "^5.3.0"
70
173
  },
71
174
  "devDependencies": {
175
+ "@firebase/api-documenter": "^0.1.2",
72
176
  "@firebase/app-compat": "^0.1.2",
73
177
  "@firebase/auth-compat": "^0.1.3",
74
178
  "@firebase/auth-types": "^0.10.3",
@@ -101,7 +205,6 @@
101
205
  "gulp-header": "^2.0.9",
102
206
  "gulp-typescript": "^5.0.1",
103
207
  "http-message-parser": "^0.0.34",
104
- "jsdom": "^15.0.0",
105
208
  "lodash": "^4.17.15",
106
209
  "minimist": "^1.2.0",
107
210
  "mocha": "^8.0.0",
@@ -115,7 +218,6 @@
115
218
  "sinon": "^9.0.0",
116
219
  "sinon-chai": "^3.0.0",
117
220
  "ts-node": "^10.2.0",
118
- "typedoc": "^0.19.2",
119
221
  "typescript": "^3.7.3",
120
222
  "yargs": "^17.0.1"
121
223
  }
@@ -1,44 +0,0 @@
1
- /*! firebase-admin v9.12.0 */
2
- "use strict";
3
- /*!
4
- * @license
5
- * Copyright 2017 Google Inc.
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
18
- */
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.refreshToken = exports.cert = exports.applicationDefault = void 0;
21
- var credential_internal_1 = require("./credential-internal");
22
- var globalAppDefaultCred;
23
- var globalCertCreds = {};
24
- var globalRefreshTokenCreds = {};
25
- exports.applicationDefault = function (httpAgent) {
26
- if (typeof globalAppDefaultCred === 'undefined') {
27
- globalAppDefaultCred = credential_internal_1.getApplicationDefault(httpAgent);
28
- }
29
- return globalAppDefaultCred;
30
- };
31
- exports.cert = function (serviceAccountPathOrObject, httpAgent) {
32
- var stringifiedServiceAccount = JSON.stringify(serviceAccountPathOrObject);
33
- if (!(stringifiedServiceAccount in globalCertCreds)) {
34
- globalCertCreds[stringifiedServiceAccount] = new credential_internal_1.ServiceAccountCredential(serviceAccountPathOrObject, httpAgent);
35
- }
36
- return globalCertCreds[stringifiedServiceAccount];
37
- };
38
- exports.refreshToken = function (refreshTokenPathOrObject, httpAgent) {
39
- var stringifiedRefreshToken = JSON.stringify(refreshTokenPathOrObject);
40
- if (!(stringifiedRefreshToken in globalRefreshTokenCreds)) {
41
- globalRefreshTokenCreds[stringifiedRefreshToken] = new credential_internal_1.RefreshTokenCredential(refreshTokenPathOrObject, httpAgent);
42
- }
43
- return globalRefreshTokenCreds[stringifiedRefreshToken];
44
- };