@firebase/functions-compat
Advanced tools
Comparing version 0.0.900-exp.1e0eb201d to 0.0.900-exp.22d84906a
@@ -1,4 +0,3 @@ | ||
import firebase, { firebase as firebase$1 } from '@firebase/app-compat'; | ||
import firebase from '@firebase/app-compat'; | ||
import { httpsCallable, useFunctionsEmulator } from '@firebase/functions'; | ||
import '@firebase/functions-types'; | ||
import { FirebaseError } from '@firebase/util'; | ||
@@ -8,3 +7,3 @@ import { Component } from '@firebase/component'; | ||
const name = "@firebase/functions-compat"; | ||
const version = "0.0.900-exp.1e0eb201d"; | ||
const version = "0.0.900-exp.22d84906a"; | ||
@@ -28,10 +27,10 @@ /** | ||
class FunctionsService { | ||
constructor(app, _functionsInstance) { | ||
constructor(app, _delegate) { | ||
this.app = app; | ||
this._functionsInstance = _functionsInstance; | ||
this._region = this._functionsInstance.region; | ||
this._customDomain = this._functionsInstance.customDomain; | ||
this._delegate = _delegate; | ||
this._region = this._delegate.region; | ||
this._customDomain = this._delegate.customDomain; | ||
} | ||
httpsCallable(name, options) { | ||
return httpsCallable(this._functionsInstance, name, options); | ||
return httpsCallable(this._delegate, name, options); | ||
} | ||
@@ -52,6 +51,6 @@ /** | ||
} | ||
return useFunctionsEmulator(this._functionsInstance, match[1], Number(match[2])); | ||
return useFunctionsEmulator(this._delegate, match[1], Number(match[2])); | ||
} | ||
useEmulator(host, port) { | ||
return useFunctionsEmulator(this._functionsInstance, host, port); | ||
return useFunctionsEmulator(this._delegate, host, port); | ||
} | ||
@@ -76,3 +75,4 @@ } | ||
*/ | ||
const factory = (container, regionOrCustomDomain) => { | ||
const DEFAULT_REGION = 'us-central1'; | ||
const factory = (container, { instanceIdentifier: regionOrCustomDomain }) => { | ||
// Dependencies | ||
@@ -83,3 +83,3 @@ const app = container.getProvider('app-compat').getImmediate(); | ||
.getImmediate({ | ||
identifier: regionOrCustomDomain | ||
identifier: regionOrCustomDomain !== null && regionOrCustomDomain !== void 0 ? regionOrCustomDomain : DEFAULT_REGION | ||
}); | ||
@@ -90,3 +90,2 @@ return new FunctionsService(app, functionsServiceExp); | ||
const namespaceExports = { | ||
// no-inline | ||
Functions: FunctionsService | ||
@@ -116,3 +115,3 @@ }; | ||
registerFunctions(); | ||
firebase$1.registerVersion(name, version); | ||
firebase.registerVersion(name, version); | ||
//# sourceMappingURL=index.esm2017.js.map |
@@ -1,4 +0,3 @@ | ||
import firebase, { firebase as firebase$1 } from '@firebase/app-compat'; | ||
import firebase from '@firebase/app-compat'; | ||
import { httpsCallable, useFunctionsEmulator } from '@firebase/functions'; | ||
import '@firebase/functions-types'; | ||
import { FirebaseError } from '@firebase/util'; | ||
@@ -8,3 +7,3 @@ import { Component } from '@firebase/component'; | ||
var name = "@firebase/functions-compat"; | ||
var version = "0.0.900-exp.1e0eb201d"; | ||
var version = "0.0.900-exp.22d84906a"; | ||
@@ -28,10 +27,10 @@ /** | ||
var FunctionsService = /** @class */ (function () { | ||
function FunctionsService(app, _functionsInstance) { | ||
function FunctionsService(app, _delegate) { | ||
this.app = app; | ||
this._functionsInstance = _functionsInstance; | ||
this._region = this._functionsInstance.region; | ||
this._customDomain = this._functionsInstance.customDomain; | ||
this._delegate = _delegate; | ||
this._region = this._delegate.region; | ||
this._customDomain = this._delegate.customDomain; | ||
} | ||
FunctionsService.prototype.httpsCallable = function (name, options) { | ||
return httpsCallable(this._functionsInstance, name, options); | ||
return httpsCallable(this._delegate, name, options); | ||
}; | ||
@@ -52,6 +51,6 @@ /** | ||
} | ||
return useFunctionsEmulator(this._functionsInstance, match[1], Number(match[2])); | ||
return useFunctionsEmulator(this._delegate, match[1], Number(match[2])); | ||
}; | ||
FunctionsService.prototype.useEmulator = function (host, port) { | ||
return useFunctionsEmulator(this._functionsInstance, host, port); | ||
return useFunctionsEmulator(this._delegate, host, port); | ||
}; | ||
@@ -77,3 +76,5 @@ return FunctionsService; | ||
*/ | ||
var factory = function (container, regionOrCustomDomain) { | ||
var DEFAULT_REGION = 'us-central1'; | ||
var factory = function (container, _a) { | ||
var regionOrCustomDomain = _a.instanceIdentifier; | ||
// Dependencies | ||
@@ -84,3 +85,3 @@ var app = container.getProvider('app-compat').getImmediate(); | ||
.getImmediate({ | ||
identifier: regionOrCustomDomain | ||
identifier: regionOrCustomDomain !== null && regionOrCustomDomain !== void 0 ? regionOrCustomDomain : DEFAULT_REGION | ||
}); | ||
@@ -91,3 +92,2 @@ return new FunctionsService(app, functionsServiceExp); | ||
var namespaceExports = { | ||
// no-inline | ||
Functions: FunctionsService | ||
@@ -117,3 +117,3 @@ }; | ||
registerFunctions(); | ||
firebase$1.registerVersion(name, version); | ||
firebase.registerVersion(name, version); | ||
//# sourceMappingURL=index.esm5.js.map |
@@ -5,3 +5,2 @@ 'use strict'; | ||
var functions = require('@firebase/functions'); | ||
require('@firebase/functions-types'); | ||
var util = require('@firebase/util'); | ||
@@ -15,3 +14,3 @@ var component = require('@firebase/component'); | ||
var name = "@firebase/functions-compat"; | ||
var version = "0.0.900-exp.1e0eb201d"; | ||
var version = "0.0.900-exp.22d84906a"; | ||
@@ -35,10 +34,10 @@ /** | ||
var FunctionsService = /** @class */ (function () { | ||
function FunctionsService(app, _functionsInstance) { | ||
function FunctionsService(app, _delegate) { | ||
this.app = app; | ||
this._functionsInstance = _functionsInstance; | ||
this._region = this._functionsInstance.region; | ||
this._customDomain = this._functionsInstance.customDomain; | ||
this._delegate = _delegate; | ||
this._region = this._delegate.region; | ||
this._customDomain = this._delegate.customDomain; | ||
} | ||
FunctionsService.prototype.httpsCallable = function (name, options) { | ||
return functions.httpsCallable(this._functionsInstance, name, options); | ||
return functions.httpsCallable(this._delegate, name, options); | ||
}; | ||
@@ -59,6 +58,6 @@ /** | ||
} | ||
return functions.useFunctionsEmulator(this._functionsInstance, match[1], Number(match[2])); | ||
return functions.useFunctionsEmulator(this._delegate, match[1], Number(match[2])); | ||
}; | ||
FunctionsService.prototype.useEmulator = function (host, port) { | ||
return functions.useFunctionsEmulator(this._functionsInstance, host, port); | ||
return functions.useFunctionsEmulator(this._delegate, host, port); | ||
}; | ||
@@ -84,3 +83,5 @@ return FunctionsService; | ||
*/ | ||
var factory = function (container, regionOrCustomDomain) { | ||
var DEFAULT_REGION = 'us-central1'; | ||
var factory = function (container, _a) { | ||
var regionOrCustomDomain = _a.instanceIdentifier; | ||
// Dependencies | ||
@@ -91,3 +92,3 @@ var app = container.getProvider('app-compat').getImmediate(); | ||
.getImmediate({ | ||
identifier: regionOrCustomDomain | ||
identifier: regionOrCustomDomain !== null && regionOrCustomDomain !== void 0 ? regionOrCustomDomain : DEFAULT_REGION | ||
}); | ||
@@ -98,3 +99,2 @@ return new FunctionsService(app, functionsServiceExp); | ||
var namespaceExports = { | ||
// no-inline | ||
Functions: FunctionsService | ||
@@ -101,0 +101,0 @@ }; |
@@ -17,2 +17,21 @@ /** | ||
*/ | ||
export {}; | ||
import * as types from '@firebase/functions-types'; | ||
declare module '@firebase/app-compat' { | ||
interface FirebaseNamespace { | ||
functions?: { | ||
(app?: FirebaseApp): types.FirebaseFunctions; | ||
Functions: typeof types.FirebaseFunctions; | ||
}; | ||
} | ||
interface FirebaseApp { | ||
functions?(regionOrCustomDomain?: string): types.FirebaseFunctions; | ||
} | ||
} | ||
import { FirebaseApp as FirebaseAppCompat } from "@firebase/app-compat"; | ||
import { Functions, HttpsCallableOptions, HttpsCallable } from "@firebase/functions"; | ||
declare module "@firebase/functions" { | ||
function getFunctions(app?: FirebaseAppCompat, regionOrCustomDomain?: string): Functions; | ||
function httpsCallable<RequestData = unknown, ResponseData = unknown>(functionsInstance: types.FirebaseFunctions, name: string, options?: HttpsCallableOptions): HttpsCallable<RequestData, ResponseData>; | ||
function useFunctionsEmulator(functionsInstance: types.FirebaseFunctions, host: string, port: number): void; | ||
} |
@@ -17,5 +17,5 @@ /** | ||
*/ | ||
import { FirebaseApp } from '@firebase/app-compat'; | ||
import { FunctionsService } from './service'; | ||
import { FirebaseApp } from '@firebase/app-types'; | ||
import { Functions as FunctionsServiceExp } from "@firebase/functions-types"; | ||
import { Functions as FunctionsServiceExp } from "@firebase/functions"; | ||
declare module '@firebase/component' { | ||
@@ -22,0 +22,0 @@ interface NameServiceMapping { |
@@ -18,7 +18,7 @@ /** | ||
import { FirebaseFunctions, HttpsCallable } from '@firebase/functions-types'; | ||
import { HttpsCallableOptions, Functions as FunctionsServiceExp } from "@firebase/functions-types"; | ||
import { FirebaseApp } from '@firebase/app-types'; | ||
export declare class FunctionsService implements FirebaseFunctions { | ||
import { HttpsCallableOptions, Functions as FunctionsServiceExp } from "@firebase/functions"; | ||
import { FirebaseApp, _FirebaseService } from '@firebase/app-compat'; | ||
export declare class FunctionsService implements FirebaseFunctions, _FirebaseService { | ||
app: FirebaseApp; | ||
private _functionsInstance; | ||
readonly _delegate: FunctionsServiceExp; | ||
/** | ||
@@ -34,3 +34,3 @@ * For testing. | ||
_customDomain: string | null; | ||
constructor(app: FirebaseApp, _functionsInstance: FunctionsServiceExp); | ||
constructor(app: FirebaseApp, _delegate: FunctionsServiceExp); | ||
httpsCallable(name: string, options?: HttpsCallableOptions): HttpsCallable; | ||
@@ -37,0 +37,0 @@ /** |
@@ -17,4 +17,4 @@ /** | ||
*/ | ||
import { FirebaseApp } from '@firebase/app-types'; | ||
import { FirebaseApp } from '@firebase/app-compat'; | ||
import { FunctionsService } from '../src/service'; | ||
export declare function createTestService(app: FirebaseApp, regionOrCustomDomain?: string): FunctionsService; |
{ | ||
"name": "@firebase/functions-compat", | ||
"version": "0.0.900-exp.1e0eb201d", | ||
"version": "0.0.900-exp.22d84906a", | ||
"description": "", | ||
@@ -8,5 +8,4 @@ "private": false, | ||
"main": "dist/index.node.cjs.js", | ||
"browser": "dist/index.esm5.js", | ||
"module": "dist/index.esm5.js", | ||
"esm2017": "dist/index.esm2017.js", | ||
"browser": "dist/index.esm2017.js", | ||
"module": "dist/index.esm2017.js", | ||
"files": [ | ||
@@ -17,10 +16,10 @@ "dist" | ||
"peerDependencies": { | ||
"@firebase/app-compat": "0.0.900-exp.1e0eb201d" | ||
"@firebase/app-compat": "0.0.900-exp.22d84906a" | ||
}, | ||
"devDependencies": { | ||
"@firebase/app-compat": "0.0.900", | ||
"rollup": "2.33.2", | ||
"rollup": "2.35.1", | ||
"@rollup/plugin-json": "4.1.0", | ||
"rollup-plugin-typescript2": "0.29.0", | ||
"typescript": "4.0.5" | ||
"typescript": "4.2.2" | ||
}, | ||
@@ -40,3 +39,3 @@ "repository": { | ||
"build:deps": "lerna run --scope @firebase/functions-compat --include-dependencies build", | ||
"build:release": "rollup -c rollup.config.release.js", | ||
"build:release": "rollup -c rollup.config.release.js && yarn add-compat-overloads", | ||
"dev": "rollup -c -w", | ||
@@ -50,12 +49,12 @@ "test": "run-p lint test:all", | ||
"test:emulator": "env FIREBASE_FUNCTIONS_HOST=http://localhost FIREBASE_FUNCTIONS_PORT=5005 run-p test:node", | ||
"prepare": "yarn build:release" | ||
"add-compat-overloads": "ts-node-script ../../scripts/exp/create-overloads.ts -i ../functions-exp/dist/functions-exp-public.d.ts -o dist/src/index.d.ts -a -r Functions:types.FirebaseFunctions -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/functions" | ||
}, | ||
"typings": "dist/functions-compat-public.d.ts", | ||
"typings": "dist/src/index.d.ts", | ||
"dependencies": { | ||
"@firebase/component": "0.1.21", | ||
"@firebase/functions": "0.0.900-exp.1e0eb201d", | ||
"@firebase/functions-types": "0.0.900-exp.1e0eb201d", | ||
"@firebase/component": "0.4.1", | ||
"@firebase/functions": "0.0.900-exp.22d84906a", | ||
"@firebase/functions-types": "0.4.0", | ||
"@firebase/messaging-types": "0.5.0", | ||
"@firebase/util": "0.3.4", | ||
"tslib": "^1.11.1" | ||
"@firebase/util": "1.0.0", | ||
"tslib": "^2.1.0" | ||
}, | ||
@@ -67,3 +66,4 @@ "nyc": { | ||
"reportDir": "./coverage/node" | ||
} | ||
}, | ||
"esm5": "dist/index.esm5.js" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44234
468
+ Added@firebase/app@0.0.900-exp.22d84906a(transitive)
+ Added@firebase/app-compat@0.0.900-exp.22d84906a(transitive)
+ Added@firebase/component@0.4.1(transitive)
+ Added@firebase/functions@0.0.900-exp.22d84906a(transitive)
+ Added@firebase/functions-types@0.4.0(transitive)
+ Added@firebase/util@1.0.0(transitive)
+ Addedtslib@2.8.1(transitive)
- Removed@firebase/app@0.0.900-exp.1e0eb201d(transitive)
- Removed@firebase/app-compat@0.0.900-exp.1e0eb201d(transitive)
- Removed@firebase/app-types@0.0.900-exp.1e0eb201d(transitive)
- Removed@firebase/component@0.1.21(transitive)
- Removed@firebase/functions@0.0.900-exp.1e0eb201d(transitive)
- Removed@firebase/functions-types@0.0.900-exp.1e0eb201d(transitive)
- Removed@firebase/util@0.3.4(transitive)
- Removedtslib@1.14.1(transitive)
Updated@firebase/component@0.4.1
Updated@firebase/util@1.0.0
Updatedtslib@^2.1.0