@arcjet/bun 1.0.0 → 1.1.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 CHANGED
@@ -29,10 +29,21 @@ This is the [Arcjet][arcjet] SDK for [Bun.sh][bun-sh].
29
29
 
30
30
  Visit the [quick start guide][quick-start] to get started.
31
31
 
32
- ## Example app
32
+ ## Example
33
33
 
34
- Try an Arcjet protected app live at [https://example.arcjet.com][example-url]
35
- ([source code][example-source]).
34
+ Try an Arcjet protected Next.js app live at
35
+ [`example.arcjet.com`][example-next-url]
36
+ ([source code][example-next-source]).
37
+
38
+ <!--
39
+
40
+ TODO: Bun example.
41
+
42
+ See [`arcjet/example-bun`][example-astro-source] for a Bun example.
43
+
44
+ [example-bun-source]: https://github.com/arcjet/example-bun
45
+
46
+ -->
36
47
 
37
48
  ## What is this?
38
49
 
@@ -112,7 +123,7 @@ bun test
112
123
  [arcjet-reference-bun]: https://docs.arcjet.com/reference/bun
113
124
  [arcjet]: https://arcjet.com
114
125
  [bun-sh]: https://bun.sh/
115
- [example-url]: https://example.arcjet.com
126
+ [example-next-source]: https://github.com/arcjet/example-nextjs
127
+ [example-next-url]: https://example.arcjet.com
116
128
  [quick-start]: https://docs.arcjet.com/get-started/bun
117
- [example-source]: https://github.com/arcjet/arcjet-js-example
118
129
  [apache-license]: http://www.apache.org/licenses/LICENSE-2.0
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ArcjetDecision, ArcjetOptions as CoreOptions, Primitive, Product, ExtraProps, CharacteristicProps } from "arcjet";
1
+ import type { ArcjetDecision, ArcjetOptions as CoreOptions, ArcjetRule, Primitive, Product, ExtraProps, CharacteristicProps } from "arcjet";
2
2
  import type { Server } from "bun";
3
3
  export * from "arcjet";
4
4
  type Simplify<T> = {
@@ -104,7 +104,7 @@ export interface ArcjetBun<Props extends PlainObject> {
104
104
  * @returns
105
105
  * Arcjet instance augmented with the given rule.
106
106
  */
107
- withRule<ChildProperties extends PlainObject>(rule: Primitive<ChildProperties> | Product<ChildProperties>): ArcjetBun<Props & ChildProperties>;
107
+ withRule<Rule extends ArcjetRule>(rule: Array<Rule>): ArcjetBun<Props & (Rule extends ArcjetRule<infer P> ? P : {})>;
108
108
  /**
109
109
  * Wrap the Bun `fetch` handler to provide additional details when calling
110
110
  * the `protect()` method.
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as core from 'arcjet';
2
2
  import core__default from 'arcjet';
3
3
  export * from 'arcjet';
4
- import findIp, { parseProxy } from '@arcjet/ip';
4
+ import { parseProxy, findIp } from '@arcjet/ip';
5
5
  import { ArcjetHeaders } from '@arcjet/headers';
6
6
  import { env } from 'bun';
7
7
  import { readBodyWeb } from '@arcjet/body';
@@ -26,7 +26,7 @@ function createRemoteClient(options) {
26
26
  // Transport is the HTTP client that the client uses to make requests.
27
27
  const transport = createTransport(url);
28
28
  const sdkStack = "BUN";
29
- const sdkVersion = "1.0.0";
29
+ const sdkVersion = "1.1.0";
30
30
  return createClient({
31
31
  transport,
32
32
  baseUrl: url,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcjet/bun",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Arcjet SDK for Bun",
5
5
  "keywords": [
6
6
  "analyze",
@@ -41,27 +41,26 @@
41
41
  "scripts": {
42
42
  "build": "rollup --config rollup.config.js",
43
43
  "lint": "eslint .",
44
- "prepublishOnly": "npm run build",
45
44
  "test": "npm run build && npm run lint"
46
45
  },
47
46
  "dependencies": {
48
- "@arcjet/body": "1.0.0",
49
- "@arcjet/env": "1.0.0",
50
- "@arcjet/headers": "1.0.0",
51
- "@arcjet/ip": "1.0.0",
52
- "@arcjet/logger": "1.0.0",
53
- "@arcjet/protocol": "1.0.0",
54
- "@arcjet/transport": "1.0.0",
55
- "arcjet": "1.0.0"
47
+ "@arcjet/body": "1.1.0",
48
+ "@arcjet/env": "1.1.0",
49
+ "@arcjet/headers": "1.1.0",
50
+ "@arcjet/ip": "1.1.0",
51
+ "@arcjet/logger": "1.1.0",
52
+ "@arcjet/protocol": "1.1.0",
53
+ "@arcjet/transport": "1.1.0",
54
+ "arcjet": "1.1.0"
56
55
  },
57
56
  "devDependencies": {
58
- "@arcjet/eslint-config": "1.0.0",
59
- "@arcjet/rollup-config": "1.0.0",
60
- "@rollup/wasm-node": "4.55.1",
61
- "bun-types": "1.3.6",
57
+ "@arcjet/eslint-config": "1.1.0",
58
+ "@arcjet/rollup-config": "1.1.0",
59
+ "@rollup/wasm-node": "4.57.0",
60
+ "bun-types": "1.3.7",
62
61
  "eslint": "9.39.2",
63
62
  "typescript": "5.9.3",
64
- "undici-types": "7.18.2"
63
+ "undici-types": "7.19.2"
65
64
  },
66
65
  "publishConfig": {
67
66
  "access": "public",