@nuxtjs/turnstile
Advanced tools
Comparing version 0.7.1 to 0.8.0
{ | ||
"configKey": "turnstile", | ||
"name": "@nuxtjs/turnstile", | ||
"version": "0.7.1" | ||
"version": "0.8.0" | ||
} |
@@ -5,3 +5,3 @@ export interface TurnstileRenderOptions { | ||
*/ | ||
sitekey?: string; | ||
'sitekey'?: string; | ||
/** | ||
@@ -12,3 +12,3 @@ * The widget theme. This can be forced to light or dark by setting the theme accordingly. | ||
*/ | ||
theme?: 'dark' | 'light' | 'auto'; | ||
'theme'?: 'dark' | 'light' | 'auto'; | ||
/** | ||
@@ -18,11 +18,11 @@ * The tabindex of Turnstile’s iframe for accessibility purposes. | ||
*/ | ||
tabindex?: number; | ||
'tabindex'?: number; | ||
/** | ||
* A customer value that can be used to differentiate widgets under the same sitekey in analytics and which is returned upon validation. | ||
*/ | ||
action?: string; | ||
'action'?: string; | ||
/** | ||
* A customer payload that can be used to attach customer data to the challenge throughout its issuance and which is returned upon validation. | ||
*/ | ||
cData?: any; | ||
'cData'?: any; | ||
/** | ||
@@ -32,7 +32,7 @@ * A custom language setting. Use 'auto' (default) for the visitor's chosen language, ISO 639-1 two-letter language code (e.g., en), or language and country code (e.g., en-US). | ||
*/ | ||
language?: string; | ||
'language'?: string; | ||
/** | ||
* A JavaScript callback that is invoked upon success of the challenge. The callback is passed a token that can be validated. | ||
*/ | ||
callback?: (token: string) => void; | ||
'callback'?: (token: string) => void; | ||
/** | ||
@@ -46,25 +46,31 @@ * A JavaScript callback that is invoked when a challenge expires. | ||
'error-callback'?: () => void; | ||
/** | ||
* Appearance controls when the widget is visible. It can be always (default), execute, or interaction-only. | ||
* | ||
* @default {`always`} | ||
*/ | ||
'appearance'?: 'always' | 'execute' | 'interaction-only'; | ||
} | ||
export type TurnstileValidationErrorCode = | ||
/** The secret parameter was not passed. */ | ||
/** The secret parameter was not passed. */ | ||
'missing-input-secret' | ||
/** The secret parameter was invalid or did not exist. */ | ||
/** The secret parameter was invalid or did not exist. */ | ||
| 'invalid-input-secret' | ||
/** The response parameter was not passed. */ | ||
/** The response parameter was not passed. */ | ||
| 'missing-input-response' | ||
/** The response parameter is invalid or has expired. */ | ||
/** The response parameter is invalid or has expired. */ | ||
| 'invalid-input-response' | ||
/** The request was rejected because it was malformed. */ | ||
/** The request was rejected because it was malformed. */ | ||
| 'bad-request' | ||
/** The response parameter has already been validated before. */ | ||
/** The response parameter has already been validated before. */ | ||
| 'timeout-or-duplicate' | ||
/** An internal error happened while validating the response. The request can be retried. */ | ||
/** An internal error happened while validating the response. The request can be retried. */ | ||
| 'internal-error'; | ||
export interface TurnstileValidationResponse { | ||
success: boolean; | ||
hostname: string; | ||
'success': boolean; | ||
'hostname': string; | ||
'error-codes': TurnstileValidationErrorCode[]; | ||
challenge_ts?: string; | ||
action?: string; | ||
cdata?: string; | ||
'challenge_ts'?: string; | ||
'action'?: string; | ||
'cdata'?: string; | ||
} |
{ | ||
"name": "@nuxtjs/turnstile", | ||
"version": "0.7.1", | ||
"version": "0.8.0", | ||
"license": "MIT", | ||
@@ -38,7 +38,5 @@ "description": "Cloudflare Turnstile integration for Nuxt", | ||
"docs:build": "nuxi generate docs", | ||
"lint": "pnpm lint:all:eslint && pnpm lint:all:prettier", | ||
"lint:all:eslint": "pnpm lint:eslint --ext .ts,.js,.mjs,.cjs .", | ||
"lint:all:prettier": "pnpm lint:prettier \"{src,test}/**/*.{js,json,ts}\"", | ||
"lint": "pnpm lint:all:eslint", | ||
"lint:all:eslint": "pnpm lint:eslint .", | ||
"lint:eslint": "eslint --fix", | ||
"lint:prettier": "prettier --write --log-level warn", | ||
"prepack": "pnpm build", | ||
@@ -56,13 +54,11 @@ "prepublishOnly": "pnpm lint && pnpm test", | ||
"devDependencies": { | ||
"@nuxt/eslint-config": "0.2.0", | ||
"@nuxt/eslint-config": "0.3.8", | ||
"@nuxt/module-builder": "0.5.4", | ||
"@nuxt/schema": "3.8.2", | ||
"@nuxt/test-utils": "3.8.1", | ||
"@types/node": "20.11.30", | ||
"@types/node": "20.12.7", | ||
"@vitest/coverage-v8": "1.0.1", | ||
"bumpp": "9.4.0", | ||
"conventional-changelog-conventionalcommits": "7.0.2", | ||
"eslint": "8.57.0", | ||
"eslint-config-prettier": "9.1.0", | ||
"eslint-plugin-prettier": "5.1.3", | ||
"eslint": "9.0.0", | ||
"expect-type": "0.17.3", | ||
@@ -73,3 +69,2 @@ "get-port-please": "3.0.2", | ||
"playwright": "1.37.1", | ||
"prettier": "3.2.5", | ||
"typescript": "5.1.6", | ||
@@ -76,0 +71,0 @@ "vitest": "1.0.1", |
@@ -27,6 +27,3 @@ # Nuxt Turnstile | ||
```bash | ||
# Whichever matches your package manager | ||
pnpm add -D @nuxtjs/turnstile | ||
npm install -D @nuxtjs/turnstile | ||
yarn add -D @nuxtjs/turnstile | ||
npx nuxi@latest module add turnstile | ||
``` | ||
@@ -33,0 +30,0 @@ |
Sorry, the diff of this file is not supported yet
18
374
25741
168