From a3a48f985de5fd11b18c5107cae6541e6a000164 Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Thu, 11 Mar 2021 01:10:07 +0000 Subject: [PATCH 01/16] v0.1.255 --- javascript/build/ee_api_js.js | 24 +++++++-------- javascript/build/ee_api_js_debug.js | 9 +++--- javascript/build/ee_api_js_npm.js | 47 +++++++++++++++-------------- javascript/package.json | 2 +- javascript/src/apiclient.js | 2 +- python/ee/__init__.py | 7 +++-- 6 files changed, 48 insertions(+), 43 deletions(-) diff --git a/javascript/build/ee_api_js.js b/javascript/build/ee_api_js.js index a1388eaf5..dcc2d797a 100644 --- a/javascript/build/ee_api_js.js +++ b/javascript/build/ee_api_js.js @@ -397,7 +397,7 @@ Dd(p,g[m]))});return b?b(h):h};return this.callback?(Xi(d,null,function(g,h){ret Yi.prototype.send=function(a,b){var c=[a.A+" "+a.path+" HTTP/1.1"];c.push("Content-Type: application/json; charset=utf-8");var d=$i();null!=d&&c.push("Authorization: "+d);a=a.body?JSON.stringify(a.body):"";return[c.join("\r\n")+"\r\n\r\n"+a,b]}; var aj=function(a,b,c){a=n(b.split("--"+a.split("; boundary=")[1]));for(b=a.next();!b.done;b=a.next())if(b=b.value.split("\r\n\r\n"),!(3>b.length)){var d=b[0].match(/\r\nContent-ID: ]*)>/)[1],e=Number(b[1].match(/^HTTP\S*\s(\d+)\s/)[1]);c(d,e,b.slice(2).join("\r\n\r\n"))}},Vi=function(){var a=bj.replace(/\/api$/,"");return"window"in r&&!a.match(/^https?:\/\/content-/)?a.replace(/^(https?:\/\/)(.*\.googleapis\.com)$/,"$1content-$2"):a},hj=function(a,b,c){cj&&dj&&cj({client_id:String(dj), immediate:!0,scope:ej.join(" ")},function(d){if("immediate_failed"==d.error&&c)c();else if("window"in r)try{fj(function(){try{r.gapi.auth.setToken(d),gj(a,b,d)}catch(e){b(e.toString())}})}catch(e){b(e.toString())}else gj(a,b,d)})},$i=function(){ij&&0<=Date.now()-ij&&jj();return kj},jj=function(){ij=kj=null},Si=function(a,b,c){null!=a?bj=a:lj||(bj="https://earthengine.googleapis.com/api");null!=b?mj=b:lj||(mj="https://earthengine.googleapis.com");void 0!==c&&(nj=c);Ri=Ri||"earthengine-legacy";lj=!0}, -Xi=function(a,b,c,d,e,f){Si();var g=oj,h="application/x-www-form-urlencoded";e&&(h="application/json",d&&d.startsWith("multipart")&&(h=d,d="POST"));d=d||"POST";h={"Content-Type":h};var m="0.1.254";"0.1.254"===m&&(m="latest");h["x-goog-api-client"]="ee-js/"+m;m=$i();if(null!=m)h.Authorization=m;else if(c&&cj&&dj)return hj(function(){pj(g,function(){Xi(a,b,c,d)})}),null;b=b?b.clone():new Td;null!=qj&&b.add("key",qj);g&&(h["X-Earth-Engine-Computation-Profile"]="1");Ri&&"earthengine-legacy"!==Ri&&(h["X-Goog-User-Project"]= +Xi=function(a,b,c,d,e,f){Si();var g=oj,h="application/x-www-form-urlencoded";e&&(h="application/json",d&&d.startsWith("multipart")&&(h=d,d="POST"));d=d||"POST";h={"Content-Type":h};var m="0.1.255";"0.1.255"===m&&(m="latest");h["x-goog-api-client"]="ee-js/"+m;m=$i();if(null!=m)h.Authorization=m;else if(c&&cj&&dj)return hj(function(){pj(g,function(){Xi(a,b,c,d)})}),null;b=b?b.clone():new Td;null!=qj&&b.add("key",qj);g&&(h["X-Earth-Engine-Computation-Profile"]="1");Ri&&"earthengine-legacy"!==Ri&&(h["X-Goog-User-Project"]= Ri);b=rj(b,a);null!=nj&&(h["X-XSRF-Token"]=nj);null!=sj&&(h["X-Earth-Engine-App-ID-Token"]=sj);m=e||null;var p=b?b.toString():"";"POST"===d&&void 0===e?m=p:/^[\s\xa0]*$/.test(p)||(a+=-1!=a.indexOf("?")?"&":"?",a+=p);e=a.startsWith("/")?bj+a:a;if(c)return tj.push(uj(e,c,d,m,h,f)),vj.Ye(),null;p=function(E,V){this.setRequestHeader&&this.setRequestHeader(V,E)};var t=0;for(f=null!=f?f:5;;){var C=Ci(Ai);C.open(d,e,!1);xb(h,p,C);C.send(m);if(429!=C.status||t>f)break;t++}return wj(C.status,function(E){try{return C.getResponseHeader(E)}catch(V){return null}}, C.responseText,g,void 0,e,d)},uj=function(a,b,c,d,e,f){var g=0,h={url:a,method:c,content:d,headers:e},m=oj,p=null!=f?f:10;h.callback=function(t){t=t.target;if(429==t.getStatus()&&gY||300<=Y)return"Server returned HTTP code: "+Y+" for "+g+" "+f},t;b=b("Content-Type")||"application/json"; @@ -627,16 +627,16 @@ k.ik=function(){if(!this.ic){var a=v(function(d){this.ic||(rp(this.fa,this.ea,d) k.fa=null;k.ei=null;k.Ja=null;k.Hh=null;var Pp=["load","abort","error"],Qp=function(){Ga.call(this);this.Fa=!1};q(Qp,Ga);Qp.prototype.setActive=function(a){this.Fa=a};Qp.prototype.jh=function(){return this.Fa};var Lp=function(a,b){Hp.call(this,a,b)};q(Lp,Hp);Lp.prototype.Ne=function(){return new Qp};Lp.prototype.wd=function(a){a.Ta()};Lp.prototype.yf=function(a){return!a.Ua&&!a.jh()};var Rp=function(a,b,c,d,e){ud.call(this,a,b,c,d,e);this.minZoom=d.minZoom||0;this.maxZoom=d.maxZoom||20;if(!window.google||!window.google.maps)throw Error("Google Maps API hasn't been initialized.");this.tileSize=d.tileSize||new google.maps.Size(256,256);this.name=d.name;this.$f=new pd;this.zf=1;this.va=e||null};q(Rp,ud);k=Rp.prototype;k.De=function(a){return Rc(this,"tileevent",a)};k.If=function(a){Zc(a)}; k.getTile=function(a,b,c){if(ba.y||a.y>=1< Date: Fri, 12 Mar 2021 00:22:48 +0000 Subject: [PATCH 02/16] v0.1.256 --- javascript/build/ee_api_js.js | 257 ++--- javascript/build/ee_api_js_debug.js | 58 +- javascript/build/ee_api_js_npm.js | 98 +- javascript/package.json | 2 +- javascript/src/apiclient.js | 2 +- javascript/src/batch.js | 5 +- javascript/src/data.js | 4 +- javascript/src/ee_api_js.externs.js | 1443 --------------------------- javascript/src/encodable_batch.js | 7 +- python/ee/__init__.py | 2 +- python/ee/batch.py | 58 +- python/ee/tests/batch_test.py | 121 ++- python/setup.py | 2 +- 13 files changed, 354 insertions(+), 1705 deletions(-) delete mode 100644 javascript/src/ee_api_js.externs.js diff --git a/javascript/build/ee_api_js.js b/javascript/build/ee_api_js.js index dcc2d797a..1ee39d049 100644 --- a/javascript/build/ee_api_js.js +++ b/javascript/build/ee_api_js.js @@ -17,18 +17,18 @@ da("Promise",function(a){function b(){this.qb=null}function c(g){return g instan })};var e=function(g){this.U=0;this.ia=void 0;this.uc=[];this.lh=!1;var h=this.Oe();try{g(h.resolve,h.reject)}catch(m){h.reject(m)}};e.prototype.Oe=function(){function g(p){return function(t){m||(m=!0,p.call(h,t))}}var h=this,m=!1;return{resolve:g(this.dk),reject:g(this.Hf)}};e.prototype.dk=function(g){if(g===this)this.Hf(new TypeError("A Promise cannot resolve to itself"));else if(g instanceof e)this.fk(g);else{a:switch(typeof g){case "object":var h=null!=g;break a;case "function":h=!0;break a;default:h= !1}h?this.ck(g):this.Xg(g)}};e.prototype.ck=function(g){var h=void 0;try{h=g.then}catch(m){this.Hf(m);return}"function"==typeof h?this.gk(h,g):this.Xg(g)};e.prototype.Hf=function(g){this.Rh(2,g)};e.prototype.Xg=function(g){this.Rh(1,g)};e.prototype.Rh=function(g,h){if(0!=this.U)throw Error("Cannot settle("+g+", "+h+"): Promise already settled in state"+this.U);this.U=g;this.ia=h;2===this.U&&this.ek();this.Ij()};e.prototype.ek=function(){var g=this;d(function(){if(g.Yj()){var h=l.console;"undefined"!== typeof h&&h.error(g.ia)}},1)};e.prototype.Yj=function(){if(this.lh)return!1;var g=l.CustomEvent,h=l.Event,m=l.dispatchEvent;if("undefined"===typeof m)return!0;"function"===typeof g?g=new g("unhandledrejection",{cancelable:!0}):"function"===typeof h?g=new h("unhandledrejection",{cancelable:!0}):(g=l.document.createEvent("CustomEvent"),g.initCustomEvent("unhandledrejection",!1,!0,g));g.promise=this;g.reason=this.ia;return m(g)};e.prototype.Ij=function(){if(null!=this.uc){for(var g=0;gc&&(c=Math.max(c+e,0));c=d.J.length)throw cd;var f=d.J[b++];return a?f:d.D[f]};return e};var id=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};var kd=function(a){if(a.O&&"function"==typeof a.O)a=a.O();else if(wa(a)||"string"===typeof a)a=a.length;else{var b=0,c;for(c in a)b++;a=b}return a},ld=function(a){if(a.T&&"function"==typeof a.T)return a.T();if("string"===typeof a)return a.split("");if(wa(a)){for(var b=[],c=a.length,d=0;dc)return!1;!(b instanceof pd)&&5e&&(e+=d);return[a.Uj,c,e,b.y].join("/")};ud.prototype.Pc=function(){return this.Bb.length};var wd=function(a){y.call(this,"tileevent");this.count=a};x(wd,y);var xd=function(){},yd=new xd;function zd(a){return Object.assign({R:{},uk:{},keys:[],Ca:{},u:{},L:{}},a)}var B=function(){this.h={}},D=function(a,b){return a.h.hasOwnProperty(b)?a.h[b]:null},F=function(a,b){return null!=a.h[b]};function Ad(a,b){return D(b,a)}function Bd(a,b,c){b[a]=c}function Cd(){return{}}function Dd(a,b){var c=new a;return null==b?c:Ed(b,Fd,Gd,Hd,a)}function Fd(a,b){return b[a]}function Gd(a,b,c){b.h[a]=c} +var td=function(a,b){var c=kd(b);if(a.O()>c)return!1;!(b instanceof pd)&&5e&&(e+=d);return[a.Uj,c,e,b.y].join("/")};ud.prototype.Pc=function(){return this.Bb.length};var wd=function(a){y.call(this,"tileevent");this.count=a};x(wd,y);var xd=function(){},yd=new xd;function zd(a){return Object.assign({R:{},uk:{},keys:[],Ca:{},u:{},L:{}},a)}var C=function(){this.h={}},D=function(a,b){return a.h.hasOwnProperty(b)?a.h[b]:null},F=function(a,b){return null!=a.h[b]};function Ad(a,b){return D(b,a)}function Bd(a,b,c){b[a]=c}function Cd(){return{}}function Dd(a,b){var c=new a;return null==b?c:Ed(b,Fd,Gd,Hd,a)}function Fd(a,b){return b[a]}function Gd(a,b,c){b.h[a]=c} function Hd(a){if(null==a)throw Error("Cannot deserialize, target constructor was null.");return new a} -function Ed(a,b,c,d,e){e=d(e);var f=Id(a,e),g=f.R||{},h=f.u||{},m=f.Ca||{},p={};f=n(f.keys||[]);for(var t=f.next();!t.done;p={Dc:p.Dc},t=f.next()){t=t.value;var C=b(t,a);if(null!=C){var E=void 0;g.hasOwnProperty(t)?E=Jd(C,b,c,d,!0,!0,g[t]):h.hasOwnProperty(t)?E=Jd(C,b,c,d,!1,!0,h[t]):m.hasOwnProperty(t)?(p.Dc=m[t],E=p.Dc.pa?C.map(function(V){return function(Y){return Kd(Y,V.Dc,b,c,d)}}(p)):Kd(C,p.Dc,b,c,d)):E=Array.isArray(C)?Jd(C,b,c,d,!0,!1):C instanceof xd?null:C;c(t,e,E)}}return e} +function Ed(a,b,c,d,e){e=d(e);var f=Id(a,e),g=f.R||{},h=f.u||{},m=f.Ca||{},p={};f=n(f.keys||[]);for(var t=f.next();!t.done;p={Dc:p.Dc},t=f.next()){t=t.value;var B=b(t,a);if(null!=B){var E=void 0;g.hasOwnProperty(t)?E=Jd(B,b,c,d,!0,!0,g[t]):h.hasOwnProperty(t)?E=Jd(B,b,c,d,!1,!0,h[t]):m.hasOwnProperty(t)?(p.Dc=m[t],E=p.Dc.pa?B.map(function(V){return function(Y){return Kd(Y,V.Dc,b,c,d)}}(p)):Kd(B,p.Dc,b,c,d)):E=Array.isArray(B)?Jd(B,b,c,d,!0,!1):B instanceof xd?null:B;c(t,e,E)}}return e} function Kd(a,b,c,d,e){for(var f={},g=n(Object.keys(a)),h=g.next();!h.done;h=g.next()){h=h.value;var m=a[h];null!=m&&(f[h]=Jd(m,c,d,e,b.ra,b.qa,b.ja))}return f}function Jd(a,b,c,d,e,f,g){if(f&&null==g)throw Error("Cannot deserialize a reference object without a constructor.");return null==a?a:e&&f?a.map(function(h){return Ed(h,b,c,d,g)}):e&&!f?a.map(function(h){return h}):!e&&f?Ed(a,b,c,d,g):a instanceof xd?null:"object"===typeof a?JSON.parse(JSON.stringify(a)):a} -function Id(a,b){if(b instanceof B)a=zd(b.i());else if(a instanceof B)a=zd(a.i());else throw Error("Cannot find ClassMetadata.");return a};var Ld=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/,Md=function(a,b){if(a){a=a.split("&");for(var c=0;c