Socket
Socket
Sign inDemoInstall

google-gax

Package Overview
Dependencies
11
Maintainers
4
Versions
358
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.0 to 4.0.1-debug

2

build/protos/http.js

@@ -1,1 +0,1 @@

!function(e){"function"==typeof define&&define.amd?define(["protobufjs/minimal"],e):"function"==typeof require&&"object"==typeof module&&module&&module.exports&&(module.exports=e(require("protobufjs/minimal")))}(function(e){"use strict";var t,n,r,i=e.Reader,o=e.Writer,l=e.util,s=e.roots.default||(e.roots.default={});function a(e){if(this.rules=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}function p(e){if(this.additional_bindings=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}function u(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.google=((r={}).api=((n={}).Http=(a.prototype.rules=l.emptyArray,a.prototype.fully_decode_reserved_expansion=!1,a.create=function(e){return new a(e)},a.encode=function(e,t){if(t=t||o.create(),null!=e.rules&&e.rules.length)for(var n=0;n<e.rules.length;++n)s.google.api.HttpRule.encode(e.rules[n],t.uint32(10).fork()).ldelim();return null!=e.fully_decode_reserved_expansion&&Object.hasOwnProperty.call(e,"fully_decode_reserved_expansion")&&t.uint32(16).bool(e.fully_decode_reserved_expansion),t},a.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},a.decode=function(e,t){e instanceof i||(e=i.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.google.api.Http;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.rules&&r.rules.length||(r.rules=[]),r.rules.push(s.google.api.HttpRule.decode(e,e.uint32()));break;case 2:r.fully_decode_reserved_expansion=e.bool();break;default:e.skipType(7&o)}}return r},a.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},a.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.rules&&e.hasOwnProperty("rules")){if(!Array.isArray(e.rules))return"rules: array expected";for(var t=0;t<e.rules.length;++t){var n=s.google.api.HttpRule.verify(e.rules[t]);if(n)return"rules."+n}}return null!=e.fully_decode_reserved_expansion&&e.hasOwnProperty("fully_decode_reserved_expansion")&&"boolean"!=typeof e.fully_decode_reserved_expansion?"fully_decode_reserved_expansion: boolean expected":null},a.fromObject=function(e){if(e instanceof s.google.api.Http)return e;var t=new s.google.api.Http;if(e.rules){if(!Array.isArray(e.rules))throw TypeError(".google.api.Http.rules: array expected");t.rules=[];for(var n=0;n<e.rules.length;++n){if("object"!=typeof e.rules[n])throw TypeError(".google.api.Http.rules: object expected");t.rules[n]=s.google.api.HttpRule.fromObject(e.rules[n])}}return null!=e.fully_decode_reserved_expansion&&(t.fully_decode_reserved_expansion=Boolean(e.fully_decode_reserved_expansion)),t},a.toObject=function(e,t){var n={};if(((t=t||{}).arrays||t.defaults)&&(n.rules=[]),t.defaults&&(n.fully_decode_reserved_expansion=!1),e.rules&&e.rules.length){n.rules=[];for(var r=0;r<e.rules.length;++r)n.rules[r]=s.google.api.HttpRule.toObject(e.rules[r],t)}return null!=e.fully_decode_reserved_expansion&&e.hasOwnProperty("fully_decode_reserved_expansion")&&(n.fully_decode_reserved_expansion=e.fully_decode_reserved_expansion),n},a.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},a),n.HttpRule=(p.prototype.selector="",p.prototype.get="",p.prototype.put="",p.prototype.post="",p.prototype.delete="",p.prototype.patch="",p.prototype.custom=null,p.prototype.body="",p.prototype.response_body="",p.prototype.additional_bindings=l.emptyArray,Object.defineProperty(p.prototype,"pattern",{get:l.oneOfGetter(t=["get","put","post","delete","patch","custom"]),set:l.oneOfSetter(t)}),p.create=function(e){return new p(e)},p.encode=function(e,t){if(t=t||o.create(),null!=e.selector&&Object.hasOwnProperty.call(e,"selector")&&t.uint32(10).string(e.selector),null!=e.get&&Object.hasOwnProperty.call(e,"get")&&t.uint32(18).string(e.get),null!=e.put&&Object.hasOwnProperty.call(e,"put")&&t.uint32(26).string(e.put),null!=e.post&&Object.hasOwnProperty.call(e,"post")&&t.uint32(34).string(e.post),null!=e.delete&&Object.hasOwnProperty.call(e,"delete")&&t.uint32(42).string(e.delete),null!=e.patch&&Object.hasOwnProperty.call(e,"patch")&&t.uint32(50).string(e.patch),null!=e.body&&Object.hasOwnProperty.call(e,"body")&&t.uint32(58).string(e.body),null!=e.custom&&Object.hasOwnProperty.call(e,"custom")&&s.google.api.CustomHttpPattern.encode(e.custom,t.uint32(66).fork()).ldelim(),null!=e.additional_bindings&&e.additional_bindings.length)for(var n=0;n<e.additional_bindings.length;++n)s.google.api.HttpRule.encode(e.additional_bindings[n],t.uint32(90).fork()).ldelim();return null!=e.response_body&&Object.hasOwnProperty.call(e,"response_body")&&t.uint32(98).string(e.response_body),t},p.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},p.decode=function(e,t){e instanceof i||(e=i.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.google.api.HttpRule;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.selector=e.string();break;case 2:r.get=e.string();break;case 3:r.put=e.string();break;case 4:r.post=e.string();break;case 5:r.delete=e.string();break;case 6:r.patch=e.string();break;case 8:r.custom=s.google.api.CustomHttpPattern.decode(e,e.uint32());break;case 7:r.body=e.string();break;case 12:r.response_body=e.string();break;case 11:r.additional_bindings&&r.additional_bindings.length||(r.additional_bindings=[]),r.additional_bindings.push(s.google.api.HttpRule.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},p.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},p.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.selector&&e.hasOwnProperty("selector")&&!l.isString(e.selector))return"selector: string expected";if(null!=e.get&&e.hasOwnProperty("get")&&(t.pattern=1,!l.isString(e.get)))return"get: string expected";if(null!=e.put&&e.hasOwnProperty("put")){if(1===t.pattern)return"pattern: multiple values";if(t.pattern=1,!l.isString(e.put))return"put: string expected"}if(null!=e.post&&e.hasOwnProperty("post")){if(1===t.pattern)return"pattern: multiple values";if(t.pattern=1,!l.isString(e.post))return"post: string expected"}if(null!=e.delete&&e.hasOwnProperty("delete")){if(1===t.pattern)return"pattern: multiple values";if(t.pattern=1,!l.isString(e.delete))return"delete: string expected"}if(null!=e.patch&&e.hasOwnProperty("patch")){if(1===t.pattern)return"pattern: multiple values";if(t.pattern=1,!l.isString(e.patch))return"patch: string expected"}if(null!=e.custom&&e.hasOwnProperty("custom")){if(1===t.pattern)return"pattern: multiple values";if(t.pattern=1,n=s.google.api.CustomHttpPattern.verify(e.custom))return"custom."+n}if(null!=e.body&&e.hasOwnProperty("body")&&!l.isString(e.body))return"body: string expected";if(null!=e.response_body&&e.hasOwnProperty("response_body")&&!l.isString(e.response_body))return"response_body: string expected";if(null!=e.additional_bindings&&e.hasOwnProperty("additional_bindings")){if(!Array.isArray(e.additional_bindings))return"additional_bindings: array expected";for(var n,r=0;r<e.additional_bindings.length;++r)if(n=s.google.api.HttpRule.verify(e.additional_bindings[r]))return"additional_bindings."+n}return null},p.fromObject=function(e){if(e instanceof s.google.api.HttpRule)return e;var t=new s.google.api.HttpRule;if(null!=e.selector&&(t.selector=String(e.selector)),null!=e.get&&(t.get=String(e.get)),null!=e.put&&(t.put=String(e.put)),null!=e.post&&(t.post=String(e.post)),null!=e.delete&&(t.delete=String(e.delete)),null!=e.patch&&(t.patch=String(e.patch)),null!=e.custom){if("object"!=typeof e.custom)throw TypeError(".google.api.HttpRule.custom: object expected");t.custom=s.google.api.CustomHttpPattern.fromObject(e.custom)}if(null!=e.body&&(t.body=String(e.body)),null!=e.response_body&&(t.response_body=String(e.response_body)),e.additional_bindings){if(!Array.isArray(e.additional_bindings))throw TypeError(".google.api.HttpRule.additional_bindings: array expected");t.additional_bindings=[];for(var n=0;n<e.additional_bindings.length;++n){if("object"!=typeof e.additional_bindings[n])throw TypeError(".google.api.HttpRule.additional_bindings: object expected");t.additional_bindings[n]=s.google.api.HttpRule.fromObject(e.additional_bindings[n])}}return t},p.toObject=function(e,t){var n={};if(((t=t||{}).arrays||t.defaults)&&(n.additional_bindings=[]),t.defaults&&(n.selector="",n.body="",n.response_body=""),null!=e.selector&&e.hasOwnProperty("selector")&&(n.selector=e.selector),null!=e.get&&e.hasOwnProperty("get")&&(n.get=e.get,t.oneofs)&&(n.pattern="get"),null!=e.put&&e.hasOwnProperty("put")&&(n.put=e.put,t.oneofs)&&(n.pattern="put"),null!=e.post&&e.hasOwnProperty("post")&&(n.post=e.post,t.oneofs)&&(n.pattern="post"),null!=e.delete&&e.hasOwnProperty("delete")&&(n.delete=e.delete,t.oneofs)&&(n.pattern="delete"),null!=e.patch&&e.hasOwnProperty("patch")&&(n.patch=e.patch,t.oneofs)&&(n.pattern="patch"),null!=e.body&&e.hasOwnProperty("body")&&(n.body=e.body),null!=e.custom&&e.hasOwnProperty("custom")&&(n.custom=s.google.api.CustomHttpPattern.toObject(e.custom,t),t.oneofs)&&(n.pattern="custom"),e.additional_bindings&&e.additional_bindings.length){n.additional_bindings=[];for(var r=0;r<e.additional_bindings.length;++r)n.additional_bindings[r]=s.google.api.HttpRule.toObject(e.additional_bindings[r],t)}return null!=e.response_body&&e.hasOwnProperty("response_body")&&(n.response_body=e.response_body),n},p.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},p),n.CustomHttpPattern=(u.prototype.kind="",u.prototype.path="",u.create=function(e){return new u(e)},u.encode=function(e,t){return t=t||o.create(),null!=e.kind&&Object.hasOwnProperty.call(e,"kind")&&t.uint32(10).string(e.kind),null!=e.path&&Object.hasOwnProperty.call(e,"path")&&t.uint32(18).string(e.path),t},u.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},u.decode=function(e,t){e instanceof i||(e=i.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.google.api.CustomHttpPattern;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.kind=e.string();break;case 2:r.path=e.string();break;default:e.skipType(7&o)}}return r},u.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},u.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.kind&&e.hasOwnProperty("kind")&&!l.isString(e.kind)?"kind: string expected":null!=e.path&&e.hasOwnProperty("path")&&!l.isString(e.path)?"path: string expected":null},u.fromObject=function(e){var t;return e instanceof s.google.api.CustomHttpPattern?e:(t=new s.google.api.CustomHttpPattern,null!=e.kind&&(t.kind=String(e.kind)),null!=e.path&&(t.path=String(e.path)),t)},u.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.kind="",n.path=""),null!=e.kind&&e.hasOwnProperty("kind")&&(n.kind=e.kind),null!=e.path&&e.hasOwnProperty("path")&&(n.path=e.path),n},u.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},u),n),r),s});
!function(e){"function"==typeof define&&define.amd?define(["protobufjs/minimal"],e):"function"==typeof require&&"object"==typeof module&&module&&module.exports&&(module.exports=e(require("protobufjs/minimal")))}(function(e){"use strict";var t,n,r,i=e.Reader,o=e.Writer,l=e.util,s=e.roots.default||(e.roots.default={});function a(e){if(this.rules=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}function p(e){if(this.additional_bindings=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}function u(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return s.google=((r={}).api=((n={}).Http=(a.prototype.rules=l.emptyArray,a.prototype.fully_decode_reserved_expansion=!1,a.create=function(e){return new a(e)},a.encode=function(e,t){if(t=t||o.create(),null!=e.rules&&e.rules.length)for(var n=0;n<e.rules.length;++n)s.google.api.HttpRule.encode(e.rules[n],t.uint32(10).fork()).ldelim();return null!=e.fully_decode_reserved_expansion&&Object.hasOwnProperty.call(e,"fully_decode_reserved_expansion")&&t.uint32(16).bool(e.fully_decode_reserved_expansion),t},a.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},a.decode=function(e,t){e instanceof i||(e=i.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.google.api.Http;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.rules&&r.rules.length||(r.rules=[]),r.rules.push(s.google.api.HttpRule.decode(e,e.uint32()));break;case 2:r.fully_decode_reserved_expansion=e.bool();break;default:e.skipType(7&o)}}return r},a.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},a.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.rules&&e.hasOwnProperty("rules")){if(!Array.isArray(e.rules))return"rules: array expected";for(var t=0;t<e.rules.length;++t){var n=s.google.api.HttpRule.verify(e.rules[t]);if(n)return"rules."+n}}return null!=e.fully_decode_reserved_expansion&&e.hasOwnProperty("fully_decode_reserved_expansion")&&"boolean"!=typeof e.fully_decode_reserved_expansion?"fully_decode_reserved_expansion: boolean expected":null},a.fromObject=function(e){if(e instanceof s.google.api.Http)return e;var t=new s.google.api.Http;if(e.rules){if(!Array.isArray(e.rules))throw TypeError(".google.api.Http.rules: array expected");t.rules=[];for(var n=0;n<e.rules.length;++n){if("object"!=typeof e.rules[n])throw TypeError(".google.api.Http.rules: object expected");t.rules[n]=s.google.api.HttpRule.fromObject(e.rules[n])}}return null!=e.fully_decode_reserved_expansion&&(t.fully_decode_reserved_expansion=Boolean(e.fully_decode_reserved_expansion)),t},a.toObject=function(e,t){var n={};if(((t=t||{}).arrays||t.defaults)&&(n.rules=[]),t.defaults&&(n.fully_decode_reserved_expansion=!1),e.rules&&e.rules.length){n.rules=[];for(var r=0;r<e.rules.length;++r)n.rules[r]=s.google.api.HttpRule.toObject(e.rules[r],t)}return null!=e.fully_decode_reserved_expansion&&e.hasOwnProperty("fully_decode_reserved_expansion")&&(n.fully_decode_reserved_expansion=e.fully_decode_reserved_expansion),n},a.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},a),n.HttpRule=(p.prototype.selector="",p.prototype.get="",p.prototype.put="",p.prototype.post="",p.prototype.delete="",p.prototype.patch="",p.prototype.custom=null,p.prototype.body="",p.prototype.response_body="",p.prototype.additional_bindings=l.emptyArray,Object.defineProperty(p.prototype,"pattern",{get:l.oneOfGetter(t=["get","put","post","delete","patch","custom"]),set:l.oneOfSetter(t)}),p.create=function(e){return new p(e)},p.encode=function(e,t){if(t=t||o.create(),null!=e.selector&&Object.hasOwnProperty.call(e,"selector")&&t.uint32(10).string(e.selector),null!=e.get&&Object.hasOwnProperty.call(e,"get")&&t.uint32(18).string(e.get),null!=e.put&&Object.hasOwnProperty.call(e,"put")&&t.uint32(26).string(e.put),null!=e.post&&Object.hasOwnProperty.call(e,"post")&&t.uint32(34).string(e.post),null!=e.delete&&Object.hasOwnProperty.call(e,"delete")&&t.uint32(42).string(e.delete),null!=e.patch&&Object.hasOwnProperty.call(e,"patch")&&t.uint32(50).string(e.patch),null!=e.body&&Object.hasOwnProperty.call(e,"body")&&t.uint32(58).string(e.body),null!=e.custom&&Object.hasOwnProperty.call(e,"custom")&&s.google.api.CustomHttpPattern.encode(e.custom,t.uint32(66).fork()).ldelim(),null!=e.additional_bindings&&e.additional_bindings.length)for(var n=0;n<e.additional_bindings.length;++n)s.google.api.HttpRule.encode(e.additional_bindings[n],t.uint32(90).fork()).ldelim();return null!=e.response_body&&Object.hasOwnProperty.call(e,"response_body")&&t.uint32(98).string(e.response_body),t},p.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},p.decode=function(e,t){e instanceof i||(e=i.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.google.api.HttpRule;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.selector=e.string();break;case 2:r.get=e.string();break;case 3:r.put=e.string();break;case 4:r.post=e.string();break;case 5:r.delete=e.string();break;case 6:r.patch=e.string();break;case 8:r.custom=s.google.api.CustomHttpPattern.decode(e,e.uint32());break;case 7:r.body=e.string();break;case 12:r.response_body=e.string();break;case 11:r.additional_bindings&&r.additional_bindings.length||(r.additional_bindings=[]),r.additional_bindings.push(s.google.api.HttpRule.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},p.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},p.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.selector&&e.hasOwnProperty("selector")&&!l.isString(e.selector))return"selector: string expected";if(null!=e.get&&e.hasOwnProperty("get")&&(t.pattern=1,!l.isString(e.get)))return"get: string expected";if(null!=e.put&&e.hasOwnProperty("put")){if(1===t.pattern)return"pattern: multiple values";if(t.pattern=1,!l.isString(e.put))return"put: string expected"}if(null!=e.post&&e.hasOwnProperty("post")){if(1===t.pattern)return"pattern: multiple values";if(t.pattern=1,!l.isString(e.post))return"post: string expected"}if(null!=e.delete&&e.hasOwnProperty("delete")){if(1===t.pattern)return"pattern: multiple values";if(t.pattern=1,!l.isString(e.delete))return"delete: string expected"}if(null!=e.patch&&e.hasOwnProperty("patch")){if(1===t.pattern)return"pattern: multiple values";if(t.pattern=1,!l.isString(e.patch))return"patch: string expected"}if(null!=e.custom&&e.hasOwnProperty("custom")){if(1===t.pattern)return"pattern: multiple values";if(t.pattern=1,n=s.google.api.CustomHttpPattern.verify(e.custom))return"custom."+n}if(null!=e.body&&e.hasOwnProperty("body")&&!l.isString(e.body))return"body: string expected";if(null!=e.response_body&&e.hasOwnProperty("response_body")&&!l.isString(e.response_body))return"response_body: string expected";if(null!=e.additional_bindings&&e.hasOwnProperty("additional_bindings")){if(!Array.isArray(e.additional_bindings))return"additional_bindings: array expected";for(var n,r=0;r<e.additional_bindings.length;++r)if(n=s.google.api.HttpRule.verify(e.additional_bindings[r]))return"additional_bindings."+n}return null},p.fromObject=function(e){if(e instanceof s.google.api.HttpRule)return e;var t=new s.google.api.HttpRule;if(null!=e.selector&&(t.selector=String(e.selector)),null!=e.get&&(t.get=String(e.get)),null!=e.put&&(t.put=String(e.put)),null!=e.post&&(t.post=String(e.post)),null!=e.delete&&(t.delete=String(e.delete)),null!=e.patch&&(t.patch=String(e.patch)),null!=e.custom){if("object"!=typeof e.custom)throw TypeError(".google.api.HttpRule.custom: object expected");t.custom=s.google.api.CustomHttpPattern.fromObject(e.custom)}if(null!=e.body&&(t.body=String(e.body)),null!=e.response_body&&(t.response_body=String(e.response_body)),e.additional_bindings){if(!Array.isArray(e.additional_bindings))throw TypeError(".google.api.HttpRule.additional_bindings: array expected");t.additional_bindings=[];for(var n=0;n<e.additional_bindings.length;++n){if("object"!=typeof e.additional_bindings[n])throw TypeError(".google.api.HttpRule.additional_bindings: object expected");t.additional_bindings[n]=s.google.api.HttpRule.fromObject(e.additional_bindings[n])}}return t},p.toObject=function(e,t){var n={};if(((t=t||{}).arrays||t.defaults)&&(n.additional_bindings=[]),t.defaults&&(n.selector="",n.body="",n.response_body=""),null!=e.selector&&e.hasOwnProperty("selector")&&(n.selector=e.selector),null!=e.get&&e.hasOwnProperty("get")&&(n.get=e.get,t.oneofs&&(n.pattern="get")),null!=e.put&&e.hasOwnProperty("put")&&(n.put=e.put,t.oneofs&&(n.pattern="put")),null!=e.post&&e.hasOwnProperty("post")&&(n.post=e.post,t.oneofs&&(n.pattern="post")),null!=e.delete&&e.hasOwnProperty("delete")&&(n.delete=e.delete,t.oneofs&&(n.pattern="delete")),null!=e.patch&&e.hasOwnProperty("patch")&&(n.patch=e.patch,t.oneofs&&(n.pattern="patch")),null!=e.body&&e.hasOwnProperty("body")&&(n.body=e.body),null!=e.custom&&e.hasOwnProperty("custom")&&(n.custom=s.google.api.CustomHttpPattern.toObject(e.custom,t),t.oneofs&&(n.pattern="custom")),e.additional_bindings&&e.additional_bindings.length){n.additional_bindings=[];for(var r=0;r<e.additional_bindings.length;++r)n.additional_bindings[r]=s.google.api.HttpRule.toObject(e.additional_bindings[r],t)}return null!=e.response_body&&e.hasOwnProperty("response_body")&&(n.response_body=e.response_body),n},p.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},p),n.CustomHttpPattern=(u.prototype.kind="",u.prototype.path="",u.create=function(e){return new u(e)},u.encode=function(e,t){return t=t||o.create(),null!=e.kind&&Object.hasOwnProperty.call(e,"kind")&&t.uint32(10).string(e.kind),null!=e.path&&Object.hasOwnProperty.call(e,"path")&&t.uint32(18).string(e.path),t},u.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},u.decode=function(e,t){e instanceof i||(e=i.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new s.google.api.CustomHttpPattern;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.kind=e.string();break;case 2:r.path=e.string();break;default:e.skipType(7&o)}}return r},u.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},u.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.kind&&e.hasOwnProperty("kind")&&!l.isString(e.kind)?"kind: string expected":null!=e.path&&e.hasOwnProperty("path")&&!l.isString(e.path)?"path: string expected":null},u.fromObject=function(e){var t;return e instanceof s.google.api.CustomHttpPattern?e:(t=new s.google.api.CustomHttpPattern,null!=e.kind&&(t.kind=String(e.kind)),null!=e.path&&(t.path=String(e.path)),t)},u.toObject=function(e,t){var n={};return(t=t||{}).defaults&&(n.kind="",n.path=""),null!=e.kind&&e.hasOwnProperty("kind")&&(n.kind=e.kind),null!=e.path&&e.hasOwnProperty("path")&&(n.path=e.path),n},u.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},u),n),r),s});

@@ -28,8 +28,8 @@ /**

}
export type ResponseType = {} | null;
export type NextPageRequestType = {
export declare type ResponseType = {} | null;
export declare type NextPageRequestType = {
[index: string]: string | number | {};
} | null;
export type RawResponseType = Operation | {} | null;
export type ResultTuple = [
export declare type RawResponseType = Operation | {} | null;
export declare type ResultTuple = [
ResponseType | [ResponseType],

@@ -42,10 +42,10 @@ NextPageRequestType | undefined,

}
export type APICallback = (err: GoogleError | null, response?: ResponseType, next?: NextPageRequestType, rawResponse?: RawResponseType) => void;
export type UnaryCall = (argument: {}, metadata: {}, options: {}, callback: APICallback) => GRPCCallResult;
export type ServerStreamingCall = (argument: {}, metadata: {}, options: {}) => Duplex & GRPCCallResult;
export type ClientStreamingCall = (metadata: {}, options: {}, callback?: APICallback) => Duplex & GRPCCallResult;
export type BiDiStreamingCall = (metadata: {}, options: {}) => Duplex & GRPCCallResult;
export type GRPCCall = UnaryCall | ServerStreamingCall | ClientStreamingCall | BiDiStreamingCall;
export type CancellableStream = Duplex & GRPCCallResult;
export type GaxCallResult = CancellablePromise<ResultTuple> | CancellableStream;
export declare type APICallback = (err: GoogleError | null, response?: ResponseType, next?: NextPageRequestType, rawResponse?: RawResponseType) => void;
export declare type UnaryCall = (argument: {}, metadata: {}, options: {}, callback: APICallback) => GRPCCallResult;
export declare type ServerStreamingCall = (argument: {}, metadata: {}, options: {}) => Duplex & GRPCCallResult;
export declare type ClientStreamingCall = (metadata: {}, options: {}, callback?: APICallback) => Duplex & GRPCCallResult;
export declare type BiDiStreamingCall = (metadata: {}, options: {}) => Duplex & GRPCCallResult;
export declare type GRPCCall = UnaryCall | ServerStreamingCall | ClientStreamingCall | BiDiStreamingCall;
export declare type CancellableStream = Duplex & GRPCCallResult;
export declare type GaxCallResult = CancellablePromise<ResultTuple> | CancellableStream;
export interface GaxCallPromise {

@@ -52,0 +52,0 @@ (argument: {}, callOptions?: CallOptions, callback?: APICallback): CancellablePromise<ResultTuple>;

@@ -51,7 +51,7 @@ /**

}
export type AuthClient = OAuth2Client | Compute | JWT | UserRefreshClient | BaseExternalAccountClient;
export declare type AuthClient = OAuth2Client | Compute | JWT | UserRefreshClient | BaseExternalAccountClient;
export declare class GrpcClient {
auth?: OAuth2Client | GoogleAuth;
authClient?: AuthClient;
fallback: boolean | 'rest' | 'proto';
fallback: boolean;
grpcVersion: string;

@@ -77,3 +77,7 @@ private static protoCache;

}) & {
fallback?: boolean | 'rest' | 'proto';
/**
* Fallback mode to use instead of gRPC.
* A string is accepted for compatibility, all non-empty string values enable the HTTP REST fallback.
*/
fallback?: boolean | string;
});

@@ -157,3 +161,3 @@ /**

*/
export declare function createApiCall(func: Promise<GRPCCall> | GRPCCall, settings: gax.CallSettings, descriptor?: Descriptor, fallback?: boolean | 'proto' | 'rest'): GaxCall;
export declare function createApiCall(func: Promise<GRPCCall> | GRPCCall, settings: gax.CallSettings, descriptor?: Descriptor, _fallback?: boolean | string): GaxCall;
export { protobuf };

@@ -160,0 +164,0 @@ export * as protobufMinimal from 'protobufjs/minimal';

@@ -29,3 +29,2 @@ "use strict";

const createApiCall_1 = require("./createApiCall");
const fallbackProto = require("./fallbackProto");
const fallbackRest = require("./fallbackRest");

@@ -73,9 +72,2 @@ const featureDetection_1 = require("./featureDetection");

/**
* In rare cases users might need to deallocate all memory consumed by loaded protos.
* This method will delete the proto cache content.
*/
static clearProtoCache() {
GrpcClient.protoCache.clear();
}
/**
* gRPC-fallback version of GrpcClient

@@ -102,3 +94,3 @@ * Implements GrpcClient API for a browser using grpc-fallback protocol (sends serialized protobuf to HTTP/1 $rpc endpoint).

}
this.fallback = options.fallback !== 'rest' ? 'proto' : 'rest';
this.fallback = options.fallback ? true : false;
this.grpcVersion = require('../../package.json').version;

@@ -109,2 +101,9 @@ this.httpRules = options.httpRules;

/**
* In rare cases users might need to deallocate all memory consumed by loaded protos.
* This method will delete the proto cache content.
*/
static clearProtoCache() {
GrpcClient.protoCache.clear();
}
/**
* gRPC-fallback version of loadProto

@@ -248,8 +247,4 @@ * Loads the protobuf root object from a JSON object created from a proto file

}
const encoder = this.fallback === 'rest'
? fallbackRest.encodeRequest
: fallbackProto.encodeRequest;
const decoder = this.fallback === 'rest'
? fallbackRest.decodeResponse
: fallbackProto.decodeResponse;
const encoder = fallbackRest.encodeRequest;
const decoder = fallbackRest.decodeResponse;
const serviceStub = (0, fallbackServiceStub_1.generateServiceStub)(methods, protocol, servicePath, servicePort, this.authClient, encoder, decoder, this.numericEnums);

@@ -283,3 +278,3 @@ return serviceStub;

if (options.protoJson) {
options = Object.assign(options, { fallback: 'rest' });
options = Object.assign(options, { fallback: true });
}

@@ -313,5 +308,7 @@ const gaxGrpc = new GrpcClient(options);

*/
function createApiCall(func, settings, descriptor, fallback) {
if ((!fallback || fallback === 'rest') &&
descriptor &&
function createApiCall(func, settings, descriptor,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_fallback // unused; for compatibility only
) {
if (descriptor &&
'streaming' in descriptor &&

@@ -323,7 +320,5 @@ descriptor.type !== streaming_1.StreamType.SERVER_STREAMING) {

}
if ((fallback === 'proto' || fallback === true) && // for legacy reasons, fallback === true means 'proto'
descriptor &&
'streaming' in descriptor) {
if (descriptor && 'streaming' in descriptor && !(0, featureDetection_1.isNodeJS)()) {
return () => {
throw new Error('The gRPC-fallback (proto over HTTP) transport currently does not support streaming calls.');
throw new Error('Server streaming over the REST transport is only supported in Node.js.');
};

@@ -330,0 +325,0 @@ }

@@ -24,3 +24,3 @@ /**

}
export type FetchParametersMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
export declare type FetchParametersMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
export interface FetchParameters {

@@ -27,0 +27,0 @@ headers: {

@@ -34,3 +34,3 @@ /**

}
export type FallbackServiceError = FallbackStatusObject & Error;
export declare type FallbackServiceError = FallbackStatusObject & Error;
interface FallbackStatusObject {

@@ -37,0 +37,0 @@ code: Status;

@@ -42,3 +42,3 @@ /**

}
export type GrpcModule = typeof grpc;
export declare type GrpcModule = typeof grpc;
export interface ClientStubOptions {

@@ -129,3 +129,3 @@ protocol?: string;

loadProtoJSON(json: protobuf.INamespace, ignoreCache?: boolean): grpc.GrpcObject;
metadataBuilder(headers: OutgoingHttpHeaders): (abTests?: {}, moreHeaders?: OutgoingHttpHeaders) => grpc.Metadata;
metadataBuilder(headers: OutgoingHttpHeaders): (abTests?: {} | undefined, moreHeaders?: OutgoingHttpHeaders | undefined) => grpc.Metadata;
/**

@@ -132,0 +132,0 @@ * A wrapper of {@link constructSettings} function under the gRPC context.

@@ -74,24 +74,2 @@ "use strict";

/**
* Key for proto cache map. We are doing our best to make sure we respect
* the options, so if the same proto file is loaded with different set of
* options, the cache won't be used. Since some of the options are
* Functions (e.g. `enums: String` - see below in `loadProto()`),
* they will be omitted from the cache key. If the cache breaks anything
* for you, use the `ignoreCache` parameter of `loadProto()` to disable it.
*/
static protoCacheKey(filename, options) {
if (!filename ||
(Array.isArray(filename) && (filename.length === 0 || !filename[0]))) {
return undefined;
}
return JSON.stringify(filename) + ' ' + JSON.stringify(options);
}
/**
* In rare cases users might need to deallocate all memory consumed by loaded protos.
* This method will delete the proto cache content.
*/
static clearProtoCache() {
GrpcClient.protoCache.clear();
}
/**
* A class which keeps the context of gRPC and auth for the gRPC.

@@ -131,2 +109,24 @@ *

/**
* Key for proto cache map. We are doing our best to make sure we respect
* the options, so if the same proto file is loaded with different set of
* options, the cache won't be used. Since some of the options are
* Functions (e.g. `enums: String` - see below in `loadProto()`),
* they will be omitted from the cache key. If the cache breaks anything
* for you, use the `ignoreCache` parameter of `loadProto()` to disable it.
*/
static protoCacheKey(filename, options) {
if (!filename ||
(Array.isArray(filename) && (filename.length === 0 || !filename[0]))) {
return undefined;
}
return JSON.stringify(filename) + ' ' + JSON.stringify(options);
}
/**
* In rare cases users might need to deallocate all memory consumed by loaded protos.
* This method will delete the proto cache content.
*/
static clearProtoCache() {
GrpcClient.protoCache.clear();
}
/**
* Creates a gRPC credentials. It asks the auth data if necessary.

@@ -133,0 +133,0 @@ * @private

@@ -66,9 +66,9 @@ import * as gax from './gax';

getProjectId(callback: ProjectIdCallback): void;
getIamPolicy(request: protos.google.iam.v1.GetIamPolicyRequest, options?: gax.CallOptions): Promise<protos.google.iam.v1.Policy>;
getIamPolicy(request: protos.google.iam.v1.GetIamPolicyRequest, options?: gax.CallOptions): Promise<[protos.google.iam.v1.Policy]>;
getIamPolicy(request: protos.google.iam.v1.GetIamPolicyRequest, options: gax.CallOptions, callback: Callback<protos.google.iam.v1.Policy, protos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
getIamPolicy(request: protos.google.iam.v1.GetIamPolicyRequest, callback: Callback<protos.google.iam.v1.Policy, protos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
setIamPolicy(request: protos.google.iam.v1.SetIamPolicyRequest, options?: gax.CallOptions): Promise<protos.google.iam.v1.Policy>;
setIamPolicy(request: protos.google.iam.v1.SetIamPolicyRequest, options?: gax.CallOptions): Promise<[protos.google.iam.v1.Policy]>;
setIamPolicy(request: protos.google.iam.v1.SetIamPolicyRequest, options: gax.CallOptions, callback: Callback<protos.google.iam.v1.Policy, protos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
setIamPolicy(request: protos.google.iam.v1.SetIamPolicyRequest, callback: Callback<protos.google.iam.v1.Policy, protos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
testIamPermissions(request: protos.google.iam.v1.TestIamPermissionsRequest, options?: gax.CallOptions): Promise<protos.google.iam.v1.TestIamPermissionsResponse>;
testIamPermissions(request: protos.google.iam.v1.TestIamPermissionsRequest, options?: gax.CallOptions): Promise<[protos.google.iam.v1.TestIamPermissionsResponse]>;
testIamPermissions(request: protos.google.iam.v1.TestIamPermissionsRequest, callback: Callback<protos.google.iam.v1.TestIamPermissionsResponse, protos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;

@@ -85,7 +85,7 @@ testIamPermissions(request: protos.google.iam.v1.TestIamPermissionsRequest, options: gax.CallOptions, callback: Callback<protos.google.iam.v1.TestIamPermissionsResponse, protos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;

getIamPolicy(request: protos.google.iam.v1.GetIamPolicyRequest): void;
getIamPolicy(request: protos.google.iam.v1.GetIamPolicyRequest, options?: gax.CallOptions | Callback<protos.google.iam.v1.Policy, protos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<protos.google.iam.v1.Policy, protos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<protos.google.iam.v1.Policy>;
getIamPolicy(request: protos.google.iam.v1.GetIamPolicyRequest, options?: gax.CallOptions | Callback<protos.google.iam.v1.Policy, protos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<protos.google.iam.v1.Policy, protos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<[protos.google.iam.v1.Policy]>;
setIamPolicy(request: protos.google.iam.v1.SetIamPolicyRequest): void;
setIamPolicy(request: protos.google.iam.v1.SetIamPolicyRequest, options?: gax.CallOptions | Callback<protos.google.iam.v1.Policy, protos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<protos.google.iam.v1.Policy, protos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<protos.google.iam.v1.Policy>;
setIamPolicy(request: protos.google.iam.v1.SetIamPolicyRequest, options?: gax.CallOptions | Callback<protos.google.iam.v1.Policy, protos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<protos.google.iam.v1.Policy, protos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<[protos.google.iam.v1.Policy]>;
testIamPermissions(request: protos.google.iam.v1.TestIamPermissionsRequest): void;
testIamPermissions(request: protos.google.iam.v1.TestIamPermissionsRequest, options?: gax.CallOptions | Callback<protos.google.iam.v1.TestIamPermissionsResponse, protos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>, callback?: Callback<protos.google.iam.v1.TestIamPermissionsResponse, protos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>): Promise<protos.google.iam.v1.TestIamPermissionsResponse>;
testIamPermissions(request: protos.google.iam.v1.TestIamPermissionsRequest, options?: gax.CallOptions | Callback<protos.google.iam.v1.TestIamPermissionsResponse, protos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>, callback?: Callback<protos.google.iam.v1.TestIamPermissionsResponse, protos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>): Promise<[protos.google.iam.v1.TestIamPermissionsResponse]>;
}

@@ -35,3 +35,3 @@ /**

}
type LROOperation = operationProtos.google.longrunning.Operation;
declare type LROOperation = operationProtos.google.longrunning.Operation;
export declare class Operation extends EventEmitter {

@@ -38,0 +38,0 @@ completeListeners: number;

@@ -49,3 +49,5 @@ "use strict";

for (let i = 0; i < resources.length; ++i) {
if (stream._readableState.ended) {
// TODO: rewrite without accessing stream internals
if (stream
._readableState.ended) {
return;

@@ -62,3 +64,5 @@ }

}
if (stream._readableState.ended) {
// TODO: rewrite without accessing stream internals
if (stream._readableState
.ended) {
return;

@@ -65,0 +69,0 @@ }

[
"google/api/annotations.proto",
"google/api/apikeys/v2/apikeys.proto",
"google/api/apikeys/v2/resources.proto",
"google/api/auth.proto",

@@ -48,2 +50,3 @@ "google/api/backend.proto",

"google/api/servicecontrol/v1/service_controller.proto",
"google/api/servicecontrol/v2/service_controller.proto",
"google/api/servicemanagement/v1/resources.proto",

@@ -81,2 +84,4 @@ "google/api/servicemanagement/v1/servicemanager.proto",

"google/monitoring/v3/service_service.proto",
"google/monitoring/v3/snooze.proto",
"google/monitoring/v3/snooze_service.proto",
"google/monitoring/v3/span_context.proto",

@@ -87,2 +92,3 @@ "google/monitoring/v3/uptime.proto",

"google/protobuf/api.proto",
"google/protobuf/bridge/message_set.proto",
"google/protobuf/compiler/plugin.proto",

@@ -108,3 +114,5 @@ "google/protobuf/compiler/ruby/ruby_generated_code.proto",

"google/rpc/context/attribute_context.proto",
"google/rpc/context/audit_context.proto",
"google/rpc/error_details.proto",
"google/rpc/http.proto",
"google/rpc/status.proto",

@@ -111,0 +119,0 @@ "google/type/calendar_period.proto",

@@ -17,3 +17,2 @@ /**

/// <reference types="node" />
/// <reference types="node" />
import { AbortController as NodeAbortController } from 'abort-controller';

@@ -20,0 +19,0 @@ import { Transform } from 'stream';

@@ -101,3 +101,3 @@ "use strict";

try {
// HTTP reponse.ok is true.
// HTTP response.ok is true.
const msgObj = (0, fallbackRest_1.decodeResponse)(this.rpc, true, objBuff);

@@ -104,0 +104,0 @@ this.push(msgObj);

@@ -26,4 +26,4 @@ /**

declare const httpOptionName = "(google.api.http)";
type allowedOptions = '(google.api.method_signature)';
export type ParsedOptionsType = Array<{
declare type allowedOptions = '(google.api.method_signature)';
export declare type ParsedOptionsType = Array<{
[httpOptionName]?: google.api.IHttpRule;

@@ -30,0 +30,0 @@ } & {

{
"name": "google-gax",
"version": "4.0.0",
"version": "4.0.1-debug",
"description": "Google API Extensions",

@@ -18,10 +18,11 @@ "main": "build/src/index.js",

"duplexify": "^4.0.0",
"google-auth-library": "^8.0.2",
"google-auth-library": "^9.0.0",
"node-fetch": "^2.6.1",
"object-hash": "^3.0.0",
"proto3-json-serializer": "^1.0.0",
"protobufjs": "7.2.3",
"retry-request": "^5.0.0"
"proto3-json-serializer": "^1.1.1",
"protobufjs": "7.2.4",
"retry-request": "^6.0.0"
},
"devDependencies": {
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@compodoc/compodoc": "1.1.19",

@@ -35,10 +36,9 @@ "@types/mocha": "^9.0.0",

"@types/pumpify": "^1.4.1",
"@types/rimraf": "^3.0.2",
"@types/sinon": "^10.0.0",
"@types/uglify-js": "^3.17.0",
"c8": "^7.0.0",
"c8": "^8.0.0",
"codecov": "^3.1.0",
"execa": "^5.0.0",
"gapic-tools": "^0.1.7",
"google-proto-files": "^3.0.0",
"google-proto-files": "^3.0.3",
"gts": "^3.1.0",

@@ -54,3 +54,3 @@ "linkinator": "^4.0.0",

"pumpify": "^2.0.0",
"rimraf": "^3.0.2",
"rimraf": "^5.0.1",
"sinon": "^15.0.0",

@@ -57,0 +57,0 @@ "stream-events": "^1.0.4",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc