Нема описа
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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. 'use strict';
  2. var firebase = require('@firebase/app-compat');
  3. var functions = require('@firebase/functions');
  4. var util = require('@firebase/util');
  5. var component = require('@firebase/component');
  6. function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  7. var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
  8. var name = "@firebase/functions-compat";
  9. var version = "0.3.1";
  10. /**
  11. * @license
  12. * Copyright 2020 Google LLC
  13. *
  14. * Licensed under the Apache License, Version 2.0 (the "License");
  15. * you may not use this file except in compliance with the License.
  16. * You may obtain a copy of the License at
  17. *
  18. * http://www.apache.org/licenses/LICENSE-2.0
  19. *
  20. * Unless required by applicable law or agreed to in writing, software
  21. * distributed under the License is distributed on an "AS IS" BASIS,
  22. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  23. * See the License for the specific language governing permissions and
  24. * limitations under the License.
  25. */
  26. var FunctionsService = /** @class */ (function () {
  27. function FunctionsService(app, _delegate) {
  28. this.app = app;
  29. this._delegate = _delegate;
  30. this._region = this._delegate.region;
  31. this._customDomain = this._delegate.customDomain;
  32. }
  33. FunctionsService.prototype.httpsCallable = function (name, options) {
  34. return functions.httpsCallable(this._delegate, name, options);
  35. };
  36. FunctionsService.prototype.httpsCallableFromURL = function (url, options) {
  37. return functions.httpsCallableFromURL(this._delegate, url, options);
  38. };
  39. /**
  40. * Deprecated in pre-modularized repo, does not exist in modularized
  41. * functions package, need to convert to "host" and "port" args that
  42. * `useFunctionsEmulatorExp` takes.
  43. * @deprecated
  44. */
  45. FunctionsService.prototype.useFunctionsEmulator = function (origin) {
  46. var match = origin.match('[a-zA-Z]+://([a-zA-Z0-9.-]+)(?::([0-9]+))?');
  47. if (match == null) {
  48. throw new util.FirebaseError('functions', 'No origin provided to useFunctionsEmulator()');
  49. }
  50. if (match[2] == null) {
  51. throw new util.FirebaseError('functions', 'Port missing in origin provided to useFunctionsEmulator()');
  52. }
  53. return functions.connectFunctionsEmulator(this._delegate, match[1], Number(match[2]));
  54. };
  55. FunctionsService.prototype.useEmulator = function (host, port) {
  56. return functions.connectFunctionsEmulator(this._delegate, host, port);
  57. };
  58. return FunctionsService;
  59. }());
  60. /**
  61. * @license
  62. * Copyright 2020 Google LLC
  63. *
  64. * Licensed under the Apache License, Version 2.0 (the "License");
  65. * you may not use this file except in compliance with the License.
  66. * You may obtain a copy of the License at
  67. *
  68. * http://www.apache.org/licenses/LICENSE-2.0
  69. *
  70. * Unless required by applicable law or agreed to in writing, software
  71. * distributed under the License is distributed on an "AS IS" BASIS,
  72. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  73. * See the License for the specific language governing permissions and
  74. * limitations under the License.
  75. */
  76. var DEFAULT_REGION = 'us-central1';
  77. var factory = function (container, _a) {
  78. var regionOrCustomDomain = _a.instanceIdentifier;
  79. // Dependencies
  80. var app = container.getProvider('app-compat').getImmediate();
  81. var functionsServiceExp = container.getProvider('functions').getImmediate({
  82. identifier: regionOrCustomDomain !== null && regionOrCustomDomain !== void 0 ? regionOrCustomDomain : DEFAULT_REGION
  83. });
  84. return new FunctionsService(app, functionsServiceExp);
  85. };
  86. function registerFunctions() {
  87. var namespaceExports = {
  88. Functions: FunctionsService
  89. };
  90. firebase__default["default"].INTERNAL.registerComponent(new component.Component('functions-compat', factory, "PUBLIC" /* ComponentType.PUBLIC */)
  91. .setServiceProps(namespaceExports)
  92. .setMultipleInstances(true));
  93. }
  94. /**
  95. * @license
  96. * Copyright 2020 Google LLC
  97. *
  98. * Licensed under the Apache License, Version 2.0 (the "License");
  99. * you may not use this file except in compliance with the License.
  100. * You may obtain a copy of the License at
  101. *
  102. * http://www.apache.org/licenses/LICENSE-2.0
  103. *
  104. * Unless required by applicable law or agreed to in writing, software
  105. * distributed under the License is distributed on an "AS IS" BASIS,
  106. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  107. * See the License for the specific language governing permissions and
  108. * limitations under the License.
  109. */
  110. registerFunctions();
  111. firebase__default["default"].registerVersion(name, version, 'node');
  112. //# sourceMappingURL=index.node.cjs.js.map