Skip to content

Commit 524b8e3

Browse files
committed
Merge branch 'master' into fei-auth-entrypoints
2 parents a7e4a95 + 2a2a376 commit 524b8e3

File tree

140 files changed

+1335
-377
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+1335
-377
lines changed

.changeset/empty-countries-run.md

-7
This file was deleted.

.changeset/loud-lamps-camp.md

-5
This file was deleted.

.changeset/silent-seals-approve.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/database': patch
3+
---
4+
5+
On Node, always send Auth and AppCheck tokens when they are available.

.changeset/sixty-masks-wash.md

-6
This file was deleted.

.github/auto_assign.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Set to true to add reviewers to pull requests
2+
addReviewers: false
3+
4+
# Set to true to add assignees to pull requests
5+
addAssignees: true
6+
7+
# A list of reviewers to be added to pull requests (GitHub user name)
8+
# reviewers:
9+
# - egilmorez
10+
11+
# A number of reviewers added to the pull request
12+
# Set 0 to add all the reviewers (default: 0)
13+
# numberOfReviewers: 0
14+
15+
# A list of assignees, overrides reviewers if set
16+
assignees:
17+
- egilmorez
18+
19+
# A number of assignees to add to the pull request
20+
# Set to 0 to add all of the assignees.
21+
# Uses numberOfReviewers if unset.
22+
numberOfAssignees: 0
23+
24+
# A list of keywords to be skipped the process that add reviewers if pull requests include it
25+
# skipKeywords:
26+
# - wip
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Assign tech writers
2+
3+
on:
4+
pull_request:
5+
types: [labeled]
6+
jobs:
7+
assign_tech_writers:
8+
if: ${{github.event.label.name == 'doc-changes'}}
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: assign techwriters to PR
13+
uses: kentaro-m/[email protected]
14+
with:
15+
configuration-path: ".github/auto_assign.yml"

.github/workflows/check-changeset.yml

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: Check Changeset
22

33
on: pull_request
44

5+
env:
6+
GITHUB_PULL_REQUEST_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
7+
GITHUB_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}
8+
59
jobs:
610
check_changeset:
711
name: Check changeset vs changed files
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Label doc changes
2+
3+
on: pull_request
4+
5+
env:
6+
GITHUB_PULL_REQUEST_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
7+
GITHUB_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}
8+
9+
jobs:
10+
check_doc_changes:
11+
name: Check if docs are being changed
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout Repo
16+
uses: actions/checkout@master
17+
with:
18+
# This makes Actions fetch all Git history so check_changeset script can diff properly.
19+
fetch-depth: 0
20+
- name: Set up Node (14)
21+
uses: actions/setup-node@v2
22+
with:
23+
node-version: 14.x
24+
- name: Yarn install
25+
run: yarn
26+
- name: Run detect doc changes script
27+
run: yarn ts-node-script scripts/exp/detect-doc-changes.ts
28+
id: check-doc-changes
29+
- name: Print if doc changed output
30+
run: echo "${{steps.check-doc-changes.outputs.DOC_CHANGED}}"
31+
- name: Add label if there are doc changes
32+
uses: actions-ecosystem/[email protected]
33+
if: ${{steps.check-doc-changes.outputs.DOC_CHANGED == 'true'}}
34+
with:
35+
labels: doc-changes
36+
github_token: ${{ secrets.GITHUB_TOKEN }}

common/api-review/app-check-exp.api.md

+4
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ export function onTokenChanged(appCheckInstance: AppCheck, observer: PartialObse
7070
// @public
7171
export function onTokenChanged(appCheckInstance: AppCheck, onNext: (tokenResult: AppCheckTokenResult) => void, onError?: (error: Error) => void, onCompletion?: () => void): Unsubscribe;
7272

73+
export { PartialObserver }
74+
7375
// @public
7476
export class ReCaptchaV3Provider implements AppCheckProvider {
7577
constructor(_siteKey: string);
@@ -82,6 +84,8 @@ export class ReCaptchaV3Provider implements AppCheckProvider {
8284
// @public
8385
export function setTokenAutoRefreshEnabled(appCheckInstance: AppCheck, isTokenAutoRefreshEnabled: boolean): void;
8486

87+
export { Unsubscribe }
88+
8589

8690
// (No @packageDocumentation comment for this package)
8791

common/api-review/auth-exp.api.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,10 @@ export class EmailAuthCredential extends AuthCredential {
218218
export class EmailAuthProvider implements AuthProvider {
219219
static credential(email: string, password: string): EmailAuthCredential;
220220
static credentialWithLink(email: string, emailLink: string): EmailAuthCredential;
221-
static readonly EMAIL_LINK_SIGN_IN_METHOD = SignInMethod.EMAIL_LINK;
222-
static readonly EMAIL_PASSWORD_SIGN_IN_METHOD = SignInMethod.EMAIL_PASSWORD;
223-
static readonly PROVIDER_ID = ProviderId.PASSWORD;
224-
readonly providerId = ProviderId.PASSWORD;
221+
static readonly EMAIL_LINK_SIGN_IN_METHOD: 'emailLink';
222+
static readonly EMAIL_PASSWORD_SIGN_IN_METHOD: 'password';
223+
static readonly PROVIDER_ID: 'password';
224+
readonly providerId: "password";
225225
}
226226

227227
export { ErrorFn }
@@ -234,8 +234,8 @@ export class FacebookAuthProvider extends BaseOAuthProvider {
234234
static credential(accessToken: string): OAuthCredential;
235235
static credentialFromError(error: FirebaseError): OAuthCredential | null;
236236
static credentialFromResult(userCredential: UserCredential): OAuthCredential | null;
237-
static readonly FACEBOOK_SIGN_IN_METHOD = SignInMethod.FACEBOOK;
238-
static readonly PROVIDER_ID = ProviderId.FACEBOOK;
237+
static readonly FACEBOOK_SIGN_IN_METHOD: 'facebook.com';
238+
static readonly PROVIDER_ID: 'facebook.com';
239239
}
240240

241241
// @public
@@ -270,8 +270,8 @@ export class GithubAuthProvider extends BaseOAuthProvider {
270270
static credential(accessToken: string): OAuthCredential;
271271
static credentialFromError(error: FirebaseError): OAuthCredential | null;
272272
static credentialFromResult(userCredential: UserCredential): OAuthCredential | null;
273-
static readonly GITHUB_SIGN_IN_METHOD = SignInMethod.GITHUB;
274-
static readonly PROVIDER_ID = ProviderId.GITHUB;
273+
static readonly GITHUB_SIGN_IN_METHOD: 'github.com';
274+
static readonly PROVIDER_ID: 'github.com';
275275
}
276276

277277
// @public
@@ -280,8 +280,8 @@ export class GoogleAuthProvider extends BaseOAuthProvider {
280280
static credential(idToken?: string | null, accessToken?: string | null): OAuthCredential;
281281
static credentialFromError(error: FirebaseError): OAuthCredential | null;
282282
static credentialFromResult(userCredential: UserCredential): OAuthCredential | null;
283-
static readonly GOOGLE_SIGN_IN_METHOD = SignInMethod.GOOGLE;
284-
static readonly PROVIDER_ID = ProviderId.GOOGLE;
283+
static readonly GOOGLE_SIGN_IN_METHOD: 'google.com';
284+
static readonly PROVIDER_ID: 'google.com';
285285
}
286286

287287
// @public
@@ -458,9 +458,9 @@ export class PhoneAuthProvider {
458458
static credential(verificationId: string, verificationCode: string): PhoneAuthCredential;
459459
static credentialFromError(error: FirebaseError): AuthCredential | null;
460460
static credentialFromResult(userCredential: UserCredential): AuthCredential | null;
461-
static readonly PHONE_SIGN_IN_METHOD = SignInMethod.PHONE;
462-
static readonly PROVIDER_ID = ProviderId.PHONE;
463-
readonly providerId = ProviderId.PHONE;
461+
static readonly PHONE_SIGN_IN_METHOD: 'phone';
462+
static readonly PROVIDER_ID: 'phone';
463+
readonly providerId: "phone";
464464
verifyPhoneNumber(phoneOptions: PhoneInfoOptions | string, applicationVerifier: ApplicationVerifier): Promise<string>;
465465
}
466466

@@ -617,8 +617,8 @@ export class TwitterAuthProvider extends BaseOAuthProvider {
617617
static credential(token: string, secret: string): OAuthCredential;
618618
static credentialFromError(error: FirebaseError): OAuthCredential | null;
619619
static credentialFromResult(userCredential: UserCredential): OAuthCredential | null;
620-
static readonly PROVIDER_ID = ProviderId.TWITTER;
621-
static readonly TWITTER_SIGN_IN_METHOD = SignInMethod.TWITTER;
620+
static readonly PROVIDER_ID: 'twitter.com';
621+
static readonly TWITTER_SIGN_IN_METHOD: 'twitter.com';
622622
}
623623

624624
// @public

integration/firebase/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test"
88
},
99
"devDependencies": {
10-
"firebase": "8.6.8",
10+
"firebase": "8.7.0",
1111
"@types/chai": "4.2.14",
1212
"@types/mocha": "7.0.2",
1313
"chai": "4.3.4",

integration/firestore/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"test:memory:debug": "yarn build:memory; karma start --auto-watch --browsers Chrome"
1515
},
1616
"devDependencies": {
17-
"@firebase/app": "0.6.27",
18-
"@firebase/firestore": "2.3.7",
17+
"@firebase/app": "0.6.28",
18+
"@firebase/firestore": "2.3.8",
1919
"@types/mocha": "7.0.2",
2020
"gulp": "4.0.2",
2121
"gulp-filter": "6.0.0",

integration/messaging/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"test:manual": "mocha --exit"
1010
},
1111
"devDependencies": {
12-
"firebase": "8.6.8",
12+
"firebase": "8.7.0",
1313
"chai": "4.3.4",
1414
"chromedriver": "91.0.0",
1515
"express": "4.17.1",

packages-exp/analytics-compat/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
"typings": "dist/src/index.d.ts",
4646
"dependencies": {
47-
"@firebase/component": "0.5.3",
47+
"@firebase/component": "0.5.4",
4848
"@firebase/analytics-exp": "0.0.900",
4949
"@firebase/analytics-types": "0.4.0",
5050
"@firebase/util": "1.1.0",

packages-exp/analytics-exp/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@firebase/installations-exp": "0.0.900",
3636
"@firebase/logger": "0.2.6",
3737
"@firebase/util": "1.1.0",
38-
"@firebase/component": "0.5.3",
38+
"@firebase/component": "0.5.4",
3939
"tslib": "^2.1.0"
4040
},
4141
"license": "Apache-2.0",

packages-exp/app-check-compat/package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
1515
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
1616
"build": "rollup -c",
17-
"build:release": "rollup -c rollup.config.release.js",
17+
"build:release": "rollup -c rollup.config.release.js && yarn add-compat-overloads",
1818
"build:deps": "lerna run --scope @firebase/app-check-compat --include-dependencies build",
1919
"dev": "rollup -c -w",
2020
"test": "run-p lint test:browser",
2121
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:browser",
22-
"test:browser": "karma start --single-run --nocache"
22+
"test:browser": "karma start --single-run --nocache",
23+
"add-compat-overloads": "ts-node-script ../../scripts/exp/create-overloads.ts -i ../app-check-exp/dist/app-check-exp-public.d.ts -o dist/src/index.d.ts -a -r AppCheck:FirebaseAppCheck -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/app-check"
2324
},
2425
"peerDependencies": {
2526
"@firebase/app-compat": "0.x"
@@ -28,17 +29,17 @@
2829
"@firebase/app-check-exp": "0.0.900",
2930
"@firebase/logger": "0.2.6",
3031
"@firebase/util": "1.1.0",
31-
"@firebase/component": "0.5.3",
32+
"@firebase/component": "0.5.4",
3233
"tslib": "^2.1.0"
3334
},
3435
"license": "Apache-2.0",
3536
"devDependencies": {
3637
"@firebase/app-compat": "0.0.900",
37-
"rollup": "2.33.2",
38+
"rollup": "2.52.2",
3839
"@rollup/plugin-commonjs": "17.1.0",
3940
"@rollup/plugin-json": "4.1.0",
4041
"@rollup/plugin-node-resolve": "11.2.0",
41-
"rollup-plugin-typescript2": "0.29.0",
42+
"rollup-plugin-typescript2": "0.30.0",
4243
"typescript": "4.2.2"
4344
},
4445
"repository": {
@@ -57,4 +58,4 @@
5758
"reportDir": "./coverage/node"
5859
},
5960
"esm5": "dist/index.esm.js"
60-
}
61+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* @license
3+
* Copyright 2021 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+
18+
import { ErrorFactory, ErrorMap } from '@firebase/util';
19+
20+
export const enum AppCheckError {
21+
USE_BEFORE_ACTIVATION = 'use-before-activation'
22+
}
23+
24+
const ERRORS: ErrorMap<AppCheckError> = {
25+
[AppCheckError.USE_BEFORE_ACTIVATION]:
26+
'App Check is being used before activate() is called for FirebaseApp {$appName}. ' +
27+
'Call activate() before instantiating other Firebase services.'
28+
};
29+
30+
interface ErrorParams {
31+
[AppCheckError.USE_BEFORE_ACTIVATION]: { appName: string };
32+
}
33+
34+
export const ERROR_FACTORY = new ErrorFactory<AppCheckError, ErrorParams>(
35+
'appCheck',
36+
'AppCheck',
37+
ERRORS
38+
);

packages-exp/app-check-compat/src/index.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
InstanceFactory
2828
} from '@firebase/component';
2929
import { AppCheckService } from './service';
30-
import { FirebaseAppCheck } from '../../../packages/app-check-types';
30+
import { FirebaseAppCheck } from '@firebase/app-check-types';
3131

3232
declare module '@firebase/component' {
3333
interface NameServiceMapping {
@@ -40,11 +40,8 @@ const factory: InstanceFactory<'appCheck-compat'> = (
4040
) => {
4141
// Dependencies
4242
const app = container.getProvider('app-compat').getImmediate();
43-
const appCheckServiceExp = container
44-
.getProvider('app-check-exp')
45-
.getImmediate();
4643

47-
return new AppCheckService(app as FirebaseApp, appCheckServiceExp);
44+
return new AppCheckService(app as FirebaseApp);
4845
};
4946

5047
export function registerAppCheck(): void {

0 commit comments

Comments
 (0)