Skip to content

Commit c6edd9f

Browse files
authored
Create app-check-exp (#4888)
1 parent 704fd41 commit c6edd9f

Some content is hidden

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

42 files changed

+3573
-0
lines changed

.changeset/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"firebase-compat-interop-test",
1717
"firebase-compat-typings-test",
1818
"@firebase/app-exp",
19+
"@firebase/app-check-exp",
1920
"@firebase/analytics-compat",
2021
"@firebase/analytics-exp",
2122
"@firebase/auth-exp",
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
## API Report File for "@firebase/app-check-exp"
2+
3+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4+
5+
```ts
6+
7+
import { FirebaseApp } from '@firebase/app-exp';
8+
9+
// @public
10+
export interface AppCheck {
11+
app: FirebaseApp;
12+
}
13+
14+
// @internal (undocumented)
15+
export type _AppCheckComponentName = 'app-check-exp';
16+
17+
// @internal (undocumented)
18+
export type _AppCheckInternalComponentName = 'app-check-internal';
19+
20+
// @public
21+
export interface AppCheckOptions {
22+
isTokenAutoRefreshEnabled?: boolean;
23+
provider: CustomProvider | ReCaptchaV3Provider;
24+
}
25+
26+
// @public
27+
export interface AppCheckToken {
28+
readonly expireTimeMillis: number;
29+
// (undocumented)
30+
readonly token: string;
31+
}
32+
33+
// Warning: (ae-forgotten-export) The symbol "AppCheckProvider" needs to be exported by the entry point index.d.ts
34+
//
35+
// @public
36+
export class CustomProvider implements AppCheckProvider {
37+
constructor(_customProviderOptions: CustomProviderOptions);
38+
// Warning: (ae-forgotten-export) The symbol "AppCheckTokenInternal" needs to be exported by the entry point index.d.ts
39+
//
40+
// @internal (undocumented)
41+
getToken(): Promise<AppCheckTokenInternal>;
42+
// @internal (undocumented)
43+
initialize(app: FirebaseApp): void;
44+
}
45+
46+
// @public
47+
export interface CustomProviderOptions {
48+
getToken: () => Promise<AppCheckToken>;
49+
}
50+
51+
// @public
52+
export function initializeAppCheck(app: FirebaseApp | undefined, options: AppCheckOptions): AppCheck;
53+
54+
// @public
55+
export class ReCaptchaV3Provider implements AppCheckProvider {
56+
constructor(_siteKey: string);
57+
// @internal
58+
getToken(): Promise<AppCheckTokenInternal>;
59+
// @internal (undocumented)
60+
initialize(app: FirebaseApp): void;
61+
}
62+
63+
// @public
64+
export function setTokenAutoRefreshEnabled(app: FirebaseApp, isTokenAutoRefreshEnabled: boolean): void;
65+
66+
67+
// (No @packageDocumentation comment for this package)
68+
69+
```
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
const path = require('path');
18+
19+
module.exports = {
20+
'extends': '../../config/.eslintrc.js',
21+
'parserOptions': {
22+
'project': 'tsconfig.json',
23+
'tsconfigRootDir': __dirname
24+
},
25+
rules: {
26+
'import/no-extraneous-dependencies': [
27+
'error',
28+
{
29+
'packageDir': [path.resolve(__dirname, '../../'), __dirname]
30+
}
31+
]
32+
}
33+
};

packages-exp/app-check-exp/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# @firebase/app-check
2+
3+
This is the Firebase App Check component of the Firebase JS SDK.
4+
5+
**This package is not intended for direct usage, and should only be used via the officially supported [`firebase`](https://www.npmjs.com/package/firebase) package.**
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "../../config/api-extractor.json",
3+
// Point it to your entry point d.ts file.
4+
"mainEntryPointFilePath": "<projectFolder>/dist/src/index.d.ts",
5+
"dtsRollup": {
6+
"enabled": true,
7+
"untrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>.d.ts",
8+
"publicTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-public.d.ts"
9+
}
10+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
// eslint-disable-next-line @typescript-eslint/no-require-imports
19+
const karmaBase = require('../../config/karma.base');
20+
21+
const files = [`**/*.test.ts`];
22+
23+
module.exports = function (config) {
24+
config.set({
25+
...karmaBase,
26+
files,
27+
preprocessors: { '**/*.ts': ['webpack', 'sourcemap'] },
28+
frameworks: ['mocha']
29+
});
30+
};
31+
32+
module.exports.files = files;
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"name": "@firebase/app-check-exp",
3+
"version": "0.0.900",
4+
"private": true,
5+
"description": "An App Check package for new firebase packages",
6+
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
7+
"main": "dist/index.cjs.js",
8+
"browser": "dist/index.esm2017.js",
9+
"module": "dist/index.esm2017.js",
10+
"files": [
11+
"dist"
12+
],
13+
"scripts": {
14+
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
15+
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
16+
"build": "rollup -c && yarn api-report",
17+
"build:release": "rollup -c rollup.config.release.js && yarn api-report && yarn typings:public",
18+
"build:deps": "lerna run --scope @firebase/app-check-exp --include-dependencies build",
19+
"dev": "rollup -c -w",
20+
"test": "run-p lint test:browser",
21+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:browser",
22+
"test:browser": "karma start --single-run --nocache",
23+
"api-report": "api-extractor run --local --verbose",
24+
"predoc": "node ../../scripts/exp/remove-exp.js temp",
25+
"doc": "api-documenter markdown --input temp --output docs",
26+
"build:doc": "yarn build && yarn doc",
27+
"typings:public": "node ../../scripts/exp/use_typings.js ./dist/app-check-exp-public.d.ts"
28+
},
29+
"peerDependencies": {
30+
"@firebase/app-exp": "0.x"
31+
},
32+
"dependencies": {
33+
"@firebase/logger": "0.2.6",
34+
"@firebase/util": "1.1.0",
35+
"@firebase/component": "0.5.2",
36+
"tslib": "^2.1.0"
37+
},
38+
"license": "Apache-2.0",
39+
"devDependencies": {
40+
"@firebase/app-exp": "0.0.900",
41+
"rollup": "2.33.2",
42+
"@rollup/plugin-commonjs": "17.1.0",
43+
"@rollup/plugin-json": "4.1.0",
44+
"@rollup/plugin-node-resolve": "11.2.0",
45+
"rollup-plugin-typescript2": "0.29.0",
46+
"typescript": "4.2.2"
47+
},
48+
"repository": {
49+
"directory": "packages/app-check",
50+
"type": "git",
51+
"url": "https://github.com/firebase/firebase-js-sdk.git"
52+
},
53+
"bugs": {
54+
"url": "https://github.com/firebase/firebase-js-sdk/issues"
55+
},
56+
"typings": "dist/src/index.d.ts",
57+
"nyc": {
58+
"extension": [
59+
".ts"
60+
],
61+
"reportDir": "./coverage/node"
62+
},
63+
"esm5": "dist/index.esm.js"
64+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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 json from '@rollup/plugin-json';
19+
import typescriptPlugin from 'rollup-plugin-typescript2';
20+
import typescript from 'typescript';
21+
import { es2017BuildsNoPlugin, es5BuildsNoPlugin } from './rollup.shared';
22+
23+
/**
24+
* ES5 Builds
25+
*/
26+
const es5BuildPlugins = [
27+
typescriptPlugin({
28+
typescript
29+
}),
30+
json()
31+
];
32+
33+
const es5Builds = es5BuildsNoPlugin.map(build => ({
34+
...build,
35+
plugins: es5BuildPlugins
36+
}));
37+
38+
/**
39+
* ES2017 Builds
40+
*/
41+
const es2017BuildPlugins = [
42+
typescriptPlugin({
43+
typescript,
44+
tsconfigOverride: {
45+
compilerOptions: {
46+
target: 'es2017'
47+
}
48+
}
49+
}),
50+
json({ preferConst: true })
51+
];
52+
53+
const es2017Builds = es2017BuildsNoPlugin.map(build => ({
54+
...build,
55+
plugins: es2017BuildPlugins
56+
}));
57+
58+
export default [...es5Builds, ...es2017Builds];
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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 typescriptPlugin from 'rollup-plugin-typescript2';
19+
import typescript from 'typescript';
20+
import json from '@rollup/plugin-json';
21+
import { importPathTransformer } from '../../scripts/exp/ts-transform-import-path';
22+
import { es2017BuildsNoPlugin, es5BuildsNoPlugin } from './rollup.shared';
23+
24+
/**
25+
* ES5 Builds
26+
*/
27+
const es5BuildPlugins = [
28+
typescriptPlugin({
29+
typescript,
30+
clean: true,
31+
abortOnError: false,
32+
transformers: [importPathTransformer]
33+
}),
34+
json()
35+
];
36+
37+
const es5Builds = es5BuildsNoPlugin.map(build => ({
38+
...build,
39+
plugins: es5BuildPlugins,
40+
treeshake: {
41+
moduleSideEffects: id => id === '@firebase/installations'
42+
}
43+
}));
44+
45+
/**
46+
* ES2017 Builds
47+
*/
48+
const es2017BuildPlugins = [
49+
typescriptPlugin({
50+
typescript,
51+
tsconfigOverride: {
52+
compilerOptions: {
53+
target: 'es2017'
54+
}
55+
},
56+
abortOnError: false,
57+
clean: true,
58+
transformers: [importPathTransformer]
59+
}),
60+
json({
61+
preferConst: true
62+
})
63+
];
64+
65+
const es2017Builds = es2017BuildsNoPlugin.map(build => ({
66+
...build,
67+
plugins: es2017BuildPlugins,
68+
treeshake: {
69+
moduleSideEffects: id => id === '@firebase/installations'
70+
}
71+
}));
72+
73+
export default [...es5Builds, ...es2017Builds];

0 commit comments

Comments
 (0)