Skip to content

Commit 22415cc

Browse files
committed
[1/4] Add ppl protos and setup dependencies
1 parent bb8fc27 commit 22415cc

File tree

8 files changed

+293
-17
lines changed

8 files changed

+293
-17
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ dist
44
.awcache
55
.cache
66
/config/project.json
7+
/config/prod.project.json
78
scripts/docgen-compat/html
89

910
# OS Specific Files

packages/firestore/externs.json

+3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
"node_modules/typescript/lib/lib.dom.d.ts",
66
"node_modules/typescript/lib/lib.es2015.promise.d.ts",
77
"node_modules/typescript/lib/lib.es2015.symbol.d.ts",
8+
"node_modules/typescript/lib/lib.es2020.bigint.d.ts",
89
"node_modules/typescript/lib/lib.es2015.iterable.d.ts",
910
"node_modules/typescript/lib/lib.es2015.collection.d.ts",
1011
"node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts",
1112
"node_modules/typescript/lib/lib.es2015.core.d.ts",
1213
"node_modules/typescript/lib/lib.es2017.object.d.ts",
1314
"node_modules/typescript/lib/lib.es2017.string.d.ts",
15+
"node_modules/typescript/lib/lib.es2019.array.d.ts",
16+
"node_modules/re2js/build/index.esm.d.ts",
1417
"packages/app-types/index.d.ts",
1518
"packages/app-types/private.d.ts",
1619
"packages/app/dist/app.d.ts",

packages/firestore/package.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@
119119
"license": "Apache-2.0",
120120
"files": [
121121
"dist",
122-
"lite/package.json"
122+
"lite",
123+
"pipelines"
123124
],
124125
"dependencies": {
125126
"@firebase/component": "0.6.13",
@@ -128,7 +129,9 @@
128129
"@firebase/webchannel-wrapper": "1.0.3",
129130
"@grpc/grpc-js": "~1.9.0",
130131
"@grpc/proto-loader": "^0.7.8",
131-
"tslib": "^2.1.0"
132+
"re2js": "^0.4.2",
133+
"tslib": "^2.1.0",
134+
"undici": "6.19.7"
132135
},
133136
"peerDependencies": {
134137
"@firebase/app": "0.x"
@@ -146,6 +149,7 @@
146149
"rollup": "2.79.2",
147150
"rollup-plugin-copy": "3.5.0",
148151
"rollup-plugin-copy-assets": "2.0.3",
152+
"rollup-plugin-dts": "5.3.1",
149153
"rollup-plugin-replace": "2.2.0",
150154
"rollup-plugin-sourcemaps": "0.6.3",
151155
"@rollup/plugin-terser": "0.4.4",
@@ -162,7 +166,7 @@
162166
"bugs": {
163167
"url": "https://github.com/firebase/firebase-js-sdk/issues"
164168
},
165-
"types": "dist/index.d.ts",
169+
"types": "dist/firestore/src/index.d.ts",
166170
"nyc": {
167171
"extension": [
168172
".ts"

packages/firestore/src/protos/firestore_proto_api.ts

+6
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,9 @@ export declare namespace firestoreV1ApiClientInterfaces {
356356
parent?: string;
357357
structuredQuery?: StructuredQuery;
358358
}
359+
interface PipelineQueryTarget {
360+
structuredPipeline?: StructuredPipeline;
361+
}
359362
interface ReadOnly {
360363
readTime?: string;
361364
}
@@ -424,6 +427,7 @@ export declare namespace firestoreV1ApiClientInterfaces {
424427
interface Target {
425428
query?: QueryTarget;
426429
documents?: DocumentsTarget;
430+
pipelineQuery?: PipelineQueryTarget;
427431
resumeToken?: string | Uint8Array;
428432
readTime?: Timestamp;
429433
targetId?: number;
@@ -555,6 +559,8 @@ export declare type Pipeline = firestoreV1ApiClientInterfaces.Pipeline;
555559
export declare type Precondition = firestoreV1ApiClientInterfaces.Precondition;
556560
export declare type Projection = firestoreV1ApiClientInterfaces.Projection;
557561
export declare type QueryTarget = firestoreV1ApiClientInterfaces.QueryTarget;
562+
export declare type PipelineQueryTarget =
563+
firestoreV1ApiClientInterfaces.PipelineQueryTarget;
558564
export declare type ReadOnly = firestoreV1ApiClientInterfaces.ReadOnly;
559565
export declare type ReadWrite = firestoreV1ApiClientInterfaces.ReadWrite;
560566
export declare type RollbackRequest =

packages/firestore/src/protos/google/firestore/v1/firestore.proto

+12
Original file line numberDiff line numberDiff line change
@@ -913,13 +913,25 @@ message Target {
913913
}
914914
}
915915

916+
// A target specified by a pipeline query.
917+
message PipelineQueryTarget {
918+
// The pipeline to run.
919+
oneof pipeline_type {
920+
// A pipelined operation in structured format.
921+
StructuredPipeline structured_pipeline = 1;
922+
}
923+
}
924+
916925
// The type of target to listen to.
917926
oneof target_type {
918927
// A target specified by a query.
919928
QueryTarget query = 2;
920929

921930
// A target specified by a set of document names.
922931
DocumentsTarget documents = 3;
932+
933+
// A target specified by a pipeline query.
934+
PipelineQueryTarget pipeline_query = 13;
923935
}
924936

925937
// When to start listening.

packages/firestore/src/protos/google/firestore/v1/write.proto

+6
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,12 @@ message WriteResult {
198198
//
199199
// Multiple [DocumentChange][google.firestore.v1.DocumentChange] messages may be returned for the same logical
200200
// change, if multiple targets are affected.
201+
//
202+
// For PipelineQueryTargets, `document` will be in the new pipeline format,
203+
// (-- TODO(b/330735468): Insert link to spec. --)
204+
// For a Listen stream with both QueryTargets and PipelineQueryTargets present,
205+
// if a document matches both types of queries, then a separate DocumentChange
206+
// messages will be sent out one for each set.
201207
message DocumentChange {
202208
// The new state of the [Document][google.firestore.v1.Document].
203209
//

packages/firestore/src/protos/protos.json

+22-2
Original file line numberDiff line numberDiff line change
@@ -2343,7 +2343,8 @@
23432343
"targetType": {
23442344
"oneof": [
23452345
"query",
2346-
"documents"
2346+
"documents",
2347+
"pipeline_query"
23472348
]
23482349
},
23492350
"resumeType": {
@@ -2362,6 +2363,10 @@
23622363
"type": "DocumentsTarget",
23632364
"id": 3
23642365
},
2366+
"pipelineQuery": {
2367+
"type": "PipelineQueryTarget",
2368+
"id": 13
2369+
},
23652370
"resumeToken": {
23662371
"type": "bytes",
23672372
"id": 4
@@ -2411,6 +2416,21 @@
24112416
"id": 2
24122417
}
24132418
}
2419+
},
2420+
"PipelineQueryTarget": {
2421+
"oneofs": {
2422+
"pipelineType": {
2423+
"oneof": [
2424+
"structuredPipeline"
2425+
]
2426+
}
2427+
},
2428+
"fields": {
2429+
"structuredPipeline": {
2430+
"type": "StructuredPipeline",
2431+
"id": 1
2432+
}
2433+
}
24142434
}
24152435
}
24162436
},
@@ -3266,4 +3286,4 @@
32663286
}
32673287
}
32683288
}
3269-
}
3289+
}

0 commit comments

Comments
 (0)