From b86cf0cd20305c4cf3d92e5e598c661c3bee7770 Mon Sep 17 00:00:00 2001 From: decobot Date: Tue, 14 Jan 2025 14:36:53 -0300 Subject: [PATCH 1/2] App: google sheets --- deco.ts | 1 + decohub/apps/google-sheets.ts | 1 + decohub/manifest.gen.ts | 94 +++++++++++++++++----------------- google-sheets/README.md | 1 + google-sheets/loaders/doc.ts | 5 ++ google-sheets/logo.png | Bin 0 -> 4733 bytes google-sheets/manifest.gen.ts | 17 ++++++ google-sheets/mod.ts | 67 ++++++++++++++++++++++++ 8 files changed, 140 insertions(+), 46 deletions(-) create mode 100644 decohub/apps/google-sheets.ts create mode 100644 google-sheets/README.md create mode 100644 google-sheets/loaders/doc.ts create mode 100644 google-sheets/logo.png create mode 100644 google-sheets/manifest.gen.ts create mode 100644 google-sheets/mod.ts diff --git a/deco.ts b/deco.ts index 4d50e9fcd..3be1a8269 100644 --- a/deco.ts +++ b/deco.ts @@ -10,6 +10,7 @@ const compatibilityApps = [{ const config = { apps: [ + app("google-sheets"), app("posthog"), app("decopilot-app"), app("smarthint"), diff --git a/decohub/apps/google-sheets.ts b/decohub/apps/google-sheets.ts new file mode 100644 index 000000000..df45eda80 --- /dev/null +++ b/decohub/apps/google-sheets.ts @@ -0,0 +1 @@ +export { default, preview } from "../../google-sheets/mod.ts"; diff --git a/decohub/manifest.gen.ts b/decohub/manifest.gen.ts index 6b2d1aacb..0df88f52c 100644 --- a/decohub/manifest.gen.ts +++ b/decohub/manifest.gen.ts @@ -10,29 +10,30 @@ import * as $$$$$$$$$$$4 from "./apps/blog.ts"; import * as $$$$$$$$$$$5 from "./apps/brand-assistant.ts"; import * as $$$$$$$$$$$6 from "./apps/crux.ts"; import * as $$$$$$$$$$$7 from "./apps/emailjs.ts"; -import * as $$$$$$$$$$$8 from "./apps/htmx.ts"; -import * as $$$$$$$$$$$9 from "./apps/implementation.ts"; -import * as $$$$$$$$$$$10 from "./apps/konfidency.ts"; -import * as $$$$$$$$$$$11 from "./apps/linx-impulse.ts"; -import * as $$$$$$$$$$$12 from "./apps/linx.ts"; -import * as $$$$$$$$$$$13 from "./apps/mailchimp.ts"; -import * as $$$$$$$$$$$14 from "./apps/nuvemshop.ts"; -import * as $$$$$$$$$$$15 from "./apps/posthog.ts"; -import * as $$$$$$$$$$$16 from "./apps/power-reviews.ts"; -import * as $$$$$$$$$$$17 from "./apps/ra-trustvox.ts"; -import * as $$$$$$$$$$$18 from "./apps/resend.ts"; -import * as $$$$$$$$$$$19 from "./apps/shopify.ts"; -import * as $$$$$$$$$$$20 from "./apps/smarthint.ts"; -import * as $$$$$$$$$$$21 from "./apps/sourei.ts"; -import * as $$$$$$$$$$$22 from "./apps/streamshop.ts"; -import * as $$$$$$$$$$$23 from "./apps/typesense.ts"; -import * as $$$$$$$$$$$24 from "./apps/verified-reviews.ts"; -import * as $$$$$$$$$$$25 from "./apps/vnda.ts"; -import * as $$$$$$$$$$$26 from "./apps/vtex.ts"; -import * as $$$$$$$$$$$27 from "./apps/wake.ts"; -import * as $$$$$$$$$$$28 from "./apps/wap.ts"; -import * as $$$$$$$$$$$29 from "./apps/weather.ts"; -import * as $$$$$$$$$$$30 from "./apps/workflows.ts"; +import * as $$$$$$$$$$$8 from "./apps/google-sheets.ts"; +import * as $$$$$$$$$$$9 from "./apps/htmx.ts"; +import * as $$$$$$$$$$$10 from "./apps/implementation.ts"; +import * as $$$$$$$$$$$11 from "./apps/konfidency.ts"; +import * as $$$$$$$$$$$12 from "./apps/linx-impulse.ts"; +import * as $$$$$$$$$$$13 from "./apps/linx.ts"; +import * as $$$$$$$$$$$14 from "./apps/mailchimp.ts"; +import * as $$$$$$$$$$$15 from "./apps/nuvemshop.ts"; +import * as $$$$$$$$$$$16 from "./apps/posthog.ts"; +import * as $$$$$$$$$$$17 from "./apps/power-reviews.ts"; +import * as $$$$$$$$$$$18 from "./apps/ra-trustvox.ts"; +import * as $$$$$$$$$$$19 from "./apps/resend.ts"; +import * as $$$$$$$$$$$20 from "./apps/shopify.ts"; +import * as $$$$$$$$$$$21 from "./apps/smarthint.ts"; +import * as $$$$$$$$$$$22 from "./apps/sourei.ts"; +import * as $$$$$$$$$$$23 from "./apps/streamshop.ts"; +import * as $$$$$$$$$$$24 from "./apps/typesense.ts"; +import * as $$$$$$$$$$$25 from "./apps/verified-reviews.ts"; +import * as $$$$$$$$$$$26 from "./apps/vnda.ts"; +import * as $$$$$$$$$$$27 from "./apps/vtex.ts"; +import * as $$$$$$$$$$$28 from "./apps/wake.ts"; +import * as $$$$$$$$$$$29 from "./apps/wap.ts"; +import * as $$$$$$$$$$$30 from "./apps/weather.ts"; +import * as $$$$$$$$$$$31 from "./apps/workflows.ts"; const manifest = { "apps": { @@ -44,29 +45,30 @@ const manifest = { "decohub/apps/brand-assistant.ts": $$$$$$$$$$$5, "decohub/apps/crux.ts": $$$$$$$$$$$6, "decohub/apps/emailjs.ts": $$$$$$$$$$$7, - "decohub/apps/htmx.ts": $$$$$$$$$$$8, - "decohub/apps/implementation.ts": $$$$$$$$$$$9, - "decohub/apps/konfidency.ts": $$$$$$$$$$$10, - "decohub/apps/linx-impulse.ts": $$$$$$$$$$$11, - "decohub/apps/linx.ts": $$$$$$$$$$$12, - "decohub/apps/mailchimp.ts": $$$$$$$$$$$13, - "decohub/apps/nuvemshop.ts": $$$$$$$$$$$14, - "decohub/apps/posthog.ts": $$$$$$$$$$$15, - "decohub/apps/power-reviews.ts": $$$$$$$$$$$16, - "decohub/apps/ra-trustvox.ts": $$$$$$$$$$$17, - "decohub/apps/resend.ts": $$$$$$$$$$$18, - "decohub/apps/shopify.ts": $$$$$$$$$$$19, - "decohub/apps/smarthint.ts": $$$$$$$$$$$20, - "decohub/apps/sourei.ts": $$$$$$$$$$$21, - "decohub/apps/streamshop.ts": $$$$$$$$$$$22, - "decohub/apps/typesense.ts": $$$$$$$$$$$23, - "decohub/apps/verified-reviews.ts": $$$$$$$$$$$24, - "decohub/apps/vnda.ts": $$$$$$$$$$$25, - "decohub/apps/vtex.ts": $$$$$$$$$$$26, - "decohub/apps/wake.ts": $$$$$$$$$$$27, - "decohub/apps/wap.ts": $$$$$$$$$$$28, - "decohub/apps/weather.ts": $$$$$$$$$$$29, - "decohub/apps/workflows.ts": $$$$$$$$$$$30, + "decohub/apps/google-sheets.ts": $$$$$$$$$$$8, + "decohub/apps/htmx.ts": $$$$$$$$$$$9, + "decohub/apps/implementation.ts": $$$$$$$$$$$10, + "decohub/apps/konfidency.ts": $$$$$$$$$$$11, + "decohub/apps/linx-impulse.ts": $$$$$$$$$$$12, + "decohub/apps/linx.ts": $$$$$$$$$$$13, + "decohub/apps/mailchimp.ts": $$$$$$$$$$$14, + "decohub/apps/nuvemshop.ts": $$$$$$$$$$$15, + "decohub/apps/posthog.ts": $$$$$$$$$$$16, + "decohub/apps/power-reviews.ts": $$$$$$$$$$$17, + "decohub/apps/ra-trustvox.ts": $$$$$$$$$$$18, + "decohub/apps/resend.ts": $$$$$$$$$$$19, + "decohub/apps/shopify.ts": $$$$$$$$$$$20, + "decohub/apps/smarthint.ts": $$$$$$$$$$$21, + "decohub/apps/sourei.ts": $$$$$$$$$$$22, + "decohub/apps/streamshop.ts": $$$$$$$$$$$23, + "decohub/apps/typesense.ts": $$$$$$$$$$$24, + "decohub/apps/verified-reviews.ts": $$$$$$$$$$$25, + "decohub/apps/vnda.ts": $$$$$$$$$$$26, + "decohub/apps/vtex.ts": $$$$$$$$$$$27, + "decohub/apps/wake.ts": $$$$$$$$$$$28, + "decohub/apps/wap.ts": $$$$$$$$$$$29, + "decohub/apps/weather.ts": $$$$$$$$$$$30, + "decohub/apps/workflows.ts": $$$$$$$$$$$31, }, "name": "decohub", "baseUrl": import.meta.url, diff --git a/google-sheets/README.md b/google-sheets/README.md new file mode 100644 index 000000000..f3bd95a52 --- /dev/null +++ b/google-sheets/README.md @@ -0,0 +1 @@ +# App Template diff --git a/google-sheets/loaders/doc.ts b/google-sheets/loaders/doc.ts new file mode 100644 index 000000000..45d53ad3a --- /dev/null +++ b/google-sheets/loaders/doc.ts @@ -0,0 +1,5 @@ +import { AppContext } from "../mod.ts"; + +export default function doc(_: null, __: Request, ctx: AppContext) { + return ctx.doc; +} diff --git a/google-sheets/logo.png b/google-sheets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..61c3c5c7c90809418d18d3ec1d746d88e662c045 GIT binary patch literal 4733 zcmb_fcT`hbm%kwpf)JYYqLBnelnxSl;86lf6`m;4r3gruG$Dj0ML|GBdJ&bPAPCZ> zND&aQ(n}};!jme!eV6xUz4>P5&HOd@uDj1U`?vSm^_;9knHcFIjtLwC005zn(>4Rg z_u#h!hk}kA z(jnlr{6L*+PL}%4hK7JRIEMoa5KaIJ&LH3mKm-7WKj#2o01^CqZUzzi4;eZDpgaDb z@}TU|g9ATM`>*k&*`_=IuHa*F%1SG*48Yf$5ygMQm^M(#f zT8ZMP>R-@J=UTkN->;XNb;_hj&3qWNc4%{H^XpNSTiZpxlBnD8bMD2@rYrRx#Mvcw z%;KZyd{L4HMr^W>MTX z^-2y+y4?AdUab`vXgdIQt2D{0B$ADeaz#hzmtH6aLJJ7<8CZ-n*A$U16rgv@+G_0( zjO$OUAPrk)SYzB)ZHA>E7f{k4eNRcgJ)c%P|NH(F;0*Y`@|js~l*4@^a*mx*=Z#cb zJU7o6uvq$!N7()@rS;EsQ#lcI7yxJ_1=fB zPkyn_A@qP7Q7St9TTDwnWp6N?A|8mInfc9_1Y|B8q_RDob0ftQ@`WiIBZ?P=qpDw2 zv_nRsmX-9*dZC>>QJe)7vge97>R#R*;}JyjtT2{P5uI;qiq5i7Xn%*>cqqvUwVQpG zbzHPmG@;&0h#7VDyfGTqs8^#gyT)elgg1&_K-U*f6p;bi)@D|8_kQDR1_l?0Ey#?gkK9%v)UXalL}=~GWg4vXu&8TVVN z8BCpiiI}<@f2dzEMk z!<=Y}W^3NG8QdLxH^sO}?2JOhR!arvgVwg53F;rXaKf}C2RS?5E(tUBqLtLo*dwP? zZP0y*iC`yG-W3#DiwdJYh{?qT9dGOy3`Y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5m4b*yN-Jac*FD^zim%IH~x zTKdk_Y|?g+NBbQKASW=Ld2|(ni%m5ldA+~Aa4Q@(gE^(R%-A4-&mPumEttxw?#RZ6 zb4>2s7PO&brlkLt9dH@(B$@bSf`-9k0$SA+6rteMH!P8wN7T9V@{6`~w&Dss0GFOo zpQj=PgcPF{ z-~Q^4g0=7eWHYv3nq;mD@-O4`E4=_~zdy12#kRd_Tx^C`Wte`9es1x~r8|K&~(~b+6qGrCwj4VT@TWJ-cgF zLka3^@)=dQ88P1Sy?D;j$2;8*G~%@T4OdL$vzG5E-pdO^t!^p9O<7=CT%lCsvXFMEo<_z-Jj-Np}2QJ`4t^4WG1)y))Nu2 zJVW)(IlJ9Aie!e;B zOGacYKBzo@h0ArT4;~{6CJpI))WI^>|P3bZm`#VRNzw1ORJw9>U2MbeTa?UTWg=yzK8~ zCxp(>RX|d$B68MMFvU#P*3Cqm!dS>l@{6JM3!nobI1I*<9NpwY**I6b{2C1LUZsO( zPQKvDCpHbCQ_Wvm-&F=3JAhImSFWMHxLQ9m`KopjB_yPXJj>X=-y@~=c(b$e1tYLn zKQUFc84)*IpRPrtRRuj27JAN;lBGO$W}Al5$?h8r)D4}UOfNI9L@hB~zX}?3NFQEt z*0wYF6;=@~?tLpJGw~(k|ZZLV7&HtPL6bWq7zh zE-FmsXc<(f)*)%s5MO|N`h|?s0L_$)zYH=_4C9(z`G^nwk&(&C{*`b^Z!!d|9O%9`>p@~h{Env%H^`< z!Ws?6ijclvouIUri&BKsr;h1J)Hwm?{VDcqHr(;3Tpk`4`sXzbwBrG}CSRM+qIk|g z>Zr>Z<3ygE!q;#sLSS>bamrJd8HsG$g#%-Cww%Hkfvut826A(%Fe5$<{Bvu|u&fHO zVO5s6Ilt%Ke?_HOW~OLVPkk(xffWLFToi!D6)X_Uy5${H_)es*w;xE??cU=6_##uE zrVuk!I4qH?; + +export interface Props { + client_email: string; + private_key: Secret; + sheet_id: string; + scopes: string[]; +} + +// Here we define the state of the app +// You choose what to put in the state +export interface State extends Omit { + doc: GoogleSpreadsheet; +} + +/** + * @title Google Sheets + * @description This is an app that enables a google spreadsheet integration. + * @category Tool + * @logo https://raw.githubusercontent.com/deco-cx/apps/main/google-sheets/logo.png + */ +export default function GoogleSheet(props: Props): App { + const SCOPES = props.scopes; + + const jwt = new JWT({ + email: props.client_email, + key: props.private_key?.get() || "", + scopes: SCOPES, + }); + + const doc = new GoogleSpreadsheet( + props.sheet_id, + jwt, + ); + + return { + state: { + ...props, + doc, + }, + manifest, + }; +} + +// It is important to use the same name as the default export of the app +export const preview = () => { + return { + Component: PreviewContainer, + props: { + name: "Google Sheets", + owner: "deco.cx", + description: + "This is an app that enables a google spreadsheet integration.", + logo: + "https://raw.githubusercontent.com/deco-cx/apps/main/google-sheets/logo.png", + images: [], + tabs: [], + }, + }; +}; From 90b5af9518f72c4a2cad284587af663a1796061c Mon Sep 17 00:00:00 2001 From: Luis Sousa Date: Mon, 20 Jan 2025 16:30:11 -0300 Subject: [PATCH 2/2] Delete google-sheets/README.md --- google-sheets/README.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 google-sheets/README.md diff --git a/google-sheets/README.md b/google-sheets/README.md deleted file mode 100644 index f3bd95a52..000000000 --- a/google-sheets/README.md +++ /dev/null @@ -1 +0,0 @@ -# App Template