Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions __checks__/api.check.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ApiCheck, AssertionBuilder } from 'checkly/constructs'

// API checks send an HTTP request to a URL endpoint and validate the response. Read more at:
// https://www.checklyhq.com/docs/api-checks/

new ApiCheck('books-api-check-1', {
name: 'Books API',
alertChannels: [],
degradedResponseTime: 10000, // milliseconds
maxResponseTime: 20000,
request: {
url: 'https://danube-web.shop/api/books',
method: 'GET',
followRedirects: true,
skipSSL: false,
assertions: [
AssertionBuilder.statusCode().equals(200),
AssertionBuilder.jsonBody('$[0].id').isNotNull(),
],
},
runParallel: false,
})
16 changes: 16 additions & 0 deletions __checks__/heartbeat.check.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { HeartbeatMonitor } from 'checkly/constructs'

// Heartbeat monitors allow you to monitor jobs or recurring tasks.
// After you deploy this check, you'll get a ping URL for your check
// from the Checkly CLI. This check will generate alerts if it's not
// getting pings at the generated URL, so it's deactivated for now.
// Further documentation: https://www.checklyhq.com/docs/heartbeat-monitors/

new HeartbeatMonitor('heartbeat-1', {
name: 'Send weekly newsletter job',
activated: false,
period: 1,
periodUnit: 'hours',
grace: 30,
graceUnit: 'minutes',
})
12 changes: 12 additions & 0 deletions __checks__/homepage.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { test, expect } from '@playwright/test'

// This test is being used as a Browser check
// See browserCheck.testMatch in your checkly.config.ts to configure

test('Visit webshop homepage', async ({ page }) => {
// The baseURL for Browser checks can be set in the playwrightConfig of your checkly.config.ts
const response = await page.goto('/')
expect(response?.status()).toBeLessThan(400)
await expect(page).toHaveTitle(/Danube WebShop/)
await page.screenshot({ path: 'homepage.jpg' })
})
15 changes: 15 additions & 0 deletions __checks__/url.check.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { UrlAssertionBuilder, UrlMonitor } from 'checkly/constructs'

new UrlMonitor('books-url-check', {
name: 'Books URL',
activated: true,
maxResponseTime: 10000,
degradedResponseTime: 5000,
request: {
url: 'https://www.danube-web.shop/',
followRedirects: true,
assertions: [
UrlAssertionBuilder.statusCode().equals(200),
]
}
})
19 changes: 4 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"bugs": {
"url": "https://github.com/zayed-cybershield/protection/issues"
},

"keywords": [
"cybersecurity",
"cryptography",
Expand All @@ -35,18 +34,15 @@
"حماية",
"الإمارات"
],

"engines": {
"node": ">=18.0.0",
"npm": ">=9.0.0"
},

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable files

"dependencies": {
"@noble/secp256k1": "^3.0.0",
"express": "^4.19.0",
"lodash": "^4.17.21"
},

"devDependencies": {
"ajv": "^8.18.0",
"ajv-keywords": "^5.1.0",
Expand All @@ -58,38 +54,32 @@
"webpack": "^6.0.0",
"webpack-cli": "^5.1.4",
"html-webpack-plugin": "^5.6.6",
"terser-webpack-plugin": "^5.3.16"
"terser-webpack-plugin": "^5.3.16",
"checkly": "latest",
"jiti": "^2"
},

"peerDependencies": {
"react": ">=18.0.0",
"vue": ">=3.0.0"
},

"scripts": {
"test": "jest",
"test:coverage": "nyc npm test",
"lint": "eslint .",
"lint:fix": "eslint . --fix",

"security:check": "npm audit --omit=dev",
"security:fix": "npm audit fix",
"security:update": "npm update && npm audit",
"security:full": "npm audit && npm outdated",

"prebuild": "npm run security:check",
"build": "webpack --mode production",
"dev": "webpack --mode development --watch",

"start": "node index.js",

"clean": "rm -rf node_modules package-lock.json",
"reinstall": "npm run clean && npm install",

"prepare": "npm run build",
"prepublishOnly": "npm test && npm run lint"
},

"files": [
"dist/",
"src/",
Expand All @@ -100,6 +90,5 @@
"SECURITY.md",
"CHANGELOG.md"
],

"types": "index.d.ts"
}
}
Loading