diff --git a/.github/workflows/agent.yml b/.github/workflows/agent.yml
index 6a6e210..b73397f 100644
--- a/.github/workflows/agent.yml
+++ b/.github/workflows/agent.yml
@@ -28,7 +28,7 @@ jobs:
egress-policy: audit
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
+ uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 52ef8a3..bac409c 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -54,7 +54,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@49abf0ba24d0b7953cb586944e918a0b92074c80 # v2.22.4
+ uses: github/codeql-action/init@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -68,7 +68,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
- uses: github/codeql-action/autobuild@49abf0ba24d0b7953cb586944e918a0b92074c80 # v2.22.4
+ uses: github/codeql-action/autobuild@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5
# âšī¸ Command-line programs to run using the OS shell.
# đ See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -81,6 +81,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@49abf0ba24d0b7953cb586944e918a0b92074c80 # v2.22.4
+ uses: github/codeql-action/analyze@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5
with:
category: "/language:${{matrix.language}}"
diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml
index 7d04e1d..9319420 100644
--- a/.github/workflows/config.yml
+++ b/.github/workflows/config.yml
@@ -28,7 +28,7 @@ jobs:
egress-policy: audit
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
+ uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
diff --git a/.github/workflows/discord.yml b/.github/workflows/discord.yml
index f30abd9..e9bbcbc 100644
--- a/.github/workflows/discord.yml
+++ b/.github/workflows/discord.yml
@@ -28,10 +28,12 @@ jobs:
egress-policy: audit
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
+ uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
+ - name: Build packages
+ run: npm run build
- name: Run tests
run: npm run test --workspace=src/discord
diff --git a/.github/workflows/logql.yml b/.github/workflows/logql.yml
index df93a93..d10ab2e 100644
--- a/.github/workflows/logql.yml
+++ b/.github/workflows/logql.yml
@@ -28,7 +28,7 @@ jobs:
egress-policy: audit
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
+ uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
diff --git a/.github/workflows/morphix.yml b/.github/workflows/morphix.yml
new file mode 100644
index 0000000..555b092
--- /dev/null
+++ b/.github/workflows/morphix.yml
@@ -0,0 +1,37 @@
+name: Morphix
+
+on:
+ push:
+ branches: [main]
+ paths:
+ - src/morphix/src/**
+ - src/morphix/test/**
+ pull_request:
+ paths:
+ - src/morphix/src/**
+ - src/morphix/test/**
+
+permissions:
+ contents: read
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ node-version: [18.x, 20.x]
+ fail-fast: false
+ steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
+ with:
+ egress-policy: audit
+ - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
+ with:
+ node-version: ${{ matrix.node-version }}
+ - name: Install dependencies
+ run: npm ci
+ - name: Run tests
+ run: npm run test --workspace=src/morphix
diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml
index c0d9e23..7221a12 100644
--- a/.github/workflows/scorecard.yml
+++ b/.github/workflows/scorecard.yml
@@ -43,7 +43,7 @@ jobs:
persist-credentials: false
- name: "Run analysis"
- uses: ossf/scorecard-action@483ef80eb98fb506c348f7d62e28055e49fe2398 # v2.3.0
+ uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
with:
results_file: results.sarif
results_format: sarif
@@ -73,6 +73,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
- uses: github/codeql-action/upload-sarif@49abf0ba24d0b7953cb586944e918a0b92074c80 # v2.22.4
+ uses: github/codeql-action/upload-sarif@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5
with:
sarif_file: results.sarif
diff --git a/.github/workflows/slack.yml b/.github/workflows/slack.yml
index ab8b446..174ac96 100644
--- a/.github/workflows/slack.yml
+++ b/.github/workflows/slack.yml
@@ -28,10 +28,12 @@ jobs:
egress-policy: audit
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
+ uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
+ - name: Build packages
+ run: npm run build
- name: Run tests
run: npm run test --workspace=src/slack
diff --git a/.github/workflows/teams.yml b/.github/workflows/teams.yml
index 2662098..cf85787 100644
--- a/.github/workflows/teams.yml
+++ b/.github/workflows/teams.yml
@@ -28,10 +28,12 @@ jobs:
egress-policy: audit
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
+ uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
+ - name: Build packages
+ run: npm run build
- name: Run tests
run: npm run test --workspace=src/teams
diff --git a/README.md b/README.md
index b95fe72..786902d 100644
--- a/README.md
+++ b/README.md
@@ -39,6 +39,7 @@ Click on one of the links to access the documentation of the package:
| name | package and link |
| --- | --- |
| logql | [@sigyn/logql](./src/logql) |
+| morphix | [@sigyn/morphix](./src/morphix) |
### Notifiers
| name | package and link |
diff --git a/package-lock.json b/package-lock.json
index 23862a1..57309be 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -12,13 +12,14 @@
"src/config",
"src/logql",
"src/agent",
+ "src/morphix",
"src/discord",
"src/slack",
"src/teams"
],
"devDependencies": {
"@nodesecure/eslint-config": "^1.8.0",
- "@types/node": "^20.8.7",
+ "@types/node": "^20.8.9",
"c8": "^8.0.1",
"cross-env": "^7.0.3",
"glob": "^10.3.10",
@@ -1070,6 +1071,10 @@
"resolved": "src/logql",
"link": true
},
+ "node_modules/@sigyn/morphix": {
+ "resolved": "src/morphix",
+ "link": true
+ },
"node_modules/@sigyn/slack": {
"resolved": "src/slack",
"link": true
@@ -1100,12 +1105,12 @@
"dev": true
},
"node_modules/@types/node": {
- "version": "20.8.7",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.7.tgz",
- "integrity": "sha512-21TKHHh3eUHIi2MloeptJWALuCu5H7HQTdTrWIFReA8ad+aggoX+lRes3ex7/FtpC+sVUpFMQ+QTfYr74mruiQ==",
+ "version": "20.8.9",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.9.tgz",
+ "integrity": "sha512-UzykFsT3FhHb1h7yD4CA4YhBHq545JC0YnEz41xkipN88eKQtL6rSgocL5tbAP6Ola9Izm/Aw4Ora8He4x0BHg==",
"dev": true,
"dependencies": {
- "undici-types": "~5.25.1"
+ "undici-types": "~5.26.4"
}
},
"node_modules/@types/semver": {
@@ -2215,17 +2220,6 @@
"node": ">=6"
}
},
- "node_modules/escape-goat": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-4.0.0.tgz",
- "integrity": "sha512-2Sd4ShcWxbx6OY1IHyla/CVNwvg7XwZVoXZHcSu9w9SReNP1EzzD5T8NWKIR38fIqEns9kDWKUQTXXAmlDrdPg==",
- "engines": {
- "node": ">=12"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
@@ -2445,6 +2439,15 @@
"node": ">=8"
}
},
+ "node_modules/esmock": {
+ "version": "2.5.8",
+ "resolved": "https://registry.npmjs.org/esmock/-/esmock-2.5.8.tgz",
+ "integrity": "sha512-Lvn8OhAvdM+OBgIkljnG8WNPayDN4vMyoHaKGnXnM4J7T3bE6qztUWHd7cnbnyW0ueLQRT/3bS6SoHnBN1hEsg==",
+ "dev": true,
+ "engines": {
+ "node": ">=14.16.0"
+ }
+ },
"node_modules/espree": {
"version": "9.6.1",
"resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz",
@@ -3825,9 +3828,9 @@
}
},
"node_modules/pino": {
- "version": "8.16.0",
- "resolved": "https://registry.npmjs.org/pino/-/pino-8.16.0.tgz",
- "integrity": "sha512-UUmvQ/7KTZt/vHjhRrnyS7h+J7qPBQnpG80V56xmIC+o9IqYmQOw/UIny9S9zYDfRBR0ClouCr464EkBMIT7Fw==",
+ "version": "8.16.1",
+ "resolved": "https://registry.npmjs.org/pino/-/pino-8.16.1.tgz",
+ "integrity": "sha512-3bKsVhBmgPjGV9pyn4fO/8RtoVDR8ssW1ev819FsRXlRNgW8gR/9Kx+gCK4UPWd4JjrRDLWpzd/pb1AyWm3MGA==",
"dependencies": {
"atomic-sleep": "^1.0.0",
"fast-redact": "^3.1.1",
@@ -3986,20 +3989,6 @@
"node": ">=6"
}
},
- "node_modules/pupa": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/pupa/-/pupa-3.1.0.tgz",
- "integrity": "sha512-FLpr4flz5xZTSJxSeaheeMKN/EDzMdK7b8PTOC6a5PYFKTucWbdqjgqaEyH0shFiSJrVB1+Qqi4Tk19ccU6Aug==",
- "dependencies": {
- "escape-goat": "^4.0.0"
- },
- "engines": {
- "node": ">=12.20"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/queue-microtask": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
@@ -4852,9 +4841,9 @@
}
},
"node_modules/undici-types": {
- "version": "5.25.3",
- "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz",
- "integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==",
+ "version": "5.26.5",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
+ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
"dev": true
},
"node_modules/update-browserslist-db": {
@@ -5173,8 +5162,7 @@
"dayjs": "^1.11.10",
"dotenv": "^16.3.1",
"ms": "^2.1.3",
- "pino": "^8.16.0",
- "pupa": "^3.1.0",
+ "pino": "^8.16.1",
"toad-scheduler": "^3.0.0"
},
"devDependencies": {
@@ -5264,8 +5252,7 @@
"version": "1.3.1",
"license": "MIT",
"dependencies": {
- "@myunisoft/httpie": "^2.0.3",
- "pupa": "^3.1.0"
+ "@myunisoft/httpie": "^2.0.3"
},
"engines": {
"node": ">=18"
@@ -5279,13 +5266,23 @@
"node": ">=18"
}
},
+ "src/morphix": {
+ "name": "@sigyn/morphix",
+ "version": "1.0.0",
+ "license": "MIT",
+ "devDependencies": {
+ "esmock": "^2.5.8"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
"src/slack": {
"name": "@sigyn/slack",
"version": "1.6.1",
"license": "MIT",
"dependencies": {
- "@myunisoft/httpie": "^2.0.3",
- "pupa": "^3.1.0"
+ "@myunisoft/httpie": "^2.0.3"
},
"engines": {
"node": ">=18"
@@ -5296,8 +5293,7 @@
"version": "1.3.0",
"license": "MIT",
"dependencies": {
- "@myunisoft/httpie": "^2.0.3",
- "pupa": "^3.1.0"
+ "@myunisoft/httpie": "^2.0.3"
},
"engines": {
"node": ">=18"
diff --git a/package.json b/package.json
index 1d6396e..e9bad6d 100644
--- a/package.json
+++ b/package.json
@@ -13,13 +13,14 @@
"src/config",
"src/logql",
"src/agent",
+ "src/morphix",
"src/discord",
"src/slack",
"src/teams"
],
"devDependencies": {
"@nodesecure/eslint-config": "^1.8.0",
- "@types/node": "^20.8.7",
+ "@types/node": "^20.8.9",
"c8": "^8.0.1",
"cross-env": "^7.0.3",
"glob": "^10.3.10",
diff --git a/src/agent/package.json b/src/agent/package.json
index cd0af1d..d90d01b 100644
--- a/src/agent/package.json
+++ b/src/agent/package.json
@@ -47,8 +47,7 @@
"dayjs": "^1.11.10",
"dotenv": "^16.3.1",
"ms": "^2.1.3",
- "pino": "^8.16.0",
- "pupa": "^3.1.0",
+ "pino": "^8.16.1",
"toad-scheduler": "^3.0.0"
},
"devDependencies": {
diff --git a/src/agent/src/notifiers/notifierQueue.ts b/src/agent/src/notifiers/notifierQueue.ts
index aaf1fbb..e45112e 100644
--- a/src/agent/src/notifiers/notifierQueue.ts
+++ b/src/agent/src/notifiers/notifierQueue.ts
@@ -8,6 +8,9 @@ const kPrivateInstancier = Symbol("instancier");
type NotifierQueueAlert
+ Morphix
+
+ Micro templating with function pipes support +
+ + + +## đ Getting Started + +This package is available in the Node Package Repository and can be easily installed with [npm](https://doc.npmjs.com/getting-started/what-is-npm) or [yarn](https://yarnpkg.com) + +```bash +$ npm i @sigyn/morphix +# or +$ yarn add @sigyn/morphix +``` + +## đ Usage + +```ts +import { morphix } from "@sigyn/morphix"; + +await morphix("Hello {name | capitalize}", { name: "john" }); +``` + +> [!NOTE] +> `morphix()` is async because it supports async **functions** + +## đ API + +### `morphix` + +```ts +async function morphix( + template: string, + data: Record