firebase-admin 9.100.0-alpha.0 → 10.0.2

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 (188) hide show
  1. package/README.md +7 -3
  2. package/lib/app/core.d.ts +15 -22
  3. package/lib/app/core.js +1 -1
  4. package/lib/app/credential-factory.d.ts +17 -33
  5. package/lib/app/credential-factory.js +17 -33
  6. package/lib/app/credential-internal.d.ts +10 -9
  7. package/lib/app/credential-internal.js +15 -13
  8. package/lib/app/credential.d.ts +3 -9
  9. package/lib/app/credential.js +1 -1
  10. package/lib/app/firebase-app.d.ts +6 -30
  11. package/lib/app/firebase-app.js +72 -216
  12. package/lib/app/firebase-namespace.d.ts +28 -34
  13. package/lib/app/firebase-namespace.js +119 -99
  14. package/lib/app/index.d.ts +6 -1
  15. package/lib/app/index.js +1 -1
  16. package/lib/app/lifecycle.d.ts +24 -3
  17. package/lib/app/lifecycle.js +119 -25
  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 +197 -0
  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 +82 -0
  26. package/lib/app-check/index.d.ts +53 -0
  27. package/lib/app-check/index.js +63 -0
  28. package/lib/app-check/token-generator.d.ts +25 -0
  29. package/lib/app-check/token-generator.js +159 -0
  30. package/lib/app-check/token-verifier.d.ts +17 -0
  31. package/lib/app-check/token-verifier.js +151 -0
  32. package/lib/auth/action-code-settings-builder.d.ts +1 -1
  33. package/lib/auth/action-code-settings-builder.js +2 -2
  34. package/lib/auth/auth-api-request.d.ts +28 -32
  35. package/lib/auth/auth-api-request.js +167 -125
  36. package/lib/auth/auth-config.d.ts +123 -21
  37. package/lib/auth/auth-config.js +85 -34
  38. package/lib/auth/auth-namespace.d.ts +157 -4
  39. package/lib/auth/auth-namespace.js +1 -1
  40. package/lib/auth/auth.d.ts +5 -3
  41. package/lib/auth/auth.js +6 -4
  42. package/lib/auth/base-auth.d.ts +134 -116
  43. package/lib/auth/base-auth.js +213 -143
  44. package/lib/auth/identifier.d.ts +5 -5
  45. package/lib/auth/identifier.js +1 -1
  46. package/lib/auth/index.d.ts +10 -5
  47. package/lib/auth/index.js +9 -4
  48. package/lib/auth/tenant-manager.d.ts +19 -19
  49. package/lib/auth/tenant-manager.js +21 -25
  50. package/lib/auth/tenant.d.ts +14 -5
  51. package/lib/auth/tenant.js +19 -11
  52. package/lib/auth/token-generator.d.ts +7 -108
  53. package/lib/auth/token-generator.js +52 -145
  54. package/lib/auth/token-verifier.d.ts +3 -4
  55. package/lib/auth/token-verifier.js +96 -145
  56. package/lib/auth/user-import-builder.d.ts +11 -11
  57. package/lib/auth/user-import-builder.js +9 -9
  58. package/lib/auth/user-record.d.ts +23 -15
  59. package/lib/auth/user-record.js +30 -20
  60. package/lib/credential/index.d.ts +18 -35
  61. package/lib/credential/index.js +17 -33
  62. package/lib/database/database-namespace.d.ts +39 -10
  63. package/lib/database/database-namespace.js +1 -1
  64. package/lib/database/database.d.ts +16 -6
  65. package/lib/database/database.js +61 -6
  66. package/lib/database/index.d.ts +19 -18
  67. package/lib/database/index.js +21 -23
  68. package/lib/default-namespace.d.ts +7 -1
  69. package/lib/default-namespace.js +4 -4
  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 +24 -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 +12 -6
  85. package/lib/firebase-namespace-api.js +5 -1
  86. package/lib/firestore/firestore-internal.d.ts +2 -2
  87. package/lib/firestore/firestore-internal.js +2 -2
  88. package/lib/firestore/firestore-namespace.d.ts +6 -1
  89. package/lib/firestore/firestore-namespace.js +2 -1
  90. package/lib/firestore/index.d.ts +36 -4
  91. package/lib/firestore/index.js +29 -1
  92. package/lib/index.d.ts +1 -1
  93. package/lib/index.js +1 -1
  94. package/lib/installations/index.d.ts +52 -0
  95. package/lib/installations/index.js +62 -0
  96. package/lib/installations/installations-namespace.d.ts +55 -0
  97. package/lib/installations/installations-namespace.js +18 -0
  98. package/lib/{instance-id/instance-id-request-internal.d.ts → installations/installations-request-handler.d.ts} +8 -8
  99. package/lib/{instance-id/instance-id-request-internal.js → installations/installations-request-handler.js} +23 -23
  100. package/lib/installations/installations.d.ts +38 -0
  101. package/lib/installations/installations.js +63 -0
  102. package/lib/instance-id/index.d.ts +20 -9
  103. package/lib/instance-id/index.js +20 -9
  104. package/lib/instance-id/instance-id-namespace.d.ts +9 -8
  105. package/lib/instance-id/instance-id-namespace.js +1 -1
  106. package/lib/instance-id/instance-id.d.ts +8 -6
  107. package/lib/instance-id/instance-id.js +20 -11
  108. package/lib/machine-learning/index.d.ts +29 -27
  109. package/lib/machine-learning/index.js +29 -27
  110. package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
  111. package/lib/machine-learning/machine-learning-api-client.js +4 -4
  112. package/lib/machine-learning/machine-learning-namespace.d.ts +33 -8
  113. package/lib/machine-learning/machine-learning-namespace.js +1 -1
  114. package/lib/machine-learning/machine-learning-utils.d.ts +1 -1
  115. package/lib/machine-learning/machine-learning-utils.js +1 -1
  116. package/lib/machine-learning/machine-learning.d.ts +19 -19
  117. package/lib/machine-learning/machine-learning.js +20 -20
  118. package/lib/messaging/batch-request-internal.d.ts +3 -3
  119. package/lib/messaging/batch-request-internal.js +9 -9
  120. package/lib/messaging/index.d.ts +11 -9
  121. package/lib/messaging/index.js +11 -9
  122. package/lib/messaging/messaging-api-request-internal.d.ts +8 -8
  123. package/lib/messaging/messaging-api-request-internal.js +8 -8
  124. package/lib/messaging/messaging-api.d.ts +79 -75
  125. package/lib/messaging/messaging-api.js +1 -1
  126. package/lib/messaging/messaging-errors-internal.d.ts +5 -5
  127. package/lib/messaging/messaging-errors-internal.js +7 -7
  128. package/lib/messaging/messaging-internal.d.ts +1 -1
  129. package/lib/messaging/messaging-internal.js +6 -31
  130. package/lib/messaging/messaging-namespace.d.ts +105 -8
  131. package/lib/messaging/messaging-namespace.js +1 -1
  132. package/lib/messaging/messaging.d.ts +70 -86
  133. package/lib/messaging/messaging.js +76 -89
  134. package/lib/project-management/android-app.d.ts +11 -12
  135. package/lib/project-management/android-app.js +13 -14
  136. package/lib/project-management/app-metadata.d.ts +1 -1
  137. package/lib/project-management/app-metadata.js +1 -1
  138. package/lib/project-management/index.d.ts +11 -9
  139. package/lib/project-management/index.js +11 -9
  140. package/lib/project-management/ios-app.d.ts +6 -7
  141. package/lib/project-management/ios-app.js +6 -7
  142. package/lib/project-management/project-management-api-request-internal.d.ts +1 -80
  143. package/lib/project-management/project-management-api-request-internal.js +14 -14
  144. package/lib/project-management/project-management-namespace.d.ts +31 -9
  145. package/lib/project-management/project-management-namespace.js +1 -1
  146. package/lib/project-management/project-management.d.ts +18 -21
  147. package/lib/project-management/project-management.js +19 -22
  148. package/lib/remote-config/index.d.ts +12 -10
  149. package/lib/remote-config/index.js +11 -9
  150. package/lib/remote-config/remote-config-api-client-internal.d.ts +1 -1
  151. package/lib/remote-config/remote-config-api-client-internal.js +2 -2
  152. package/lib/remote-config/remote-config-api.d.ts +12 -2
  153. package/lib/remote-config/remote-config-api.js +1 -1
  154. package/lib/remote-config/remote-config-namespace.d.ts +50 -9
  155. package/lib/remote-config/remote-config-namespace.js +1 -1
  156. package/lib/remote-config/remote-config.d.ts +19 -21
  157. package/lib/remote-config/remote-config.js +25 -25
  158. package/lib/security-rules/index.d.ts +12 -10
  159. package/lib/security-rules/index.js +12 -10
  160. package/lib/security-rules/security-rules-api-client-internal.d.ts +1 -1
  161. package/lib/security-rules/security-rules-api-client-internal.js +1 -1
  162. package/lib/security-rules/security-rules-internal.d.ts +1 -1
  163. package/lib/security-rules/security-rules-internal.js +1 -1
  164. package/lib/security-rules/security-rules-namespace.d.ts +43 -28
  165. package/lib/security-rules/security-rules-namespace.js +1 -1
  166. package/lib/security-rules/security-rules.d.ts +39 -42
  167. package/lib/security-rules/security-rules.js +38 -39
  168. package/lib/storage/index.d.ts +9 -7
  169. package/lib/storage/index.js +9 -7
  170. package/lib/storage/storage-namespace.d.ts +7 -6
  171. package/lib/storage/storage-namespace.js +1 -1
  172. package/lib/storage/storage.d.ts +3 -3
  173. package/lib/storage/storage.js +14 -4
  174. package/lib/utils/api-request.d.ts +24 -24
  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 +237 -0
  178. package/lib/utils/deep-copy.d.ts +6 -6
  179. package/lib/utils/deep-copy.js +6 -6
  180. package/lib/utils/error.d.ts +69 -36
  181. package/lib/utils/error.js +98 -43
  182. package/lib/utils/index.d.ts +30 -19
  183. package/lib/utils/index.js +47 -20
  184. package/lib/utils/jwt.d.ts +131 -0
  185. package/lib/utils/jwt.js +355 -0
  186. package/lib/utils/validator.d.ts +37 -37
  187. package/lib/utils/validator.js +37 -37
  188. package/package.json +126 -53
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v9.100.0-alpha.0 */
1
+ /*! firebase-admin v10.0.2 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2017 Google Inc.
@@ -19,126 +19,126 @@
19
19
  /**
20
20
  * Validates that a value is a byte buffer.
21
21
  *
22
- * @param {any} value The value to validate.
23
- * @return {boolean} Whether the value is byte buffer or not.
22
+ * @param value - The value to validate.
23
+ * @returns Whether the value is byte buffer or not.
24
24
  */
25
25
  export declare function isBuffer(value: any): value is Buffer;
26
26
  /**
27
27
  * Validates that a value is an array.
28
28
  *
29
- * @param {any} value The value to validate.
30
- * @return {boolean} Whether the value is an array or not.
29
+ * @param value - The value to validate.
30
+ * @returns Whether the value is an array or not.
31
31
  */
32
32
  export declare function isArray<T>(value: any): value is T[];
33
33
  /**
34
34
  * Validates that a value is a non-empty array.
35
35
  *
36
- * @param {any} value The value to validate.
37
- * @return {boolean} Whether the value is a non-empty array or not.
36
+ * @param value - The value to validate.
37
+ * @returns Whether the value is a non-empty array or not.
38
38
  */
39
39
  export declare function isNonEmptyArray<T>(value: any): value is T[];
40
40
  /**
41
41
  * Validates that a value is a boolean.
42
42
  *
43
- * @param {any} value The value to validate.
44
- * @return {boolean} Whether the value is a boolean or not.
43
+ * @param value - The value to validate.
44
+ * @returns Whether the value is a boolean or not.
45
45
  */
46
46
  export declare function isBoolean(value: any): boolean;
47
47
  /**
48
48
  * Validates that a value is a number.
49
49
  *
50
- * @param {any} value The value to validate.
51
- * @return {boolean} Whether the value is a number or not.
50
+ * @param value - The value to validate.
51
+ * @returns Whether the value is a number or not.
52
52
  */
53
53
  export declare function isNumber(value: any): boolean;
54
54
  /**
55
55
  * Validates that a value is a string.
56
56
  *
57
- * @param {any} value The value to validate.
58
- * @return {boolean} Whether the value is a string or not.
57
+ * @param value - The value to validate.
58
+ * @returns Whether the value is a string or not.
59
59
  */
60
60
  export declare function isString(value: any): value is string;
61
61
  /**
62
62
  * Validates that a value is a base64 string.
63
63
  *
64
- * @param {any} value The value to validate.
65
- * @return {boolean} Whether the value is a base64 string or not.
64
+ * @param value - The value to validate.
65
+ * @returns Whether the value is a base64 string or not.
66
66
  */
67
67
  export declare function isBase64String(value: any): boolean;
68
68
  /**
69
69
  * Validates that a value is a non-empty string.
70
70
  *
71
- * @param {any} value The value to validate.
72
- * @return {boolean} Whether the value is a non-empty string or not.
71
+ * @param value - The value to validate.
72
+ * @returns Whether the value is a non-empty string or not.
73
73
  */
74
74
  export declare function isNonEmptyString(value: any): value is string;
75
75
  /**
76
76
  * Validates that a value is a nullable object.
77
77
  *
78
- * @param {any} value The value to validate.
79
- * @return {boolean} Whether the value is an object or not.
78
+ * @param value - The value to validate.
79
+ * @returns Whether the value is an object or not.
80
80
  */
81
81
  export declare function isObject(value: any): boolean;
82
82
  /**
83
83
  * Validates that a value is a non-null object.
84
84
  *
85
- * @param {any} value The value to validate.
86
- * @return {boolean} Whether the value is a non-null object or not.
85
+ * @param value - The value to validate.
86
+ * @returns Whether the value is a non-null object or not.
87
87
  */
88
88
  export declare function isNonNullObject<T>(value: T | null | undefined): value is T;
89
89
  /**
90
90
  * Validates that a string is a valid Firebase Auth uid.
91
91
  *
92
- * @param {any} uid The string to validate.
93
- * @return {boolean} Whether the string is a valid Firebase Auth uid.
92
+ * @param uid - The string to validate.
93
+ * @returns Whether the string is a valid Firebase Auth uid.
94
94
  */
95
95
  export declare function isUid(uid: any): boolean;
96
96
  /**
97
97
  * Validates that a string is a valid Firebase Auth password.
98
98
  *
99
- * @param {any} password The password string to validate.
100
- * @return {boolean} Whether the string is a valid Firebase Auth password.
99
+ * @param password - The password string to validate.
100
+ * @returns Whether the string is a valid Firebase Auth password.
101
101
  */
102
102
  export declare function isPassword(password: any): boolean;
103
103
  /**
104
104
  * Validates that a string is a valid email.
105
105
  *
106
- * @param {any} email The string to validate.
107
- * @return {boolean} Whether the string is valid email or not.
106
+ * @param email - The string to validate.
107
+ * @returns Whether the string is valid email or not.
108
108
  */
109
109
  export declare function isEmail(email: any): boolean;
110
110
  /**
111
111
  * Validates that a string is a valid phone number.
112
112
  *
113
- * @param {any} phoneNumber The string to validate.
114
- * @return {boolean} Whether the string is a valid phone number or not.
113
+ * @param phoneNumber - The string to validate.
114
+ * @returns Whether the string is a valid phone number or not.
115
115
  */
116
116
  export declare function isPhoneNumber(phoneNumber: any): boolean;
117
117
  /**
118
118
  * Validates that a string is a valid ISO date string.
119
119
  *
120
- * @param dateString The string to validate.
121
- * @return Whether the string is a valid ISO date string.
120
+ * @param dateString - The string to validate.
121
+ * @returns Whether the string is a valid ISO date string.
122
122
  */
123
123
  export declare function isISODateString(dateString: any): boolean;
124
124
  /**
125
125
  * Validates that a string is a valid UTC date string.
126
126
  *
127
- * @param dateString The string to validate.
128
- * @return Whether the string is a valid UTC date string.
127
+ * @param dateString - The string to validate.
128
+ * @returns Whether the string is a valid UTC date string.
129
129
  */
130
130
  export declare function isUTCDateString(dateString: any): boolean;
131
131
  /**
132
132
  * Validates that a string is a valid web URL.
133
133
  *
134
- * @param {any} urlStr The string to validate.
135
- * @return {boolean} Whether the string is valid web URL or not.
134
+ * @param urlStr - The string to validate.
135
+ * @returns Whether the string is valid web URL or not.
136
136
  */
137
137
  export declare function isURL(urlStr: any): boolean;
138
138
  /**
139
139
  * Validates that the provided topic is a valid FCM topic name.
140
140
  *
141
- * @param {any} topic The topic to validate.
142
- * @return {boolean} Whether the provided topic is a valid FCM topic name.
141
+ * @param topic - The topic to validate.
142
+ * @returns Whether the provided topic is a valid FCM topic name.
143
143
  */
144
144
  export declare function isTopic(topic: any): boolean;
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v9.100.0-alpha.0 */
1
+ /*! firebase-admin v10.0.2 */
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,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase-admin",
3
- "version": "9.100.0-alpha.0",
3
+ "version": "10.0.2",
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",
@@ -11,7 +11,7 @@
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",
23
+ "apidocs": "run-s api-extractor:local api-documenter",
24
24
  "api-extractor": "node generate-reports.js",
25
- "api-extractor:local": "npm run build && node generate-reports.js --local"
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": [
@@ -57,95 +62,163 @@
57
62
  "types": "./lib/index.d.ts",
58
63
  "typesVersions": {
59
64
  "*": {
60
- "app": ["lib/app"],
61
- "auth": ["lib/auth"],
62
- "database": ["lib/database"],
63
- "firestore": ["lib/firestore"],
64
- "instance-id": ["lib/instance-id"],
65
- "machine-learning": ["lib/machine-learning"],
66
- "messaging": ["lib/messaging"],
67
- "project-management": ["lib/project-management"],
68
- "remote-config": ["lib/remote-config"],
69
- "security-rules": ["lib/security-rules"],
70
- "storage": ["lib/storage"]
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
+ ]
71
104
  }
72
105
  },
73
106
  "exports": {
74
107
  ".": "./lib/index.js",
75
- "./app": "./lib/app/index.js",
76
- "./auth": "./lib/auth/index.js",
77
- "./database": "./lib/database/index.js",
78
- "./firestore": "./lib/firestore/index.js",
79
- "./instance-id": "./lib/instance-id/index.js",
80
- "./machine-learning": "./lib/machine-learning/index.js",
81
- "./messaging": "./lib/messaging/index.js",
82
- "./project-management": "./lib/project-management/index.js",
83
- "./remote-config": "./lib/remote-config/index.js",
84
- "./security-rules": "./lib/security-rules/index.js",
85
- "./storage": "./lib/storage/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
+ }
86
160
  },
87
161
  "dependencies": {
88
- "@firebase/database": "^0.8.1",
89
- "@firebase/database-types": "^0.6.1",
90
- "@types/node": "^10.10.0",
162
+ "@firebase/database-compat": "^0.1.1",
163
+ "@firebase/database-types": "^0.9.3",
164
+ "@types/node": ">=12.12.47",
91
165
  "dicer": "^0.3.0",
92
166
  "jsonwebtoken": "^8.5.1",
93
- "node-forge": "^0.10.0"
167
+ "jwks-rsa": "^2.0.2",
168
+ "node-forge": "^1.0.0"
94
169
  },
95
170
  "optionalDependencies": {
96
171
  "@google-cloud/firestore": "^4.5.0",
97
172
  "@google-cloud/storage": "^5.3.0"
98
173
  },
99
174
  "devDependencies": {
100
- "@firebase/app": "^0.6.13",
101
- "@firebase/auth": "^0.15.2",
102
- "@firebase/auth-types": "^0.10.1",
175
+ "@firebase/api-documenter": "^0.1.2",
176
+ "@firebase/app-compat": "^0.1.2",
177
+ "@firebase/auth-compat": "^0.2.5",
178
+ "@firebase/auth-types": "^0.11.0",
103
179
  "@microsoft/api-extractor": "^7.11.2",
104
- "@types/bcrypt": "^2.0.0",
180
+ "@types/bcrypt": "^5.0.0",
105
181
  "@types/chai": "^4.0.0",
106
182
  "@types/chai-as-promised": "^7.1.0",
107
183
  "@types/firebase-token-generator": "^2.0.28",
108
- "@types/jsonwebtoken": "^8.5.0",
184
+ "@types/jsonwebtoken": "8.5.1",
109
185
  "@types/lodash": "^4.14.104",
110
186
  "@types/minimist": "^1.2.0",
111
- "@types/mocha": "^2.2.48",
112
- "@types/nock": "^9.1.0",
187
+ "@types/mocha": "^9.0.0",
188
+ "@types/nock": "^11.1.0",
113
189
  "@types/request": "^2.47.0",
114
190
  "@types/request-promise": "^4.1.41",
115
- "@types/sinon": "^9.0.0",
191
+ "@types/sinon": "^10.0.2",
116
192
  "@types/sinon-chai": "^3.0.0",
117
- "@typescript-eslint/eslint-plugin": "^2.20.0",
118
- "@typescript-eslint/parser": "^2.20.0",
193
+ "@typescript-eslint/eslint-plugin": "^5.0.0",
194
+ "@typescript-eslint/parser": "^5.0.0",
119
195
  "bcrypt": "^5.0.0",
120
196
  "chai": "^4.2.0",
121
197
  "chai-as-promised": "^7.0.0",
122
- "chalk": "^1.1.3",
198
+ "chalk": "^4.1.1",
123
199
  "child-process-promise": "^2.2.1",
124
- "del": "^2.2.1",
125
- "eslint": "^6.8.0",
200
+ "del": "^6.0.0",
201
+ "eslint": "^7.1.0",
126
202
  "firebase-token-generator": "^2.0.0",
127
203
  "gulp": "^4.0.2",
128
- "gulp-filter": "^6.0.0",
129
- "gulp-header": "^1.8.8",
130
- "gulp-replace": "^0.5.4",
204
+ "gulp-filter": "^7.0.0",
205
+ "gulp-header": "^2.0.9",
131
206
  "gulp-typescript": "^5.0.1",
132
207
  "http-message-parser": "^0.0.34",
133
- "jsdom": "^15.0.0",
134
208
  "lodash": "^4.17.15",
135
209
  "minimist": "^1.2.0",
136
- "mocha": "^8.0.0",
210
+ "mocha": "^9.1.2",
137
211
  "mz": "^2.7.0",
138
212
  "nock": "^13.0.0",
139
213
  "npm-run-all": "^4.1.5",
140
- "nyc": "^14.1.0",
214
+ "nyc": "^15.1.0",
141
215
  "request": "^2.75.0",
142
216
  "request-promise": "^4.1.1",
143
- "run-sequence": "^1.1.5",
217
+ "run-sequence": "^2.2.1",
144
218
  "sinon": "^9.0.0",
145
219
  "sinon-chai": "^3.0.0",
146
- "ts-node": "^9.0.0",
147
- "typedoc": "^0.19.2",
220
+ "ts-node": "^10.2.0",
148
221
  "typescript": "^3.7.3",
149
- "yargs": "^16.0.0"
222
+ "yargs": "^17.0.1"
150
223
  }
151
224
  }