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

build: make update-license script work on Windows #851

Merged
merged 4 commits into from
Jan 2, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion dev/protos/firestore_admin_v1_proto_api.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2019 Google LLC
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions dev/protos/firestore_admin_v1_proto_api.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2019 Google LLC
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -5398,4 +5398,4 @@ $root.google = (function() {
})();

return google;
})();
})();
10 changes: 5 additions & 5 deletions dev/protos/firestore_v1_proto_api.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2019 Google LLC
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -3278,10 +3278,6 @@ export namespace google {
public direction: google.firestore.v1.StructuredQuery.Direction;
}

/** Direction enum. */
type Direction =
"DIRECTION_UNSPECIFIED"| "ASCENDING"| "DESCENDING";

/** Properties of a FieldReference. */
interface IFieldReference {

Expand Down Expand Up @@ -3321,6 +3317,10 @@ export namespace google {
/** Projection fields. */
public fields: google.firestore.v1.StructuredQuery.IFieldReference[];
}

/** Direction enum. */
type Direction =
"DIRECTION_UNSPECIFIED"| "ASCENDING"| "DESCENDING";
}

/** Properties of a Cursor. */
Expand Down
36 changes: 18 additions & 18 deletions dev/protos/firestore_v1_proto_api.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2019 Google LLC
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -5705,22 +5705,6 @@ $root.google = (function() {
return Order;
})();

/**
* Direction enum.
* @name google.firestore.v1.StructuredQuery.Direction
* @enum {number}
* @property {string} DIRECTION_UNSPECIFIED=DIRECTION_UNSPECIFIED DIRECTION_UNSPECIFIED value
* @property {string} ASCENDING=ASCENDING ASCENDING value
* @property {string} DESCENDING=DESCENDING DESCENDING value
*/
StructuredQuery.Direction = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "DIRECTION_UNSPECIFIED"] = "DIRECTION_UNSPECIFIED";
values[valuesById[1] = "ASCENDING"] = "ASCENDING";
values[valuesById[2] = "DESCENDING"] = "DESCENDING";
return values;
})();

StructuredQuery.FieldReference = (function() {

/**
Expand Down Expand Up @@ -5792,6 +5776,22 @@ $root.google = (function() {
return Projection;
})();

/**
* Direction enum.
* @name google.firestore.v1.StructuredQuery.Direction
* @enum {number}
* @property {string} DIRECTION_UNSPECIFIED=DIRECTION_UNSPECIFIED DIRECTION_UNSPECIFIED value
* @property {string} ASCENDING=ASCENDING ASCENDING value
* @property {string} DESCENDING=DESCENDING DESCENDING value
*/
StructuredQuery.Direction = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "DIRECTION_UNSPECIFIED"] = "DIRECTION_UNSPECIFIED";
values[valuesById[1] = "ASCENDING"] = "ASCENDING";
values[valuesById[2] = "DESCENDING"] = "DESCENDING";
return values;
})();

return StructuredQuery;
})();

Expand Down Expand Up @@ -7428,4 +7428,4 @@ $root.google = (function() {
})();

return google;
})();
})();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have new lines back? (here and everywhere)

2 changes: 1 addition & 1 deletion dev/protos/firestore_v1beta1_proto_api.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2019 Google LLC
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions dev/protos/firestore_v1beta1_proto_api.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2019 Google LLC
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -7428,4 +7428,4 @@ $root.google = (function() {
})();

return google;
})();
})();
26 changes: 10 additions & 16 deletions dev/protos/google/firestore/v1/firestore.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,12 @@ option php_namespace = "Google\\Cloud\\Firestore\\V1";

// The Cloud Firestore service.
//
// This service exposes several types of comparable timestamps:
//
// * `create_time` - The time at which a document was created. Changes only
// when a document is deleted, then re-created. Increases in a strict
// monotonic fashion.
// * `update_time` - The time at which a document was last updated. Changes
// every time a document is modified. Does not change when a write results
// in no modifications. Increases in a strict monotonic fashion.
// * `read_time` - The time at which a particular state was observed. Used
// to denote a consistent snapshot of the database or the time at which a
// Document was observed to not exist.
// * `commit_time` - The time at which the writes in a transaction were
// committed. Any read with an equal or greater `read_time` is guaranteed
// to see the effects of the transaction.
// Cloud Firestore is a fast, fully managed, serverless, cloud-native NoSQL
// document database that simplifies storing, syncing, and querying data for
// your mobile, web, and IoT apps at global scale. Its client libraries provide
// live synchronization and offline support, while its security features and
// integrations with Firebase and Google Cloud Platform (GCP) accelerate
// building truly serverless apps.
service Firestore {
option (google.api.default_host) = "firestore.googleapis.com";
option (google.api.oauth_scopes) =
Expand Down Expand Up @@ -425,7 +417,8 @@ message CommitResponse {
// request.
repeated WriteResult write_results = 1;

// The time at which the commit occurred.
// The time at which the commit occurred. Any read with an equal or greater
// `read_time` is guaranteed to see the effects of the commit.
google.protobuf.Timestamp commit_time = 2;
}

Expand Down Expand Up @@ -566,7 +559,8 @@ message WriteResponse {
// request.
repeated WriteResult write_results = 3;

// The time at which the commit occurred.
// The time at which the commit occurred. Any read with an equal or greater
// `read_time` is guaranteed to see the effects of the write.
google.protobuf.Timestamp commit_time = 4;
}

Expand Down
24 changes: 12 additions & 12 deletions dev/protos/google/firestore/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,6 @@ message StructuredQuery {
Direction direction = 2;
}

// A sort direction.
enum Direction {
// Unspecified.
DIRECTION_UNSPECIFIED = 0;

// Ascending.
ASCENDING = 1;

// Descending.
DESCENDING = 2;
}

// A reference to a field, such as `max(messages.time) as max_time`.
message FieldReference {
string field_path = 2;
Expand All @@ -181,6 +169,18 @@ message StructuredQuery {
repeated FieldReference fields = 2;
}

// A sort direction.
enum Direction {
// Unspecified.
DIRECTION_UNSPECIFIED = 0;

// Ascending.
ASCENDING = 1;

// Descending.
DESCENDING = 2;
}

// The projection to return.
Projection select = 1;

Expand Down
38 changes: 0 additions & 38 deletions dev/protos/insert-license.sh

This file was deleted.

2 changes: 1 addition & 1 deletion dev/protos/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ PBJS_ARGS=( --proto_path=. \
"${PROTOS_DIR}/google/longrunning/*.proto"
"${PBTS}" -o firestore_v1beta1_proto_api.d.ts firestore_v1beta1_proto_api.js

"${PROTOS_DIR}"/insert-license.sh *.d.ts *.js
node "${PROTOS_DIR}"/../../scripts/license.js *.d.ts *.js

# Copy typings into source repo
cp {firestore_v1_proto_api.d.ts,firestore_v1_proto_api.js} ${PROTOS_DIR}
Expand Down
39 changes: 39 additions & 0 deletions scripts/license.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*!
* Copyright 2020 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.
*/

const fs = require('fs');

const LICENSE_HEADER = `/*!
* Copyright 2020 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.
*/
`;

for (const file of process.argv.slice(2)) {
const content = fs.readFileSync(file);
fs.writeFileSync(file, `${LICENSE_HEADER}\n${content}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just add \n here

}