Skip to content

Commit

Permalink
chore: update manifest req.url path
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Oct 20, 2024
1 parent 37338c5 commit 225dfc0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
14 changes: 14 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@
"default": {},
"type": "object",
"properties": {
"globalConfigUpdate": {
"default": {},
"type": "object",
"properties": {
"excludeRepos": {
"default": [],
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["excludeRepos"]
},
"labels": {
"default": {},
"type": "object",
Expand Down
1 change: 0 additions & 1 deletion src/types/plugin-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export const assistivePricingSettingsSchema = T.Object(
excludeRepos: T.Array(T.String()),
})
),

labels: T.Object(
{
time: T.Array(T.String(), { default: [] }),
Expand Down
5 changes: 2 additions & 3 deletions src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ export default {
async fetch(request: Request, env: Env): Promise<Response> {
try {
const url = new URL(request.url);
if (url.pathname === "/manifest" && request.method === "GET") {
if (url.pathname === "/manifest.json" && request.method === "GET") {
return new Response(JSON.stringify(manifest), {
headers: { "content-type": "application/json" },
});
} else if (url.pathname === "/manifest" && request.method === "POST") {
} else if (url.pathname === "/manifest.json" && request.method === "POST") {
const webhookPayload = await request.json();

validateAndDecodeSchemas(env, webhookPayload.settings);
return new Response(JSON.stringify({ message: "Schema is valid" }), { status: 200, headers: { "content-type": "application/json" } });
}
Expand Down

0 comments on commit 225dfc0

Please sign in to comment.