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
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
"SPDX",
"Splug",
"Sprintf",
"standardised",
"stretchr",
"supervisorctl",
"supervisord",
Expand Down
2 changes: 1 addition & 1 deletion .dcilintignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ examples/cactus-example-carbon-accounting-backend/src/main/json/generated/build-
**/generated/**/typescript-axios/git_push.sh
examples/cactus-example-cbdc-bridging-backend/src/main/typescript/generated/openapi/typescript-axios/git_push.sh
packages/cactus-plugin-satp-hermes/src/main/typescript/generated/gateway-client/typescript-axios/git_push.sh
packages/cactus-plugin-satp-hermes/src/main/typescript/generated/openapi-blo/typescript-axios/git_push.sh
packages/cactus-plugin-satp-hermes/src/main/typescript/generated/oapi-api1/typescript-axios/git_push.sh

# Generated architecture diagrams
packages/cactus-plugin-satp-hermes/docs/architecture/satp-hermes-arch-v2.1.0.vsdx
Expand Down
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
},
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"version": "18.19.0"
"version": "18.19.0",
"installYarnUsingApt": false
},
"ghcr.io/devcontainers/features/rust:1": {
"version": "1.74",
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/configure-repo/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ runs:
# 1. Setup Node.js + yarn cache
- name: Use Node.js ${{ inputs.node_version }}
id: setup-node
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 #v6.2.0
with:
cache: yarn
cache-dependency-path: yarn.lock
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/actionlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
# npm ERR! this command with --force or --legacy-peer-deps
# npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
- name: wipe_non_yaml_sources
run: rm -rf packages/ examples/ extensions/ package.json weaver/
run: rm -rf packages/ examples/ extensions/ package.json weaver/ node_modules/

# Shellcheck comlains that inside single quotes
# the environment variables are not expanded, but that's exactly what we want here because
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checks-and-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v6
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 #v6.2.0
with:
node-version: ${{ inputs.node_version }}
- id: compute-affected-packages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/satp-hermes-codegen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ jobs:
with:
name: satp-hermes-generated-openapi
path: |
packages/cactus-plugin-satp-hermes/src/main/yml/bol/openapi-blo-bundled.yml
packages/cactus-plugin-satp-hermes/src/main/json/openapi-blo-bundled.json
packages/cactus-plugin-satp-hermes/src/main/yml/bol/oapi-api1-bundled.yml
packages/cactus-plugin-satp-hermes/src/main/json/oapi-api1-bundled.json
packages/cactus-plugin-satp-hermes/src/main/typescript/generated/gateway-client/

- name: Upload generated Solidity artifacts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/satp-hermes-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ jobs:
- name: Create documentation metadata
run: |
VERSION=$(node -p "require('./packages/cactus-plugin-satp-hermes/package.json').version")
SATP_VERSION=$(node -p "require('./packages/cactus-plugin-satp-hermes/package.json').customMetadata['satp-package-version']")
SATP_VERSION=$(node -p "require('./packages/cactus-plugin-satp-hermes/package.json').version")

cat > ./gh-pages/cacti/satp/metadata.json << EOF
{
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/satp-hermes-ghcr-gateway-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ name: SATP Hermes Gateway SDK - GHCR Publish
# Registry: https://ghcr.io/
#
# VERSION STRATEGY:
# Version Source: package.json customMetadata.satp-package-version (0.0.3-beta)
# Note: package.json "version" field remains at 2.1.0 for monorepo compatibility.
# The workflow dynamically updates version from customMetadata before publishing.
# Version Source: package.json version (0.0.3-beta)
# Note: package.json "version" field is the single source of truth.
#
# Development Builds:
# Format: {base-version}-dev.{timestamp}
# Example: 0.0.3-beta-dev.20250106120000
# GHCR Tag: dev
# Format: {YYYY-MM-DD}-dev-{hash}
# Example: 2026-01-22-dev-abc1234
# GHCR Tag: dev-hash
# Trigger: Push to main, satp-dev, or satp-stg branches
#
# Release Builds:
Expand Down Expand Up @@ -110,7 +109,7 @@ jobs:
- name: Set image tags
id: set_tags
run: |
PACKAGE_VERSION=$(node -e "console.log(require('./packages/cactus-plugin-satp-hermes/package.json').customMetadata['satp-package-version'])")
PACKAGE_VERSION=$(node -e "console.log(require('./packages/cactus-plugin-satp-hermes/package.json').version)")
IS_RELEASE="${{ inputs.is_release }}"
if [ "$IS_RELEASE" = "true" ]; then
if [ -n "${{ inputs.custom_version }}" ]; then
Expand All @@ -136,7 +135,7 @@ jobs:
} >> "$GITHUB_OUTPUT"
- name: Debug Build Info
run: |
PACKAGE_VERSION=$(node -e "console.log(require('./packages/cactus-plugin-satp-hermes/package.json').customMetadata['satp-package-version'])")
PACKAGE_VERSION=$(node -e "console.log(require('./packages/cactus-plugin-satp-hermes/package.json').version)")
{
echo "Debug: Current ref = ${{ github.ref }}"
echo "Debug: Event name = ${{ github.event_name }}"
Expand Down
27 changes: 13 additions & 14 deletions .github/workflows/satp-hermes-npmjs-gateway-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ name: SATP Hermes Gateway SDK - NPM Publish
# Registry: https://registry.npmjs.org/
#
# VERSION STRATEGY:
# Version Source: package.json customMetadata.satp-package-version (0.0.3-beta)
# Note: package.json "version" field remains at 2.1.0 for monorepo compatibility.
# The workflow dynamically updates version from customMetadata before publishing.
# Version Source: package.json version (0.0.3-beta)
# Note: package.json "version" field is the single source of truth.
#
# Development Builds:
# Format: {base-version}-dev.{timestamp}
Expand Down Expand Up @@ -155,8 +154,8 @@ jobs:
- name: Set package tags
id: set_tags
run: |
# Extract SATP package version from package.json customMetadata
PACKAGE_VERSION=$(node -e "console.log(require('./packages/cactus-plugin-satp-hermes/package.json').customMetadata['satp-package-version'])")
# Extract SATP package version from package.json version field
PACKAGE_VERSION=$(node -e "console.log(require('./packages/cactus-plugin-satp-hermes/package.json').version)")

# Check if this is a release build (manual trigger with is_release=true)
IS_RELEASE="${{ inputs.is_release }}"
Expand Down Expand Up @@ -190,7 +189,7 @@ jobs:

- name: Debug Build Info
run: |
PACKAGE_VERSION=$(node -e "console.log(require('./packages/cactus-plugin-satp-hermes/package.json').customMetadata['satp-package-version'])")
PACKAGE_VERSION=$(node -e "console.log(require('./packages/cactus-plugin-satp-hermes/package.json').version)")
{
echo "Debug: Current ref = ${{ github.ref }}"
echo "Debug: Event name = ${{ github.event_name }}"
Expand Down Expand Up @@ -305,8 +304,8 @@ jobs:
if: needs.set-npm-tags.outputs.is_release != 'true'
run: |
cd packages/cactus-plugin-satp-hermes
# Get the base version from customMetadata
BASE_VERSION=$(node -e "console.log(require('./package.json').customMetadata['satp-package-version'])")
# Get the base version from package.json
BASE_VERSION=$(node -e "console.log(require('./package.json').version)")
# Create a development version with timestamp
DEV_VERSION="${BASE_VERSION}-dev.$(date +%Y%m%d%H%M%S)"
# Update package.json version field
Expand All @@ -318,11 +317,11 @@ jobs:
if: needs.set-npm-tags.outputs.is_release == 'true'
run: |
cd packages/cactus-plugin-satp-hermes
# Use the version from customMetadata or custom version input
# Use the version from package.json or custom version input
if [ -n "${{ inputs.custom_version }}" ]; then
RELEASE_VERSION="${{ inputs.custom_version }}"
else
RELEASE_VERSION=$(node -e "console.log(require('./package.json').customMetadata['satp-package-version'])")
RELEASE_VERSION=$(node -e "console.log(require('./package.json').version)")
fi
# Update package.json version field
npm version "$RELEASE_VERSION" --no-git-tag-version --allow-same-version
Expand Down Expand Up @@ -391,8 +390,8 @@ jobs:
if: needs.set-npm-tags.outputs.is_release != 'true'
run: |
cd packages/cactus-plugin-satp-hermes
# Get the base version from customMetadata
BASE_VERSION=$(node -e "console.log(require('./package.json').customMetadata['satp-package-version'])")
# Get the base version from package.json
BASE_VERSION=$(node -e "console.log(require('./package.json').version)")
# Create a development version with timestamp
DEV_VERSION="${BASE_VERSION}-dev.$(date +%Y%m%d%H%M%S)"
# Update package.json version field
Expand All @@ -403,11 +402,11 @@ jobs:
if: needs.set-npm-tags.outputs.is_release == 'true'
run: |
cd packages/cactus-plugin-satp-hermes
# Use the version from customMetadata or custom version input
# Use the version from package.json or custom version input
if [ -n "${{ inputs.custom_version }}" ]; then
RELEASE_VERSION="${{ inputs.custom_version }}"
else
RELEASE_VERSION=$(node -e "console.log(require('./package.json').customMetadata['satp-package-version'])")
RELEASE_VERSION=$(node -e "console.log(require('./package.json').version)")
fi
# Update package.json version field
npm version "$RELEASE_VERSION" --no-git-tag-version --allow-same-version
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/satp-hermes-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ jobs:
- Custom Version: ${{ inputs.custom_version || 'None (using package.json)' }}
- Source Branch: ${{ inputs.release_branch || github.ref }}
- Workflow Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

Released on: $(date -u '+%Y-%m-%d %H:%M:%S UTC')
- Release Time (github): ${{ github.run_id }}
draft: false
prerelease: ${{ contains(inputs.tag_version, 'alpha') || contains(inputs.tag_version, 'beta') || contains(inputs.tag_version, 'rc') }}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ router.get(
"/api/v1/bl/logics/",
(req: Request, res: Response, next: NextFunction) => {
try {
res.render("Not Implemented (Show Business Logics)\n");
res.status(501).send("Not Implemented (Show Business Logics)\n");
} catch (err) {
next(err);
}
Expand All @@ -43,12 +43,14 @@ router.get(
"/api/v1/bl/logics/:id",
(req: Request, res: Response, next: NextFunction) => {
try {
res.render(
"Not Implemented (Show Specification of Business Logic" +
", id=" +
escapeHtml(req.params.id) +
")\n",
);
res
.status(501)
.send(
"Not Implemented (Show Specification of Business Logic" +
", id=" +
escapeHtml(req.params.id as string) +
")\n",
);
} catch (err) {
next(err);
}
Expand All @@ -60,7 +62,7 @@ router.post(
"/api/v1/bl/wallets/",
(req: Request, res: Response, next: NextFunction) => {
try {
res.render("Not Implemented (Register a Wallet)\n");
res.status(501).send("Not Implemented (Register a Wallet)\n");
} catch (err) {
next(err);
}
Expand All @@ -72,7 +74,7 @@ router.get(
"/api/v1/bl/wallets/",
(req: Request, res: Response, next: NextFunction) => {
try {
res.render("Not Implemented (Show Wallet List)\n");
res.status(501).send("Not Implemented (Show Wallet List)\n");
} catch (err) {
next(err);
}
Expand All @@ -84,12 +86,14 @@ router.put(
"/api/v1/bl/wallets/:id",
(req: Request, res: Response, next: NextFunction) => {
try {
res.render(
"Not Implemented (Update Existing Wallets" +
", id=" +
escapeHtml(req.params.id) +
")\n",
);
res
.status(501)
.send(
"Not Implemented (Update Existing Wallets" +
", id=" +
escapeHtml(req.params.id as string) +
")\n",
);
} catch (err) {
next(err);
}
Expand All @@ -101,7 +105,7 @@ router.delete(
"/api/v1/bl/wallets/:id",
(req: Request, res: Response, next: NextFunction) => {
try {
const walletIdEsc = escapeHtml(req.params.id);
const walletIdEsc = escapeHtml(req.params.id as string);
const out = "Not Implemented (Delete a Wallet, id=" + walletIdEsc + ")\n";
res.status(501).send(out);
} catch (err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const router: Router = Router();
/* GET balance. */
router.get("/:account", (req: Request, res: Response, next: NextFunction) => {
try {
getAccountBalance(req.params.account)
getAccountBalance(req.params.account as string)
.then((result) => {
logger.debug(`#####[sample/balance.ts]`);
logger.debug("result(getBalance) = " + result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ router.get("/:assetID", (req: Request, res: Response, next: NextFunction) => {
try {
logger.debug(`start queryAsset`);

queryAsset(req.params.assetID)
queryAsset(req.params.assetID as string)
.then((result: unknown) => {
logger.debug("result(queryAsset) = " + JSON.stringify(result));
res.status(200).json(result);
Expand Down
4 changes: 3 additions & 1 deletion examples/cactus-example-discounted-asset-trade/trades.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ router.post("/", (req: Request, res: Response, next: NextFunction) => {
// Show Current Status of Trade
router.get("/:id", (req: Request, res: Response, next: NextFunction) => {
try {
const result = transactionManagement.getOperationStatus(req.params.id);
const result = transactionManagement.getOperationStatus(
req.params.id as string,
);
if (result) {
res.status(200).json(result);
} else {
Expand Down
2 changes: 1 addition & 1 deletion examples/cactus-example-electricity-trade/balance.ts
Comment thread
LordKubaya marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const router: Router = Router();
/* GET balance. */
router.get("/:account", (req: Request, res: Response, next: NextFunction) => {
try {
getAccountBalance(req.params.account)
getAccountBalance(req.params.account as string)
.then((result) => {
logger.debug(`#####[sample/balance.ts]`);
logger.debug("result(getBalance) = " + result);
Expand Down
13 changes: 7 additions & 6 deletions packages/cactus-plugin-satp-hermes/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ src/test/solidity/generated/build-info/
src/main/solidity/generated/build-info/
src/main/typescript/database/*
!src/main/typescript/database/*.ts
reports/junit/satp-hermes-tests-unit.xml
reports/junit/satp-hermes-tests-integration.xml

reports/**/*
# TypeDoc generated documentation
public/typedoc/

# Generated diagrams (keep only .mmd source files)
assets/diagrams/*.svg
assets/diagrams/*.png
assets/diagrams/*.pdf
assets/diagrams/svg/
assets/diagrams/png/
assets/diagrams/pdf/
src/test/solidity/generated/build-info
typedoc/** */
docs/assets/diagrams
tmp/
out/**/*

Loading
Loading