3 Commits

Author SHA1 Message Date
naomi d46fba2bfc 0.0.1
Node.js CI / Lint and Test (pull_request) Successful in 29s
2025-02-10 20:41:43 -08:00
naomi bd1593d87d feat: include source maps in build 2025-02-10 20:41:28 -08:00
naomi a72ceaccd1 feat: initial prototype 2025-02-10 20:30:22 -08:00
7 changed files with 74 additions and 326 deletions
+5 -14
View File
@@ -8,31 +8,22 @@ on:
- main
jobs:
ci:
name: CI
runs-on: ubuntu-latest
lint:
name: Lint and Test
steps:
- name: Checkout Source Files
uses: actions/checkout@v4
- name: Use Node.js v24
- name: Use Node.js v22
uses: actions/setup-node@v4
with:
node-version: 24
node-version: 22
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 10
- name: Ensure Dependencies are Pinned
uses: naomi-lgbt/dependency-pin-check@main
with:
language: javascript
dev-dependencies: true
peer-dependencies: true
optional-dependencies: true
version: 9
- name: Install Dependencies
run: pnpm install
-177
View File
@@ -1,177 +0,0 @@
name: Security Scan and Upload
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:
jobs:
security-audit:
name: Security & DefectDojo Upload
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@v4
# --- AUTO-SETUP PROJECT ---
- name: Ensure DefectDojo Product Exists
env:
DD_URL: ${{ secrets.DD_URL }}
DD_TOKEN: ${{ secrets.DD_TOKEN }}
PRODUCT_NAME: ${{ github.repository }}
PRODUCT_TYPE_ID: 1
run: |
sudo apt-get install jq -y > /dev/null
echo "Checking connection to $DD_URL..."
# Check if product exists - capture HTTP code to debug connection issues
RESPONSE=$(curl --write-out "%{http_code}" --silent --output /tmp/response.json \
-H "Authorization: Token $DD_TOKEN" \
"$DD_URL/api/v2/products/?name=$PRODUCT_NAME")
# If response is not 200, print error
if [ "$RESPONSE" != "200" ]; then
echo "::error::Failed to query DefectDojo. HTTP Code: $RESPONSE"
cat /tmp/response.json
exit 1
fi
COUNT=$(cat /tmp/response.json | jq -r '.count')
if [ "$COUNT" = "0" ]; then
echo "Creating product '$PRODUCT_NAME'..."
curl -s -X POST "$DD_URL/api/v2/products/" \
-H "Authorization: Token $DD_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "name": "'"$PRODUCT_NAME"'", "description": "Auto-created by Gitea Actions", "prod_type": '$PRODUCT_TYPE_ID' }'
else
echo "Product '$PRODUCT_NAME' already exists."
fi
# --- 1. TRIVY (Dependencies & Misconfig) ---
- name: Install Trivy
run: |
sudo apt-get install wget apt-transport-https gnupg lsb-release -y
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
echo "deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | sudo tee -a /etc/apt/sources.list.d/trivy.list
sudo apt-get update && sudo apt-get install trivy -y
- name: Run Trivy (FS Scan)
run: |
trivy fs . --scanners vuln,misconfig --format json --output trivy-results.json --exit-code 0
- name: Upload Trivy to DefectDojo
env:
DD_URL: ${{ secrets.DD_URL }}
DD_TOKEN: ${{ secrets.DD_TOKEN }}
run: |
echo "Uploading Trivy results..."
# Generate today's date in YYYY-MM-DD format
TODAY=$(date +%Y-%m-%d)
HTTP_CODE=$(curl --write-out "%{http_code}" --output response.txt --silent -X POST "$DD_URL/api/v2/import-scan/" \
-H "Authorization: Token $DD_TOKEN" \
-F "active=true" \
-F "verified=true" \
-F "scan_type=Trivy Scan" \
-F "engagement_name=CI/CD Pipeline" \
-F "product_name=${{ github.repository }}" \
-F "scan_date=$TODAY" \
-F "auto_create_context=true" \
-F "file=@trivy-results.json")
if [[ "$HTTP_CODE" != "200" && "$HTTP_CODE" != "201" ]]; then
echo "::error::Upload Failed with HTTP $HTTP_CODE"
echo "--- SERVER RESPONSE ---"
cat response.txt
echo "-----------------------"
exit 1
else
echo "Upload Success!"
fi
# --- 2. GITLEAKS (Secrets) ---
- name: Install Gitleaks
run: |
wget -qO gitleaks.tar.gz https://github.com/gitleaks/gitleaks/releases/download/v8.18.0/gitleaks_8.18.0_linux_x64.tar.gz
tar -xzf gitleaks.tar.gz
sudo mv gitleaks /usr/local/bin/ && chmod +x /usr/local/bin/gitleaks
- name: Run Gitleaks
run: gitleaks detect --source . -v --report-path gitleaks-results.json --report-format json --no-git || true
- name: Upload Gitleaks to DefectDojo
env:
DD_URL: ${{ secrets.DD_URL }}
DD_TOKEN: ${{ secrets.DD_TOKEN }}
run: |
echo "Uploading Gitleaks results..."
TODAY=$(date +%Y-%m-%d)
HTTP_CODE=$(curl --write-out "%{http_code}" --output response.txt --silent -X POST "$DD_URL/api/v2/import-scan/" \
-H "Authorization: Token $DD_TOKEN" \
-F "active=true" \
-F "verified=true" \
-F "scan_type=Gitleaks Scan" \
-F "engagement_name=CI/CD Pipeline" \
-F "product_name=${{ github.repository }}" \
-F "scan_date=$TODAY" \
-F "auto_create_context=true" \
-F "file=@gitleaks-results.json")
if [[ "$HTTP_CODE" != "200" && "$HTTP_CODE" != "201" ]]; then
echo "::error::Upload Failed with HTTP $HTTP_CODE"
echo "--- SERVER RESPONSE ---"
cat response.txt
echo "-----------------------"
exit 1
else
echo "Upload Success!"
fi
# --- 3. SEMGREP (SAST) ---
- name: Install Semgrep (via pipx)
run: |
sudo apt-get install pipx -y
pipx install semgrep
# Add pipx binary path to GITHUB_PATH so next steps can see 'semgrep'
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Run Semgrep
run: semgrep scan --config=p/security-audit --config=p/owasp-top-ten --json --output semgrep-results.json . || true
- name: Upload Semgrep to DefectDojo
env:
DD_URL: ${{ secrets.DD_URL }}
DD_TOKEN: ${{ secrets.DD_TOKEN }}
run: |
echo "Uploading Semgrep results..."
TODAY=$(date +%Y-%m-%d)
HTTP_CODE=$(curl --write-out "%{http_code}" --output response.txt --silent -X POST "$DD_URL/api/v2/import-scan/" \
-H "Authorization: Token $DD_TOKEN" \
-F "active=true" \
-F "verified=true" \
-F "scan_type=Semgrep JSON Report" \
-F "engagement_name=CI/CD Pipeline" \
-F "product_name=${{ github.repository }}" \
-F "scan_date=$TODAY" \
-F "auto_create_context=true" \
-F "file=@semgrep-results.json")
if [[ "$HTTP_CODE" != "200" && "$HTTP_CODE" != "201" ]]; then
echo "::error::Upload Failed with HTTP $HTTP_CODE"
echo "--- SERVER RESPONSE ---"
cat response.txt
echo "-----------------------"
exit 1
else
echo "Upload Success!"
fi
-25
View File
@@ -1,25 +0,0 @@
# Package Manager Configuration
# Force pnpm usage - breaks npm/yarn intentionally
node-linker=pnpm
# Security: Disable all lifecycle scripts
ignore-scripts=true
enable-pre-post-scripts=false
# Security: Require packages to be 10+ days old before installation
minimum-release-age=14400
# Security: Verify package integrity hashes
verify-store-integrity=true
# Security: Enforce strict trust policies
trust-policy=strict
# Security: Strict peer dependency resolution
strict-peer-dependencies=true
# Performance: Use symlinks for node_modules
symlink=true
# Lockfile: Ensure lockfile is not modified during install
frozen-lockfile=false
+1 -1
View File
@@ -8,7 +8,7 @@ This page is currently deployed. [View the live website.](https://www.npmjs.com/
## Feedback and Bugs
If you have feedback or a bug report, please [log a ticket on our forum](https://support.nhcarrigan.com).
If you have feedback or a bug report, please feel free to open a GitHub issue!
## Contributing
+2 -3
View File
@@ -1,11 +1,10 @@
{
"name": "@nhcarrigan/logger",
"version": "1.1.1",
"version": "0.0.1",
"description": "Our custom logging package, which pipes logs to our alerts server.",
"type": "module",
"main": "prod/index.js",
"scripts": {
"prepublish": "pnpm lint && pnpm build",
"lint": "eslint src --max-warnings 0",
"build": "rm -rf prod && tsc",
"test": "echo \"Error: no test specified\" && exit 0"
@@ -26,6 +25,6 @@
"@nhcarrigan/typescript-config": "4.0.0",
"@types/node": "22.13.1",
"eslint": "9.20.0",
"typescript": "5.9.3"
"typescript": "5.7.3"
}
}
+66 -76
View File
@@ -10,10 +10,10 @@ importers:
devDependencies:
'@nhcarrigan/eslint-config':
specifier: 5.1.0
version: 5.1.0(@typescript-eslint/utils@8.24.0(eslint@9.20.0)(typescript@5.9.3))(eslint@9.20.0)(playwright@1.50.1)(react@19.0.0)(typescript@5.9.3)(vitest@3.0.5(@types/node@22.13.1))
version: 5.1.0(@typescript-eslint/utils@8.24.0(eslint@9.20.0)(typescript@5.7.3))(eslint@9.20.0)(playwright@1.50.1)(react@19.0.0)(typescript@5.7.3)(vitest@3.0.5(@types/node@22.13.1))
'@nhcarrigan/typescript-config':
specifier: 4.0.0
version: 4.0.0(typescript@5.9.3)
version: 4.0.0(typescript@5.7.3)
'@types/node':
specifier: 22.13.1
version: 22.13.1
@@ -21,8 +21,8 @@ importers:
specifier: 9.20.0
version: 9.20.0
typescript:
specifier: 5.9.3
version: 5.9.3
specifier: 5.7.3
version: 5.7.3
packages:
@@ -334,61 +334,51 @@ packages:
resolution: {integrity: sha512-88fSzjC5xeH9S2Vg3rPgXJULkHcLYMkh8faix8DX4h4TIAL65ekwuQMA/g2CXq8W+NJC43V6fUpYZNjaX3+IIg==}
cpu: [arm]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-arm-musleabihf@4.34.6':
resolution: {integrity: sha512-wM4ztnutBqYFyvNeR7Av+reWI/enK9tDOTKNF+6Kk2Q96k9bwhDDOlnCUNRPvromlVXo04riSliMBs/Z7RteEg==}
cpu: [arm]
os: [linux]
libc: [musl]
'@rollup/rollup-linux-arm64-gnu@4.34.6':
resolution: {integrity: sha512-9RyprECbRa9zEjXLtvvshhw4CMrRa3K+0wcp3KME0zmBe1ILmvcVHnypZ/aIDXpRyfhSYSuN4EPdCCj5Du8FIA==}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-arm64-musl@4.34.6':
resolution: {integrity: sha512-qTmklhCTyaJSB05S+iSovfo++EwnIEZxHkzv5dep4qoszUMX5Ca4WM4zAVUMbfdviLgCSQOu5oU8YoGk1s6M9Q==}
cpu: [arm64]
os: [linux]
libc: [musl]
'@rollup/rollup-linux-loongarch64-gnu@4.34.6':
resolution: {integrity: sha512-4Qmkaps9yqmpjY5pvpkfOerYgKNUGzQpFxV6rnS7c/JfYbDSU0y6WpbbredB5cCpLFGJEqYX40WUmxMkwhWCjw==}
cpu: [loong64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-powerpc64le-gnu@4.34.6':
resolution: {integrity: sha512-Zsrtux3PuaxuBTX/zHdLaFmcofWGzaWW1scwLU3ZbW/X+hSsFbz9wDIp6XvnT7pzYRl9MezWqEqKy7ssmDEnuQ==}
cpu: [ppc64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-riscv64-gnu@4.34.6':
resolution: {integrity: sha512-aK+Zp+CRM55iPrlyKiU3/zyhgzWBxLVrw2mwiQSYJRobCURb781+XstzvA8Gkjg/hbdQFuDw44aUOxVQFycrAg==}
cpu: [riscv64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-s390x-gnu@4.34.6':
resolution: {integrity: sha512-WoKLVrY9ogmaYPXwTH326+ErlCIgMmsoRSx6bO+l68YgJnlOXhygDYSZe/qbUJCSiCiZAQ+tKm88NcWuUXqOzw==}
cpu: [s390x]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-x64-gnu@4.34.6':
resolution: {integrity: sha512-Sht4aFvmA4ToHd2vFzwMFaQCiYm2lDFho5rPcvPBT5pCdC+GwHG6CMch4GQfmWTQ1SwRKS0dhDYb54khSrjDWw==}
cpu: [x64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-x64-musl@4.34.6':
resolution: {integrity: sha512-zmmpOQh8vXc2QITsnCiODCDGXFC8LMi64+/oPpPx5qz3pqv0s6x46ps4xoycfUiVZps5PFn1gksZzo4RGTKT+A==}
cpu: [x64]
os: [linux]
libc: [musl]
'@rollup/rollup-win32-arm64-msvc@4.34.6':
resolution: {integrity: sha512-3/q1qUsO/tLqGBaD4uXsB6coVGB3usxw3qyeVb59aArCgedSF66MPdgRStUd7vbZOsko/CgVaY5fo2vkvPLWiA==}
@@ -1770,8 +1760,8 @@ packages:
resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==}
engines: {node: '>= 0.4'}
typescript@5.9.3:
resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==}
typescript@5.7.3:
resolution: {integrity: sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==}
engines: {node: '>=14.17'}
hasBin: true
@@ -2065,19 +2055,19 @@ snapshots:
'@jridgewell/sourcemap-codec@1.5.0': {}
'@nhcarrigan/eslint-config@5.1.0(@typescript-eslint/utils@8.24.0(eslint@9.20.0)(typescript@5.9.3))(eslint@9.20.0)(playwright@1.50.1)(react@19.0.0)(typescript@5.9.3)(vitest@3.0.5(@types/node@22.13.1))':
'@nhcarrigan/eslint-config@5.1.0(@typescript-eslint/utils@8.24.0(eslint@9.20.0)(typescript@5.7.3))(eslint@9.20.0)(playwright@1.50.1)(react@19.0.0)(typescript@5.7.3)(vitest@3.0.5(@types/node@22.13.1))':
dependencies:
'@eslint-community/eslint-plugin-eslint-comments': 4.4.1(eslint@9.20.0)
'@eslint/compat': 1.2.4(eslint@9.20.0)
'@eslint/eslintrc': 3.2.0
'@eslint/js': 9.17.0
'@stylistic/eslint-plugin': 2.12.1(eslint@9.20.0)(typescript@5.9.3)
'@typescript-eslint/eslint-plugin': 8.19.0(@typescript-eslint/parser@8.19.0(eslint@9.20.0)(typescript@5.9.3))(eslint@9.20.0)(typescript@5.9.3)
'@typescript-eslint/parser': 8.19.0(eslint@9.20.0)(typescript@5.9.3)
'@vitest/eslint-plugin': 1.1.24(@typescript-eslint/utils@8.24.0(eslint@9.20.0)(typescript@5.9.3))(eslint@9.20.0)(typescript@5.9.3)(vitest@3.0.5(@types/node@22.13.1))
'@stylistic/eslint-plugin': 2.12.1(eslint@9.20.0)(typescript@5.7.3)
'@typescript-eslint/eslint-plugin': 8.19.0(@typescript-eslint/parser@8.19.0(eslint@9.20.0)(typescript@5.7.3))(eslint@9.20.0)(typescript@5.7.3)
'@typescript-eslint/parser': 8.19.0(eslint@9.20.0)(typescript@5.7.3)
'@vitest/eslint-plugin': 1.1.24(@typescript-eslint/utils@8.24.0(eslint@9.20.0)(typescript@5.7.3))(eslint@9.20.0)(typescript@5.7.3)(vitest@3.0.5(@types/node@22.13.1))
eslint: 9.20.0
eslint-plugin-deprecation: 3.0.0(eslint@9.20.0)(typescript@5.9.3)
eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.19.0(eslint@9.20.0)(typescript@5.9.3))(eslint@9.20.0)
eslint-plugin-deprecation: 3.0.0(eslint@9.20.0)(typescript@5.7.3)
eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.19.0(eslint@9.20.0)(typescript@5.7.3))(eslint@9.20.0)
eslint-plugin-jsdoc: 50.6.1(eslint@9.20.0)
eslint-plugin-playwright: 2.1.0(eslint@9.20.0)
eslint-plugin-react: 7.37.3(eslint@9.20.0)
@@ -2086,7 +2076,7 @@ snapshots:
globals: 15.14.0
playwright: 1.50.1
react: 19.0.0
typescript: 5.9.3
typescript: 5.7.3
vitest: 3.0.5(@types/node@22.13.1)
transitivePeerDependencies:
- '@typescript-eslint/utils'
@@ -2094,9 +2084,9 @@ snapshots:
- eslint-import-resolver-webpack
- supports-color
'@nhcarrigan/typescript-config@4.0.0(typescript@5.9.3)':
'@nhcarrigan/typescript-config@4.0.0(typescript@5.7.3)':
dependencies:
typescript: 5.9.3
typescript: 5.7.3
'@nodelib/fs.scandir@2.1.5':
dependencies:
@@ -2171,9 +2161,9 @@ snapshots:
'@rtsao/scc@1.1.0': {}
'@stylistic/eslint-plugin@2.12.1(eslint@9.20.0)(typescript@5.9.3)':
'@stylistic/eslint-plugin@2.12.1(eslint@9.20.0)(typescript@5.7.3)':
dependencies:
'@typescript-eslint/utils': 8.24.0(eslint@9.20.0)(typescript@5.9.3)
'@typescript-eslint/utils': 8.24.0(eslint@9.20.0)(typescript@5.7.3)
eslint: 9.20.0
eslint-visitor-keys: 4.2.0
espree: 10.3.0
@@ -2195,32 +2185,32 @@ snapshots:
'@types/normalize-package-data@2.4.4': {}
'@typescript-eslint/eslint-plugin@8.19.0(@typescript-eslint/parser@8.19.0(eslint@9.20.0)(typescript@5.9.3))(eslint@9.20.0)(typescript@5.9.3)':
'@typescript-eslint/eslint-plugin@8.19.0(@typescript-eslint/parser@8.19.0(eslint@9.20.0)(typescript@5.7.3))(eslint@9.20.0)(typescript@5.7.3)':
dependencies:
'@eslint-community/regexpp': 4.12.1
'@typescript-eslint/parser': 8.19.0(eslint@9.20.0)(typescript@5.9.3)
'@typescript-eslint/parser': 8.19.0(eslint@9.20.0)(typescript@5.7.3)
'@typescript-eslint/scope-manager': 8.19.0
'@typescript-eslint/type-utils': 8.19.0(eslint@9.20.0)(typescript@5.9.3)
'@typescript-eslint/utils': 8.19.0(eslint@9.20.0)(typescript@5.9.3)
'@typescript-eslint/type-utils': 8.19.0(eslint@9.20.0)(typescript@5.7.3)
'@typescript-eslint/utils': 8.19.0(eslint@9.20.0)(typescript@5.7.3)
'@typescript-eslint/visitor-keys': 8.19.0
eslint: 9.20.0
graphemer: 1.4.0
ignore: 5.3.2
natural-compare: 1.4.0
ts-api-utils: 1.4.3(typescript@5.9.3)
typescript: 5.9.3
ts-api-utils: 1.4.3(typescript@5.7.3)
typescript: 5.7.3
transitivePeerDependencies:
- supports-color
'@typescript-eslint/parser@8.19.0(eslint@9.20.0)(typescript@5.9.3)':
'@typescript-eslint/parser@8.19.0(eslint@9.20.0)(typescript@5.7.3)':
dependencies:
'@typescript-eslint/scope-manager': 8.19.0
'@typescript-eslint/types': 8.19.0
'@typescript-eslint/typescript-estree': 8.19.0(typescript@5.9.3)
'@typescript-eslint/typescript-estree': 8.19.0(typescript@5.7.3)
'@typescript-eslint/visitor-keys': 8.19.0
debug: 4.4.0
eslint: 9.20.0
typescript: 5.9.3
typescript: 5.7.3
transitivePeerDependencies:
- supports-color
@@ -2239,14 +2229,14 @@ snapshots:
'@typescript-eslint/types': 8.24.0
'@typescript-eslint/visitor-keys': 8.24.0
'@typescript-eslint/type-utils@8.19.0(eslint@9.20.0)(typescript@5.9.3)':
'@typescript-eslint/type-utils@8.19.0(eslint@9.20.0)(typescript@5.7.3)':
dependencies:
'@typescript-eslint/typescript-estree': 8.19.0(typescript@5.9.3)
'@typescript-eslint/utils': 8.19.0(eslint@9.20.0)(typescript@5.9.3)
'@typescript-eslint/typescript-estree': 8.19.0(typescript@5.7.3)
'@typescript-eslint/utils': 8.19.0(eslint@9.20.0)(typescript@5.7.3)
debug: 4.4.0
eslint: 9.20.0
ts-api-utils: 1.4.3(typescript@5.9.3)
typescript: 5.9.3
ts-api-utils: 1.4.3(typescript@5.7.3)
typescript: 5.7.3
transitivePeerDependencies:
- supports-color
@@ -2256,7 +2246,7 @@ snapshots:
'@typescript-eslint/types@8.24.0': {}
'@typescript-eslint/typescript-estree@7.18.0(typescript@5.9.3)':
'@typescript-eslint/typescript-estree@7.18.0(typescript@5.7.3)':
dependencies:
'@typescript-eslint/types': 7.18.0
'@typescript-eslint/visitor-keys': 7.18.0
@@ -2265,13 +2255,13 @@ snapshots:
is-glob: 4.0.3
minimatch: 9.0.5
semver: 7.7.1
ts-api-utils: 1.4.3(typescript@5.9.3)
ts-api-utils: 1.4.3(typescript@5.7.3)
optionalDependencies:
typescript: 5.9.3
typescript: 5.7.3
transitivePeerDependencies:
- supports-color
'@typescript-eslint/typescript-estree@8.19.0(typescript@5.9.3)':
'@typescript-eslint/typescript-estree@8.19.0(typescript@5.7.3)':
dependencies:
'@typescript-eslint/types': 8.19.0
'@typescript-eslint/visitor-keys': 8.19.0
@@ -2280,12 +2270,12 @@ snapshots:
is-glob: 4.0.3
minimatch: 9.0.5
semver: 7.7.1
ts-api-utils: 1.4.3(typescript@5.9.3)
typescript: 5.9.3
ts-api-utils: 1.4.3(typescript@5.7.3)
typescript: 5.7.3
transitivePeerDependencies:
- supports-color
'@typescript-eslint/typescript-estree@8.24.0(typescript@5.9.3)':
'@typescript-eslint/typescript-estree@8.24.0(typescript@5.7.3)':
dependencies:
'@typescript-eslint/types': 8.24.0
'@typescript-eslint/visitor-keys': 8.24.0
@@ -2294,41 +2284,41 @@ snapshots:
is-glob: 4.0.3
minimatch: 9.0.5
semver: 7.7.1
ts-api-utils: 2.0.1(typescript@5.9.3)
typescript: 5.9.3
ts-api-utils: 2.0.1(typescript@5.7.3)
typescript: 5.7.3
transitivePeerDependencies:
- supports-color
'@typescript-eslint/utils@7.18.0(eslint@9.20.0)(typescript@5.9.3)':
'@typescript-eslint/utils@7.18.0(eslint@9.20.0)(typescript@5.7.3)':
dependencies:
'@eslint-community/eslint-utils': 4.4.1(eslint@9.20.0)
'@typescript-eslint/scope-manager': 7.18.0
'@typescript-eslint/types': 7.18.0
'@typescript-eslint/typescript-estree': 7.18.0(typescript@5.9.3)
'@typescript-eslint/typescript-estree': 7.18.0(typescript@5.7.3)
eslint: 9.20.0
transitivePeerDependencies:
- supports-color
- typescript
'@typescript-eslint/utils@8.19.0(eslint@9.20.0)(typescript@5.9.3)':
'@typescript-eslint/utils@8.19.0(eslint@9.20.0)(typescript@5.7.3)':
dependencies:
'@eslint-community/eslint-utils': 4.4.1(eslint@9.20.0)
'@typescript-eslint/scope-manager': 8.19.0
'@typescript-eslint/types': 8.19.0
'@typescript-eslint/typescript-estree': 8.19.0(typescript@5.9.3)
'@typescript-eslint/typescript-estree': 8.19.0(typescript@5.7.3)
eslint: 9.20.0
typescript: 5.9.3
typescript: 5.7.3
transitivePeerDependencies:
- supports-color
'@typescript-eslint/utils@8.24.0(eslint@9.20.0)(typescript@5.9.3)':
'@typescript-eslint/utils@8.24.0(eslint@9.20.0)(typescript@5.7.3)':
dependencies:
'@eslint-community/eslint-utils': 4.4.1(eslint@9.20.0)
'@typescript-eslint/scope-manager': 8.24.0
'@typescript-eslint/types': 8.24.0
'@typescript-eslint/typescript-estree': 8.24.0(typescript@5.9.3)
'@typescript-eslint/typescript-estree': 8.24.0(typescript@5.7.3)
eslint: 9.20.0
typescript: 5.9.3
typescript: 5.7.3
transitivePeerDependencies:
- supports-color
@@ -2347,12 +2337,12 @@ snapshots:
'@typescript-eslint/types': 8.24.0
eslint-visitor-keys: 4.2.0
'@vitest/eslint-plugin@1.1.24(@typescript-eslint/utils@8.24.0(eslint@9.20.0)(typescript@5.9.3))(eslint@9.20.0)(typescript@5.9.3)(vitest@3.0.5(@types/node@22.13.1))':
'@vitest/eslint-plugin@1.1.24(@typescript-eslint/utils@8.24.0(eslint@9.20.0)(typescript@5.7.3))(eslint@9.20.0)(typescript@5.7.3)(vitest@3.0.5(@types/node@22.13.1))':
dependencies:
'@typescript-eslint/utils': 8.24.0(eslint@9.20.0)(typescript@5.9.3)
'@typescript-eslint/utils': 8.24.0(eslint@9.20.0)(typescript@5.7.3)
eslint: 9.20.0
optionalDependencies:
typescript: 5.9.3
typescript: 5.7.3
vitest: 3.0.5(@types/node@22.13.1)
'@vitest/expect@3.0.5':
@@ -2788,27 +2778,27 @@ snapshots:
transitivePeerDependencies:
- supports-color
eslint-module-utils@2.12.0(@typescript-eslint/parser@8.19.0(eslint@9.20.0)(typescript@5.9.3))(eslint-import-resolver-node@0.3.9)(eslint@9.20.0):
eslint-module-utils@2.12.0(@typescript-eslint/parser@8.19.0(eslint@9.20.0)(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint@9.20.0):
dependencies:
debug: 3.2.7
optionalDependencies:
'@typescript-eslint/parser': 8.19.0(eslint@9.20.0)(typescript@5.9.3)
'@typescript-eslint/parser': 8.19.0(eslint@9.20.0)(typescript@5.7.3)
eslint: 9.20.0
eslint-import-resolver-node: 0.3.9
transitivePeerDependencies:
- supports-color
eslint-plugin-deprecation@3.0.0(eslint@9.20.0)(typescript@5.9.3):
eslint-plugin-deprecation@3.0.0(eslint@9.20.0)(typescript@5.7.3):
dependencies:
'@typescript-eslint/utils': 7.18.0(eslint@9.20.0)(typescript@5.9.3)
'@typescript-eslint/utils': 7.18.0(eslint@9.20.0)(typescript@5.7.3)
eslint: 9.20.0
ts-api-utils: 1.4.3(typescript@5.9.3)
ts-api-utils: 1.4.3(typescript@5.7.3)
tslib: 2.8.1
typescript: 5.9.3
typescript: 5.7.3
transitivePeerDependencies:
- supports-color
eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.19.0(eslint@9.20.0)(typescript@5.9.3))(eslint@9.20.0):
eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.19.0(eslint@9.20.0)(typescript@5.7.3))(eslint@9.20.0):
dependencies:
'@rtsao/scc': 1.1.0
array-includes: 3.1.8
@@ -2819,7 +2809,7 @@ snapshots:
doctrine: 2.1.0
eslint: 9.20.0
eslint-import-resolver-node: 0.3.9
eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.19.0(eslint@9.20.0)(typescript@5.9.3))(eslint-import-resolver-node@0.3.9)(eslint@9.20.0)
eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.19.0(eslint@9.20.0)(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint@9.20.0)
hasown: 2.0.2
is-core-module: 2.16.1
is-glob: 4.0.3
@@ -2831,7 +2821,7 @@ snapshots:
string.prototype.trimend: 1.0.9
tsconfig-paths: 3.15.0
optionalDependencies:
'@typescript-eslint/parser': 8.19.0(eslint@9.20.0)(typescript@5.9.3)
'@typescript-eslint/parser': 8.19.0(eslint@9.20.0)(typescript@5.7.3)
transitivePeerDependencies:
- eslint-import-resolver-typescript
- eslint-import-resolver-webpack
@@ -3792,13 +3782,13 @@ snapshots:
dependencies:
is-number: 7.0.0
ts-api-utils@1.4.3(typescript@5.9.3):
ts-api-utils@1.4.3(typescript@5.7.3):
dependencies:
typescript: 5.9.3
typescript: 5.7.3
ts-api-utils@2.0.1(typescript@5.9.3):
ts-api-utils@2.0.1(typescript@5.7.3):
dependencies:
typescript: 5.9.3
typescript: 5.7.3
tsconfig-paths@3.15.0:
dependencies:
@@ -3852,7 +3842,7 @@ snapshots:
possible-typed-array-names: 1.1.0
reflect.getprototypeof: 1.0.10
typescript@5.9.3: {}
typescript@5.7.3: {}
unbox-primitive@1.1.0:
dependencies:
-30
View File
@@ -71,34 +71,4 @@ export class Logger {
method: "POST",
});
}
/**
* Sends a counter metric to the alerting service.
* The alerting service is configured to handle aggregation, so you can send
* summative counts or individual increments. (e.g. Send a count of all users, or send a count of 1 every time a user joins).
* @param name -- The name of the metric to track.
* @param value -- The value of the metric to insert.
* @param metadata -- Any metadata to attach to the metric.
*/
public async metric(
name: string,
value: number,
metadata: Record<string, string | number | boolean>,
): Promise<void> {
await fetch(`${this.url}/metric`, {
body: JSON.stringify({
application: this.application,
metadata: metadata,
name: name,
value: value,
}),
headers: {
// eslint-disable-next-line @typescript-eslint/naming-convention -- Standard header name.
"Authorization": this.token,
// eslint-disable-next-line @typescript-eslint/naming-convention -- Standard header name.
"Content-Type": "application/json",
},
method: "POST",
});
}
}