No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.esm5.js 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. import firebase from '@firebase/app-compat';
  2. import { Component } from '@firebase/component';
  3. import { activate, ensureInitialized, fetchConfig, fetchAndActivate, getAll, getBoolean, getNumber, getString, getValue, setLogLevel, isSupported } from '@firebase/remote-config';
  4. /**
  5. * @license
  6. * Copyright 2020 Google LLC
  7. *
  8. * Licensed under the Apache License, Version 2.0 (the "License");
  9. * you may not use this file except in compliance with the License.
  10. * You may obtain a copy of the License at
  11. *
  12. * http://www.apache.org/licenses/LICENSE-2.0
  13. *
  14. * Unless required by applicable law or agreed to in writing, software
  15. * distributed under the License is distributed on an "AS IS" BASIS,
  16. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17. * See the License for the specific language governing permissions and
  18. * limitations under the License.
  19. */
  20. var RemoteConfigCompatImpl = /** @class */ (function () {
  21. function RemoteConfigCompatImpl(app, _delegate) {
  22. this.app = app;
  23. this._delegate = _delegate;
  24. }
  25. Object.defineProperty(RemoteConfigCompatImpl.prototype, "defaultConfig", {
  26. get: function () {
  27. return this._delegate.defaultConfig;
  28. },
  29. set: function (value) {
  30. this._delegate.defaultConfig = value;
  31. },
  32. enumerable: false,
  33. configurable: true
  34. });
  35. Object.defineProperty(RemoteConfigCompatImpl.prototype, "fetchTimeMillis", {
  36. get: function () {
  37. return this._delegate.fetchTimeMillis;
  38. },
  39. enumerable: false,
  40. configurable: true
  41. });
  42. Object.defineProperty(RemoteConfigCompatImpl.prototype, "lastFetchStatus", {
  43. get: function () {
  44. return this._delegate.lastFetchStatus;
  45. },
  46. enumerable: false,
  47. configurable: true
  48. });
  49. Object.defineProperty(RemoteConfigCompatImpl.prototype, "settings", {
  50. get: function () {
  51. return this._delegate.settings;
  52. },
  53. set: function (value) {
  54. this._delegate.settings = value;
  55. },
  56. enumerable: false,
  57. configurable: true
  58. });
  59. RemoteConfigCompatImpl.prototype.activate = function () {
  60. return activate(this._delegate);
  61. };
  62. RemoteConfigCompatImpl.prototype.ensureInitialized = function () {
  63. return ensureInitialized(this._delegate);
  64. };
  65. /**
  66. * @throws a {@link ErrorCode.FETCH_CLIENT_TIMEOUT} if the request takes longer than
  67. * {@link Settings.fetchTimeoutInSeconds} or
  68. * {@link DEFAULT_FETCH_TIMEOUT_SECONDS}.
  69. */
  70. RemoteConfigCompatImpl.prototype.fetch = function () {
  71. return fetchConfig(this._delegate);
  72. };
  73. RemoteConfigCompatImpl.prototype.fetchAndActivate = function () {
  74. return fetchAndActivate(this._delegate);
  75. };
  76. RemoteConfigCompatImpl.prototype.getAll = function () {
  77. return getAll(this._delegate);
  78. };
  79. RemoteConfigCompatImpl.prototype.getBoolean = function (key) {
  80. return getBoolean(this._delegate, key);
  81. };
  82. RemoteConfigCompatImpl.prototype.getNumber = function (key) {
  83. return getNumber(this._delegate, key);
  84. };
  85. RemoteConfigCompatImpl.prototype.getString = function (key) {
  86. return getString(this._delegate, key);
  87. };
  88. RemoteConfigCompatImpl.prototype.getValue = function (key) {
  89. return getValue(this._delegate, key);
  90. };
  91. // Based on packages/firestore/src/util/log.ts but not static because we need per-instance levels
  92. // to differentiate 2p and 3p use-cases.
  93. RemoteConfigCompatImpl.prototype.setLogLevel = function (logLevel) {
  94. setLogLevel(this._delegate, logLevel);
  95. };
  96. return RemoteConfigCompatImpl;
  97. }());
  98. var name = "@firebase/remote-config-compat";
  99. var version = "0.2.1";
  100. /**
  101. * @license
  102. * Copyright 2020 Google LLC
  103. *
  104. * Licensed under the Apache License, Version 2.0 (the "License");
  105. * you may not use this file except in compliance with the License.
  106. * You may obtain a copy of the License at
  107. *
  108. * http://www.apache.org/licenses/LICENSE-2.0
  109. *
  110. * Unless required by applicable law or agreed to in writing, software
  111. * distributed under the License is distributed on an "AS IS" BASIS,
  112. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  113. * See the License for the specific language governing permissions and
  114. * limitations under the License.
  115. */
  116. function registerRemoteConfigCompat(firebaseInstance) {
  117. firebaseInstance.INTERNAL.registerComponent(new Component('remoteConfig-compat', remoteConfigFactory, "PUBLIC" /* ComponentType.PUBLIC */)
  118. .setMultipleInstances(true)
  119. .setServiceProps({ isSupported: isSupported }));
  120. firebaseInstance.registerVersion(name, version);
  121. }
  122. function remoteConfigFactory(container, _a) {
  123. var namespace = _a.instanceIdentifier;
  124. var app = container.getProvider('app-compat').getImmediate();
  125. // The following call will always succeed because rc `import {...} from '@firebase/remote-config'`
  126. var remoteConfig = container.getProvider('remote-config').getImmediate({
  127. identifier: namespace
  128. });
  129. return new RemoteConfigCompatImpl(app, remoteConfig);
  130. }
  131. registerRemoteConfigCompat(firebase);
  132. //# sourceMappingURL=index.esm5.js.map