@firebase/firestore-compat 0.1.3-2021822203916 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -6
- package/dist/index.esm2017.js +1 -1
- package/dist/index.esm5.js +1 -1
- package/dist/index.node.cjs.js +1 -1
- package/dist/index.rn.js +1 -1
- package/package.json +9 -6
- package/.eslintrc.js +0 -76
- package/karma.conf.js +0 -83
- package/rollup.config.js +0 -99
- package/src/api/blob.ts +0 -71
- package/src/api/database.ts +0 -1304
- package/src/api/field_path.ts +0 -64
- package/src/api/field_value.ts +0 -65
- package/src/api/geo_point.ts +0 -18
- package/src/api/observer.ts +0 -54
- package/src/api/timestamp.ts +0 -18
- package/src/config.ts +0 -90
- package/src/index.console.ts +0 -111
- package/src/index.node.ts +0 -40
- package/src/index.rn.ts +0 -39
- package/src/index.ts +0 -69
- package/src/register-module.ts +0 -44
- package/src/util/input_validation.ts +0 -40
- package/tools/console.build.js +0 -81
- package/tsconfig.json +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
# @firebase/firestore-compat
|
|
2
2
|
|
|
3
|
-
## 0.1.3
|
|
3
|
+
## 0.1.3
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- @firebase/
|
|
11
|
-
- @firebase/
|
|
7
|
+
- [`08c098211`](https://github.com/firebase/firebase-js-sdk/commit/08c098211f44a79a5b8d30c6b4222d560ff522a3) [#5538](https://github.com/firebase/firebase-js-sdk/pull/5538) - only publish dist folder to npm for @firebase/firestore-compat
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`f78ceca1c`](https://github.com/firebase/firebase-js-sdk/commit/f78ceca1cf9198f5d371320e8814c859c261cf67), [`a99943fe3`](https://github.com/firebase/firebase-js-sdk/commit/a99943fe3bd5279761aa29d138ec91272b06df39), [`b835b4cba`](https://github.com/firebase/firebase-js-sdk/commit/b835b4cbabc4b7b180ae38b908c49205ce31a422), [`a99943fe3`](https://github.com/firebase/firebase-js-sdk/commit/a99943fe3bd5279761aa29d138ec91272b06df39)]:
|
|
10
|
+
- @firebase/firestore@3.1.0
|
|
11
|
+
- @firebase/util@1.4.0
|
|
12
|
+
- @firebase/component@0.5.7
|
|
12
13
|
|
|
13
14
|
## 0.1.2
|
|
14
15
|
|
package/dist/index.esm2017.js
CHANGED
package/dist/index.esm5.js
CHANGED
package/dist/index.node.cjs.js
CHANGED
|
@@ -12,7 +12,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
12
12
|
var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
|
|
13
13
|
|
|
14
14
|
const name = "@firebase/firestore-compat";
|
|
15
|
-
const version = "0.1.3
|
|
15
|
+
const version = "0.1.3";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @license
|
package/dist/index.rn.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/firestore-compat",
|
|
3
|
-
"version": "0.1.3
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "The Cloud Firestore component of the Firebase JS SDK.",
|
|
5
5
|
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
|
|
6
6
|
"main": "dist/index.node.cjs.js",
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
"browser": "dist/index.esm2017.js",
|
|
9
9
|
"module": "dist/index.esm2017.js",
|
|
10
10
|
"esm5": "dist/index.esm5.js",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
11
14
|
"scripts": {
|
|
12
15
|
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
|
|
13
16
|
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
|
|
@@ -20,17 +23,17 @@
|
|
|
20
23
|
"add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../firestore/dist/index.d.ts -o dist/src/index.d.ts -a -r Firestore:types.FirebaseFirestore -r CollectionReference:types.CollectionReference -r DocumentReference:types.DocumentReference -r Query:types.Query -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/firestore"
|
|
21
24
|
},
|
|
22
25
|
"peerDependencies": {
|
|
23
|
-
"@firebase/app-compat": "0.
|
|
26
|
+
"@firebase/app-compat": "0.x"
|
|
24
27
|
},
|
|
25
28
|
"dependencies": {
|
|
26
|
-
"@firebase/component": "0.5.7
|
|
27
|
-
"@firebase/firestore": "3.1.0
|
|
28
|
-
"@firebase/util": "1.
|
|
29
|
+
"@firebase/component": "0.5.7",
|
|
30
|
+
"@firebase/firestore": "3.1.0",
|
|
31
|
+
"@firebase/util": "1.4.0",
|
|
29
32
|
"@firebase/firestore-types": "2.5.0",
|
|
30
33
|
"tslib": "^2.1.0"
|
|
31
34
|
},
|
|
32
35
|
"devDependencies": {
|
|
33
|
-
"@firebase/app-compat": "0.1.2
|
|
36
|
+
"@firebase/app-compat": "0.1.2",
|
|
34
37
|
"@types/eslint": "7.28.0",
|
|
35
38
|
"rollup": "2.56.3",
|
|
36
39
|
"rollup-plugin-sourcemaps": "0.6.3",
|
package/.eslintrc.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
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
|
-
module.exports = {
|
|
19
|
-
extends: '../../config/.eslintrc.js',
|
|
20
|
-
parserOptions: {
|
|
21
|
-
project: 'tsconfig.json',
|
|
22
|
-
// to make vscode-eslint work with monorepo
|
|
23
|
-
// https://github.com/typescript-eslint/typescript-eslint/issues/251#issuecomment-463943250
|
|
24
|
-
tsconfigRootDir: __dirname
|
|
25
|
-
},
|
|
26
|
-
plugins: ['import'],
|
|
27
|
-
rules: {
|
|
28
|
-
'no-console': ['error', { allow: ['warn', 'error'] }],
|
|
29
|
-
'@typescript-eslint/no-unused-vars': [
|
|
30
|
-
'error',
|
|
31
|
-
{
|
|
32
|
-
varsIgnorePattern: '^_',
|
|
33
|
-
args: 'none'
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
'import/order': [
|
|
37
|
-
'error',
|
|
38
|
-
{
|
|
39
|
-
'groups': [
|
|
40
|
-
'builtin',
|
|
41
|
-
'external',
|
|
42
|
-
'internal',
|
|
43
|
-
'parent',
|
|
44
|
-
'sibling',
|
|
45
|
-
'index'
|
|
46
|
-
],
|
|
47
|
-
'newlines-between': 'always',
|
|
48
|
-
'alphabetize': { 'order': 'asc', 'caseInsensitive': true }
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
},
|
|
52
|
-
overrides: [
|
|
53
|
-
{
|
|
54
|
-
files: ['**/*.d.ts'],
|
|
55
|
-
rules: {
|
|
56
|
-
'camelcase': 'off',
|
|
57
|
-
'import/no-duplicates': 'off',
|
|
58
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
59
|
-
'@typescript-eslint/no-unused-vars': 'off'
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
files: ['**/*.test.ts', '**/test/**/*.ts'],
|
|
64
|
-
rules: {
|
|
65
|
-
'@typescript-eslint/no-explicit-any': 'error'
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
files: ['scripts/*.ts'],
|
|
70
|
-
rules: {
|
|
71
|
-
'import/no-extraneous-dependencies': 'off',
|
|
72
|
-
'@typescript-eslint/no-require-imports': 'off'
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
};
|
package/karma.conf.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 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
|
-
const karmaBase = require('../../config/karma.base');
|
|
19
|
-
const { argv } = require('yargs');
|
|
20
|
-
|
|
21
|
-
module.exports = function (config) {
|
|
22
|
-
const karmaConfig = Object.assign({}, karmaBase, {
|
|
23
|
-
// files to load into karma
|
|
24
|
-
files: getTestFiles(argv),
|
|
25
|
-
|
|
26
|
-
preprocessors: {
|
|
27
|
-
'test/**/*.ts': ['webpack', 'sourcemap']
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
// frameworks to use
|
|
31
|
-
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
|
32
|
-
frameworks: ['mocha'],
|
|
33
|
-
|
|
34
|
-
client: Object.assign({}, karmaBase.client, {
|
|
35
|
-
firestoreSettings: getFirestoreSettings(argv)
|
|
36
|
-
})
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
config.set(karmaConfig);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Gets the list of files to execute, based on existence of the
|
|
44
|
-
* --unit and --integration command-line arguments.
|
|
45
|
-
*/
|
|
46
|
-
function getTestFiles(argv) {
|
|
47
|
-
const unitTests = 'test/unit/bootstrap.ts';
|
|
48
|
-
const legcayIntegrationTests = 'test/integration/bootstrap.ts';
|
|
49
|
-
const liteIntegrationTests = 'test/lite/bootstrap.ts';
|
|
50
|
-
if (argv.unit) {
|
|
51
|
-
return [unitTests];
|
|
52
|
-
} else if (argv.integration) {
|
|
53
|
-
return [legcayIntegrationTests];
|
|
54
|
-
} else if (argv.lite) {
|
|
55
|
-
process.env.TEST_PLATFORM = 'browser_lite';
|
|
56
|
-
return [liteIntegrationTests];
|
|
57
|
-
} else {
|
|
58
|
-
// Note that we cannot include both the firestore-exp and the legacy SDK
|
|
59
|
-
// as the test runners modify the global namespace cannot be both included
|
|
60
|
-
// in the same bundle.
|
|
61
|
-
return [unitTests, legcayIntegrationTests];
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* If the --local argument is passed, returns a {host, ssl} FirestoreSettings
|
|
67
|
-
* object that point to localhost instead of production.
|
|
68
|
-
*/
|
|
69
|
-
function getFirestoreSettings(argv) {
|
|
70
|
-
if (argv.local) {
|
|
71
|
-
return {
|
|
72
|
-
host: 'localhost:8080',
|
|
73
|
-
ssl: false
|
|
74
|
-
};
|
|
75
|
-
} else {
|
|
76
|
-
return {
|
|
77
|
-
host: 'firestore.googleapis.com',
|
|
78
|
-
ssl: true
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
module.exports.files = getTestFiles(argv);
|
package/rollup.config.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
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 pkg from './package.json';
|
|
19
|
-
import typescriptPlugin from 'rollup-plugin-typescript2';
|
|
20
|
-
import typescript from 'typescript';
|
|
21
|
-
import json from '@rollup/plugin-json';
|
|
22
|
-
|
|
23
|
-
const util = require('../firestore/rollup.shared');
|
|
24
|
-
|
|
25
|
-
const deps = Object.keys({ ...pkg.peerDependencies, ...pkg.dependencies });
|
|
26
|
-
|
|
27
|
-
const es2017Plugins = [
|
|
28
|
-
typescriptPlugin({
|
|
29
|
-
typescript,
|
|
30
|
-
tsconfigOverride: {
|
|
31
|
-
compilerOptions: {
|
|
32
|
-
target: 'es2017'
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
transformers: [util.removeAssertTransformer]
|
|
36
|
-
}),
|
|
37
|
-
json({ preferConst: true })
|
|
38
|
-
];
|
|
39
|
-
|
|
40
|
-
const es5Plugings = [
|
|
41
|
-
typescriptPlugin({
|
|
42
|
-
typescript,
|
|
43
|
-
transformers: [util.removeAssertTransformer]
|
|
44
|
-
}),
|
|
45
|
-
json({ preferConst: true })
|
|
46
|
-
];
|
|
47
|
-
|
|
48
|
-
const browserBuilds = [
|
|
49
|
-
{
|
|
50
|
-
input: './src/index.ts',
|
|
51
|
-
output: {
|
|
52
|
-
file: pkg.browser,
|
|
53
|
-
format: 'es',
|
|
54
|
-
sourcemap: true
|
|
55
|
-
},
|
|
56
|
-
plugins: es2017Plugins,
|
|
57
|
-
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
input: './src/index.ts',
|
|
61
|
-
output: [
|
|
62
|
-
{
|
|
63
|
-
file: pkg.esm5,
|
|
64
|
-
format: 'es',
|
|
65
|
-
sourcemap: true
|
|
66
|
-
}
|
|
67
|
-
],
|
|
68
|
-
plugins: es5Plugings,
|
|
69
|
-
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
|
|
70
|
-
}
|
|
71
|
-
];
|
|
72
|
-
|
|
73
|
-
const nodeBuilds = [
|
|
74
|
-
{
|
|
75
|
-
input: './src/index.node.ts',
|
|
76
|
-
output: {
|
|
77
|
-
file: pkg.main,
|
|
78
|
-
format: 'cjs',
|
|
79
|
-
sourcemap: true
|
|
80
|
-
},
|
|
81
|
-
plugins: es2017Plugins,
|
|
82
|
-
external: deps
|
|
83
|
-
}
|
|
84
|
-
];
|
|
85
|
-
|
|
86
|
-
const rnBuilds = [
|
|
87
|
-
{
|
|
88
|
-
input: './src/index.rn.ts',
|
|
89
|
-
output: {
|
|
90
|
-
file: pkg['react-native'],
|
|
91
|
-
format: 'es',
|
|
92
|
-
sourcemap: true
|
|
93
|
-
},
|
|
94
|
-
plugins: es2017Plugins,
|
|
95
|
-
external: deps
|
|
96
|
-
}
|
|
97
|
-
];
|
|
98
|
-
|
|
99
|
-
export default [...browserBuilds, ...nodeBuilds, ...rnBuilds];
|
package/src/api/blob.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 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 { Bytes, FirestoreError, _isBase64Available } from '@firebase/firestore';
|
|
19
|
-
import { Compat } from '@firebase/util';
|
|
20
|
-
|
|
21
|
-
/** Helper function to assert Uint8Array is available at runtime. */
|
|
22
|
-
function assertUint8ArrayAvailable(): void {
|
|
23
|
-
if (typeof Uint8Array === 'undefined') {
|
|
24
|
-
throw new FirestoreError(
|
|
25
|
-
'unimplemented',
|
|
26
|
-
'Uint8Arrays are not available in this environment.'
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/** Helper function to assert Base64 functions are available at runtime. */
|
|
32
|
-
function assertBase64Available(): void {
|
|
33
|
-
if (!_isBase64Available()) {
|
|
34
|
-
throw new FirestoreError(
|
|
35
|
-
'unimplemented',
|
|
36
|
-
'Blobs are unavailable in Firestore in this environment.'
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/** Immutable class holding a blob (binary data) */
|
|
42
|
-
export class Blob implements Compat<Bytes> {
|
|
43
|
-
constructor(readonly _delegate: Bytes) {}
|
|
44
|
-
static fromBase64String(base64: string): Blob {
|
|
45
|
-
assertBase64Available();
|
|
46
|
-
return new Blob(Bytes.fromBase64String(base64));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
static fromUint8Array(array: Uint8Array): Blob {
|
|
50
|
-
assertUint8ArrayAvailable();
|
|
51
|
-
return new Blob(Bytes.fromUint8Array(array));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
toBase64(): string {
|
|
55
|
-
assertBase64Available();
|
|
56
|
-
return this._delegate.toBase64();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
toUint8Array(): Uint8Array {
|
|
60
|
-
assertUint8ArrayAvailable();
|
|
61
|
-
return this._delegate.toUint8Array();
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
isEqual(other: Blob): boolean {
|
|
65
|
-
return this._delegate.isEqual(other._delegate);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
toString(): string {
|
|
69
|
-
return 'Blob(base64: ' + this.toBase64() + ')';
|
|
70
|
-
}
|
|
71
|
-
}
|