Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

Commit 6c3f1a0

Browse files
Updating synth.py to add V1 Admin API
1 parent b3eb1e2 commit 6c3f1a0

4 files changed

Lines changed: 27 additions & 18 deletions

File tree

dev/src/v1/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515
'use strict';
1616

1717
const FirestoreClient = require('./firestore_client');
18+
const FirestoreAdminClient = require('./firestore_admin_client');
1819

20+
FirestoreClient.FirestoreClient = FirestoreClient;
21+
FirestoreClient.FirestoreAdminClient = FirestoreAdminClient;
1922
module.exports = FirestoreClient;

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,17 @@
7171
"extend": "^3.0.1",
7272
"gts": "^0.9.0",
7373
"hard-rejection": "^2.0.0",
74-
"jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git",
7574
"intelli-espower-loader": "^1.0.1",
7675
"jsdoc": "^3.5.5",
76+
"jsdoc-baseline": "git+https://github.com/hegemonic/jsdoc-baseline.git",
77+
"linkinator": "^1.1.2",
7778
"mocha": "^6.0.0",
7879
"nyc": "^13.0.0",
79-
"proxyquire": "^2.0.1",
80+
"power-assert": "^1.6.1",
8081
"protobufjs": "^6.8.6",
82+
"proxyquire": "^2.0.1",
8183
"source-map-support": "^0.5.6",
8284
"ts-node": "^8.0.0",
83-
"typescript": "~3.3.0",
84-
"linkinator": "^1.1.2"
85+
"typescript": "~3.3.0"
8586
}
8687
}

synth.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,23 @@
88
gapic = gcp.GAPICGenerator()
99

1010
# tasks has two product names, and a poorly named artman yaml
11+
admin_library = gapic.node_library(
12+
"firestore-admin", "v1", config_path="/google/firestore/admin/artman_firestore_v1.yaml"
13+
)
1114
library = gapic.node_library(
1215
"firestore", "v1", config_path="/google/firestore/artman_firestore_v1.yaml"
1316
)
1417

1518
# skip index, protos, package.json, and README.md
16-
s.copy(library, "dev", excludes=["package.json", "README.md", "src/index.js"])
19+
s.copy(admin_library, "dev", excludes=["package.json", "README.md", "src/index.js", "src/v1/index.js"])
20+
s.copy(library, "dev", excludes=["package.json", "README.md", "src/index.js", "src/v1/index.js"])
1721

1822
# package.json is one level deeper since firestore's src/ is under dev/
1923
s.replace(
20-
"dev/src/v1/firestore_client.js", "../../package.json", "../../../package.json"
24+
"dev/src/v1/firestore_admin_client.js", "../../package.json", "../../../package.json"
2125
)
22-
23-
# Special case for firestore: FirestoreClient is exported as top level module.exports
24-
# from gapic-generated code
2526
s.replace(
26-
"dev/src/v1/index.js",
27-
"module.exports.FirestoreClient = FirestoreClient",
28-
"module.exports = FirestoreClient",
29-
)
30-
31-
s.replace(
32-
"dev/test/gapic-v1.js",
33-
"new firestoreModule.v1.FirestoreClient\(",
34-
"new firestoreModule.v1(",
27+
"dev/src/v1/firestore_client.js", "../../package.json", "../../../package.json"
3528
)
3629

3730
# Fix dropping of google-cloud-resource-header

types/firestore.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,6 +1340,18 @@ declare namespace FirebaseFirestore {
13401340
*/
13411341
isEqual(other: Timestamp): boolean;
13421342
}
1343+
1344+
/**
1345+
* The v1beta1 Veneer client. This client provides access to to the underlying
1346+
* Firestore v1beta1 RPCs.
1347+
*/
1348+
export const v1beta1 : any;
1349+
1350+
/**
1351+
* The v1 Veneer clients. These clients provide access to the Firestore Admin
1352+
* API and the underlying Firestore v1 RPCs.
1353+
*/
1354+
export const v1: {FirestoreClient: any, FirestoreAdminClient: any};
13431355
}
13441356

13451357
declare module '@google-cloud/firestore' {

0 commit comments

Comments
 (0)