The best way to control Claude Code, Codex and more from any computer or phone

main
ts 38 lines 1.63 KB
Raw
1 import * as Cloudflare from "@alchemy.run/cloudflare";
2 import { expect } from "@alchemy.run/test";
3 import * as Test from "@alchemy.run/test/Alchemy";
4 import * as Provider from "alchemy/Provider";
5 import * as Effect from "effect/Effect";
6 import { MinimumLogLevel } from "effect/References";
7
8 const { test } = Test.make({ providers: Cloudflare.providers() });
9
10 const logLevel = Effect.provideService(MinimumLogLevel, process.env.DEBUG ? "Debug" : "Info");
11
12 // IndicatorFeedPermission is non-listable (pattern (e)): a grant is keyed by
13 // {feedId, accountTag} from the granting account's side, and Cloudflare
14 // exposes no provider-side API to enumerate a feed's grantees. The only
15 // related collection op (`listIndicatorFeedPermissions`, the
16 // `/permissions/view` endpoint) returns feeds the *calling* account can
17 // consume — feed metadata with no `accountTag` — which cannot reconstruct the
18 // `read` Attributes shape. So `list()` returns `[]` without any cloud call,
19 // which means this assertion runs cleanly even on the unentitled testing
20 // account (Intel feeds are a paid Cloudforce One add-on:
21 // `IndicatorFeedsNotEntitled`, HTTP 403, would gate any real feed lifecycle).
22 test.provider(
23 "list returns [] for the non-listable IndicatorFeedPermission",
24 (stack) =>
25 Effect.gen(function* () {
26 yield* stack.destroy();
27
28 const provider = yield* Provider.findProvider(Cloudflare.Intel.IndicatorFeedPermission);
29 const all = yield* provider.list();
30 expect(all).toEqual([]);
31
32 yield* stack.destroy();
33 }).pipe(logLevel),
34 {
35 tags: ["provider:cloudflare", "provider:cloudflare:intel", "live"],
36 timeout: 120_000,
37 },
38 );