diff --git a/packages/google-storage-control/.OwlBot.yaml b/packages/google-storage-control/.OwlBot.yaml index d963237aaa1..688844a25c1 100644 --- a/packages/google-storage-control/.OwlBot.yaml +++ b/packages/google-storage-control/.OwlBot.yaml @@ -15,7 +15,5 @@ deep-copy-regex: - source: /google/storage/control/google-storage-control-nodejs dest: /owl-bot-staging/google-storage-control -deep-preserve-regex: - - /.*\.jsdoc\.js api-name: control \ No newline at end of file diff --git a/packages/google-storage-control/.eslintrc.json b/packages/google-storage-control/.eslintrc.json index 78215349546..3e8d97ccb39 100644 --- a/packages/google-storage-control/.eslintrc.json +++ b/packages/google-storage-control/.eslintrc.json @@ -1,3 +1,4 @@ { - "extends": "./node_modules/gts" + "extends": "./node_modules/gts", + "root": true } diff --git a/packages/google-storage-control/.gitattributes b/packages/google-storage-control/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-storage-control/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-storage-control/CODE_OF_CONDUCT.md b/packages/google-storage-control/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-storage-control/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-storage-control/CONTRIBUTING.md b/packages/google-storage-control/CONTRIBUTING.md new file mode 100644 index 00000000000..09c4066f429 --- /dev/null +++ b/packages/google-storage-control/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Control API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=storage.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-storage-control/LICENSE b/packages/google-storage-control/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-storage-control/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/packages/google-storage-control/protos/google/storage/v2/storage.proto b/packages/google-storage-control/protos/google/storage/v2/storage.proto index d1cea3b906c..4b649f47638 100644 --- a/packages/google-storage-control/protos/google/storage/v2/storage.proto +++ b/packages/google-storage-control/protos/google/storage/v2/storage.proto @@ -1461,6 +1461,9 @@ message WriteObjectResponse { // the upload has finalized. StorageObject resource = 2; } + + // If persisted_size is set, contains checksums of persisted data. + ObjectChecksums persisted_data_checksums = 3; } // Describes an attempt to append to an object, possibly over multiple requests. @@ -1543,9 +1546,9 @@ message BidiWriteObjectRequest { } // Optional. Checksums for the complete object. If the checksums computed by - // the service don't match the specified checksums the call fails. Might only - // be provided in the first request or the last request (with finish_write - // set). + // the service don't match the specified checksums the call fails. May be + // provided in the last request (with finish_write set). For non-appendable + // objects only, may also be provided in the first request. ObjectChecksums object_checksums = 6 [(google.api.field_behavior) = OPTIONAL]; // Optional. For each `BidiWriteObjectRequest` where `state_lookup` is `true` @@ -1593,6 +1596,9 @@ message BidiWriteObjectResponse { StorageObject resource = 2; } + // If persisted_size is set, contains checksums of persisted data. + ObjectChecksums persisted_data_checksums = 4; + // An optional write handle that is returned periodically in response // messages. Clients should save it for later use in establishing a new stream // if a connection is interrupted. @@ -1704,6 +1710,9 @@ message QueryWriteStatusResponse { // the upload has finalized. StorageObject resource = 2; } + + // If persisted_size is set, contains checksums of persisted data. + ObjectChecksums persisted_data_checksums = 3; } // Request message for [RewriteObject][google.storage.v2.Storage.RewriteObject]. diff --git a/packages/google-storage-control/protos/protos.d.ts b/packages/google-storage-control/protos/protos.d.ts index e4b6b2a3002..83c05c95e28 100644 --- a/packages/google-storage-control/protos/protos.d.ts +++ b/packages/google-storage-control/protos/protos.d.ts @@ -9727,6 +9727,9 @@ export namespace google { /** WriteObjectResponse resource */ resource?: (google.storage.v2.IStorageObject|null); + + /** WriteObjectResponse persistedDataChecksums */ + persistedDataChecksums?: (google.storage.v2.IObjectChecksums|null); } /** Represents a WriteObjectResponse. */ @@ -9744,6 +9747,9 @@ export namespace google { /** WriteObjectResponse resource. */ public resource?: (google.storage.v2.IStorageObject|null); + /** WriteObjectResponse persistedDataChecksums. */ + public persistedDataChecksums?: (google.storage.v2.IObjectChecksums|null); + /** WriteObjectResponse writeStatus. */ public writeStatus?: ("persistedSize"|"resource"); @@ -10124,6 +10130,9 @@ export namespace google { /** BidiWriteObjectResponse resource */ resource?: (google.storage.v2.IStorageObject|null); + /** BidiWriteObjectResponse persistedDataChecksums */ + persistedDataChecksums?: (google.storage.v2.IObjectChecksums|null); + /** BidiWriteObjectResponse writeHandle */ writeHandle?: (google.storage.v2.IBidiWriteHandle|null); } @@ -10143,6 +10152,9 @@ export namespace google { /** BidiWriteObjectResponse resource. */ public resource?: (google.storage.v2.IStorageObject|null); + /** BidiWriteObjectResponse persistedDataChecksums. */ + public persistedDataChecksums?: (google.storage.v2.IObjectChecksums|null); + /** BidiWriteObjectResponse writeHandle. */ public writeHandle?: (google.storage.v2.IBidiWriteHandle|null); @@ -10513,6 +10525,9 @@ export namespace google { /** QueryWriteStatusResponse resource */ resource?: (google.storage.v2.IStorageObject|null); + + /** QueryWriteStatusResponse persistedDataChecksums */ + persistedDataChecksums?: (google.storage.v2.IObjectChecksums|null); } /** Represents a QueryWriteStatusResponse. */ @@ -10530,6 +10545,9 @@ export namespace google { /** QueryWriteStatusResponse resource. */ public resource?: (google.storage.v2.IStorageObject|null); + /** QueryWriteStatusResponse persistedDataChecksums. */ + public persistedDataChecksums?: (google.storage.v2.IObjectChecksums|null); + /** QueryWriteStatusResponse writeStatus. */ public writeStatus?: ("persistedSize"|"resource"); diff --git a/packages/google-storage-control/protos/protos.js b/packages/google-storage-control/protos/protos.js index 9898f374bc4..34f4dd107e5 100644 --- a/packages/google-storage-control/protos/protos.js +++ b/packages/google-storage-control/protos/protos.js @@ -24336,6 +24336,7 @@ * @interface IWriteObjectResponse * @property {number|Long|null} [persistedSize] WriteObjectResponse persistedSize * @property {google.storage.v2.IStorageObject|null} [resource] WriteObjectResponse resource + * @property {google.storage.v2.IObjectChecksums|null} [persistedDataChecksums] WriteObjectResponse persistedDataChecksums */ /** @@ -24369,6 +24370,14 @@ */ WriteObjectResponse.prototype.resource = null; + /** + * WriteObjectResponse persistedDataChecksums. + * @member {google.storage.v2.IObjectChecksums|null|undefined} persistedDataChecksums + * @memberof google.storage.v2.WriteObjectResponse + * @instance + */ + WriteObjectResponse.prototype.persistedDataChecksums = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -24411,6 +24420,8 @@ writer.uint32(/* id 1, wireType 0 =*/8).int64(message.persistedSize); if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.google.storage.v2.StorageObject.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.persistedDataChecksums != null && Object.hasOwnProperty.call(message, "persistedDataChecksums")) + $root.google.storage.v2.ObjectChecksums.encode(message.persistedDataChecksums, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -24455,6 +24466,10 @@ message.resource = $root.google.storage.v2.StorageObject.decode(reader, reader.uint32()); break; } + case 3: { + message.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -24506,6 +24521,11 @@ return "resource." + error; } } + if (message.persistedDataChecksums != null && message.hasOwnProperty("persistedDataChecksums")) { + var error = $root.google.storage.v2.ObjectChecksums.verify(message.persistedDataChecksums); + if (error) + return "persistedDataChecksums." + error; + } return null; }; @@ -24535,6 +24555,11 @@ throw TypeError(".google.storage.v2.WriteObjectResponse.resource: object expected"); message.resource = $root.google.storage.v2.StorageObject.fromObject(object.resource); } + if (object.persistedDataChecksums != null) { + if (typeof object.persistedDataChecksums !== "object") + throw TypeError(".google.storage.v2.WriteObjectResponse.persistedDataChecksums: object expected"); + message.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.persistedDataChecksums); + } return message; }; @@ -24551,6 +24576,8 @@ if (!options) options = {}; var object = {}; + if (options.defaults) + object.persistedDataChecksums = null; if (message.persistedSize != null && message.hasOwnProperty("persistedSize")) { if (typeof message.persistedSize === "number") object.persistedSize = options.longs === String ? String(message.persistedSize) : message.persistedSize; @@ -24564,6 +24591,8 @@ if (options.oneofs) object.writeStatus = "resource"; } + if (message.persistedDataChecksums != null && message.hasOwnProperty("persistedDataChecksums")) + object.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.persistedDataChecksums, options); return object; }; @@ -25533,6 +25562,7 @@ * @interface IBidiWriteObjectResponse * @property {number|Long|null} [persistedSize] BidiWriteObjectResponse persistedSize * @property {google.storage.v2.IStorageObject|null} [resource] BidiWriteObjectResponse resource + * @property {google.storage.v2.IObjectChecksums|null} [persistedDataChecksums] BidiWriteObjectResponse persistedDataChecksums * @property {google.storage.v2.IBidiWriteHandle|null} [writeHandle] BidiWriteObjectResponse writeHandle */ @@ -25567,6 +25597,14 @@ */ BidiWriteObjectResponse.prototype.resource = null; + /** + * BidiWriteObjectResponse persistedDataChecksums. + * @member {google.storage.v2.IObjectChecksums|null|undefined} persistedDataChecksums + * @memberof google.storage.v2.BidiWriteObjectResponse + * @instance + */ + BidiWriteObjectResponse.prototype.persistedDataChecksums = null; + /** * BidiWriteObjectResponse writeHandle. * @member {google.storage.v2.IBidiWriteHandle|null|undefined} writeHandle @@ -25625,6 +25663,8 @@ $root.google.storage.v2.StorageObject.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.writeHandle != null && Object.hasOwnProperty.call(message, "writeHandle")) $root.google.storage.v2.BidiWriteHandle.encode(message.writeHandle, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.persistedDataChecksums != null && Object.hasOwnProperty.call(message, "persistedDataChecksums")) + $root.google.storage.v2.ObjectChecksums.encode(message.persistedDataChecksums, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -25669,6 +25709,10 @@ message.resource = $root.google.storage.v2.StorageObject.decode(reader, reader.uint32()); break; } + case 4: { + message.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.decode(reader, reader.uint32()); + break; + } case 3: { message.writeHandle = $root.google.storage.v2.BidiWriteHandle.decode(reader, reader.uint32()); break; @@ -25724,6 +25768,11 @@ return "resource." + error; } } + if (message.persistedDataChecksums != null && message.hasOwnProperty("persistedDataChecksums")) { + var error = $root.google.storage.v2.ObjectChecksums.verify(message.persistedDataChecksums); + if (error) + return "persistedDataChecksums." + error; + } if (message.writeHandle != null && message.hasOwnProperty("writeHandle")) { properties._writeHandle = 1; { @@ -25761,6 +25810,11 @@ throw TypeError(".google.storage.v2.BidiWriteObjectResponse.resource: object expected"); message.resource = $root.google.storage.v2.StorageObject.fromObject(object.resource); } + if (object.persistedDataChecksums != null) { + if (typeof object.persistedDataChecksums !== "object") + throw TypeError(".google.storage.v2.BidiWriteObjectResponse.persistedDataChecksums: object expected"); + message.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.persistedDataChecksums); + } if (object.writeHandle != null) { if (typeof object.writeHandle !== "object") throw TypeError(".google.storage.v2.BidiWriteObjectResponse.writeHandle: object expected"); @@ -25782,6 +25836,8 @@ if (!options) options = {}; var object = {}; + if (options.defaults) + object.persistedDataChecksums = null; if (message.persistedSize != null && message.hasOwnProperty("persistedSize")) { if (typeof message.persistedSize === "number") object.persistedSize = options.longs === String ? String(message.persistedSize) : message.persistedSize; @@ -25800,6 +25856,8 @@ if (options.oneofs) object._writeHandle = "writeHandle"; } + if (message.persistedDataChecksums != null && message.hasOwnProperty("persistedDataChecksums")) + object.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.persistedDataChecksums, options); return object; }; @@ -26599,6 +26657,7 @@ * @interface IQueryWriteStatusResponse * @property {number|Long|null} [persistedSize] QueryWriteStatusResponse persistedSize * @property {google.storage.v2.IStorageObject|null} [resource] QueryWriteStatusResponse resource + * @property {google.storage.v2.IObjectChecksums|null} [persistedDataChecksums] QueryWriteStatusResponse persistedDataChecksums */ /** @@ -26632,6 +26691,14 @@ */ QueryWriteStatusResponse.prototype.resource = null; + /** + * QueryWriteStatusResponse persistedDataChecksums. + * @member {google.storage.v2.IObjectChecksums|null|undefined} persistedDataChecksums + * @memberof google.storage.v2.QueryWriteStatusResponse + * @instance + */ + QueryWriteStatusResponse.prototype.persistedDataChecksums = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -26674,6 +26741,8 @@ writer.uint32(/* id 1, wireType 0 =*/8).int64(message.persistedSize); if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.google.storage.v2.StorageObject.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.persistedDataChecksums != null && Object.hasOwnProperty.call(message, "persistedDataChecksums")) + $root.google.storage.v2.ObjectChecksums.encode(message.persistedDataChecksums, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -26718,6 +26787,10 @@ message.resource = $root.google.storage.v2.StorageObject.decode(reader, reader.uint32()); break; } + case 3: { + message.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -26769,6 +26842,11 @@ return "resource." + error; } } + if (message.persistedDataChecksums != null && message.hasOwnProperty("persistedDataChecksums")) { + var error = $root.google.storage.v2.ObjectChecksums.verify(message.persistedDataChecksums); + if (error) + return "persistedDataChecksums." + error; + } return null; }; @@ -26798,6 +26876,11 @@ throw TypeError(".google.storage.v2.QueryWriteStatusResponse.resource: object expected"); message.resource = $root.google.storage.v2.StorageObject.fromObject(object.resource); } + if (object.persistedDataChecksums != null) { + if (typeof object.persistedDataChecksums !== "object") + throw TypeError(".google.storage.v2.QueryWriteStatusResponse.persistedDataChecksums: object expected"); + message.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.fromObject(object.persistedDataChecksums); + } return message; }; @@ -26814,6 +26897,8 @@ if (!options) options = {}; var object = {}; + if (options.defaults) + object.persistedDataChecksums = null; if (message.persistedSize != null && message.hasOwnProperty("persistedSize")) { if (typeof message.persistedSize === "number") object.persistedSize = options.longs === String ? String(message.persistedSize) : message.persistedSize; @@ -26827,6 +26912,8 @@ if (options.oneofs) object.writeStatus = "resource"; } + if (message.persistedDataChecksums != null && message.hasOwnProperty("persistedDataChecksums")) + object.persistedDataChecksums = $root.google.storage.v2.ObjectChecksums.toObject(message.persistedDataChecksums, options); return object; }; diff --git a/packages/google-storage-control/protos/protos.json b/packages/google-storage-control/protos/protos.json index fa4ab4e7ebd..be32a19bcad 100644 --- a/packages/google-storage-control/protos/protos.json +++ b/packages/google-storage-control/protos/protos.json @@ -3903,6 +3903,10 @@ "resource": { "type": "StorageObject", "id": 2 + }, + "persistedDataChecksums": { + "type": "ObjectChecksums", + "id": 3 } } }, @@ -4081,6 +4085,10 @@ "type": "StorageObject", "id": 2 }, + "persistedDataChecksums": { + "type": "ObjectChecksums", + "id": 4 + }, "writeHandle": { "type": "BidiWriteHandle", "id": 3, @@ -4235,6 +4243,10 @@ "resource": { "type": "StorageObject", "id": 2 + }, + "persistedDataChecksums": { + "type": "ObjectChecksums", + "id": 3 } } }, diff --git a/packages/google-storage-control/system-test/install.ts b/packages/google-storage-control/system-test/install.ts index 394f3362d20..f66069aa394 100644 --- a/packages/google-storage-control/system-test/install.ts +++ b/packages/google-storage-control/system-test/install.ts @@ -40,7 +40,7 @@ describe('📦 pack-n-play test', () => { packageDir: process.cwd(), sample: { description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + cjs: readFileSync('./system-test/fixtures/sample/src/index.js').toString() } }; await packNTest(options); diff --git a/packages/google-storage-control/tsconfig.json b/packages/google-storage-control/tsconfig.json index 5ff6c0e41aa..ca73e7bfc82 100644 --- a/packages/google-storage-control/tsconfig.json +++ b/packages/google-storage-control/tsconfig.json @@ -7,8 +7,7 @@ "lib": [ "es2023", "dom" - ], - "stripInternal": false + ] }, "include": [ "src/*.ts",