@firebase/functions-compat 0.1.4 → 0.1.5-2021102231614

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @firebase/functions-compat
2
2
 
3
+ ## 0.1.5-2021102231614
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2322b6023`](https://github.com/firebase/firebase-js-sdk/commit/2322b6023c628cd9f4f4172767c17d215dd91684) [#5693](https://github.com/firebase/firebase-js-sdk/pull/5693) - Add exports field to all packages
8
+
9
+ - Updated dependencies [[`2322b6023`](https://github.com/firebase/firebase-js-sdk/commit/2322b6023c628cd9f4f4172767c17d215dd91684)]:
10
+ - @firebase/app-compat@0.1.7-2021102231614
11
+ - @firebase/component@0.5.8-2021102231614
12
+ - @firebase/functions@0.7.4-2021102231614
13
+ - @firebase/util@1.4.1-2021102231614
14
+
3
15
  ## 0.1.4
4
16
 
5
17
  ### Patch Changes
@@ -4,7 +4,7 @@ import { FirebaseError } from '@firebase/util';
4
4
  import { Component } from '@firebase/component';
5
5
 
6
6
  const name = "@firebase/functions-compat";
7
- const version = "0.1.4";
7
+ const version = "0.1.5-2021102231614";
8
8
 
9
9
  /**
10
10
  * @license
@@ -4,7 +4,7 @@ import { FirebaseError } from '@firebase/util';
4
4
  import { Component } from '@firebase/component';
5
5
 
6
6
  var name = "@firebase/functions-compat";
7
- var version = "0.1.4";
7
+ var version = "0.1.5-2021102231614";
8
8
 
9
9
  /**
10
10
  * @license
@@ -10,7 +10,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
10
10
  var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
11
11
 
12
12
  var name = "@firebase/functions-compat";
13
- var version = "0.1.4";
13
+ var version = "0.1.5-2021102231614";
14
14
 
15
15
  /**
16
16
  * @license
@@ -0,0 +1,108 @@
1
+ import firebase from '@firebase/app-compat';
2
+ import { httpsCallable, connectFunctionsEmulator } from '@firebase/functions';
3
+ import { FirebaseError } from '@firebase/util';
4
+ import { Component } from '@firebase/component';
5
+
6
+ const name = "@firebase/functions-compat";
7
+ const version = "0.1.5-2021102231614";
8
+
9
+ /**
10
+ * @license
11
+ * Copyright 2020 Google LLC
12
+ *
13
+ * Licensed under the Apache License, Version 2.0 (the "License");
14
+ * you may not use this file except in compliance with the License.
15
+ * You may obtain a copy of the License at
16
+ *
17
+ * http://www.apache.org/licenses/LICENSE-2.0
18
+ *
19
+ * Unless required by applicable law or agreed to in writing, software
20
+ * distributed under the License is distributed on an "AS IS" BASIS,
21
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
+ * See the License for the specific language governing permissions and
23
+ * limitations under the License.
24
+ */
25
+ class FunctionsService {
26
+ constructor(app, _delegate) {
27
+ this.app = app;
28
+ this._delegate = _delegate;
29
+ this._region = this._delegate.region;
30
+ this._customDomain = this._delegate.customDomain;
31
+ }
32
+ httpsCallable(name, options) {
33
+ return httpsCallable(this._delegate, name, options);
34
+ }
35
+ /**
36
+ * Deprecated in pre-modularized repo, does not exist in modularized
37
+ * functions package, need to convert to "host" and "port" args that
38
+ * `useFunctionsEmulatorExp` takes.
39
+ * @deprecated
40
+ */
41
+ useFunctionsEmulator(origin) {
42
+ const match = origin.match('[a-zA-Z]+://([a-zA-Z0-9.-]+)(?::([0-9]+))?');
43
+ if (match == null) {
44
+ throw new FirebaseError('functions', 'No origin provided to useFunctionsEmulator()');
45
+ }
46
+ if (match[2] == null) {
47
+ throw new FirebaseError('functions', 'Port missing in origin provided to useFunctionsEmulator()');
48
+ }
49
+ return connectFunctionsEmulator(this._delegate, match[1], Number(match[2]));
50
+ }
51
+ useEmulator(host, port) {
52
+ return connectFunctionsEmulator(this._delegate, host, port);
53
+ }
54
+ }
55
+
56
+ /**
57
+ * @license
58
+ * Copyright 2020 Google LLC
59
+ *
60
+ * Licensed under the Apache License, Version 2.0 (the "License");
61
+ * you may not use this file except in compliance with the License.
62
+ * You may obtain a copy of the License at
63
+ *
64
+ * http://www.apache.org/licenses/LICENSE-2.0
65
+ *
66
+ * Unless required by applicable law or agreed to in writing, software
67
+ * distributed under the License is distributed on an "AS IS" BASIS,
68
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
69
+ * See the License for the specific language governing permissions and
70
+ * limitations under the License.
71
+ */
72
+ const DEFAULT_REGION = 'us-central1';
73
+ const factory = (container, { instanceIdentifier: regionOrCustomDomain }) => {
74
+ // Dependencies
75
+ const app = container.getProvider('app-compat').getImmediate();
76
+ const functionsServiceExp = container.getProvider('functions').getImmediate({
77
+ identifier: regionOrCustomDomain !== null && regionOrCustomDomain !== void 0 ? regionOrCustomDomain : DEFAULT_REGION
78
+ });
79
+ return new FunctionsService(app, functionsServiceExp);
80
+ };
81
+ function registerFunctions() {
82
+ const namespaceExports = {
83
+ Functions: FunctionsService
84
+ };
85
+ firebase.INTERNAL.registerComponent(new Component('functions-compat', factory, "PUBLIC" /* PUBLIC */)
86
+ .setServiceProps(namespaceExports)
87
+ .setMultipleInstances(true));
88
+ }
89
+
90
+ /**
91
+ * @license
92
+ * Copyright 2020 Google LLC
93
+ *
94
+ * Licensed under the Apache License, Version 2.0 (the "License");
95
+ * you may not use this file except in compliance with the License.
96
+ * You may obtain a copy of the License at
97
+ *
98
+ * http://www.apache.org/licenses/LICENSE-2.0
99
+ *
100
+ * Unless required by applicable law or agreed to in writing, software
101
+ * distributed under the License is distributed on an "AS IS" BASIS,
102
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
103
+ * See the License for the specific language governing permissions and
104
+ * limitations under the License.
105
+ */
106
+ registerFunctions();
107
+ firebase.registerVersion(name, version, 'node');
108
+ //# sourceMappingURL=index.node.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.node.esm.js","sources":["../../src/service.ts","../../src/register.ts","../../src/index.node.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseFunctions, HttpsCallable } from '@firebase/functions-types';\nimport {\n httpsCallable as httpsCallableExp,\n connectFunctionsEmulator as useFunctionsEmulatorExp,\n HttpsCallableOptions,\n Functions as FunctionsServiceExp\n} from '@firebase/functions';\nimport { FirebaseApp, _FirebaseService } from '@firebase/app-compat';\nimport { FirebaseError } from '@firebase/util';\n\nexport class FunctionsService implements FirebaseFunctions, _FirebaseService {\n /**\n * For testing.\n * @internal\n */\n _region: string;\n /**\n * For testing.\n * @internal\n */\n _customDomain: string | null;\n\n constructor(\n public app: FirebaseApp,\n readonly _delegate: FunctionsServiceExp\n ) {\n this._region = this._delegate.region;\n this._customDomain = this._delegate.customDomain;\n }\n httpsCallable(name: string, options?: HttpsCallableOptions): HttpsCallable {\n return httpsCallableExp(this._delegate, name, options);\n }\n /**\n * Deprecated in pre-modularized repo, does not exist in modularized\n * functions package, need to convert to \"host\" and \"port\" args that\n * `useFunctionsEmulatorExp` takes.\n * @deprecated\n */\n useFunctionsEmulator(origin: string): void {\n const match = origin.match('[a-zA-Z]+://([a-zA-Z0-9.-]+)(?::([0-9]+))?');\n if (match == null) {\n throw new FirebaseError(\n 'functions',\n 'No origin provided to useFunctionsEmulator()'\n );\n }\n if (match[2] == null) {\n throw new FirebaseError(\n 'functions',\n 'Port missing in origin provided to useFunctionsEmulator()'\n );\n }\n return useFunctionsEmulatorExp(this._delegate, match[1], Number(match[2]));\n }\n useEmulator(host: string, port: number): void {\n return useFunctionsEmulatorExp(this._delegate, host, port);\n }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport firebase, { _FirebaseNamespace } from '@firebase/app-compat';\nimport { FunctionsService } from './service';\nimport {\n Component,\n ComponentType,\n InstanceFactory,\n ComponentContainer,\n InstanceFactoryOptions\n} from '@firebase/component';\n\nconst DEFAULT_REGION = 'us-central1';\n\nconst factory: InstanceFactory<'functions-compat'> = (\n container: ComponentContainer,\n { instanceIdentifier: regionOrCustomDomain }: InstanceFactoryOptions\n) => {\n // Dependencies\n const app = container.getProvider('app-compat').getImmediate();\n const functionsServiceExp = container.getProvider('functions').getImmediate({\n identifier: regionOrCustomDomain ?? DEFAULT_REGION\n });\n\n return new FunctionsService(app, functionsServiceExp);\n};\n\nexport function registerFunctions(): void {\n const namespaceExports = {\n Functions: FunctionsService\n };\n (firebase as _FirebaseNamespace).INTERNAL.registerComponent(\n new Component('functions-compat', factory, ComponentType.PUBLIC)\n .setServiceProps(namespaceExports)\n .setMultipleInstances(true)\n );\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport firebase from '@firebase/app-compat';\nimport { name, version } from '../package.json';\nimport { registerFunctions } from './register';\n\nregisterFunctions();\nfirebase.registerVersion(name, version, 'node');\n"],"names":["httpsCall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C,CAAC,YAAY,EAAE,CAAC;IAC/D,MAAM,mBAAmB,GAAG,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC;QAC1E,UAAU,EAAE,oBAAoB,aAApB,oBAAoB,cAApB,oBAAoB,GAAI,cAAc;KACnD,CAAC,CAAC;IAEH,OAAO,IAAI,gBAAgB,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;AACxD,CAAC,CAAC;SAEc,iBAAiB;IAC/B,MAAM,gBAAgB,GAAG;QACvB,SAAS,EAAE,gBAAgB;KAC5B,CAAC;IACD,QAA+B,CAAC,QAAQ,CAAC,iBAAiB,CACzD,IAAI,SAAS,CAAC,kBAAkB,EAAE,OAAO,wBAAuB;SAC7D,eAAe,CAAC,gBAAgB,CAAC;SACjC,oBAAoB,CAAC,IAAI,CAAC,CAC9B,CAAC;AACJ;;ACnDA;;;;;;;;;;;;;;;;AAqBA,iBAAiB,EAAE,CAAC;AACpB,QAAQ,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1 @@
1
+ export declare const TEST_PROJECT: any;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 Google LLC
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
+ import * as types from '@firebase/functions-types';
18
+ declare module '@firebase/app-compat' {
19
+ interface FirebaseNamespace {
20
+ functions: {
21
+ (app?: FirebaseApp): types.FirebaseFunctions;
22
+ Functions: typeof types.FirebaseFunctions;
23
+ };
24
+ }
25
+ interface FirebaseApp {
26
+ functions(regionOrCustomDomain?: string): types.FirebaseFunctions;
27
+ }
28
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 Google LLC
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,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 Google LLC
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 declare function registerFunctions(): void;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2020 Google LLC
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
+ import { FirebaseFunctions, HttpsCallable } from '@firebase/functions-types';
18
+ import { HttpsCallableOptions, Functions as FunctionsServiceExp } from '@firebase/functions';
19
+ import { FirebaseApp, _FirebaseService } from '@firebase/app-compat';
20
+ export declare class FunctionsService implements FirebaseFunctions, _FirebaseService {
21
+ app: FirebaseApp;
22
+ readonly _delegate: FunctionsServiceExp;
23
+ /**
24
+ * For testing.
25
+ * @internal
26
+ */
27
+ _region: string;
28
+ /**
29
+ * For testing.
30
+ * @internal
31
+ */
32
+ _customDomain: string | null;
33
+ constructor(app: FirebaseApp, _delegate: FunctionsServiceExp);
34
+ httpsCallable(name: string, options?: HttpsCallableOptions): HttpsCallable;
35
+ /**
36
+ * Deprecated in pre-modularized repo, does not exist in modularized
37
+ * functions package, need to convert to "host" and "port" args that
38
+ * `useFunctionsEmulatorExp` takes.
39
+ * @deprecated
40
+ */
41
+ useFunctionsEmulator(origin: string): void;
42
+ useEmulator(host: string, port: number): void;
43
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
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
+ import { FirebaseApp } from '@firebase/app-compat';
18
+ import { FunctionsService } from '../src/service';
19
+ export declare function createTestService(app: FirebaseApp, regionOrCustomDomain?: string): FunctionsService;
package/package.json CHANGED
@@ -1,20 +1,31 @@
1
1
  {
2
2
  "name": "@firebase/functions-compat",
3
- "version": "0.1.4",
3
+ "version": "0.1.5-2021102231614",
4
4
  "description": "",
5
5
  "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
6
6
  "main": "dist/index.node.cjs.js",
7
7
  "browser": "dist/index.esm2017.js",
8
8
  "module": "dist/index.esm2017.js",
9
+ "esm5": "dist/index.esm5.js",
10
+ "exports": {
11
+ ".": {
12
+ "node": {
13
+ "import": "./dist/node-esm/index.node.esm.js",
14
+ "require": "./dist/index.node.cjs.js"
15
+ },
16
+ "default": "./dist/index.esm2017.js"
17
+ },
18
+ "./package.json": "./package.json"
19
+ },
9
20
  "files": [
10
21
  "dist"
11
22
  ],
12
23
  "license": "Apache-2.0",
13
24
  "peerDependencies": {
14
- "@firebase/app-compat": "0.x"
25
+ "@firebase/app-compat": "0.1.7-2021102231614"
15
26
  },
16
27
  "devDependencies": {
17
- "@firebase/app-compat": "0.1.5",
28
+ "@firebase/app-compat": "0.1.7-2021102231614",
18
29
  "rollup": "2.57.0",
19
30
  "@rollup/plugin-json": "4.1.0",
20
31
  "rollup-plugin-typescript2": "0.30.0",
@@ -46,10 +57,10 @@
46
57
  },
47
58
  "typings": "dist/src/index.d.ts",
48
59
  "dependencies": {
49
- "@firebase/component": "0.5.7",
50
- "@firebase/functions": "0.7.3",
60
+ "@firebase/component": "0.5.8-2021102231614",
61
+ "@firebase/functions": "0.7.4-2021102231614",
51
62
  "@firebase/functions-types": "0.5.0",
52
- "@firebase/util": "1.4.0",
63
+ "@firebase/util": "1.4.1-2021102231614",
53
64
  "tslib": "^2.1.0"
54
65
  },
55
66
  "nyc": {
@@ -57,6 +68,5 @@
57
68
  ".ts"
58
69
  ],
59
70
  "reportDir": "./coverage/node"
60
- },
61
- "esm5": "dist/index.esm5.js"
71
+ }
62
72
  }