vendure-plugin-capjs 1.0.0 → 1.0.2
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 +25 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -31,6 +31,31 @@ export const config: VendureConfig = {
|
|
|
31
31
|
};
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
+
## Database Migration
|
|
35
|
+
|
|
36
|
+
This plugin adds new entities (`CapjsChallenges` and `CapjsToken`) to your database. After adding the plugin to your config, you need to generate and run a database migration:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Generate the migration
|
|
40
|
+
npm run migration:generate capjs-plugin
|
|
41
|
+
|
|
42
|
+
# Run the migration
|
|
43
|
+
npm run migration:run
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Make sure your Vendure config has migrations enabled:
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
export const config: VendureConfig = {
|
|
50
|
+
// ... other config
|
|
51
|
+
dbConnectionOptions: {
|
|
52
|
+
// ... other options
|
|
53
|
+
migrations: [/* your migrations */],
|
|
54
|
+
migrationsRun: false, // Set to true to run migrations automatically on startup
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
```
|
|
58
|
+
|
|
34
59
|
## Usage
|
|
35
60
|
|
|
36
61
|
### REST Endpoints
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vendure-plugin-capjs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A Vendure plugin that integrates Cap.js for privacy-focused, lightweight CAPTCHA protection. Provides challenge/redeem endpoints and a guard decorator for protecting GraphQL mutations.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
"lint": "eslint .",
|
|
19
19
|
"test": "vitest --run"
|
|
20
20
|
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@cap.js/server": "^4.0.5"
|
|
23
|
+
},
|
|
21
24
|
"peerDependencies": {
|
|
22
|
-
"@cap.js/server": "^4.0.5",
|
|
23
|
-
"@google-cloud/pubsub": ">=4.0.0",
|
|
24
25
|
"@vendure/common": ">=3.0.0",
|
|
25
26
|
"@vendure/core": ">=3.0.0"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
|
-
"@google-cloud/pubsub": "^4.11.0",
|
|
29
29
|
"@nestjs/testing": "^11.1.13",
|
|
30
30
|
"@types/supertest": "^6.0.3",
|
|
31
31
|
"@vendure/common": "^3.5.3",
|