New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-google-sheets

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-google-sheets - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

.babelrc

236

google-sheet-connector/gapi.js

@@ -1,14 +0,226 @@

var gapi=window.gapi=window.gapi||{};gapi._bs=new Date().getTime();(function(){/*
"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var gapi = window.gapi = window.gapi || {};gapi._bs = new Date().getTime();(function () {
/*
gapi.loader.OBJECT_CREATE_TEST_OVERRIDE &&*/
var g=window,h=document,m=g.location,n=function(){},q=/\[native code\]/,u=function(a,b,c){return a[b]=a[b]||c},aa=function(a){a=a.sort();for(var b=[],c=void 0,d=0;d<a.length;d++){var e=a[d];e!=c&&b.push(e);c=e}return b},w=function(){var a;if((a=Object.create)&&q.test(a))a=a(null);else{a={};for(var b in a)a[b]=void 0}return a},z=u(g,"gapi",{});var A;A=u(g,"___jsl",w());u(A,"I",0);u(A,"hel",10);var B=function(){var a=m.href;if(A.dpo)var b=A.h;else{b=A.h;var c=/([#].*&|[#])jsh=([^&#]*)/g,d=/([?#].*&|[?#])jsh=([^&#]*)/g;if(a=a&&(c.exec(a)||d.exec(a)))try{b=decodeURIComponent(a[2])}catch(e){}}return b},ba=function(a){var b=u(A,"PQ",[]);A.PQ=[];var c=b.length;if(0===c)a();else for(var d=0,e=function(){++d===c&&a()},f=0;f<c;f++)b[f](e)},C=function(a){return u(u(A,"H",w()),a,w())};var D=u(A,"perf",w()),F=u(D,"g",w()),ca=u(D,"i",w());u(D,"r",[]);w();w();var G=function(a,b,c){var d=D.r;"function"===typeof d?d(a,b,c):d.push([a,b,c])},K=function(a,b,c){b&&0<b.length&&(b=J(b),c&&0<c.length&&(b+="___"+J(c)),28<b.length&&(b=b.substr(0,28)+(b.length-28)),c=b,b=u(ca,"_p",w()),u(b,c,w())[a]=(new Date).getTime(),G(a,"_p",c))},J=function(a){return a.join("__").replace(/\./g,"_").replace(/\-/g,"_").replace(/,/g,"_")};var L=w(),M=[],N=function(a){throw Error("Bad hint"+(a?": "+a:""));};M.push(["jsl",function(a){for(var b in a)if(Object.prototype.hasOwnProperty.call(a,b)){var c=a[b];"object"==typeof c?A[b]=u(A,b,[]).concat(c):u(A,b,c)}if(b=a.u)a=u(A,"us",[]),a.push(b),(b=/^https:(.*)$/.exec(b))&&a.push("http:"+b[1])}]);var da=/^(\/[a-zA-Z0-9_\-]+)+$/,O=[/\/amp\//,/\/amp$/,/^\/amp$/],ea=/^[a-zA-Z0-9\-_\.,!]+$/,fa=/^gapi\.loaded_[0-9]+$/,ha=/^[a-zA-Z0-9,._-]+$/,la=function(a,b,c,d){var e=a.split(";"),f=e.shift(),l=L[f],k=null;l?k=l(e,b,c,d):N("no hint processor for: "+f);k||N("failed to generate load url");b=k;c=b.match(ia);(d=b.match(ja))&&1===d.length&&ka.test(b)&&c&&1===c.length||N("failed sanity: "+a);return k},na=function(a,b,c,d){a=ma(a);fa.test(c)||N("invalid_callback");b=P(b);d=d&&d.length?P(d):null;var e=
function(a){return encodeURIComponent(a).replace(/%2C/g,",")};return[encodeURIComponent(a.pathPrefix).replace(/%2C/g,",").replace(/%2F/g,"/"),"/k=",e(a.version),"/m=",e(b),d?"/exm="+e(d):"","/rt=j/sv=1/d=1/ed=1",a.a?"/am="+e(a.a):"",a.c?"/rs="+e(a.c):"",a.f?"/t="+e(a.f):"","/cb=",e(c)].join("")},ma=function(a){"/"!==a.charAt(0)&&N("relative path");for(var b=a.substring(1).split("/"),c=[];b.length;){a=b.shift();if(!a.length||0==a.indexOf("."))N("empty/relative directory");else if(0<a.indexOf("=")){b.unshift(a);
break}c.push(a)}a={};for(var d=0,e=b.length;d<e;++d){var f=b[d].split("="),l=decodeURIComponent(f[0]),k=decodeURIComponent(f[1]);2==f.length&&l&&k&&(a[l]=a[l]||k)}b="/"+c.join("/");da.test(b)||N("invalid_prefix");c=0;for(d=O.length;c<d;++c)O[c].test(b)&&N("invalid_prefix");c=Q(a,"k",!0);d=Q(a,"am");e=Q(a,"rs");a=Q(a,"t");return{pathPrefix:b,version:c,a:d,c:e,f:a}},P=function(a){for(var b=[],c=0,d=a.length;c<d;++c){var e=a[c].replace(/\./g,"_").replace(/-/g,"_");ha.test(e)&&b.push(e)}return b.join(",")},
Q=function(a,b,c){a=a[b];!a&&c&&N("missing: "+b);if(a){if(ea.test(a))return a;N("invalid: "+b)}return null},ka=/^https?:\/\/[a-z0-9_.-]+\.google(rs)?\.com(:\d+)?\/[a-zA-Z0-9_.,!=\-\/]+$/,ja=/\/cb=/g,ia=/\/\//g,oa=function(){var a=B();if(!a)throw Error("Bad hint");return a};L.m=function(a,b,c,d){(a=a[0])||N("missing_hint");return"https://apis.google.com"+na(a,b,c,d)};var R=decodeURI("%73cript"),S=/^[-+_0-9\/A-Za-z]+={0,2}$/,T=function(a,b){for(var c=[],d=0;d<a.length;++d){var e=a[d],f;if(f=e){a:{for(f=0;f<b.length;f++)if(b[f]===e)break a;f=-1}f=0>f}f&&c.push(e)}return c},U=function(){var a=A.nonce;return void 0!==a?a&&a===String(a)&&a.match(S)?a:A.nonce=null:h.querySelector?(a=h.querySelector("script[nonce]"))?(a=a.nonce||a.getAttribute("nonce")||"",a&&a===String(a)&&a.match(S)?A.nonce=a:A.nonce=null):null:null},pa=function(a){if("loading"!=h.readyState)V(a);
else{var b=U(),c="";null!==b&&(c=' nonce="'+b+'"');h.write("<"+R+' src="'+encodeURI(a)+'"'+c+"></"+R+">")}},V=function(a){var b=h.createElement(R);b.setAttribute("src",a);a=U();null!==a&&b.setAttribute("nonce",a);b.async="true";(a=h.getElementsByTagName(R)[0])?a.parentNode.insertBefore(b,a):(h.head||h.body||h.documentElement).appendChild(b)},qa=function(a,b){var c=b&&b._c;if(c)for(var d=0;d<M.length;d++){var e=M[d][0],f=M[d][1];f&&Object.prototype.hasOwnProperty.call(c,e)&&f(c[e],a,b)}},ra=function(a,
b,c){X(function(){var c=b===B()?u(z,"_",w()):w();c=u(C(b),"_",c);a(c)},c)},Z=function(a,b){var c=b||{};"function"==typeof b&&(c={},c.callback=b);qa(a,c);b=a?a.split(":"):[];var d=c.h||oa(),e=u(A,"ah",w());if(e["::"]&&b.length){a=[];for(var f=null;f=b.shift();){var l=f.split(".");l=e[f]||e[l[1]&&"ns:"+l[0]||""]||d;var k=a.length&&a[a.length-1]||null,v=k;k&&k.hint==l||(v={hint:l,b:[]},a.push(v));v.b.push(f)}var x=a.length;if(1<x){var y=c.callback;y&&(c.callback=function(){0==--x&&y()})}for(;b=a.shift();)Y(b.b,
c,b.hint)}else Y(b||[],c,d)},Y=function(a,b,c){a=aa(a)||[];var d=b.callback,e=b.config,f=b.timeout,l=b.ontimeout,k=b.onerror,v=void 0;"function"==typeof k&&(v=k);var x=null,y=!1;if(f&&!l||!f&&l)throw"Timeout requires both the timeout parameter and ontimeout parameter to be set";k=u(C(c),"r",[]).sort();var H=u(C(c),"L",[]).sort(),E=[].concat(k),W=function(a,b){if(y)return 0;g.clearTimeout(x);H.push.apply(H,p);var d=((z||{}).config||{}).update;d?d(e):e&&u(A,"cu",[]).push(e);if(b){K("me0",a,E);try{ra(b,
c,v)}finally{K("me1",a,E)}}return 1};0<f&&(x=g.setTimeout(function(){y=!0;l()},f));var p=T(a,H);if(p.length){p=T(a,k);var r=u(A,"CP",[]),t=r.length;r[t]=function(a){if(!a)return 0;K("ml1",p,E);var b=function(b){r[t]=null;W(p,a)&&ba(function(){d&&d();b()})},c=function(){var a=r[t+1];a&&a()};0<t&&r[t-1]?r[t]=function(){b(c)}:b(c)};if(p.length){var I="loaded_"+A.I++;z[I]=function(a){r[t](a);z[I]=null};a=la(c,p,"gapi."+I,k);k.push.apply(k,p);K("ml0",p,E);b.sync||g.___gapisync?pa(a):V(a)}else r[t](n)}else W(p)&&
d&&d()};var X=function(a,b){if(A.hee&&0<A.hel)try{return a()}catch(c){b&&b(c),A.hel--,Z("debug_error",function(){try{window.___jsl.hefn(c)}catch(d){throw c;}})}else try{return a()}catch(c){throw b&&b(c),c;}};z.load=function(a,b){return X(function(){return Z(a,b)})};F.bs0=window.gapi._bs||(new Date).getTime();G("bs0");F.bs1=(new Date).getTime();G("bs1");delete window.gapi._bs;}).call(this);
gapi.load("",{callback:window["gapi_onload"],_c:{"jsl":{"ci":{"deviceType":"desktop","oauth-flow":{"authUrl":"https://accounts.google.com/o/oauth2/auth","proxyUrl":"https://accounts.google.com/o/oauth2/postmessageRelay","disableOpt":true,"idpIframeUrl":"https://accounts.google.com/o/oauth2/iframe","usegapi":false},"debug":{"reportExceptionRate":0.05,"forceIm":false,"rethrowException":false,"host":"https://apis.google.com"},"enableMultilogin":true,"googleapis.config":{"auth":{"useFirstPartyAuthV2":true}},"isPlusUser":true,"inline":{"css":1},"disableRealtimeCallback":false,"drive_share":{"skipInitCommand":true},"csi":{"rate":0.01},"client":{"cors":false},"isLoggedIn":true,"signInDeprecation":{"rate":0.0},"include_granted_scopes":true,"llang":"ko","iframes":{"ytsubscribe":{"url":"https://www.youtube.com/subscribe_embed?usegapi\u003d1"},"plus_share":{"params":{"url":""},"url":":socialhost:/:session_prefix::se:_/+1/sharebutton?plusShare\u003dtrue\u0026usegapi\u003d1"},":source:":"3p","playemm":{"url":"https://play.google.com/work/embedded/search?usegapi\u003d1\u0026usegapi\u003d1"},"partnersbadge":{"url":"https://www.gstatic.com/partners/badge/templates/badge.html?usegapi\u003d1"},"dataconnector":{"url":"https://dataconnector.corp.google.com/:session_prefix:ui/widgetview?usegapi\u003d1"},"shortlists":{"url":""},"plus_followers":{"params":{"url":""},"url":":socialhost:/_/im/_/widget/render/plus/followers?usegapi\u003d1"},"post":{"params":{"url":""},"url":":socialhost:/:session_prefix::im_prefix:_/widget/render/post?usegapi\u003d1"},"signin":{"params":{"url":""},"url":":socialhost:/:session_prefix:_/widget/render/signin?usegapi\u003d1","methods":["onauth"]},"donation":{"url":"https://onetoday.google.com/home/donationWidget?usegapi\u003d1"},"plusone":{"params":{"count":"","size":"","url":""},"url":":socialhost:/:session_prefix::se:_/+1/fastbutton?usegapi\u003d1"},":im_socialhost:":"https://plus.googleapis.com","backdrop":{"url":"https://clients3.google.com/cast/chromecast/home/widget/backdrop?usegapi\u003d1"},"visibility":{"params":{"url":""},"url":":socialhost:/:session_prefix:_/widget/render/visibility?usegapi\u003d1"},"additnow":{"url":"https://apis.google.com/additnow/additnow.html?usegapi\u003d1","methods":["launchurl"]},":signuphost:":"https://plus.google.com","community":{"url":":ctx_socialhost:/:session_prefix::im_prefix:_/widget/render/community?usegapi\u003d1"},"plus":{"url":":socialhost:/:session_prefix:_/widget/render/badge?usegapi\u003d1"},"commentcount":{"url":":socialhost:/:session_prefix:_/widget/render/commentcount?usegapi\u003d1"},"zoomableimage":{"url":"https://ssl.gstatic.com/microscope/embed/"},"appfinder":{"url":"https://gsuite.google.com/:session_prefix:marketplace/appfinder?usegapi\u003d1"},"person":{"url":":socialhost:/:session_prefix:_/widget/render/person?usegapi\u003d1"},"savetodrive":{"url":"https://drive.google.com/savetodrivebutton?usegapi\u003d1","methods":["save"]},"page":{"url":":socialhost:/:session_prefix:_/widget/render/page?usegapi\u003d1"},"card":{"url":":socialhost:/:session_prefix:_/hovercard/card"},"youtube":{"params":{"location":["search","hash"]},"url":":socialhost:/:session_prefix:_/widget/render/youtube?usegapi\u003d1","methods":["scroll","openwindow"]},"plus_circle":{"params":{"url":""},"url":":socialhost:/:session_prefix::se:_/widget/plus/circle?usegapi\u003d1"},"rbr_s":{"params":{"url":""},"url":":socialhost:/:session_prefix::se:_/widget/render/recobarsimplescroller"},"udc_webconsentflow":{"params":{"url":""},"url":"https://myaccount.google.com/webconsent?usegapi\u003d1"},"savetoandroidpay":{"url":"https://androidpay.google.com/a/widget/save"},"blogger":{"params":{"location":["search","hash"]},"url":":socialhost:/:session_prefix:_/widget/render/blogger?usegapi\u003d1","methods":["scroll","openwindow"]},"evwidget":{"params":{"url":""},"url":":socialhost:/:session_prefix:_/events/widget?usegapi\u003d1"},"surveyoptin":{"url":"https://www.google.com/shopping/customerreviews/optin?usegapi\u003d1"},":socialhost:":"https://apis.google.com","hangout":{"url":"https://talkgadget.google.com/:session_prefix:talkgadget/_/widget"},":gplus_url:":"https://plus.google.com","rbr_i":{"params":{"url":""},"url":":socialhost:/:session_prefix::se:_/widget/render/recobarinvitation"},"share":{"url":":socialhost:/:session_prefix::im_prefix:_/widget/render/share?usegapi\u003d1"},"comments":{"params":{"location":["search","hash"]},"url":":socialhost:/:session_prefix:_/widget/render/comments?usegapi\u003d1","methods":["scroll","openwindow"]},"autocomplete":{"params":{"url":""},"url":":socialhost:/:session_prefix:_/widget/render/autocomplete"},"ratingbadge":{"url":"https://www.google.com/shopping/customerreviews/badge?usegapi\u003d1"},"appcirclepicker":{"url":":socialhost:/:session_prefix:_/widget/render/appcirclepicker"},"follow":{"url":":socialhost:/:session_prefix:_/widget/render/follow?usegapi\u003d1"},"sharetoclassroom":{"url":"https://www.gstatic.com/classroom/sharewidget/widget_stable.html?usegapi\u003d1"},"ytshare":{"params":{"url":""},"url":":socialhost:/:session_prefix:_/widget/render/ytshare?usegapi\u003d1"},"family_creation":{"params":{"url":""},"url":"https://families.google.com/webcreation?usegapi\u003d1\u0026usegapi\u003d1"},"configurator":{"url":":socialhost:/:session_prefix:_/plusbuttonconfigurator?usegapi\u003d1"},"savetowallet":{"url":"https://androidpay.google.com/a/widget/save"}}},"h":"m;/_/scs/apps-static/_/js/k\u003doz.gapi.ko.u0WhFdqJrXQ.O/m\u003d__features__/am\u003dQQE/rt\u003dj/d\u003d1/rs\u003dAGLTcCO-v0Extr2gWwJAKxa0xtQS573uyA","u":"https://apis.google.com/js/api.js","hee":true,"fp":"cf9b1a3b781a6a354bd124f14e52b66f3c506842","dpo":false},"fp":"cf9b1a3b781a6a354bd124f14e52b66f3c506842","annotation":["interactivepost","recobar","signin2","autocomplete","profile"],"bimodal":["signin","share"]}});
var g = window,
h = document,
m = g.location,
n = function n() {},
q = /\[native code\]/,
u = function u(a, b, c) {
return a[b] = a[b] || c;
},
aa = function aa(a) {
a = a.sort();for (var b = [], c = void 0, d = 0; d < a.length; d++) {
var e = a[d];e != c && b.push(e);c = e;
}return b;
},
w = function w() {
var a;if ((a = Object.create) && q.test(a)) a = a(null);else {
a = {};for (var b in a) {
a[b] = void 0;
}
}return a;
},
z = u(g, "gapi", {});var A;A = u(g, "___jsl", w());u(A, "I", 0);u(A, "hel", 10);var B = function B() {
var a = m.href;if (A.dpo) var b = A.h;else {
b = A.h;var c = /([#].*&|[#])jsh=([^&#]*)/g,
d = /([?#].*&|[?#])jsh=([^&#]*)/g;if (a = a && (c.exec(a) || d.exec(a))) try {
b = decodeURIComponent(a[2]);
} catch (e) {}
}return b;
},
ba = function ba(a) {
var b = u(A, "PQ", []);A.PQ = [];var c = b.length;if (0 === c) a();else for (var d = 0, e = function e() {
++d === c && a();
}, f = 0; f < c; f++) {
b[f](e);
}
},
C = function C(a) {
return u(u(A, "H", w()), a, w());
};var D = u(A, "perf", w()),
F = u(D, "g", w()),
ca = u(D, "i", w());u(D, "r", []);w();w();var G = function G(a, b, c) {
var d = D.r;"function" === typeof d ? d(a, b, c) : d.push([a, b, c]);
},
K = function K(a, b, c) {
b && 0 < b.length && (b = J(b), c && 0 < c.length && (b += "___" + J(c)), 28 < b.length && (b = b.substr(0, 28) + (b.length - 28)), c = b, b = u(ca, "_p", w()), u(b, c, w())[a] = new Date().getTime(), G(a, "_p", c));
},
J = function J(a) {
return a.join("__").replace(/\./g, "_").replace(/\-/g, "_").replace(/,/g, "_");
};var L = w(),
M = [],
N = function N(a) {
throw Error("Bad hint" + (a ? ": " + a : ""));
};M.push(["jsl", function (a) {
for (var b in a) {
if (Object.prototype.hasOwnProperty.call(a, b)) {
var c = a[b];"object" == (typeof c === "undefined" ? "undefined" : _typeof(c)) ? A[b] = u(A, b, []).concat(c) : u(A, b, c);
}
}if (b = a.u) a = u(A, "us", []), a.push(b), (b = /^https:(.*)$/.exec(b)) && a.push("http:" + b[1]);
}]);var da = /^(\/[a-zA-Z0-9_\-]+)+$/,
O = [/\/amp\//, /\/amp$/, /^\/amp$/],
ea = /^[a-zA-Z0-9\-_\.,!]+$/,
fa = /^gapi\.loaded_[0-9]+$/,
ha = /^[a-zA-Z0-9,._-]+$/,
la = function la(a, b, c, d) {
var e = a.split(";"),
f = e.shift(),
l = L[f],
k = null;l ? k = l(e, b, c, d) : N("no hint processor for: " + f);k || N("failed to generate load url");b = k;c = b.match(ia);(d = b.match(ja)) && 1 === d.length && ka.test(b) && c && 1 === c.length || N("failed sanity: " + a);return k;
},
na = function na(a, b, c, d) {
a = ma(a);fa.test(c) || N("invalid_callback");b = P(b);d = d && d.length ? P(d) : null;var e = function e(a) {
return encodeURIComponent(a).replace(/%2C/g, ",");
};return [encodeURIComponent(a.pathPrefix).replace(/%2C/g, ",").replace(/%2F/g, "/"), "/k=", e(a.version), "/m=", e(b), d ? "/exm=" + e(d) : "", "/rt=j/sv=1/d=1/ed=1", a.a ? "/am=" + e(a.a) : "", a.c ? "/rs=" + e(a.c) : "", a.f ? "/t=" + e(a.f) : "", "/cb=", e(c)].join("");
},
ma = function ma(a) {
"/" !== a.charAt(0) && N("relative path");for (var b = a.substring(1).split("/"), c = []; b.length;) {
a = b.shift();if (!a.length || 0 == a.indexOf(".")) N("empty/relative directory");else if (0 < a.indexOf("=")) {
b.unshift(a);
break;
}c.push(a);
}a = {};for (var d = 0, e = b.length; d < e; ++d) {
var f = b[d].split("="),
l = decodeURIComponent(f[0]),
k = decodeURIComponent(f[1]);2 == f.length && l && k && (a[l] = a[l] || k);
}b = "/" + c.join("/");da.test(b) || N("invalid_prefix");c = 0;for (d = O.length; c < d; ++c) {
O[c].test(b) && N("invalid_prefix");
}c = Q(a, "k", !0);d = Q(a, "am");e = Q(a, "rs");a = Q(a, "t");return { pathPrefix: b, version: c, a: d, c: e, f: a };
},
P = function P(a) {
for (var b = [], c = 0, d = a.length; c < d; ++c) {
var e = a[c].replace(/\./g, "_").replace(/-/g, "_");ha.test(e) && b.push(e);
}return b.join(",");
},
Q = function Q(a, b, c) {
a = a[b];!a && c && N("missing: " + b);if (a) {
if (ea.test(a)) return a;N("invalid: " + b);
}return null;
},
ka = /^https?:\/\/[a-z0-9_.-]+\.google(rs)?\.com(:\d+)?\/[a-zA-Z0-9_.,!=\-\/]+$/,
ja = /\/cb=/g,
ia = /\/\//g,
oa = function oa() {
var a = B();if (!a) throw Error("Bad hint");return a;
};L.m = function (a, b, c, d) {
(a = a[0]) || N("missing_hint");return "https://apis.google.com" + na(a, b, c, d);
};var R = decodeURI("%73cript"),
S = /^[-+_0-9\/A-Za-z]+={0,2}$/,
T = function T(a, b) {
for (var c = [], d = 0; d < a.length; ++d) {
var e = a[d],
f;if (f = e) {
a: {
for (f = 0; f < b.length; f++) {
if (b[f] === e) break a;
}f = -1;
}f = 0 > f;
}f && c.push(e);
}return c;
},
U = function U() {
var a = A.nonce;return void 0 !== a ? a && a === String(a) && a.match(S) ? a : A.nonce = null : h.querySelector ? (a = h.querySelector("script[nonce]")) ? (a = a.nonce || a.getAttribute("nonce") || "", a && a === String(a) && a.match(S) ? A.nonce = a : A.nonce = null) : null : null;
},
pa = function pa(a) {
if ("loading" != h.readyState) V(a);else {
var b = U(),
c = "";null !== b && (c = ' nonce="' + b + '"');h.write("<" + R + ' src="' + encodeURI(a) + '"' + c + "></" + R + ">");
}
},
V = function V(a) {
var b = h.createElement(R);b.setAttribute("src", a);a = U();null !== a && b.setAttribute("nonce", a);b.async = "true";(a = h.getElementsByTagName(R)[0]) ? a.parentNode.insertBefore(b, a) : (h.head || h.body || h.documentElement).appendChild(b);
},
qa = function qa(a, b) {
var c = b && b._c;if (c) for (var d = 0; d < M.length; d++) {
var e = M[d][0],
f = M[d][1];f && Object.prototype.hasOwnProperty.call(c, e) && f(c[e], a, b);
}
},
ra = function ra(a, b, c) {
X(function () {
var c = b === B() ? u(z, "_", w()) : w();c = u(C(b), "_", c);a(c);
}, c);
},
Z = function Z(a, b) {
var c = b || {};"function" == typeof b && (c = {}, c.callback = b);qa(a, c);b = a ? a.split(":") : [];var d = c.h || oa(),
e = u(A, "ah", w());if (e["::"] && b.length) {
a = [];for (var f = null; f = b.shift();) {
var l = f.split(".");l = e[f] || e[l[1] && "ns:" + l[0] || ""] || d;var k = a.length && a[a.length - 1] || null,
v = k;k && k.hint == l || (v = { hint: l, b: [] }, a.push(v));v.b.push(f);
}var x = a.length;if (1 < x) {
var y = c.callback;y && (c.callback = function () {
0 == --x && y();
});
}for (; b = a.shift();) {
Y(b.b, c, b.hint);
}
} else Y(b || [], c, d);
},
Y = function Y(a, b, c) {
a = aa(a) || [];var d = b.callback,
e = b.config,
f = b.timeout,
l = b.ontimeout,
k = b.onerror,
v = void 0;"function" == typeof k && (v = k);var x = null,
y = !1;if (f && !l || !f && l) throw "Timeout requires both the timeout parameter and ontimeout parameter to be set";k = u(C(c), "r", []).sort();var H = u(C(c), "L", []).sort(),
E = [].concat(k),
W = function W(a, b) {
if (y) return 0;g.clearTimeout(x);H.push.apply(H, p);var d = ((z || {}).config || {}).update;d ? d(e) : e && u(A, "cu", []).push(e);if (b) {
K("me0", a, E);try {
ra(b, c, v);
} finally {
K("me1", a, E);
}
}return 1;
};0 < f && (x = g.setTimeout(function () {
y = !0;l();
}, f));var p = T(a, H);if (p.length) {
p = T(a, k);var r = u(A, "CP", []),
t = r.length;r[t] = function (a) {
if (!a) return 0;K("ml1", p, E);var b = function b(_b) {
r[t] = null;W(p, a) && ba(function () {
d && d();_b();
});
},
c = function c() {
var a = r[t + 1];a && a();
};0 < t && r[t - 1] ? r[t] = function () {
b(c);
} : b(c);
};if (p.length) {
var I = "loaded_" + A.I++;z[I] = function (a) {
r[t](a);z[I] = null;
};a = la(c, p, "gapi." + I, k);k.push.apply(k, p);K("ml0", p, E);b.sync || g.___gapisync ? pa(a) : V(a);
} else r[t](n);
} else W(p) && d && d();
};var X = function X(a, b) {
if (A.hee && 0 < A.hel) try {
return a();
} catch (c) {
b && b(c), A.hel--, Z("debug_error", function () {
try {
window.___jsl.hefn(c);
} catch (d) {
throw c;
}
});
} else try {
return a();
} catch (c) {
throw b && b(c), c;
}
};z.load = function (a, b) {
return X(function () {
return Z(a, b);
});
};F.bs0 = window.gapi._bs || new Date().getTime();G("bs0");F.bs1 = new Date().getTime();G("bs1");delete window.gapi._bs;
}).call(undefined);
gapi.load("", { callback: window["gapi_onload"], _c: { "jsl": { "ci": { "deviceType": "desktop", "oauth-flow": { "authUrl": "https://accounts.google.com/o/oauth2/auth", "proxyUrl": "https://accounts.google.com/o/oauth2/postmessageRelay", "disableOpt": true, "idpIframeUrl": "https://accounts.google.com/o/oauth2/iframe", "usegapi": false }, "debug": { "reportExceptionRate": 0.05, "forceIm": false, "rethrowException": false, "host": "https://apis.google.com" }, "enableMultilogin": true, "googleapis.config": { "auth": { "useFirstPartyAuthV2": true } }, "isPlusUser": true, "inline": { "css": 1 }, "disableRealtimeCallback": false, "drive_share": { "skipInitCommand": true }, "csi": { "rate": 0.01 }, "client": { "cors": false }, "isLoggedIn": true, "signInDeprecation": { "rate": 0.0 }, "include_granted_scopes": true, "llang": "ko", "iframes": { "ytsubscribe": { "url": "https://www.youtube.com/subscribe_embed?usegapi=1" }, "plus_share": { "params": { "url": "" }, "url": ":socialhost:/:session_prefix::se:_/+1/sharebutton?plusShare=true&usegapi=1" }, ":source:": "3p", "playemm": { "url": "https://play.google.com/work/embedded/search?usegapi=1&usegapi=1" }, "partnersbadge": { "url": "https://www.gstatic.com/partners/badge/templates/badge.html?usegapi=1" }, "dataconnector": { "url": "https://dataconnector.corp.google.com/:session_prefix:ui/widgetview?usegapi=1" }, "shortlists": { "url": "" }, "plus_followers": { "params": { "url": "" }, "url": ":socialhost:/_/im/_/widget/render/plus/followers?usegapi=1" }, "post": { "params": { "url": "" }, "url": ":socialhost:/:session_prefix::im_prefix:_/widget/render/post?usegapi=1" }, "signin": { "params": { "url": "" }, "url": ":socialhost:/:session_prefix:_/widget/render/signin?usegapi=1", "methods": ["onauth"] }, "donation": { "url": "https://onetoday.google.com/home/donationWidget?usegapi=1" }, "plusone": { "params": { "count": "", "size": "", "url": "" }, "url": ":socialhost:/:session_prefix::se:_/+1/fastbutton?usegapi=1" }, ":im_socialhost:": "https://plus.googleapis.com", "backdrop": { "url": "https://clients3.google.com/cast/chromecast/home/widget/backdrop?usegapi=1" }, "visibility": { "params": { "url": "" }, "url": ":socialhost:/:session_prefix:_/widget/render/visibility?usegapi=1" }, "additnow": { "url": "https://apis.google.com/additnow/additnow.html?usegapi=1", "methods": ["launchurl"] }, ":signuphost:": "https://plus.google.com", "community": { "url": ":ctx_socialhost:/:session_prefix::im_prefix:_/widget/render/community?usegapi=1" }, "plus": { "url": ":socialhost:/:session_prefix:_/widget/render/badge?usegapi=1" }, "commentcount": { "url": ":socialhost:/:session_prefix:_/widget/render/commentcount?usegapi=1" }, "zoomableimage": { "url": "https://ssl.gstatic.com/microscope/embed/" }, "appfinder": { "url": "https://gsuite.google.com/:session_prefix:marketplace/appfinder?usegapi=1" }, "person": { "url": ":socialhost:/:session_prefix:_/widget/render/person?usegapi=1" }, "savetodrive": { "url": "https://drive.google.com/savetodrivebutton?usegapi=1", "methods": ["save"] }, "page": { "url": ":socialhost:/:session_prefix:_/widget/render/page?usegapi=1" }, "card": { "url": ":socialhost:/:session_prefix:_/hovercard/card" }, "youtube": { "params": { "location": ["search", "hash"] }, "url": ":socialhost:/:session_prefix:_/widget/render/youtube?usegapi=1", "methods": ["scroll", "openwindow"] }, "plus_circle": { "params": { "url": "" }, "url": ":socialhost:/:session_prefix::se:_/widget/plus/circle?usegapi=1" }, "rbr_s": { "params": { "url": "" }, "url": ":socialhost:/:session_prefix::se:_/widget/render/recobarsimplescroller" }, "udc_webconsentflow": { "params": { "url": "" }, "url": "https://myaccount.google.com/webconsent?usegapi=1" }, "savetoandroidpay": { "url": "https://androidpay.google.com/a/widget/save" }, "blogger": { "params": { "location": ["search", "hash"] }, "url": ":socialhost:/:session_prefix:_/widget/render/blogger?usegapi=1", "methods": ["scroll", "openwindow"] }, "evwidget": { "params": { "url": "" }, "url": ":socialhost:/:session_prefix:_/events/widget?usegapi=1" }, "surveyoptin": { "url": "https://www.google.com/shopping/customerreviews/optin?usegapi=1" }, ":socialhost:": "https://apis.google.com", "hangout": { "url": "https://talkgadget.google.com/:session_prefix:talkgadget/_/widget" }, ":gplus_url:": "https://plus.google.com", "rbr_i": { "params": { "url": "" }, "url": ":socialhost:/:session_prefix::se:_/widget/render/recobarinvitation" }, "share": { "url": ":socialhost:/:session_prefix::im_prefix:_/widget/render/share?usegapi=1" }, "comments": { "params": { "location": ["search", "hash"] }, "url": ":socialhost:/:session_prefix:_/widget/render/comments?usegapi=1", "methods": ["scroll", "openwindow"] }, "autocomplete": { "params": { "url": "" }, "url": ":socialhost:/:session_prefix:_/widget/render/autocomplete" }, "ratingbadge": { "url": "https://www.google.com/shopping/customerreviews/badge?usegapi=1" }, "appcirclepicker": { "url": ":socialhost:/:session_prefix:_/widget/render/appcirclepicker" }, "follow": { "url": ":socialhost:/:session_prefix:_/widget/render/follow?usegapi=1" }, "sharetoclassroom": { "url": "https://www.gstatic.com/classroom/sharewidget/widget_stable.html?usegapi=1" }, "ytshare": { "params": { "url": "" }, "url": ":socialhost:/:session_prefix:_/widget/render/ytshare?usegapi=1" }, "family_creation": { "params": { "url": "" }, "url": "https://families.google.com/webcreation?usegapi=1&usegapi=1" }, "configurator": { "url": ":socialhost:/:session_prefix:_/plusbuttonconfigurator?usegapi=1" }, "savetowallet": { "url": "https://androidpay.google.com/a/widget/save" } } }, "h": "m;/_/scs/apps-static/_/js/k=oz.gapi.ko.u0WhFdqJrXQ.O/m=__features__/am=QQE/rt=j/d=1/rs=AGLTcCO-v0Extr2gWwJAKxa0xtQS573uyA", "u": "https://apis.google.com/js/api.js", "hee": true, "fp": "cf9b1a3b781a6a354bd124f14e52b66f3c506842", "dpo": false }, "fp": "cf9b1a3b781a6a354bd124f14e52b66f3c506842", "annotation": ["interactivepost", "recobar", "signin2", "autocomplete", "profile"], "bimodal": ["signin", "share"] } });
module.exports = gapi;
module.exports = gapi;

142

google-sheet-connector/index.js

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

"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _ruucmUtil = require("ruucm-util");
var fetch = require("isomorphic-fetch");

@@ -6,5 +12,5 @@ var camelCase = require("camelcase");

import { log } from 'ruucm-util'
function GoogleSheetConnector(options, onLoad) {
var _this = this;
function GoogleSheetConnector(options, onLoad) {
var sheetsData = [];

@@ -18,3 +24,3 @@ this.sheetsLoaded = 0;

this.getSheetsData = function() {
this.getSheetsData = function () {
return sheetsData.slice();

@@ -26,3 +32,3 @@ };

this.sheetsLoaded ++;
this.sheetsLoaded++;

@@ -41,12 +47,12 @@ if (this.sheetsLoaded === this.numSheets) {

}
this.updateCell = (column, row, value, successCallback, errorCallback) => {
this.updateCell = function (column, row, value, successCallback, errorCallback) {
var data = {
spreadsheetId: this.spreadsheetId,
spreadsheetId: _this.spreadsheetId,
range: 'sheet02!' + column + row,
valueInputOption: 'USER_ENTERED',
values: [ [value] ]
}
log('data', data)
values: [[value]]
};
(0, _ruucmUtil.log)('data', data);
gapi.client.sheets.spreadsheets.values.update(data).then(successCallback, errorCallback);
}
};
}

@@ -56,23 +62,16 @@

initialise: function() {
initialise: function initialise() {
console.info("Loading data from Spreadsheet");
log('this.clientId', this.clientId)
log('gapi', gapi)
(0, _ruucmUtil.log)('this.clientId', this.clientId);
(0, _ruucmUtil.log)('gapi', gapi);
if (this.clientId) {
return gapi.load("client:auth2", this.initClient.bind(this));
} else if (this.apiKey) {
var url = [
"https://sheets.googleapis.com/v4/spreadsheets/",
this.spreadsheetId,
"?key=",
this.apiKey
].join("");
var url = ["https://sheets.googleapis.com/v4/spreadsheets/", this.spreadsheetId, "?key=", this.apiKey].join("");
fetch(url)
.then(function(response) {
return response.json();
})
.then(function(data) {
return this.loadSheetsData(data);
}.bind(this));
fetch(url).then(function (response) {
return response.json();
}).then(function (data) {
return this.loadSheetsData(data);
}.bind(this));
} else {

@@ -83,5 +82,5 @@ console.info("You must specify a valid Client ID or API Key");

loadSheetsData: function(data) {
loadSheetsData: function loadSheetsData(data) {
this.numSheets = data.sheets.length;
data.sheets.forEach(function(sheet) {
data.sheets.forEach(function (sheet) {
return this.loadSheetViaKey(sheet.properties.title);

@@ -91,3 +90,3 @@ }, this);

loadSpreadsheet: function() {
loadSpreadsheet: function loadSpreadsheet() {
gapi.client.sheets.spreadsheets.get({

@@ -102,7 +101,7 @@ spreadsheetId: this.spreadsheetId

loadSheetViaAuth: function(sheet) {
loadSheetViaAuth: function loadSheetViaAuth(sheet) {
gapi.client.sheets.spreadsheets.values.get({
spreadsheetId: this.spreadsheetId,
range: sheet.properties.title
}).then(function(response) {
}).then(function (response) {
var values = JSON.parse(response.body).values;

@@ -113,24 +112,17 @@ this.loadSheet(sheet.properties.title, values);

loadSheetViaKey: function(sheetName) {
var url = [
"https://sheets.googleapis.com/v4/spreadsheets/",
this.spreadsheetId,
"/values/",
sheetName,
"?key=",
this.apiKey
].join("");
loadSheetViaKey: function loadSheetViaKey(sheetName) {
var url = ["https://sheets.googleapis.com/v4/spreadsheets/", this.spreadsheetId, "/values/", sheetName, "?key=", this.apiKey].join("");
fetch(url)
.then(function(response) { return response.json(); })
.then(function(json) {
var values = json.values;
this.loadSheet(sheetName, values);
}.bind(this));
fetch(url).then(function (response) {
return response.json();
}).then(function (json) {
var values = json.values;
this.loadSheet(sheetName, values);
}.bind(this));
},
loadSheet: function(sheetName, values) {
loadSheet: function loadSheet(sheetName, values) {
var headerRow = values[0];
var dataRows = values.slice(1);
var keys = headerRow.map(function(value) {
var keys = headerRow.map(function (value) {
return camelCase(value);

@@ -151,6 +143,6 @@ }, this);

loadRowsData: function(keys, values) {
return values.map(function(row) {
loadRowsData: function loadRowsData(keys, values) {
return values.map(function (row) {
keys.forEach(function(key, i) {
keys.forEach(function (key, i) {
row[key] = row[i];

@@ -163,4 +155,4 @@ });

initClient: function() {
log('initClient')
initClient: function initClient() {
(0, _ruucmUtil.log)('initClient');
gapi.client.init({

@@ -171,6 +163,6 @@ discoveryDocs: ["https://sheets.googleapis.com/$discovery/rest?version=v4"],

}).then(function () {
log('after initClient')
(0, _ruucmUtil.log)('after initClient');
var authInstance = gapi.auth2.getAuthInstance();
if (authInstance.isSignedIn.get()) {
this.loadSpreadsheet()
this.loadSpreadsheet();
} else {

@@ -183,3 +175,3 @@ authInstance.isSignedIn.listen(this.updateSigninStatus.bind(this));

updateSigninStatus: function(isSignedIn) {
updateSigninStatus: function updateSigninStatus(isSignedIn) {
if (isSignedIn) {

@@ -190,11 +182,11 @@ this.loadSpreadsheet();

getSheet: function(sheetName) {
getSheet: function getSheet(sheetName) {
return new SheetData(this.getSheetsData(), sheetName);
},
}
};
function SheetData(sheetsData, sheetName) {
var sheet = sheetsData.find(function(sheet) {
var sheet = sheetsData.find(function (sheet) {
return sheet.name === sheetName;
}) || {data: [], values: []};
}) || { data: [], values: [] };

@@ -206,11 +198,11 @@ this.header = sheet.header;

this.getData = function() {
this.getData = function () {
return data.slice();
};
this.getCurrentData = function() {
this.getCurrentData = function () {
return currentData.slice();
};
this.setCurrentData = function(newData) {
this.setCurrentData = function (newData) {
currentData = newData;

@@ -221,8 +213,8 @@ };

SheetData.prototype = {
map: function(callback) {
map: function map(callback) {
return this.getCurrentData().map(callback);
},
filter: function(filterObj, strValue) {
var newData = this.getData().filter(function(row) {
if (typeof filterObj === "object") {
filter: function filter(filterObj, strValue) {
var newData = this.getData().filter(function (row) {
if ((typeof filterObj === "undefined" ? "undefined" : _typeof(filterObj)) === "object") {
for (var i in filterObj) {

@@ -234,3 +226,3 @@ if (!row.hasOwnProperty(i) || row[i] !== filterObj[i]) {

} else {
const colIndex = this.header.indexOf(filterObj);
var colIndex = this.header.indexOf(filterObj);
if (row[colIndex] !== strValue) return false;

@@ -246,3 +238,3 @@ }

},
group: function(colName, sort) {
group: function group(colName, sort) {
var groups = [];

@@ -253,7 +245,7 @@ var colIndex = this.header.indexOf(colName);

this.getCurrentData().forEach(function(row) {
this.getCurrentData().forEach(function (row) {
var groupName = row[colIndex];
var groupIndex = -1;
groups.forEach(function(group, i) {
groups.forEach(function (group, i) {
if (group.name === groupName) groupIndex = i;

@@ -279,6 +271,6 @@ });

},
sort: function(colName) {
sort: function sort(colName) {
var newData = this.getCurrentData();
if (this.dataIsGrouped) {
newData.forEach(function(group) {
newData.forEach(function (group) {
sortArray(group.data, camelCase(colName));

@@ -293,3 +285,3 @@ });

},
reverse: function() {
reverse: function reverse() {
var newData = this.getCurrentData();

@@ -304,3 +296,3 @@ newData.reverse();

array.sort(function(a, b) {
array.sort(function (a, b) {
var textA = a[orderBy] ? a[orderBy].toUpperCase() : "";

@@ -307,0 +299,0 @@ var textB = b[orderBy] ? b[orderBy].toUpperCase() : "";

{
"name": "react-google-sheets",
"version": "0.1.0",
"version": "0.2.0",
"description": "Read and Write data using Google Sheets API in react",
"scripts": {
"dev": "./node_modules/.bin/babel --watch src -d ./"
},
"author": "ruucm <ruucm.a@gmail.com>",

@@ -15,3 +18,10 @@ "dependencies": {

},
"homepage": "https://github.com/ruucm/react-google-sheets"
"homepage": "https://github.com/ruucm/react-google-sheets",
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1"
}
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc