Skip to content

Commit

Permalink
MEP for firestore lite building
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkDuckworth committed Dec 19, 2024
1 parent e23ecfb commit 8006776
Show file tree
Hide file tree
Showing 10 changed files with 2,164 additions and 1,956 deletions.
1,846 changes: 1,846 additions & 0 deletions common/api-review/firestore-lite-pipelines.api.md

Large diffs are not rendered by default.

1,794 changes: 40 additions & 1,754 deletions common/api-review/firestore-lite.api.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions packages/firestore/externs.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"packages/app-check-interop-types/index.d.ts",
"packages/auth-interop-types/index.d.ts",
"packages/firestore/dist/lite/internal.d.ts",
"packages/firestore/dist/lite/internal.pipelines.d.ts",
"packages/firestore/dist/internal.d.ts",
"packages/firestore/dist/internal.pipelines.d.ts",
"packages/firestore-types/index.d.ts",
"packages/firebase/compat/index.d.ts",
"packages/component/dist/src/component.d.ts",
Expand Down
167 changes: 0 additions & 167 deletions packages/firestore/lite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,173 +27,6 @@
import { registerFirestore } from './register';
registerFirestore();

export { PipelineSource } from '../src/lite-api/pipeline-source';

export { PipelineResult } from '../src/lite-api/pipeline-result';

export { Pipeline } from '../src/lite-api/pipeline';

export {
useFluentPipelines,
pipeline,
execute
} from '../src/lite-api/pipeline_impl';

export {
Stage,
FindNearestOptions,
AddFields,
Aggregate,
Distinct,
CollectionSource,
CollectionGroupSource,
DatabaseSource,
DocumentsSource,
Where,
FindNearest,
Limit,
Offset,
Select,
Sort,
GenericStage
} from '../src/lite-api/stage';

export {
add,
subtract,
multiply,
divide,
mod,
eq,
neq,
lt,
lte,
gt,
gte,
arrayConcat,
arrayContains,
arrayContainsAny,
arrayContainsAll,
arrayLength,
eqAny,
notEqAny,
xor,
cond,
not,
logicalMaximum,
logicalMinimum,
exists,
isNan,
reverse,
replaceFirst,
replaceAll,
byteLength,
charLength,
like,
regexContains,
regexMatch,
strContains,
startsWith,
endsWith,
toLower,
toUpper,
trim,
strConcat,
mapGet,
countAll,
minimum,
maximum,
cosineDistance,
dotProduct,
euclideanDistance,
vectorLength,
unixMicrosToTimestamp,
timestampToUnixMicros,
unixMillisToTimestamp,
timestampToUnixMillis,
unixSecondsToTimestamp,
timestampToUnixSeconds,
timestampAdd,
timestampSub,
genericFunction,
ascending,
descending,
ExprWithAlias,
Field,
Fields,
Constant,
FirestoreFunction,
Add,
Subtract,
Multiply,
Divide,
Mod,
Eq,
Neq,
Lt,
Lte,
Gt,
Gte,
ArrayConcat,
ArrayReverse,
ArrayContains,
ArrayContainsAll,
ArrayContainsAny,
ArrayLength,
ArrayElement,
EqAny,
IsNan,
Exists,
Not,
And,
Or,
Xor,
Cond,
LogicalMaximum,
LogicalMinimum,
Reverse,
ReplaceFirst,
ReplaceAll,
CharLength,
ByteLength,
Like,
RegexContains,
RegexMatch,
StrContains,
StartsWith,
EndsWith,
ToLower,
ToUpper,
Trim,
StrConcat,
MapGet,
Count,
Sum,
Avg,
Minimum,
Maximum,
CosineDistance,
DotProduct,
EuclideanDistance,
VectorLength,
UnixMicrosToTimestamp,
TimestampToUnixMicros,
UnixMillisToTimestamp,
TimestampToUnixMillis,
UnixSecondsToTimestamp,
TimestampToUnixSeconds,
TimestampAdd,
TimestampSub,
Ordering,
ExprType,
AccumulatorTarget,
FilterExpr,
SelectableExpr,
Selectable,
FilterCondition,
Accumulator
} from '../src/lite-api/expressions';

export {
aggregateQuerySnapshotEqual,
getCount,
Expand Down
215 changes: 215 additions & 0 deletions packages/firestore/lite/pipelines.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
/**
* Firestore Lite Pipelines
*
* @remarks Firestore Lite is a small online-only SDK that allows read
* and write access to your Firestore database. All operations connect
* directly to the backend, and `onSnapshot()` APIs are not supported.
* @packageDocumentation
*/
/**
* @license
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// External exports: ./index
// These external exports will be stripped from the dist/pipelines.d.ts file
// by the prune-dts script, in order to reduce type duplication. However, these
// types need to be exported here to ensure that api-extractor behaves
// correctly. If a type from api.ts is missing from this export, then
// api-extractor may rename it with a suffix `_#`, e.g. `YourType_2`.
export type {
Timestamp,
DocumentReference,
VectorValue,
GeoPoint,
FieldPath,
DocumentData,
Query,
Firestore,
FirestoreDataConverter,
WithFieldValue,
PartialWithFieldValue,
SetOptions,
QueryDocumentSnapshot,
Primitive,
FieldValue
} from './index';

export { PipelineSource } from '../src/lite-api/pipeline-source';

export { PipelineResult } from '../src/lite-api/pipeline-result';

export { Pipeline } from '../src/lite-api/pipeline';

export {
useFluentPipelines,
pipeline,
execute
} from '../src/lite-api/pipeline_impl';

export {
Stage,
FindNearestOptions,
AddFields,
Aggregate,
Distinct,
CollectionSource,
CollectionGroupSource,
DatabaseSource,
DocumentsSource,
Where,
FindNearest,
Limit,
Offset,
Select,
Sort,
GenericStage
} from '../src/lite-api/stage';

export {
add,
subtract,
multiply,
divide,
mod,
eq,
neq,
lt,
lte,
gt,
gte,
arrayConcat,
arrayContains,
arrayContainsAny,
arrayContainsAll,
arrayLength,
eqAny,
notEqAny,
xor,
cond,
not,
logicalMaximum,
logicalMinimum,
exists,
isNan,
reverse,
replaceFirst,
replaceAll,
byteLength,
charLength,
like,
regexContains,
regexMatch,
strContains,
startsWith,
endsWith,
toLower,
toUpper,
trim,
strConcat,
mapGet,
countAll,
minimum,
maximum,
cosineDistance,
dotProduct,
euclideanDistance,
vectorLength,
unixMicrosToTimestamp,
timestampToUnixMicros,
unixMillisToTimestamp,
timestampToUnixMillis,
unixSecondsToTimestamp,
timestampToUnixSeconds,
timestampAdd,
timestampSub,
genericFunction,
ascending,
descending,
ExprWithAlias,
Field,
Fields,
Constant,
FirestoreFunction,
Add,
Subtract,
Multiply,
Divide,
Mod,
Eq,
Neq,
Lt,
Lte,
Gt,
Gte,
ArrayConcat,
ArrayReverse,
ArrayContains,
ArrayContainsAll,
ArrayContainsAny,
ArrayLength,
ArrayElement,
EqAny,
IsNan,
Exists,
Not,
And,
Or,
Xor,
Cond,
LogicalMaximum,
LogicalMinimum,
Reverse,
ReplaceFirst,
ReplaceAll,
CharLength,
ByteLength,
Like,
RegexContains,
RegexMatch,
StrContains,
StartsWith,
EndsWith,
ToLower,
ToUpper,
Trim,
StrConcat,
MapGet,
Count,
Sum,
Avg,
Minimum,
Maximum,
CosineDistance,
DotProduct,
EuclideanDistance,
VectorLength,
UnixMicrosToTimestamp,
TimestampToUnixMicros,
UnixMillisToTimestamp,
TimestampToUnixMillis,
UnixSecondsToTimestamp,
TimestampToUnixSeconds,
TimestampAdd,
TimestampSub,
Ordering,
ExprType,
AccumulatorTarget,
FilterExpr,
SelectableExpr,
Selectable,
FilterCondition,
Accumulator
} from '../src/lite-api/expressions';
Loading

0 comments on commit 8006776

Please sign in to comment.