firebase-admin 12.0.0 → 12.1.1

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 (218) hide show
  1. package/lib/app/core.d.ts +1 -1
  2. package/lib/app/core.js +1 -1
  3. package/lib/app/credential-factory.d.ts +1 -1
  4. package/lib/app/credential-factory.js +1 -1
  5. package/lib/app/credential-internal.d.ts +1 -1
  6. package/lib/app/credential-internal.js +1 -1
  7. package/lib/app/credential.d.ts +1 -1
  8. package/lib/app/credential.js +1 -1
  9. package/lib/app/firebase-app.d.ts +1 -1
  10. package/lib/app/firebase-app.js +1 -1
  11. package/lib/app/firebase-namespace.d.ts +1 -1
  12. package/lib/app/firebase-namespace.js +1 -1
  13. package/lib/app/index.d.ts +2 -1
  14. package/lib/app/index.js +5 -2
  15. package/lib/app/lifecycle.d.ts +1 -1
  16. package/lib/app/lifecycle.js +1 -1
  17. package/lib/app-check/app-check-api-client-internal.d.ts +1 -1
  18. package/lib/app-check/app-check-api-client-internal.js +1 -1
  19. package/lib/app-check/app-check-api.d.ts +1 -1
  20. package/lib/app-check/app-check-api.js +1 -1
  21. package/lib/app-check/app-check-namespace.d.ts +1 -1
  22. package/lib/app-check/app-check-namespace.js +1 -1
  23. package/lib/app-check/app-check.d.ts +1 -1
  24. package/lib/app-check/app-check.js +1 -1
  25. package/lib/app-check/index.d.ts +1 -1
  26. package/lib/app-check/index.js +1 -1
  27. package/lib/app-check/token-generator.d.ts +1 -1
  28. package/lib/app-check/token-generator.js +1 -1
  29. package/lib/app-check/token-verifier.d.ts +1 -1
  30. package/lib/app-check/token-verifier.js +1 -1
  31. package/lib/auth/action-code-settings-builder.d.ts +1 -1
  32. package/lib/auth/action-code-settings-builder.js +1 -1
  33. package/lib/auth/auth-api-request.d.ts +1 -1
  34. package/lib/auth/auth-api-request.js +1 -1
  35. package/lib/auth/auth-config.d.ts +1 -1
  36. package/lib/auth/auth-config.js +1 -1
  37. package/lib/auth/auth-namespace.d.ts +1 -1
  38. package/lib/auth/auth-namespace.js +1 -1
  39. package/lib/auth/auth.d.ts +1 -1
  40. package/lib/auth/auth.js +1 -1
  41. package/lib/auth/base-auth.d.ts +1 -1
  42. package/lib/auth/base-auth.js +1 -1
  43. package/lib/auth/identifier.d.ts +1 -1
  44. package/lib/auth/identifier.js +1 -1
  45. package/lib/auth/index.d.ts +2 -1
  46. package/lib/auth/index.js +5 -2
  47. package/lib/auth/project-config-manager.d.ts +1 -1
  48. package/lib/auth/project-config-manager.js +1 -1
  49. package/lib/auth/project-config.d.ts +1 -1
  50. package/lib/auth/project-config.js +1 -1
  51. package/lib/auth/tenant-manager.d.ts +1 -1
  52. package/lib/auth/tenant-manager.js +1 -1
  53. package/lib/auth/tenant.d.ts +1 -1
  54. package/lib/auth/tenant.js +1 -1
  55. package/lib/auth/token-generator.d.ts +1 -1
  56. package/lib/auth/token-generator.js +1 -1
  57. package/lib/auth/token-verifier.d.ts +1 -1
  58. package/lib/auth/token-verifier.js +16 -10
  59. package/lib/auth/user-import-builder.d.ts +1 -1
  60. package/lib/auth/user-import-builder.js +1 -1
  61. package/lib/auth/user-record.d.ts +1 -1
  62. package/lib/auth/user-record.js +1 -1
  63. package/lib/credential/index.d.ts +1 -1
  64. package/lib/credential/index.js +1 -1
  65. package/lib/database/database-namespace.d.ts +17 -17
  66. package/lib/database/database-namespace.js +1 -1
  67. package/lib/database/database.d.ts +3 -3
  68. package/lib/database/database.js +1 -1
  69. package/lib/database/index.d.ts +6 -5
  70. package/lib/database/index.js +8 -6
  71. package/lib/default-namespace.d.ts +1 -1
  72. package/lib/default-namespace.js +1 -1
  73. package/lib/esm/app/index.js +2 -0
  74. package/lib/esm/auth/index.js +2 -0
  75. package/lib/esm/database/index.js +1 -0
  76. package/lib/esm/firestore/index.js +1 -0
  77. package/lib/esm/installations/index.js +2 -0
  78. package/lib/esm/instance-id/index.js +2 -0
  79. package/lib/esm/messaging/index.js +2 -0
  80. package/lib/esm/project-management/index.js +1 -0
  81. package/lib/esm/remote-config/index.js +1 -0
  82. package/lib/eventarc/cloudevent.d.ts +1 -1
  83. package/lib/eventarc/cloudevent.js +1 -1
  84. package/lib/eventarc/eventarc-client-internal.d.ts +1 -1
  85. package/lib/eventarc/eventarc-client-internal.js +1 -1
  86. package/lib/eventarc/eventarc-utils.d.ts +1 -1
  87. package/lib/eventarc/eventarc-utils.js +1 -1
  88. package/lib/eventarc/eventarc.d.ts +1 -1
  89. package/lib/eventarc/eventarc.js +1 -1
  90. package/lib/eventarc/index.d.ts +1 -1
  91. package/lib/eventarc/index.js +1 -1
  92. package/lib/extensions/extensions-api-client-internal.d.ts +1 -1
  93. package/lib/extensions/extensions-api-client-internal.js +1 -1
  94. package/lib/extensions/extensions-api.d.ts +1 -1
  95. package/lib/extensions/extensions-api.js +1 -1
  96. package/lib/extensions/extensions.d.ts +1 -1
  97. package/lib/extensions/extensions.js +1 -1
  98. package/lib/extensions/index.d.ts +1 -1
  99. package/lib/extensions/index.js +1 -1
  100. package/lib/firebase-namespace-api.d.ts +1 -1
  101. package/lib/firebase-namespace-api.js +1 -1
  102. package/lib/firestore/firestore-internal.d.ts +1 -1
  103. package/lib/firestore/firestore-internal.js +1 -1
  104. package/lib/firestore/firestore-namespace.d.ts +1 -1
  105. package/lib/firestore/firestore-namespace.js +1 -1
  106. package/lib/firestore/index.d.ts +2 -1
  107. package/lib/firestore/index.js +4 -2
  108. package/lib/functions/functions-api-client-internal.d.ts +1 -1
  109. package/lib/functions/functions-api-client-internal.js +1 -1
  110. package/lib/functions/functions-api.d.ts +1 -1
  111. package/lib/functions/functions-api.js +1 -1
  112. package/lib/functions/functions.d.ts +1 -1
  113. package/lib/functions/functions.js +1 -1
  114. package/lib/functions/index.d.ts +1 -1
  115. package/lib/functions/index.js +1 -1
  116. package/lib/index.d.ts +1 -1
  117. package/lib/index.js +1 -1
  118. package/lib/installations/index.d.ts +2 -1
  119. package/lib/installations/index.js +5 -2
  120. package/lib/installations/installations-namespace.d.ts +1 -1
  121. package/lib/installations/installations-namespace.js +1 -1
  122. package/lib/installations/installations-request-handler.d.ts +1 -1
  123. package/lib/installations/installations-request-handler.js +1 -1
  124. package/lib/installations/installations.d.ts +1 -1
  125. package/lib/installations/installations.js +1 -1
  126. package/lib/instance-id/index.d.ts +2 -1
  127. package/lib/instance-id/index.js +5 -2
  128. package/lib/instance-id/instance-id-namespace.d.ts +1 -1
  129. package/lib/instance-id/instance-id-namespace.js +1 -1
  130. package/lib/instance-id/instance-id.d.ts +1 -1
  131. package/lib/instance-id/instance-id.js +1 -1
  132. package/lib/machine-learning/index.d.ts +1 -1
  133. package/lib/machine-learning/index.js +1 -1
  134. package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
  135. package/lib/machine-learning/machine-learning-api-client.js +1 -1
  136. package/lib/machine-learning/machine-learning-namespace.d.ts +1 -1
  137. package/lib/machine-learning/machine-learning-namespace.js +1 -1
  138. package/lib/machine-learning/machine-learning-utils.d.ts +1 -1
  139. package/lib/machine-learning/machine-learning-utils.js +1 -1
  140. package/lib/machine-learning/machine-learning.d.ts +1 -1
  141. package/lib/machine-learning/machine-learning.js +1 -1
  142. package/lib/messaging/batch-request-internal.d.ts +1 -1
  143. package/lib/messaging/batch-request-internal.js +1 -1
  144. package/lib/messaging/index.d.ts +2 -1
  145. package/lib/messaging/index.js +5 -2
  146. package/lib/messaging/messaging-api-request-internal.d.ts +1 -1
  147. package/lib/messaging/messaging-api-request-internal.js +1 -1
  148. package/lib/messaging/messaging-api.d.ts +1 -1
  149. package/lib/messaging/messaging-api.js +1 -1
  150. package/lib/messaging/messaging-errors-internal.d.ts +1 -1
  151. package/lib/messaging/messaging-errors-internal.js +1 -1
  152. package/lib/messaging/messaging-internal.d.ts +1 -1
  153. package/lib/messaging/messaging-internal.js +1 -1
  154. package/lib/messaging/messaging-namespace.d.ts +1 -1
  155. package/lib/messaging/messaging-namespace.js +1 -1
  156. package/lib/messaging/messaging.d.ts +1 -1
  157. package/lib/messaging/messaging.js +2 -2
  158. package/lib/project-management/android-app.d.ts +1 -1
  159. package/lib/project-management/android-app.js +1 -1
  160. package/lib/project-management/app-metadata.d.ts +1 -1
  161. package/lib/project-management/app-metadata.js +1 -1
  162. package/lib/project-management/index.d.ts +2 -1
  163. package/lib/project-management/index.js +4 -2
  164. package/lib/project-management/ios-app.d.ts +1 -1
  165. package/lib/project-management/ios-app.js +1 -1
  166. package/lib/project-management/project-management-api-request-internal.d.ts +1 -1
  167. package/lib/project-management/project-management-api-request-internal.js +1 -1
  168. package/lib/project-management/project-management-namespace.d.ts +1 -1
  169. package/lib/project-management/project-management-namespace.js +1 -1
  170. package/lib/project-management/project-management.d.ts +1 -1
  171. package/lib/project-management/project-management.js +1 -1
  172. package/lib/remote-config/condition-evaluator-internal.d.ts +17 -0
  173. package/lib/remote-config/condition-evaluator-internal.js +130 -0
  174. package/lib/remote-config/index.d.ts +2 -2
  175. package/lib/remote-config/index.js +4 -2
  176. package/lib/remote-config/internal/value-impl.d.ts +17 -0
  177. package/lib/remote-config/internal/value-impl.js +59 -0
  178. package/lib/remote-config/remote-config-api-client-internal.d.ts +1 -1
  179. package/lib/remote-config/remote-config-api-client-internal.js +41 -3
  180. package/lib/remote-config/remote-config-api.d.ts +310 -2
  181. package/lib/remote-config/remote-config-api.js +29 -1
  182. package/lib/remote-config/remote-config-namespace.d.ts +1 -1
  183. package/lib/remote-config/remote-config-namespace.js +1 -1
  184. package/lib/remote-config/remote-config.d.ts +11 -2
  185. package/lib/remote-config/remote-config.js +176 -1
  186. package/lib/security-rules/index.d.ts +1 -1
  187. package/lib/security-rules/index.js +1 -1
  188. package/lib/security-rules/security-rules-api-client-internal.d.ts +1 -1
  189. package/lib/security-rules/security-rules-api-client-internal.js +1 -1
  190. package/lib/security-rules/security-rules-internal.d.ts +1 -1
  191. package/lib/security-rules/security-rules-internal.js +1 -1
  192. package/lib/security-rules/security-rules-namespace.d.ts +1 -1
  193. package/lib/security-rules/security-rules-namespace.js +1 -1
  194. package/lib/security-rules/security-rules.d.ts +1 -1
  195. package/lib/security-rules/security-rules.js +1 -1
  196. package/lib/storage/index.d.ts +1 -1
  197. package/lib/storage/index.js +1 -1
  198. package/lib/storage/storage-namespace.d.ts +1 -1
  199. package/lib/storage/storage-namespace.js +1 -1
  200. package/lib/storage/storage.d.ts +1 -1
  201. package/lib/storage/storage.js +1 -1
  202. package/lib/storage/utils.d.ts +1 -1
  203. package/lib/storage/utils.js +1 -1
  204. package/lib/utils/api-request.d.ts +1 -1
  205. package/lib/utils/api-request.js +1 -1
  206. package/lib/utils/crypto-signer.d.ts +1 -1
  207. package/lib/utils/crypto-signer.js +1 -1
  208. package/lib/utils/deep-copy.d.ts +1 -1
  209. package/lib/utils/deep-copy.js +1 -1
  210. package/lib/utils/error.d.ts +1 -77
  211. package/lib/utils/error.js +73 -46
  212. package/lib/utils/index.d.ts +1 -1
  213. package/lib/utils/index.js +1 -1
  214. package/lib/utils/jwt.d.ts +1 -1
  215. package/lib/utils/jwt.js +1 -1
  216. package/lib/utils/validator.d.ts +1 -1
  217. package/lib/utils/validator.js +1 -1
  218. package/package.json +9 -7
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  /*!
3
3
  * Copyright 2019 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2019 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -50,3 +50,4 @@ export { AndroidConfig, AndroidFcmOptions, AndroidNotification, ApnsConfig, Apns
50
50
  * app.
51
51
  */
52
52
  export declare function getMessaging(app?: App): Messaging;
53
+ export { FirebaseMessagingError, MessagingClientErrorCode } from '../utils/error';
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.getMessaging = exports.Messaging = void 0;
19
+ exports.MessagingClientErrorCode = exports.FirebaseMessagingError = exports.getMessaging = exports.Messaging = void 0;
20
20
  /**
21
21
  * Firebase Cloud Messaging (FCM).
22
22
  *
@@ -60,3 +60,6 @@ function getMessaging(app) {
60
60
  return firebaseApp.getOrInitService('messaging', (app) => new messaging_1.Messaging(app));
61
61
  }
62
62
  exports.getMessaging = getMessaging;
63
+ var error_1 = require("../utils/error");
64
+ Object.defineProperty(exports, "FirebaseMessagingError", { enumerable: true, get: function () { return error_1.FirebaseMessagingError; } });
65
+ Object.defineProperty(exports, "MessagingClientErrorCode", { enumerable: true, get: function () { return error_1.MessagingClientErrorCode; } });
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2017 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  /*!
3
3
  * Copyright 2019 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2019 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2017 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -235,7 +235,7 @@ class Messaging {
235
235
  }
236
236
  return this.getUrlPath()
237
237
  .then((urlPath) => {
238
- const requests = copy.map((message) => {
238
+ const requests = copy.map(async (message) => {
239
239
  (0, messaging_internal_1.validateMessage)(message);
240
240
  const request = { message };
241
241
  if (dryRun) {
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  /*!
3
3
  * Copyright 2018 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2018 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -51,3 +51,4 @@ export { IosApp, IosAppMetadata } from './ios-app';
51
51
  * `ProjectManagement` service associated with the provided app.
52
52
  */
53
53
  export declare function getProjectManagement(app?: App): ProjectManagement;
54
+ export { FirebaseProjectManagementError, ProjectManagementErrorCode } from '../utils/error';
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.getProjectManagement = exports.IosApp = exports.ShaCertificate = exports.AndroidApp = exports.ProjectManagement = exports.AppPlatform = void 0;
19
+ exports.FirebaseProjectManagementError = exports.getProjectManagement = exports.IosApp = exports.ShaCertificate = exports.AndroidApp = exports.ProjectManagement = exports.AppPlatform = void 0;
20
20
  /**
21
21
  * Firebase project management.
22
22
  *
@@ -66,3 +66,5 @@ function getProjectManagement(app) {
66
66
  return firebaseApp.getOrInitService('projectManagement', (app) => new project_management_1.ProjectManagement(app));
67
67
  }
68
68
  exports.getProjectManagement = getProjectManagement;
69
+ var error_1 = require("../utils/error");
70
+ Object.defineProperty(exports, "FirebaseProjectManagementError", { enumerable: true, get: function () { return error_1.FirebaseProjectManagementError; } });
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  /*!
3
3
  * Copyright 2018 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2018 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  /*!
3
3
  * Copyright 2018 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2018 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  /*!
3
3
  * Copyright 2018 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2018 Google Inc.
@@ -0,0 +1,17 @@
1
+ /*! firebase-admin v12.1.1 */
2
+ /*!
3
+ * Copyright 2024 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -0,0 +1,130 @@
1
+ /*! firebase-admin v12.1.1 */
2
+ /*!
3
+ * Copyright 2024 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ 'use strict';
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.ConditionEvaluator = void 0;
20
+ const remote_config_api_1 = require("./remote-config-api");
21
+ const farmhash = require("farmhash");
22
+ const long = require("long");
23
+ /**
24
+ * Encapsulates condition evaluation logic to simplify organization and
25
+ * facilitate testing.
26
+ *
27
+ * @internal
28
+ */
29
+ class ConditionEvaluator {
30
+ evaluateConditions(namedConditions, context) {
31
+ // The order of the conditions is significant.
32
+ // A JS Map preserves the order of insertion ("Iteration happens in insertion order"
33
+ // - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#description).
34
+ const evaluatedConditions = new Map();
35
+ for (const namedCondition of namedConditions) {
36
+ evaluatedConditions.set(namedCondition.name, this.evaluateCondition(namedCondition.condition, context));
37
+ }
38
+ return evaluatedConditions;
39
+ }
40
+ evaluateCondition(condition, context, nestingLevel = 0) {
41
+ if (nestingLevel >= ConditionEvaluator.MAX_CONDITION_RECURSION_DEPTH) {
42
+ // TODO: add logging once we have a wrapped logger.
43
+ return false;
44
+ }
45
+ if (condition.orCondition) {
46
+ return this.evaluateOrCondition(condition.orCondition, context, nestingLevel + 1);
47
+ }
48
+ if (condition.andCondition) {
49
+ return this.evaluateAndCondition(condition.andCondition, context, nestingLevel + 1);
50
+ }
51
+ if (condition.true) {
52
+ return true;
53
+ }
54
+ if (condition.false) {
55
+ return false;
56
+ }
57
+ if (condition.percent) {
58
+ return this.evaluatePercentCondition(condition.percent, context);
59
+ }
60
+ // TODO: add logging once we have a wrapped logger.
61
+ return false;
62
+ }
63
+ evaluateOrCondition(orCondition, context, nestingLevel) {
64
+ const subConditions = orCondition.conditions || [];
65
+ for (const subCondition of subConditions) {
66
+ // Recursive call.
67
+ const result = this.evaluateCondition(subCondition, context, nestingLevel + 1);
68
+ // Short-circuit the evaluation result for true.
69
+ if (result) {
70
+ return result;
71
+ }
72
+ }
73
+ return false;
74
+ }
75
+ evaluateAndCondition(andCondition, context, nestingLevel) {
76
+ const subConditions = andCondition.conditions || [];
77
+ for (const subCondition of subConditions) {
78
+ // Recursive call.
79
+ const result = this.evaluateCondition(subCondition, context, nestingLevel + 1);
80
+ // Short-circuit the evaluation result for false.
81
+ if (!result) {
82
+ return result;
83
+ }
84
+ }
85
+ return true;
86
+ }
87
+ evaluatePercentCondition(percentCondition, context) {
88
+ if (!context.randomizationId) {
89
+ // TODO: add logging once we have a wrapped logger.
90
+ return false;
91
+ }
92
+ // This is the entry point for processing percent condition data from the response.
93
+ // We're not using a proto library, so we can't assume undefined fields have
94
+ // default values.
95
+ const { seed, percentOperator, microPercent, microPercentRange } = percentCondition;
96
+ if (!percentOperator) {
97
+ // TODO: add logging once we have a wrapped logger.
98
+ return false;
99
+ }
100
+ const normalizedMicroPercent = microPercent || 0;
101
+ const normalizedMicroPercentUpperBound = microPercentRange?.microPercentUpperBound || 0;
102
+ const normalizedMicroPercentLowerBound = microPercentRange?.microPercentLowerBound || 0;
103
+ const seedPrefix = seed && seed.length > 0 ? `${seed}.` : '';
104
+ const stringToHash = `${seedPrefix}${context.randomizationId}`;
105
+ // Using a 64-bit long for consistency with the Remote Config fetch endpoint.
106
+ let hash64 = long.fromString(farmhash.fingerprint64(stringToHash));
107
+ // Negate the hash if its value is less than 0. We handle this manually because the
108
+ // Long library doesn't provided an absolute value method.
109
+ if (hash64.lt(0)) {
110
+ hash64 = hash64.negate();
111
+ }
112
+ const instanceMicroPercentile = hash64.mod(100 * 1000000);
113
+ switch (percentOperator) {
114
+ case remote_config_api_1.PercentConditionOperator.LESS_OR_EQUAL:
115
+ return instanceMicroPercentile.lte(normalizedMicroPercent);
116
+ case remote_config_api_1.PercentConditionOperator.GREATER_THAN:
117
+ return instanceMicroPercentile.gt(normalizedMicroPercent);
118
+ case remote_config_api_1.PercentConditionOperator.BETWEEN:
119
+ return instanceMicroPercentile.gt(normalizedMicroPercentLowerBound)
120
+ && instanceMicroPercentile.lte(normalizedMicroPercentUpperBound);
121
+ case remote_config_api_1.PercentConditionOperator.UNKNOWN:
122
+ default:
123
+ break;
124
+ }
125
+ // TODO: add logging once we have a wrapped logger.
126
+ return false;
127
+ }
128
+ }
129
+ exports.ConditionEvaluator = ConditionEvaluator;
130
+ ConditionEvaluator.MAX_CONDITION_RECURSION_DEPTH = 10;
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -21,7 +21,7 @@
21
21
  */
22
22
  import { App } from '../app';
23
23
  import { RemoteConfig } from './remote-config';
24
- export { ExplicitParameterValue, InAppDefaultValue, ListVersionsOptions, ListVersionsResult, ParameterValueType, RemoteConfigCondition, RemoteConfigParameter, RemoteConfigParameterGroup, RemoteConfigParameterValue, RemoteConfigTemplate, RemoteConfigUser, TagColor, Version, } from './remote-config-api';
24
+ export { AndCondition, DefaultConfig, EvaluationContext, ExplicitParameterValue, GetServerTemplateOptions, InAppDefaultValue, InitServerTemplateOptions, ListVersionsOptions, ListVersionsResult, MicroPercentRange, NamedCondition, OneOfCondition, OrCondition, ParameterValueType, PercentConditionOperator, PercentCondition, RemoteConfigCondition, RemoteConfigParameter, RemoteConfigParameterGroup, RemoteConfigParameterValue, RemoteConfigTemplate, RemoteConfigUser, ServerConfig, ServerTemplate, ServerTemplateData, ServerTemplateDataType, TagColor, Value, ValueSource, Version, } from './remote-config-api';
25
25
  export { RemoteConfig } from './remote-config';
26
26
  /**
27
27
  * Gets the {@link RemoteConfig} service for the default app or a given app.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.getRemoteConfig = exports.RemoteConfig = void 0;
19
+ exports.getRemoteConfig = exports.RemoteConfig = exports.PercentConditionOperator = void 0;
20
20
  /**
21
21
  * Firebase Remote Config.
22
22
  *
@@ -24,6 +24,8 @@ exports.getRemoteConfig = exports.RemoteConfig = void 0;
24
24
  */
25
25
  const app_1 = require("../app");
26
26
  const remote_config_1 = require("./remote-config");
27
+ var remote_config_api_1 = require("./remote-config-api");
28
+ Object.defineProperty(exports, "PercentConditionOperator", { enumerable: true, get: function () { return remote_config_api_1.PercentConditionOperator; } });
27
29
  var remote_config_2 = require("./remote-config");
28
30
  Object.defineProperty(exports, "RemoteConfig", { enumerable: true, get: function () { return remote_config_2.RemoteConfig; } });
29
31
  /**
@@ -0,0 +1,17 @@
1
+ /*! firebase-admin v12.1.1 */
2
+ /*!
3
+ * Copyright 2024 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -0,0 +1,59 @@
1
+ /*! firebase-admin v12.1.1 */
2
+ /*!
3
+ * Copyright 2024 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ 'use strict';
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.ValueImpl = void 0;
20
+ /**
21
+ * Implements type-safe getters for parameter values.
22
+ *
23
+ * Visible for testing.
24
+ *
25
+ * @internal
26
+ */
27
+ class ValueImpl {
28
+ constructor(source, value = ValueImpl.DEFAULT_VALUE_FOR_STRING) {
29
+ this.source = source;
30
+ this.value = value;
31
+ }
32
+ asString() {
33
+ return this.value;
34
+ }
35
+ asBoolean() {
36
+ if (this.source === 'static') {
37
+ return ValueImpl.DEFAULT_VALUE_FOR_BOOLEAN;
38
+ }
39
+ return ValueImpl.BOOLEAN_TRUTHY_VALUES.indexOf(this.value.toLowerCase()) >= 0;
40
+ }
41
+ asNumber() {
42
+ if (this.source === 'static') {
43
+ return ValueImpl.DEFAULT_VALUE_FOR_NUMBER;
44
+ }
45
+ const num = Number(this.value);
46
+ if (isNaN(num)) {
47
+ return ValueImpl.DEFAULT_VALUE_FOR_NUMBER;
48
+ }
49
+ return num;
50
+ }
51
+ getSource() {
52
+ return this.source;
53
+ }
54
+ }
55
+ exports.ValueImpl = ValueImpl;
56
+ ValueImpl.DEFAULT_VALUE_FOR_BOOLEAN = false;
57
+ ValueImpl.DEFAULT_VALUE_FOR_STRING = '';
58
+ ValueImpl.DEFAULT_VALUE_FOR_NUMBER = 0;
59
+ ValueImpl.BOOLEAN_TRUTHY_VALUES = ['1', 'true', 't', 'yes', 'y', 'on'];
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.0.0 */
1
+ /*! firebase-admin v12.1.1 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *