@firebase/functions-compat 0.3.15 → 0.3.16
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/dist/esm/index.esm2017.js +98 -98
- package/dist/esm/index.esm2017.js.map +1 -1
- package/dist/esm/src/callable.test.d.ts +1 -1
- package/dist/esm/src/index.d.ts +28 -28
- package/dist/esm/src/register.d.ts +17 -17
- package/dist/esm/src/service.d.ts +44 -44
- package/dist/esm/src/service.test.d.ts +1 -1
- package/dist/esm/test/utils.d.ts +19 -19
- package/dist/index.cjs.js +98 -98
- package/dist/index.cjs.js.map +1 -1
- package/dist/src/callable.test.d.ts +1 -1
- package/dist/src/index.d.ts +28 -28
- package/dist/src/register.d.ts +17 -17
- package/dist/src/service.d.ts +44 -44
- package/dist/src/service.test.d.ts +1 -1
- package/dist/test/utils.d.ts +19 -19
- package/package.json +7 -7
|
@@ -4,108 +4,108 @@ 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.3.
|
|
7
|
+
const version = "0.3.16";
|
|
8
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
|
-
httpsCallableFromURL(url, options) {
|
|
36
|
-
return httpsCallableFromURL(this._delegate, url, options);
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Deprecated in pre-modularized repo, does not exist in modularized
|
|
40
|
-
* functions package, need to convert to "host" and "port" args that
|
|
41
|
-
* `useFunctionsEmulatorExp` takes.
|
|
42
|
-
* @deprecated
|
|
43
|
-
*/
|
|
44
|
-
useFunctionsEmulator(origin) {
|
|
45
|
-
const match = origin.match('[a-zA-Z]+://([a-zA-Z0-9.-]+)(?::([0-9]+))?');
|
|
46
|
-
if (match == null) {
|
|
47
|
-
throw new FirebaseError('functions', 'No origin provided to useFunctionsEmulator()');
|
|
48
|
-
}
|
|
49
|
-
if (match[2] == null) {
|
|
50
|
-
throw new FirebaseError('functions', 'Port missing in origin provided to useFunctionsEmulator()');
|
|
51
|
-
}
|
|
52
|
-
return connectFunctionsEmulator(this._delegate, match[1], Number(match[2]));
|
|
53
|
-
}
|
|
54
|
-
useEmulator(host, port) {
|
|
55
|
-
return connectFunctionsEmulator(this._delegate, host, port);
|
|
56
|
-
}
|
|
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
|
+
httpsCallableFromURL(url, options) {
|
|
36
|
+
return httpsCallableFromURL(this._delegate, url, options);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Deprecated in pre-modularized repo, does not exist in modularized
|
|
40
|
+
* functions package, need to convert to "host" and "port" args that
|
|
41
|
+
* `useFunctionsEmulatorExp` takes.
|
|
42
|
+
* @deprecated
|
|
43
|
+
*/
|
|
44
|
+
useFunctionsEmulator(origin) {
|
|
45
|
+
const match = origin.match('[a-zA-Z]+://([a-zA-Z0-9.-]+)(?::([0-9]+))?');
|
|
46
|
+
if (match == null) {
|
|
47
|
+
throw new FirebaseError('functions', 'No origin provided to useFunctionsEmulator()');
|
|
48
|
+
}
|
|
49
|
+
if (match[2] == null) {
|
|
50
|
+
throw new FirebaseError('functions', 'Port missing in origin provided to useFunctionsEmulator()');
|
|
51
|
+
}
|
|
52
|
+
return connectFunctionsEmulator(this._delegate, match[1], Number(match[2]));
|
|
53
|
+
}
|
|
54
|
+
useEmulator(host, port) {
|
|
55
|
+
return connectFunctionsEmulator(this._delegate, host, port);
|
|
56
|
+
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
/**
|
|
60
|
-
* @license
|
|
61
|
-
* Copyright 2020 Google LLC
|
|
62
|
-
*
|
|
63
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
64
|
-
* you may not use this file except in compliance with the License.
|
|
65
|
-
* You may obtain a copy of the License at
|
|
66
|
-
*
|
|
67
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
68
|
-
*
|
|
69
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
70
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
71
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
72
|
-
* See the License for the specific language governing permissions and
|
|
73
|
-
* limitations under the License.
|
|
74
|
-
*/
|
|
75
|
-
const DEFAULT_REGION = 'us-central1';
|
|
76
|
-
const factory = (container, { instanceIdentifier: regionOrCustomDomain }) => {
|
|
77
|
-
// Dependencies
|
|
78
|
-
const app = container.getProvider('app-compat').getImmediate();
|
|
79
|
-
const functionsServiceExp = container.getProvider('functions').getImmediate({
|
|
80
|
-
identifier: regionOrCustomDomain !== null && regionOrCustomDomain !== void 0 ? regionOrCustomDomain : DEFAULT_REGION
|
|
81
|
-
});
|
|
82
|
-
return new FunctionsService(app, functionsServiceExp);
|
|
83
|
-
};
|
|
84
|
-
function registerFunctions() {
|
|
85
|
-
const namespaceExports = {
|
|
86
|
-
Functions: FunctionsService
|
|
87
|
-
};
|
|
88
|
-
firebase.INTERNAL.registerComponent(new Component('functions-compat', factory, "PUBLIC" /* ComponentType.PUBLIC */)
|
|
89
|
-
.setServiceProps(namespaceExports)
|
|
90
|
-
.setMultipleInstances(true));
|
|
59
|
+
/**
|
|
60
|
+
* @license
|
|
61
|
+
* Copyright 2020 Google LLC
|
|
62
|
+
*
|
|
63
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
64
|
+
* you may not use this file except in compliance with the License.
|
|
65
|
+
* You may obtain a copy of the License at
|
|
66
|
+
*
|
|
67
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
68
|
+
*
|
|
69
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
70
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
71
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
72
|
+
* See the License for the specific language governing permissions and
|
|
73
|
+
* limitations under the License.
|
|
74
|
+
*/
|
|
75
|
+
const DEFAULT_REGION = 'us-central1';
|
|
76
|
+
const factory = (container, { instanceIdentifier: regionOrCustomDomain }) => {
|
|
77
|
+
// Dependencies
|
|
78
|
+
const app = container.getProvider('app-compat').getImmediate();
|
|
79
|
+
const functionsServiceExp = container.getProvider('functions').getImmediate({
|
|
80
|
+
identifier: regionOrCustomDomain !== null && regionOrCustomDomain !== void 0 ? regionOrCustomDomain : DEFAULT_REGION
|
|
81
|
+
});
|
|
82
|
+
return new FunctionsService(app, functionsServiceExp);
|
|
83
|
+
};
|
|
84
|
+
function registerFunctions() {
|
|
85
|
+
const namespaceExports = {
|
|
86
|
+
Functions: FunctionsService
|
|
87
|
+
};
|
|
88
|
+
firebase.INTERNAL.registerComponent(new Component('functions-compat', factory, "PUBLIC" /* ComponentType.PUBLIC */)
|
|
89
|
+
.setServiceProps(namespaceExports)
|
|
90
|
+
.setMultipleInstances(true));
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
/**
|
|
94
|
-
* @license
|
|
95
|
-
* Copyright 2020 Google LLC
|
|
96
|
-
*
|
|
97
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
98
|
-
* you may not use this file except in compliance with the License.
|
|
99
|
-
* You may obtain a copy of the License at
|
|
100
|
-
*
|
|
101
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
102
|
-
*
|
|
103
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
104
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
105
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
106
|
-
* See the License for the specific language governing permissions and
|
|
107
|
-
* limitations under the License.
|
|
108
|
-
*/
|
|
109
|
-
registerFunctions();
|
|
93
|
+
/**
|
|
94
|
+
* @license
|
|
95
|
+
* Copyright 2020 Google LLC
|
|
96
|
+
*
|
|
97
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
98
|
+
* you may not use this file except in compliance with the License.
|
|
99
|
+
* You may obtain a copy of the License at
|
|
100
|
+
*
|
|
101
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
102
|
+
*
|
|
103
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
104
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
105
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
106
|
+
* See the License for the specific language governing permissions and
|
|
107
|
+
* limitations under the License.
|
|
108
|
+
*/
|
|
109
|
+
registerFunctions();
|
|
110
110
|
firebase.registerVersion(name, version);
|
|
111
111
|
//# sourceMappingURL=index.esm2017.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm2017.js","sources":["../../src/service.ts","../../src/register.ts","../../src/index.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 httpsCallableFromURL as httpsCallableFromURLExp,\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 httpsCallableFromURL(\n url: string,\n options?: HttpsCallableOptions\n ): HttpsCallable {\n return httpsCallableFromURLExp(this._delegate, url, 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';\nimport * as types from '@firebase/functions-types';\n\nregisterFunctions();\nfirebase.registerVersion(name, version);\n\ndeclare module '@firebase/app-compat' {\n interface FirebaseNamespace {\n functions: {\n (app?: FirebaseApp): types.FirebaseFunctions;\n Functions: typeof types.FirebaseFunctions;\n };\n }\n interface FirebaseApp {\n functions(regionOrCustomDomain?: string): types.FirebaseFunctions;\n }\n}\n"],"names":["httpsCallableExp","httpsCallableFromURLExp","useFunctionsEmulatorExp"],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;MAaU,gBAAgB,CAAA;IAY3B,WACS,CAAA,GAAgB,EACd,SAA8B,EAAA;QADhC,IAAG,CAAA,GAAA,GAAH,GAAG,CAAa;QACd,IAAS,CAAA,SAAA,GAAT,SAAS,CAAqB;QAEvC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;QACrC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;KAClD;IACD,aAAa,CAAC,IAAY,EAAE,OAA8B,EAAA;QACxD,OAAOA,aAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;KACxD;IACD,oBAAoB,CAClB,GAAW,EACX,OAA8B,EAAA;QAE9B,OAAOC,oBAAuB,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;KAC9D;AACD;;;;;AAKG;AACH,IAAA,oBAAoB,CAAC,MAAc,EAAA;QACjC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.esm2017.js","sources":["../../src/service.ts","../../src/register.ts","../../src/index.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 httpsCallableFromURL as httpsCallableFromURLExp,\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 httpsCallableFromURL(\n url: string,\n options?: HttpsCallableOptions\n ): HttpsCallable {\n return httpsCallableFromURLExp(this._delegate, url, 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';\nimport * as types from '@firebase/functions-types';\n\nregisterFunctions();\nfirebase.registerVersion(name, version);\n\ndeclare module '@firebase/app-compat' {\n interface FirebaseNamespace {\n functions: {\n (app?: FirebaseApp): types.FirebaseFunctions;\n Functions: typeof types.FirebaseFunctions;\n };\n }\n interface FirebaseApp {\n functions(regionOrCustomDomain?: string): types.FirebaseFunctions;\n }\n}\n"],"names":["httpsCallableExp","httpsCallableFromURLExp","useFunctionsEmulatorExp"],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;MAaU,gBAAgB,CAAA;IAY3B,WACS,CAAA,GAAgB,EACd,SAA8B,EAAA;QADhC,IAAG,CAAA,GAAA,GAAH,GAAG,CAAa;QACd,IAAS,CAAA,SAAA,GAAT,SAAS,CAAqB;QAEvC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;QACrC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;KAClD;IACD,aAAa,CAAC,IAAY,EAAE,OAA8B,EAAA;QACxD,OAAOA,aAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;KACxD;IACD,oBAAoB,CAClB,GAAW,EACX,OAA8B,EAAA;QAE9B,OAAOC,oBAAuB,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;KAC9D;AACD;;;;;AAKG;AACH,IAAA,oBAAoB,CAAC,MAAc,EAAA;QACjC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;AACzE,QAAA,IAAI,KAAK,IAAI,IAAI,EAAE;AACjB,YAAA,MAAM,IAAI,aAAa,CACrB,WAAW,EACX,8CAA8C,CAC/C,CAAC;SACH;AACD,QAAA,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE;AACpB,YAAA,MAAM,IAAI,aAAa,CACrB,WAAW,EACX,2DAA2D,CAC5D,CAAC;SACH;AACD,QAAA,OAAOC,wBAAuB,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC5E;IACD,WAAW,CAAC,IAAY,EAAE,IAAY,EAAA;QACpC,OAAOA,wBAAuB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;KAC5D;AACF;;ACjFD;;;;;;;;;;;;;;;AAeG;AAYH,MAAM,cAAc,GAAG,aAAa,CAAC;AAErC,MAAM,OAAO,GAAwC,CACnD,SAA6B,EAC7B,EAAE,kBAAkB,EAAE,oBAAoB,EAA0B,KAClE;;IAEF,MAAM,GAAG,GAAG,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,YAAY,EAAE,CAAC;IAC/D,MAAM,mBAAmB,GAAG,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC;AAC1E,QAAA,UAAU,EAAE,oBAAoB,KAAA,IAAA,IAApB,oBAAoB,KAApB,KAAA,CAAA,GAAA,oBAAoB,GAAI,cAAc;AACnD,KAAA,CAAC,CAAC;AAEH,IAAA,OAAO,IAAI,gBAAgB,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;AACxD,CAAC,CAAC;SAEc,iBAAiB,GAAA;AAC/B,IAAA,MAAM,gBAAgB,GAAG;AACvB,QAAA,SAAS,EAAE,gBAAgB;KAC5B,CAAC;IACD,QAA+B,CAAC,QAAQ,CAAC,iBAAiB,CACzD,IAAI,SAAS,CAAC,kBAAkB,EAAE,OAAO,EAAuB,QAAA,4BAAA;SAC7D,eAAe,CAAC,gBAAgB,CAAC;AACjC,SAAA,oBAAoB,CAAC,IAAI,CAAC,CAC9B,CAAC;AACJ;;ACnDA;;;;;;;;;;;;;;;AAeG;AAOH,iBAAiB,EAAE,CAAC;AACpB,QAAQ,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const TEST_PROJECT: any;
|
|
1
|
+
export declare const TEST_PROJECT: any;
|
package/dist/esm/src/index.d.ts
CHANGED
|
@@ -1,28 +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
|
-
}
|
|
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
|
+
}
|
|
@@ -1,17 +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;
|
|
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;
|
|
@@ -1,44 +1,44 @@
|
|
|
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
|
-
httpsCallableFromURL(url: string, options?: HttpsCallableOptions): HttpsCallable;
|
|
36
|
-
/**
|
|
37
|
-
* Deprecated in pre-modularized repo, does not exist in modularized
|
|
38
|
-
* functions package, need to convert to "host" and "port" args that
|
|
39
|
-
* `useFunctionsEmulatorExp` takes.
|
|
40
|
-
* @deprecated
|
|
41
|
-
*/
|
|
42
|
-
useFunctionsEmulator(origin: string): void;
|
|
43
|
-
useEmulator(host: string, port: number): void;
|
|
44
|
-
}
|
|
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
|
+
httpsCallableFromURL(url: string, options?: HttpsCallableOptions): HttpsCallable;
|
|
36
|
+
/**
|
|
37
|
+
* Deprecated in pre-modularized repo, does not exist in modularized
|
|
38
|
+
* functions package, need to convert to "host" and "port" args that
|
|
39
|
+
* `useFunctionsEmulatorExp` takes.
|
|
40
|
+
* @deprecated
|
|
41
|
+
*/
|
|
42
|
+
useFunctionsEmulator(origin: string): void;
|
|
43
|
+
useEmulator(host: string, port: number): void;
|
|
44
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/dist/esm/test/utils.d.ts
CHANGED
|
@@ -1,19 +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;
|
|
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/dist/index.cjs.js
CHANGED
|
@@ -10,108 +10,108 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
|
|
11
11
|
|
|
12
12
|
const name = "@firebase/functions-compat";
|
|
13
|
-
const version = "0.3.
|
|
13
|
+
const version = "0.3.16";
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
* @license
|
|
17
|
-
* Copyright 2020 Google LLC
|
|
18
|
-
*
|
|
19
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
20
|
-
* you may not use this file except in compliance with the License.
|
|
21
|
-
* You may obtain a copy of the License at
|
|
22
|
-
*
|
|
23
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
24
|
-
*
|
|
25
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
26
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
27
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
28
|
-
* See the License for the specific language governing permissions and
|
|
29
|
-
* limitations under the License.
|
|
30
|
-
*/
|
|
31
|
-
class FunctionsService {
|
|
32
|
-
constructor(app, _delegate) {
|
|
33
|
-
this.app = app;
|
|
34
|
-
this._delegate = _delegate;
|
|
35
|
-
this._region = this._delegate.region;
|
|
36
|
-
this._customDomain = this._delegate.customDomain;
|
|
37
|
-
}
|
|
38
|
-
httpsCallable(name, options) {
|
|
39
|
-
return functions.httpsCallable(this._delegate, name, options);
|
|
40
|
-
}
|
|
41
|
-
httpsCallableFromURL(url, options) {
|
|
42
|
-
return functions.httpsCallableFromURL(this._delegate, url, options);
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Deprecated in pre-modularized repo, does not exist in modularized
|
|
46
|
-
* functions package, need to convert to "host" and "port" args that
|
|
47
|
-
* `useFunctionsEmulatorExp` takes.
|
|
48
|
-
* @deprecated
|
|
49
|
-
*/
|
|
50
|
-
useFunctionsEmulator(origin) {
|
|
51
|
-
const match = origin.match('[a-zA-Z]+://([a-zA-Z0-9.-]+)(?::([0-9]+))?');
|
|
52
|
-
if (match == null) {
|
|
53
|
-
throw new util.FirebaseError('functions', 'No origin provided to useFunctionsEmulator()');
|
|
54
|
-
}
|
|
55
|
-
if (match[2] == null) {
|
|
56
|
-
throw new util.FirebaseError('functions', 'Port missing in origin provided to useFunctionsEmulator()');
|
|
57
|
-
}
|
|
58
|
-
return functions.connectFunctionsEmulator(this._delegate, match[1], Number(match[2]));
|
|
59
|
-
}
|
|
60
|
-
useEmulator(host, port) {
|
|
61
|
-
return functions.connectFunctionsEmulator(this._delegate, host, port);
|
|
62
|
-
}
|
|
15
|
+
/**
|
|
16
|
+
* @license
|
|
17
|
+
* Copyright 2020 Google LLC
|
|
18
|
+
*
|
|
19
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
20
|
+
* you may not use this file except in compliance with the License.
|
|
21
|
+
* You may obtain a copy of the License at
|
|
22
|
+
*
|
|
23
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
24
|
+
*
|
|
25
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
26
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
27
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
28
|
+
* See the License for the specific language governing permissions and
|
|
29
|
+
* limitations under the License.
|
|
30
|
+
*/
|
|
31
|
+
class FunctionsService {
|
|
32
|
+
constructor(app, _delegate) {
|
|
33
|
+
this.app = app;
|
|
34
|
+
this._delegate = _delegate;
|
|
35
|
+
this._region = this._delegate.region;
|
|
36
|
+
this._customDomain = this._delegate.customDomain;
|
|
37
|
+
}
|
|
38
|
+
httpsCallable(name, options) {
|
|
39
|
+
return functions.httpsCallable(this._delegate, name, options);
|
|
40
|
+
}
|
|
41
|
+
httpsCallableFromURL(url, options) {
|
|
42
|
+
return functions.httpsCallableFromURL(this._delegate, url, options);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Deprecated in pre-modularized repo, does not exist in modularized
|
|
46
|
+
* functions package, need to convert to "host" and "port" args that
|
|
47
|
+
* `useFunctionsEmulatorExp` takes.
|
|
48
|
+
* @deprecated
|
|
49
|
+
*/
|
|
50
|
+
useFunctionsEmulator(origin) {
|
|
51
|
+
const match = origin.match('[a-zA-Z]+://([a-zA-Z0-9.-]+)(?::([0-9]+))?');
|
|
52
|
+
if (match == null) {
|
|
53
|
+
throw new util.FirebaseError('functions', 'No origin provided to useFunctionsEmulator()');
|
|
54
|
+
}
|
|
55
|
+
if (match[2] == null) {
|
|
56
|
+
throw new util.FirebaseError('functions', 'Port missing in origin provided to useFunctionsEmulator()');
|
|
57
|
+
}
|
|
58
|
+
return functions.connectFunctionsEmulator(this._delegate, match[1], Number(match[2]));
|
|
59
|
+
}
|
|
60
|
+
useEmulator(host, port) {
|
|
61
|
+
return functions.connectFunctionsEmulator(this._delegate, host, port);
|
|
62
|
+
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
/**
|
|
66
|
-
* @license
|
|
67
|
-
* Copyright 2020 Google LLC
|
|
68
|
-
*
|
|
69
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
70
|
-
* you may not use this file except in compliance with the License.
|
|
71
|
-
* You may obtain a copy of the License at
|
|
72
|
-
*
|
|
73
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
74
|
-
*
|
|
75
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
76
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
77
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
78
|
-
* See the License for the specific language governing permissions and
|
|
79
|
-
* limitations under the License.
|
|
80
|
-
*/
|
|
81
|
-
const DEFAULT_REGION = 'us-central1';
|
|
82
|
-
const factory = (container, { instanceIdentifier: regionOrCustomDomain }) => {
|
|
83
|
-
// Dependencies
|
|
84
|
-
const app = container.getProvider('app-compat').getImmediate();
|
|
85
|
-
const functionsServiceExp = container.getProvider('functions').getImmediate({
|
|
86
|
-
identifier: regionOrCustomDomain !== null && regionOrCustomDomain !== void 0 ? regionOrCustomDomain : DEFAULT_REGION
|
|
87
|
-
});
|
|
88
|
-
return new FunctionsService(app, functionsServiceExp);
|
|
89
|
-
};
|
|
90
|
-
function registerFunctions() {
|
|
91
|
-
const namespaceExports = {
|
|
92
|
-
Functions: FunctionsService
|
|
93
|
-
};
|
|
94
|
-
firebase__default["default"].INTERNAL.registerComponent(new component.Component('functions-compat', factory, "PUBLIC" /* ComponentType.PUBLIC */)
|
|
95
|
-
.setServiceProps(namespaceExports)
|
|
96
|
-
.setMultipleInstances(true));
|
|
65
|
+
/**
|
|
66
|
+
* @license
|
|
67
|
+
* Copyright 2020 Google LLC
|
|
68
|
+
*
|
|
69
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
70
|
+
* you may not use this file except in compliance with the License.
|
|
71
|
+
* You may obtain a copy of the License at
|
|
72
|
+
*
|
|
73
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
74
|
+
*
|
|
75
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
76
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
77
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
78
|
+
* See the License for the specific language governing permissions and
|
|
79
|
+
* limitations under the License.
|
|
80
|
+
*/
|
|
81
|
+
const DEFAULT_REGION = 'us-central1';
|
|
82
|
+
const factory = (container, { instanceIdentifier: regionOrCustomDomain }) => {
|
|
83
|
+
// Dependencies
|
|
84
|
+
const app = container.getProvider('app-compat').getImmediate();
|
|
85
|
+
const functionsServiceExp = container.getProvider('functions').getImmediate({
|
|
86
|
+
identifier: regionOrCustomDomain !== null && regionOrCustomDomain !== void 0 ? regionOrCustomDomain : DEFAULT_REGION
|
|
87
|
+
});
|
|
88
|
+
return new FunctionsService(app, functionsServiceExp);
|
|
89
|
+
};
|
|
90
|
+
function registerFunctions() {
|
|
91
|
+
const namespaceExports = {
|
|
92
|
+
Functions: FunctionsService
|
|
93
|
+
};
|
|
94
|
+
firebase__default["default"].INTERNAL.registerComponent(new component.Component('functions-compat', factory, "PUBLIC" /* ComponentType.PUBLIC */)
|
|
95
|
+
.setServiceProps(namespaceExports)
|
|
96
|
+
.setMultipleInstances(true));
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
/**
|
|
100
|
-
* @license
|
|
101
|
-
* Copyright 2020 Google LLC
|
|
102
|
-
*
|
|
103
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
104
|
-
* you may not use this file except in compliance with the License.
|
|
105
|
-
* You may obtain a copy of the License at
|
|
106
|
-
*
|
|
107
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
108
|
-
*
|
|
109
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
110
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
111
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
112
|
-
* See the License for the specific language governing permissions and
|
|
113
|
-
* limitations under the License.
|
|
114
|
-
*/
|
|
115
|
-
registerFunctions();
|
|
99
|
+
/**
|
|
100
|
+
* @license
|
|
101
|
+
* Copyright 2020 Google LLC
|
|
102
|
+
*
|
|
103
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
104
|
+
* you may not use this file except in compliance with the License.
|
|
105
|
+
* You may obtain a copy of the License at
|
|
106
|
+
*
|
|
107
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
108
|
+
*
|
|
109
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
110
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
111
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
112
|
+
* See the License for the specific language governing permissions and
|
|
113
|
+
* limitations under the License.
|
|
114
|
+
*/
|
|
115
|
+
registerFunctions();
|
|
116
116
|
firebase__default["default"].registerVersion(name, version);
|
|
117
117
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/service.ts","../src/register.ts","../src/index.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 httpsCallableFromURL as httpsCallableFromURLExp,\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 httpsCallableFromURL(\n url: string,\n options?: HttpsCallableOptions\n ): HttpsCallable {\n return httpsCallableFromURLExp(this._delegate, url, 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';\nimport * as types from '@firebase/functions-types';\n\nregisterFunctions();\nfirebase.registerVersion(name, version);\n\ndeclare module '@firebase/app-compat' {\n interface FirebaseNamespace {\n functions: {\n (app?: FirebaseApp): types.FirebaseFunctions;\n Functions: typeof types.FirebaseFunctions;\n };\n }\n interface FirebaseApp {\n functions(regionOrCustomDomain?: string): types.FirebaseFunctions;\n }\n}\n"],"names":["httpsCallableExp","httpsCallableFromURLExp","FirebaseError","useFunctionsEmulatorExp","firebase","Component"],"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;MAaU,gBAAgB,CAAA;IAY3B,WACS,CAAA,GAAgB,EACd,SAA8B,EAAA;QADhC,IAAG,CAAA,GAAA,GAAH,GAAG,CAAa;QACd,IAAS,CAAA,SAAA,GAAT,SAAS,CAAqB;QAEvC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;QACrC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;KAClD;IACD,aAAa,CAAC,IAAY,EAAE,OAA8B,EAAA;QACxD,OAAOA,uBAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;KACxD;IACD,oBAAoB,CAClB,GAAW,EACX,OAA8B,EAAA;QAE9B,OAAOC,8BAAuB,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;KAC9D;AACD;;;;;AAKG;AACH,IAAA,oBAAoB,CAAC,MAAc,EAAA;QACjC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/service.ts","../src/register.ts","../src/index.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 httpsCallableFromURL as httpsCallableFromURLExp,\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 httpsCallableFromURL(\n url: string,\n options?: HttpsCallableOptions\n ): HttpsCallable {\n return httpsCallableFromURLExp(this._delegate, url, 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';\nimport * as types from '@firebase/functions-types';\n\nregisterFunctions();\nfirebase.registerVersion(name, version);\n\ndeclare module '@firebase/app-compat' {\n interface FirebaseNamespace {\n functions: {\n (app?: FirebaseApp): types.FirebaseFunctions;\n Functions: typeof types.FirebaseFunctions;\n };\n }\n interface FirebaseApp {\n functions(regionOrCustomDomain?: string): types.FirebaseFunctions;\n }\n}\n"],"names":["httpsCallableExp","httpsCallableFromURLExp","FirebaseError","useFunctionsEmulatorExp","firebase","Component"],"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;MAaU,gBAAgB,CAAA;IAY3B,WACS,CAAA,GAAgB,EACd,SAA8B,EAAA;QADhC,IAAG,CAAA,GAAA,GAAH,GAAG,CAAa;QACd,IAAS,CAAA,SAAA,GAAT,SAAS,CAAqB;QAEvC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;QACrC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;KAClD;IACD,aAAa,CAAC,IAAY,EAAE,OAA8B,EAAA;QACxD,OAAOA,uBAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;KACxD;IACD,oBAAoB,CAClB,GAAW,EACX,OAA8B,EAAA;QAE9B,OAAOC,8BAAuB,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;KAC9D;AACD;;;;;AAKG;AACH,IAAA,oBAAoB,CAAC,MAAc,EAAA;QACjC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;AACzE,QAAA,IAAI,KAAK,IAAI,IAAI,EAAE;AACjB,YAAA,MAAM,IAAIC,kBAAa,CACrB,WAAW,EACX,8CAA8C,CAC/C,CAAC;SACH;AACD,QAAA,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE;AACpB,YAAA,MAAM,IAAIA,kBAAa,CACrB,WAAW,EACX,2DAA2D,CAC5D,CAAC;SACH;AACD,QAAA,OAAOC,kCAAuB,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC5E;IACD,WAAW,CAAC,IAAY,EAAE,IAAY,EAAA;QACpC,OAAOA,kCAAuB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;KAC5D;AACF;;ACjFD;;;;;;;;;;;;;;;AAeG;AAYH,MAAM,cAAc,GAAG,aAAa,CAAC;AAErC,MAAM,OAAO,GAAwC,CACnD,SAA6B,EAC7B,EAAE,kBAAkB,EAAE,oBAAoB,EAA0B,KAClE;;IAEF,MAAM,GAAG,GAAG,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,YAAY,EAAE,CAAC;IAC/D,MAAM,mBAAmB,GAAG,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC;AAC1E,QAAA,UAAU,EAAE,oBAAoB,KAAA,IAAA,IAApB,oBAAoB,KAApB,KAAA,CAAA,GAAA,oBAAoB,GAAI,cAAc;AACnD,KAAA,CAAC,CAAC;AAEH,IAAA,OAAO,IAAI,gBAAgB,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;AACxD,CAAC,CAAC;SAEc,iBAAiB,GAAA;AAC/B,IAAA,MAAM,gBAAgB,GAAG;AACvB,QAAA,SAAS,EAAE,gBAAgB;KAC5B,CAAC;IACDC,4BAA+B,CAAC,QAAQ,CAAC,iBAAiB,CACzD,IAAIC,mBAAS,CAAC,kBAAkB,EAAE,OAAO,EAAuB,QAAA,4BAAA;SAC7D,eAAe,CAAC,gBAAgB,CAAC;AACjC,SAAA,oBAAoB,CAAC,IAAI,CAAC,CAC9B,CAAC;AACJ;;ACnDA;;;;;;;;;;;;;;;AAeG;AAOH,iBAAiB,EAAE,CAAC;AACpBD,4BAAQ,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const TEST_PROJECT: any;
|
|
1
|
+
export declare const TEST_PROJECT: any;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
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
|
-
}
|
|
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
|
+
}
|
|
29
29
|
|
|
30
30
|
import { FirebaseApp as FirebaseAppCompat } from "@firebase/app-compat";
|
|
31
31
|
import { type Functions, type HttpsCallableOptions, type HttpsCallable } from "@firebase/functions";
|
package/dist/src/register.d.ts
CHANGED
|
@@ -1,17 +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;
|
|
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;
|
package/dist/src/service.d.ts
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
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
|
-
httpsCallableFromURL(url: string, options?: HttpsCallableOptions): HttpsCallable;
|
|
36
|
-
/**
|
|
37
|
-
* Deprecated in pre-modularized repo, does not exist in modularized
|
|
38
|
-
* functions package, need to convert to "host" and "port" args that
|
|
39
|
-
* `useFunctionsEmulatorExp` takes.
|
|
40
|
-
* @deprecated
|
|
41
|
-
*/
|
|
42
|
-
useFunctionsEmulator(origin: string): void;
|
|
43
|
-
useEmulator(host: string, port: number): void;
|
|
44
|
-
}
|
|
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
|
+
httpsCallableFromURL(url: string, options?: HttpsCallableOptions): HttpsCallable;
|
|
36
|
+
/**
|
|
37
|
+
* Deprecated in pre-modularized repo, does not exist in modularized
|
|
38
|
+
* functions package, need to convert to "host" and "port" args that
|
|
39
|
+
* `useFunctionsEmulatorExp` takes.
|
|
40
|
+
* @deprecated
|
|
41
|
+
*/
|
|
42
|
+
useFunctionsEmulator(origin: string): void;
|
|
43
|
+
useEmulator(host: string, port: number): void;
|
|
44
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/dist/test/utils.d.ts
CHANGED
|
@@ -1,19 +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;
|
|
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/functions-compat",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.16",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"@firebase/app-compat": "0.x"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@firebase/app-compat": "0.2.
|
|
32
|
+
"@firebase/app-compat": "0.2.46",
|
|
33
33
|
"rollup": "2.79.1",
|
|
34
34
|
"@rollup/plugin-json": "4.1.0",
|
|
35
35
|
"rollup-plugin-typescript2": "0.31.2",
|
|
36
|
-
"typescript": "
|
|
36
|
+
"typescript": "5.5.4"
|
|
37
37
|
},
|
|
38
38
|
"repository": {
|
|
39
39
|
"directory": "packages/functions-compat",
|
|
@@ -62,10 +62,10 @@
|
|
|
62
62
|
},
|
|
63
63
|
"typings": "dist/src/index.d.ts",
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@firebase/component": "0.6.
|
|
66
|
-
"@firebase/functions": "0.11.
|
|
67
|
-
"@firebase/functions-types": "0.6.
|
|
68
|
-
"@firebase/util": "1.10.
|
|
65
|
+
"@firebase/component": "0.6.11",
|
|
66
|
+
"@firebase/functions": "0.11.10",
|
|
67
|
+
"@firebase/functions-types": "0.6.3",
|
|
68
|
+
"@firebase/util": "1.10.2",
|
|
69
69
|
"tslib": "^2.1.0"
|
|
70
70
|
},
|
|
71
71
|
"nyc": {
|