Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markduckworth/ppl #8578

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,764 changes: 1,725 additions & 39 deletions common/api-review/firestore-lite.api.md

Large diffs are not rendered by default.

1,699 changes: 1,692 additions & 7 deletions common/api-review/firestore.api.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"postinstall-postinstall": "2.1.0",
"prettier": "2.8.7",
"protractor": "5.4.2",
"protobufjs-cli": "^1.1.3",
"request": "2.88.2",
"semver": "7.5.3",
"simple-git": "3.24.0",
Expand Down
166 changes: 166 additions & 0 deletions packages/firestore/lite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,172 @@
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 {
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,
inAny,
notInAny,
and as andExpression,
or as orExpression,
xor,
ifFunction,
not,
logicalMax,
logicalMin,
exists,
isNan,
reverse,
replaceFirst,
replaceAll,
byteLength,
charLength,
like,
regexContains,
regexMatch,
strContains,
startsWith,
endsWith,
toLower,
toUpper,
trim,
strConcat,
mapGet,
countAll,
count as countExpression,
sum as sumExpression,
avg,
min,
max,
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,
In,
IsNan,
Exists,
Not,
And,
Or,
Xor,
If,
LogicalMax,
LogicalMin,
Reverse,
ReplaceFirst,
ReplaceAll,
CharLength,
ByteLength,
Like,
RegexContains,
RegexMatch,
StrContains,
StartsWith,
EndsWith,
ToLower,
ToUpper,
Trim,
StrConcat,
MapGet,
Count,
Sum,
Avg,
Min,
Max,
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
8 changes: 5 additions & 3 deletions packages/firestore/rollup.shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,11 @@ exports.resolveNodeExterns = function (id) {

/** Breaks the build if there is a circular dependency. */
exports.onwarn = function (warning, defaultWarn) {
if (warning.code === 'CIRCULAR_DEPENDENCY') {
throw new Error(warning);
}
// TODO(pipeline) re-enable and fix circular dependencies after the pipeline exploration phase
// if (warning.code === 'CIRCULAR_DEPENDENCY') {
// console.log(JSON.stringify(warning));
// throw new Error(warning);
// }
defaultWarn(warning);
};

Expand Down
166 changes: 166 additions & 0 deletions packages/firestore/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,172 @@
* limitations under the License.
*/

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

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

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

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

export {
add,
subtract,
multiply,
divide,
mod,
eq,
neq,
lt,
lte,
gt,
gte,
arrayConcat,
arrayContains,
arrayContainsAny,
arrayContainsAll,
arrayLength,
inAny,
notInAny,
and as andExpression,
or as orExpression,
xor,
ifFunction,
not,
logicalMax,
logicalMin,
exists,
isNan,
reverse,
replaceFirst,
replaceAll,
byteLength,
charLength,
like,
regexContains,
regexMatch,
strContains,
startsWith,
endsWith,
toLower,
toUpper,
trim,
strConcat,
mapGet,
countAll,
count as countExpression,
sum as sumExpression,
avg,
min,
max,
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,
In,
IsNan,
Exists,
Not,
And,
Or,
Xor,
If,
LogicalMax,
LogicalMin,
Reverse,
ReplaceFirst,
ReplaceAll,
CharLength,
ByteLength,
Like,
RegexContains,
RegexMatch,
StrContains,
StartsWith,
EndsWith,
ToLower,
ToUpper,
Trim,
StrConcat,
MapGet,
Count,
Sum,
Avg,
Min,
Max,
CosineDistance,
DotProduct,
EuclideanDistance,
VectorLength,
UnixMicrosToTimestamp,
TimestampToUnixMicros,
UnixMillisToTimestamp,
TimestampToUnixMillis,
UnixSecondsToTimestamp,
TimestampToUnixSeconds,
TimestampAdd,
TimestampSub,
Ordering,
ExprType,
AccumulatorTarget,
FilterExpr,
SelectableExpr,
Selectable,
FilterCondition,
Accumulator
} from './lite-api/expressions';

export {
aggregateFieldEqual,
aggregateQuerySnapshotEqual,
Expand Down
10 changes: 7 additions & 3 deletions packages/firestore/src/api/aggregate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,21 @@
* limitations under the License.
*/

import { AggregateField, AggregateSpec, DocumentData, Query } from '../api';
import { AggregateImpl } from '../core/aggregate';
import { firestoreClientRunAggregateQuery } from '../core/firestore_client';
import { count } from '../lite-api/aggregate';
import { AggregateQuerySnapshot } from '../lite-api/aggregate_types';
import {
AggregateField,
AggregateQuerySnapshot,
AggregateSpec
} from '../lite-api/aggregate_types';
import { DocumentData, Query } from '../lite-api/reference';
import { ApiClientObjectMap, Value } from '../protos/firestore_proto_api';
import { cast } from '../util/input_validation';
import { mapToArray } from '../util/obj';

import { ensureFirestoreConfigured, Firestore } from './database';
import { ExpUserDataWriter } from './reference_impl';
import { ExpUserDataWriter } from './user_data_writer';

export {
aggregateQuerySnapshotEqual,
Expand Down
Loading
Loading