@tickboxhq/nuxt 0.0.4 → 0.0.6
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/dist/module.d.mts +14 -0
- package/dist/module.d.ts +14 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +9 -2
- package/dist/runtime/server/ai-txt.d.ts +0 -0
- package/dist/runtime/server/ai-txt.js +9 -0
- package/package.json +4 -3
package/dist/module.d.mts
CHANGED
|
@@ -8,6 +8,20 @@ interface ModuleOptions {
|
|
|
8
8
|
* @default '~/consent.config'
|
|
9
9
|
*/
|
|
10
10
|
configPath?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Register a Nitro route at `/ai.txt` that serves the Spawning.ai-format
|
|
13
|
+
* AI training opt-out file generated from the consent config.
|
|
14
|
+
*
|
|
15
|
+
* EU AI Act Article 53 (in force August 2026) requires general-purpose AI
|
|
16
|
+
* providers to respect machine-readable opt-out signals. The `ai.txt` file
|
|
17
|
+
* is the convention this satisfies.
|
|
18
|
+
*
|
|
19
|
+
* Set to `false` to skip registering the route (e.g. if you want to serve
|
|
20
|
+
* a static file instead, or write your own handler).
|
|
21
|
+
*
|
|
22
|
+
* @default true
|
|
23
|
+
*/
|
|
24
|
+
aiTxt?: boolean;
|
|
11
25
|
}
|
|
12
26
|
declare const tickboxModule: NuxtModule<ModuleOptions>;
|
|
13
27
|
|
package/dist/module.d.ts
CHANGED
|
@@ -8,6 +8,20 @@ interface ModuleOptions {
|
|
|
8
8
|
* @default '~/consent.config'
|
|
9
9
|
*/
|
|
10
10
|
configPath?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Register a Nitro route at `/ai.txt` that serves the Spawning.ai-format
|
|
13
|
+
* AI training opt-out file generated from the consent config.
|
|
14
|
+
*
|
|
15
|
+
* EU AI Act Article 53 (in force August 2026) requires general-purpose AI
|
|
16
|
+
* providers to respect machine-readable opt-out signals. The `ai.txt` file
|
|
17
|
+
* is the convention this satisfies.
|
|
18
|
+
*
|
|
19
|
+
* Set to `false` to skip registering the route (e.g. if you want to serve
|
|
20
|
+
* a static file instead, or write your own handler).
|
|
21
|
+
*
|
|
22
|
+
* @default true
|
|
23
|
+
*/
|
|
24
|
+
aiTxt?: boolean;
|
|
11
25
|
}
|
|
12
26
|
declare const tickboxModule: NuxtModule<ModuleOptions>;
|
|
13
27
|
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver, resolveAlias, addTemplate, addPlugin, addImports, addComponent } from '@nuxt/kit';
|
|
1
|
+
import { defineNuxtModule, createResolver, resolveAlias, addTemplate, addPlugin, addImports, addComponent, addServerHandler } from '@nuxt/kit';
|
|
2
2
|
|
|
3
3
|
const tickboxModule = defineNuxtModule({
|
|
4
4
|
meta: {
|
|
@@ -9,7 +9,8 @@ const tickboxModule = defineNuxtModule({
|
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
11
|
defaults: {
|
|
12
|
-
configPath: "~/consent.config"
|
|
12
|
+
configPath: "~/consent.config",
|
|
13
|
+
aiTxt: true
|
|
13
14
|
},
|
|
14
15
|
setup(options, nuxt) {
|
|
15
16
|
const resolver = createResolver(import.meta.url);
|
|
@@ -39,6 +40,12 @@ const tickboxModule = defineNuxtModule({
|
|
|
39
40
|
filePath: "@tickboxhq/vue",
|
|
40
41
|
export: "ConsentBanner"
|
|
41
42
|
});
|
|
43
|
+
if (options.aiTxt !== false) {
|
|
44
|
+
addServerHandler({
|
|
45
|
+
route: "/ai.txt",
|
|
46
|
+
handler: resolver.resolve("./runtime/server/ai-txt")
|
|
47
|
+
});
|
|
48
|
+
}
|
|
42
49
|
}
|
|
43
50
|
});
|
|
44
51
|
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { generateAiTxt } from "@tickboxhq/core";
|
|
2
|
+
import { defineEventHandler, setHeader } from "h3";
|
|
3
|
+
import userConfig from "#build/tickbox-config";
|
|
4
|
+
export default defineEventHandler((event) => {
|
|
5
|
+
const config = userConfig?.default ?? userConfig;
|
|
6
|
+
setHeader(event, "Content-Type", "text/plain; charset=utf-8");
|
|
7
|
+
setHeader(event, "Cache-Control", "public, max-age=3600, must-revalidate");
|
|
8
|
+
return generateAiTxt(config);
|
|
9
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tickboxhq/nuxt",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Nuxt 3/4 module for Tickbox consent management",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://tickbox.dev",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@nuxt/kit": "^3.13.0",
|
|
32
|
-
"@tickboxhq/vue": "0.0.
|
|
33
|
-
"@tickboxhq/core": "0.0.
|
|
32
|
+
"@tickboxhq/vue": "0.0.6",
|
|
33
|
+
"@tickboxhq/core": "0.0.6"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"nuxt": "^3.0.0 || ^4.0.0"
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@nuxt/module-builder": "^0.8.4",
|
|
40
40
|
"@nuxt/schema": "^3.13.0",
|
|
41
|
+
"h3": "^1.13.0",
|
|
41
42
|
"typescript": "^5.7.2"
|
|
42
43
|
},
|
|
43
44
|
"scripts": {
|