@arcjet/astro 1.9.1 → 1.10.0-rc.0
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/README.md +5 -1
- package/dist/index.d.ts +0 -1
- package/dist/internal.d.ts +6 -8
- package/dist/internal.js +1 -1
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -16,13 +16,17 @@
|
|
|
16
16
|
</a>
|
|
17
17
|
</p>
|
|
18
18
|
|
|
19
|
-
[Arcjet][arcjet] is the runtime security platform that ships
|
|
19
|
+
[Arcjet][arcjet] is the runtime security platform that ships in your AI code. Detect prompt injection, authorize agent tool calls, redact sensitive data, and block bots and abuse. Real-time security building blocks you call inside your app, before an action happens.
|
|
20
20
|
|
|
21
21
|
This is the [Arcjet][arcjet] SDK for [Astro][astro] **request protection** —
|
|
22
22
|
use it to protect HTTP route handlers and API endpoints. If you need to protect
|
|
23
23
|
AI agent tool calls, MCP server handlers, or background jobs (anything without
|
|
24
24
|
an HTTP request), see [`@arcjet/guard`](https://github.com/arcjet/arcjet-js/tree/main/arcjet-guard).
|
|
25
25
|
|
|
26
|
+
## Why Arcjet?
|
|
27
|
+
|
|
28
|
+
Your app's AI features and agents take real actions, calling tools, reading data, hitting APIs. Arcjet runs inside that code and lets you enforce security on each action in real time, then audit what happened
|
|
29
|
+
|
|
26
30
|
## Getting started
|
|
27
31
|
|
|
28
32
|
### Quick setup with an AI agent
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ProxyService, ProxyService as ProxyService$1, cloudflare } from "@arcjet/ip";
|
|
2
2
|
import { BotOptions, DetectPromptInjectionOptions, EmailOptions, FilterOptions, FixedWindowRateLimitOptions, ProtectSignupOptions, SensitiveInfoOptions, ShieldOptions, SlidingWindowRateLimitOptions, TokenBucketRateLimitOptions } from "arcjet";
|
|
3
3
|
import { AstroIntegration } from "astro";
|
|
4
|
-
|
|
5
4
|
//#region src/index.d.ts
|
|
6
5
|
type IntegrationRule<Characteristics extends readonly string[]> = {
|
|
7
6
|
type: "shield";
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import { ProxyService } from "@arcjet/ip";
|
|
2
|
-
import { ArcjetDecision, ArcjetOptions as ArcjetOptions$1, ArcjetRule, CharacteristicProps, ExtraProps, Primitive, Product } from "arcjet";
|
|
2
|
+
import { ArcjetDecision, ArcjetMetadata, ArcjetOptions as ArcjetOptions$1, ArcjetRule, CharacteristicProps, ExtraProps, Primitive, Product } from "arcjet";
|
|
3
3
|
export * from "arcjet";
|
|
4
|
-
|
|
5
4
|
//#region src/internal.d.ts
|
|
6
|
-
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
7
|
-
declare const emptyObjectSymbol: unique symbol;
|
|
5
|
+
type Simplify<T> = { [KeyType in keyof T]: T[KeyType]; } & {};
|
|
8
6
|
type PlainObject = {
|
|
9
7
|
[key: string]: unknown;
|
|
10
8
|
};
|
|
11
9
|
/**
|
|
12
10
|
* Dynamically generate whether zero or one `properties` object must or can be passed.
|
|
13
11
|
*/
|
|
14
|
-
type MaybeProperties<T> = { [P in keyof T]?: T[P] } extends T ? T
|
|
15
|
-
[emptyObjectSymbol]?: never;
|
|
16
|
-
} ? [] : [properties?: T] : [properties: T];
|
|
12
|
+
type MaybeProperties<T> = { [P in keyof T]?: T[P]; } extends T ? [properties?: T] : [properties: T];
|
|
17
13
|
/**
|
|
18
14
|
* Configuration for {@linkcode createRemoteClient}.
|
|
19
15
|
*/
|
|
@@ -85,7 +81,9 @@ interface ArcjetAstro<Props extends PlainObject> {
|
|
|
85
81
|
* Promise that resolves to an {@linkcode ArcjetDecision} indicating
|
|
86
82
|
* Arcjet’s decision about the request.
|
|
87
83
|
*/
|
|
88
|
-
protect(request: Request, ...props: MaybeProperties<Props
|
|
84
|
+
protect(request: Request, ...props: MaybeProperties<Props & {
|
|
85
|
+
metadata?: ArcjetMetadata;
|
|
86
|
+
}>): Promise<ArcjetDecision>;
|
|
89
87
|
/**
|
|
90
88
|
* Augment the client with another rule.
|
|
91
89
|
*
|
package/dist/internal.js
CHANGED
|
@@ -10,7 +10,7 @@ import { ARCJET_BASE_URL, ARCJET_ENV, ARCJET_KEY, ARCJET_LOG_LEVEL, FIREBASE_CON
|
|
|
10
10
|
export * from "arcjet";
|
|
11
11
|
//#region src/internal.ts
|
|
12
12
|
/** SDK version. Updated by the release process. */
|
|
13
|
-
const VERSION = "1.
|
|
13
|
+
const VERSION = "1.10.0-rc.0";
|
|
14
14
|
let warnedForAutomaticBodyRead = false;
|
|
15
15
|
const ipSymbol = Symbol.for("arcjet.ip");
|
|
16
16
|
const env = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcjet/astro",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0-rc.0",
|
|
4
4
|
"description": "Arcjet runtime security SDK for Astro — bot protection, rate limiting, prompt injection detection, PII blocking, and WAF",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -56,25 +56,25 @@
|
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsdown",
|
|
59
|
-
"typecheck": "
|
|
59
|
+
"typecheck": "tsc --noEmit",
|
|
60
60
|
"test-api": "node --test -- test/*.test.ts",
|
|
61
61
|
"test-coverage": "node --experimental-test-coverage --test -- test/*.test.ts",
|
|
62
62
|
"test": "npm run build && npm run test-coverage"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@arcjet/body": "1.
|
|
66
|
-
"@arcjet/env": "1.
|
|
67
|
-
"@arcjet/headers": "1.
|
|
68
|
-
"@arcjet/ip": "1.
|
|
69
|
-
"@arcjet/logger": "1.
|
|
70
|
-
"@arcjet/protocol": "1.
|
|
71
|
-
"@arcjet/transport": "1.
|
|
72
|
-
"arcjet": "1.
|
|
65
|
+
"@arcjet/body": "1.10.0-rc.0",
|
|
66
|
+
"@arcjet/env": "1.10.0-rc.0",
|
|
67
|
+
"@arcjet/headers": "1.10.0-rc.0",
|
|
68
|
+
"@arcjet/ip": "1.10.0-rc.0",
|
|
69
|
+
"@arcjet/logger": "1.10.0-rc.0",
|
|
70
|
+
"@arcjet/protocol": "1.10.0-rc.0",
|
|
71
|
+
"@arcjet/transport": "1.10.0-rc.0",
|
|
72
|
+
"arcjet": "1.10.0-rc.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"astro": "7.0
|
|
76
|
-
"tsdown": "0.22.
|
|
77
|
-
"typescript": "
|
|
75
|
+
"astro": "7.1.0",
|
|
76
|
+
"tsdown": "0.22.7",
|
|
77
|
+
"typescript": "7.0.2"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
80
|
"astro": "^5.9.3 || ^6.0.0 || ^7.0.0"
|