Skip to content

Commit

Permalink
Adding Secret to Crawler Action (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanluiz33 authored Dec 19, 2023
1 parent 2551e01 commit 7f9fb6a
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 72 deletions.
11 changes: 6 additions & 5 deletions actions/startAlgoliaCrawler.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
import { Secret } from "apps/website/loaders/secret.ts";
export interface Props {
/**
* @title Crawler User ID
*/
crawlerUserId: string;
crawlerUserId: Secret;
/**
* @title Crawler API Key
*/
crawlerApiKey: string;
crawlerApiKey: Secret;
/**
* @title Crawler ID
*/
crawlerId: string;
crawlerId: Secret;
}

const action = async (
{ crawlerUserId, crawlerApiKey, crawlerId }: Props,
): Promise<void> => {
const url = `https://crawler.algolia.com/api/1/crawlers/${crawlerId}/reindex`;
const url = `https://crawler.algolia.com/api/1/crawlers/${crawlerId.get()}/reindex`;
const headers = {
"Content-Type": "application/json",
"Authorization": "Basic " + btoa(`${crawlerUserId}:${crawlerApiKey}`),
"Authorization": "Basic " + btoa(`${crawlerUserId.get()}:${crawlerApiKey.get()}`),
};

await fetch(url, {
Expand Down
12 changes: 6 additions & 6 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"$live/": "https://denopkg.com/deco-cx/deco@1.47.5/",
"$store/": "./",
"deco/": "https://denopkg.com/deco-cx/deco@1.47.5/",
"apps/": "https://denopkg.com/deco-cx/apps@0.24.13/",
"$fresh/": "https://denopkg.com/denoland/fresh@7ad4610e3a42aba42638cbc1041b96ee58a9b29e/",
"preact": "https://esm.sh/preact@10.15.1",
"preact/": "https://esm.sh/preact@10.15.1/",
"apps/": "https://denopkg.com/deco-cx/apps@0.25.5/",
"$fresh/": "https://deno.land/x/fresh@1.6.1/",
"preact": "https://esm.sh/preact@10.19.2",
"preact/": "https://esm.sh/preact@10.19.2/",
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.1",
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
"@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.2.3",
"@preact/signals": "https://esm.sh/*@preact/signals@1.2.1",
"@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.5.0",
"std/": "https://deno.land/std@0.190.0/",
"partytown/": "https://denopkg.com/deco-cx/partytown@0.4.8/",
"daisyui": "npm:daisyui@3.9.2",
Expand Down
124 changes: 63 additions & 61 deletions fresh.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,73 +2,75 @@
// This file SHOULD be checked into source version control.
// This file is automatically updated during development when running `dev.ts`.

import * as $0 from "./routes/_app.tsx";
import * as $1 from "./routes/admin/[...catchall].tsx";
import * as $2 from "./routes/api/calc.tsx";
import * as $3 from "./routes/api/case.tsx";
import * as $4 from "./routes/api/leads.tsx";
import * as $5 from "./routes/api/ranking.ts";
import * as $6 from "./routes/api/webinar.tsx";
import * as $7 from "./routes/gfm.css.ts";
import * as $8 from "./routes/hackathon4.ts";
import * as $9 from "./routes/index.tsx";
import * as $10 from "./routes/proxy/image/index.tsx";
import * as $$0 from "./islands/CampHeader.tsx";
import * as $$1 from "./islands/CampMentor.tsx";
import * as $$2 from "./islands/Case.tsx";
import * as $$3 from "./islands/ChangeDevice.tsx";
import * as $$4 from "./islands/ChangeTheme.tsx";
import * as $$5 from "./islands/Cms.tsx";
import * as $$6 from "./islands/ContactUs.tsx";
import * as $$7 from "./islands/FaviconImage.tsx";
import * as $$8 from "./islands/ForwardBackButtons/ForwardBackButtons.tsx";
import * as $$9 from "./islands/Header.tsx";
import * as $$10 from "./islands/HelpFaq.tsx";
import * as $$11 from "./islands/ImpactCalculator.tsx";
import * as $$12 from "./islands/LiveProjects.tsx";
import * as $$13 from "./islands/OnThisPage.tsx";
import * as $$14 from "./islands/PopularDocuments.tsx";
import * as $$15 from "./islands/RankingAnalyze.tsx";
import * as $$16 from "./islands/RankingHeader.tsx";
import * as $$17 from "./islands/Sidebar.tsx";
import * as $$18 from "./islands/SliderJS.tsx";
import * as $_app from "./routes/_app.tsx";
import * as $admin_catchall_ from "./routes/admin/[...catchall].tsx";
import * as $api_calc from "./routes/api/calc.tsx";
import * as $api_case from "./routes/api/case.tsx";
import * as $api_leads from "./routes/api/leads.tsx";
import * as $api_ranking from "./routes/api/ranking.ts";
import * as $api_webinar from "./routes/api/webinar.tsx";
import * as $gfm_css from "./routes/gfm.css.ts";
import * as $hackathon4 from "./routes/hackathon4.ts";
import * as $index from "./routes/index.tsx";
import * as $proxy_image_index from "./routes/proxy/image/index.tsx";
import * as $CampHeader from "./islands/CampHeader.tsx";
import * as $CampMentor from "./islands/CampMentor.tsx";
import * as $Case from "./islands/Case.tsx";
import * as $ChangeDevice from "./islands/ChangeDevice.tsx";
import * as $ChangeTheme from "./islands/ChangeTheme.tsx";
import * as $Cms from "./islands/Cms.tsx";
import * as $ContactUs from "./islands/ContactUs.tsx";
import * as $FaviconImage from "./islands/FaviconImage.tsx";
import * as $ForwardBackButtons_ForwardBackButtons from "./islands/ForwardBackButtons/ForwardBackButtons.tsx";
import * as $Header from "./islands/Header.tsx";
import * as $HelpFaq from "./islands/HelpFaq.tsx";
import * as $ImpactCalculator from "./islands/ImpactCalculator.tsx";
import * as $LiveProjects from "./islands/LiveProjects.tsx";
import * as $OnThisPage from "./islands/OnThisPage.tsx";
import * as $PopularDocuments from "./islands/PopularDocuments.tsx";
import * as $RankingAnalyze from "./islands/RankingAnalyze.tsx";
import * as $RankingHeader from "./islands/RankingHeader.tsx";
import * as $Sidebar from "./islands/Sidebar.tsx";
import * as $SliderJS from "./islands/SliderJS.tsx";
import { type Manifest } from "$fresh/server.ts";

const manifest = {
routes: {
"./routes/_app.tsx": $0,
"./routes/admin/[...catchall].tsx": $1,
"./routes/api/calc.tsx": $2,
"./routes/api/case.tsx": $3,
"./routes/api/leads.tsx": $4,
"./routes/api/ranking.ts": $5,
"./routes/api/webinar.tsx": $6,
"./routes/gfm.css.ts": $7,
"./routes/hackathon4.ts": $8,
"./routes/index.tsx": $9,
"./routes/proxy/image/index.tsx": $10,
"./routes/_app.tsx": $_app,
"./routes/admin/[...catchall].tsx": $admin_catchall_,
"./routes/api/calc.tsx": $api_calc,
"./routes/api/case.tsx": $api_case,
"./routes/api/leads.tsx": $api_leads,
"./routes/api/ranking.ts": $api_ranking,
"./routes/api/webinar.tsx": $api_webinar,
"./routes/gfm.css.ts": $gfm_css,
"./routes/hackathon4.ts": $hackathon4,
"./routes/index.tsx": $index,
"./routes/proxy/image/index.tsx": $proxy_image_index,
},
islands: {
"./islands/CampHeader.tsx": $$0,
"./islands/CampMentor.tsx": $$1,
"./islands/Case.tsx": $$2,
"./islands/ChangeDevice.tsx": $$3,
"./islands/ChangeTheme.tsx": $$4,
"./islands/Cms.tsx": $$5,
"./islands/ContactUs.tsx": $$6,
"./islands/FaviconImage.tsx": $$7,
"./islands/ForwardBackButtons/ForwardBackButtons.tsx": $$8,
"./islands/Header.tsx": $$9,
"./islands/HelpFaq.tsx": $$10,
"./islands/ImpactCalculator.tsx": $$11,
"./islands/LiveProjects.tsx": $$12,
"./islands/OnThisPage.tsx": $$13,
"./islands/PopularDocuments.tsx": $$14,
"./islands/RankingAnalyze.tsx": $$15,
"./islands/RankingHeader.tsx": $$16,
"./islands/Sidebar.tsx": $$17,
"./islands/SliderJS.tsx": $$18,
"./islands/CampHeader.tsx": $CampHeader,
"./islands/CampMentor.tsx": $CampMentor,
"./islands/Case.tsx": $Case,
"./islands/ChangeDevice.tsx": $ChangeDevice,
"./islands/ChangeTheme.tsx": $ChangeTheme,
"./islands/Cms.tsx": $Cms,
"./islands/ContactUs.tsx": $ContactUs,
"./islands/FaviconImage.tsx": $FaviconImage,
"./islands/ForwardBackButtons/ForwardBackButtons.tsx":
$ForwardBackButtons_ForwardBackButtons,
"./islands/Header.tsx": $Header,
"./islands/HelpFaq.tsx": $HelpFaq,
"./islands/ImpactCalculator.tsx": $ImpactCalculator,
"./islands/LiveProjects.tsx": $LiveProjects,
"./islands/OnThisPage.tsx": $OnThisPage,
"./islands/PopularDocuments.tsx": $PopularDocuments,
"./islands/RankingAnalyze.tsx": $RankingAnalyze,
"./islands/RankingHeader.tsx": $RankingHeader,
"./islands/Sidebar.tsx": $Sidebar,
"./islands/SliderJS.tsx": $SliderJS,
},
baseUrl: import.meta.url,
};
} satisfies Manifest;

export default manifest;

0 comments on commit 7f9fb6a

Please sign in to comment.