@alteran/astro 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alteran/astro",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "Astro integration for running a Cloudflare-hosted Bluesky PDS with Alteran.",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",
@@ -0,0 +1,25 @@
1
+ import type { APIContext } from 'astro';
2
+ import { proxyAppView } from '../../lib/appview';
3
+ import { isAuthorized, unauthorized } from '../../lib/auth';
4
+
5
+ export const prerender = false;
6
+
7
+ // Implements: app.bsky.feed.getActorFeeds
8
+ // Thin proxy to AppView with a safe empty fallback to satisfy clients.
9
+ export async function GET({ locals, request }: APIContext) {
10
+ const { env } = locals.runtime;
11
+ if (!(await isAuthorized(request, env))) return unauthorized();
12
+
13
+ return proxyAppView({
14
+ request,
15
+ env,
16
+ lxm: 'app.bsky.feed.getActorFeeds',
17
+ fallback: async () => {
18
+ // Minimal valid shape per lexicon when upstream unavailable
19
+ return new Response(JSON.stringify({ feeds: [] }), {
20
+ headers: { 'Content-Type': 'application/json' },
21
+ });
22
+ },
23
+ });
24
+ }
25
+
@@ -0,0 +1,25 @@
1
+ import type { APIContext } from 'astro';
2
+ import { proxyAppView } from '../../lib/appview';
3
+ import { isAuthorized, unauthorized } from '../../lib/auth';
4
+
5
+ export const prerender = false;
6
+
7
+ // Implements: app.bsky.feed.getFeedGenerators
8
+ // Thin proxy to AppView with a safe empty fallback to satisfy clients.
9
+ export async function GET({ locals, request }: APIContext) {
10
+ const { env } = locals.runtime;
11
+ if (!(await isAuthorized(request, env))) return unauthorized();
12
+
13
+ return proxyAppView({
14
+ request,
15
+ env,
16
+ lxm: 'app.bsky.feed.getFeedGenerators',
17
+ fallback: async () => {
18
+ // Minimal valid shape per lexicon when upstream unavailable
19
+ return new Response(JSON.stringify({ feeds: [] }), {
20
+ headers: { 'Content-Type': 'application/json' },
21
+ });
22
+ },
23
+ });
24
+ }
25
+