This is an automated email from the ASF dual-hosted git repository.
piotr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iggy.git
The following commit(s) were added to refs/heads/master by this push:
new a3c090af feat(js): add node ci (#1810)
a3c090af is described below
commit a3c090afb38f6a8a4a752a0e4e87fdacb11c39e8
Author: T1B0 <[email protected]>
AuthorDate: Thu May 29 22:22:40 2025 +0200
feat(js): add node ci (#1810)
embarks https://github.com/apache/iggy/pull/1809 + add nodejs ci
---
.github/changed-files-config.json | 6 +
.github/workflows/ci-check-node-sdk.yml | 86 +++++++++++++
.github/workflows/ci-check-pr.yml | 10 +-
.github/workflows/publish_node_sdk.yml | 129 ++++++++++++++++++++
foreign/node/README.md | 7 +-
foreign/node/package-lock.json | 135 ++++++++++++++++-----
foreign/node/package.json | 8 +-
foreign/node/src/client/tcp.client.ts | 35 ------
foreign/node/src/client/tls.client.ts | 37 ------
.../src/wire/message/send-messages.command.test.ts | 2 +-
10 files changed, 340 insertions(+), 115 deletions(-)
diff --git a/.github/changed-files-config.json
b/.github/changed-files-config.json
index e37c5f50..7f9f5111 100644
--- a/.github/changed-files-config.json
+++ b/.github/changed-files-config.json
@@ -31,5 +31,11 @@
"foreign/python/pyproject.toml",
"foreign/python/Cargo.toml",
".github/workflows/ci-check-python-sdk.yml"
+ ],
+ "node-sdk": [
+ "foreign/node/.*\\.ts",
+ "foreign/node/.*\\.js",
+ "foreign/node/.*\\.json",
+ ".github/workflows/ci-check-node-sdk.yml"
]
}
diff --git a/.github/workflows/ci-check-node-sdk.yml
b/.github/workflows/ci-check-node-sdk.yml
new file mode 100644
index 00000000..f6d1a615
--- /dev/null
+++ b/.github/workflows/ci-check-node-sdk.yml
@@ -0,0 +1,86 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# -------------------------------------------------------------
+#
+# CI Check Node Workflow
+#
+# This workflow runs checks for nodejs sdk code.
+# Checks include:
+# - npm install dependencies
+# - commit-lint
+# - typescript build
+# - eslint
+# - unit test
+# - TODO: e2e test
+#
+# This workflow can be triggered manually or by other workflows.
+#
+name: ci-check-node-sdk
+
+on:
+ workflow_dispatch:
+ workflow_call:
+
+jobs:
+ install:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ cache-dependency-path: foreign/node/package-lock.json
+ node-version: 22
+ cache: "npm"
+
+ - uses: actions/cache@v4
+ env:
+ cache-name: cache-node-modules
+ with:
+ # npm cache files are stored in `~/.npm` on Linux/macOS
+ path: ~/.npm
+ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{
hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-build-${{ env.cache-name }}-${{
hashFiles('**/package-lock.json') }}
+
+ - name: install dependencies
+ run: cd foreign/node/ && npm ci --ignore-scripts # no husky hooks when
in ci
+
+ # - name: Validate current commit (last commit) message with commitlint
+ # if: github.event_name == 'push'
+ # run: npx commitlint --last --verbose
+
+ # - name: Validate PR commits messages with commitlint
+ # if: github.event_name == 'pull_request'
+ # run: npx commitlint --from ${{ github.event.pull_request.base.sha }}
--to ${{ github.event.pull_request.head.sha }} --verbose
+
+ - name: lint typescript code
+ run: cd foreign/node/ && npm run lint
+
+ - name: build typescript
+ run: cd foreign/node/ && npm run build
+
+ - name: run unit test
+ run: cd foreign/node/ && npm run test
+
+ ### Integration tests (e2e)
+
+ # - name: Setup iggy
+ # uses: iggy-rs/setup-iggy@v1
+
+ # - name: Perform integration tests
+ # run: npm run test:e2e
diff --git a/.github/workflows/ci-check-pr.yml
b/.github/workflows/ci-check-pr.yml
index 914c27e2..743d2a7c 100644
--- a/.github/workflows/ci-check-pr.yml
+++ b/.github/workflows/ci-check-pr.yml
@@ -56,7 +56,8 @@ jobs:
trigger-rust: ${{ steps.changed-files.outputs.RUST_FILES_CHANGED }}
trigger-shell: ${{ steps.changed-files.outputs.SHELL_FILES_CHANGED }}
trigger-java-sdk: ${{ steps.changed-files.outputs.JAVA-SDK_FILES_CHANGED
}}
- trigger-python-sdk: ${{
steps.changed-files.outputs.PYTHON-SDK_FILES_CHANGED }}
+ trigger-python-sdk: ${{
steps.changed-files.outputs.PYTHON-SDK_FILES_CHANGED }},
+ trigger-node-sdk: ${{ steps.changed-files.outputs.NODE-SDK_FILES_CHANGED
}}
steps:
- name: Checkout code
uses: actions/checkout@v4
@@ -133,6 +134,12 @@ jobs:
if: ${{ needs.pr-file-changes.outputs.trigger-python-sdk == 'true' }}
uses: ./.github/workflows/ci-check-python-sdk.yml
+ ci-check-node-sdk:
+ name: ci-check-node-sdk
+ needs: pr-file-changes
+ if: ${{ needs.pr-file-changes.outputs.trigger-node-sdk == 'true' }}
+ uses: ./.github/workflows/ci-check-node-sdk.yml
+
finalize-pr:
runs-on: ubuntu-latest
needs:
@@ -144,6 +151,7 @@ jobs:
- ci-check-shell
- ci-check-java-sdk
- ci-check-python-sdk
+ - ci-check-node-sdk
if: always()
steps:
- name: Everything is fine
diff --git a/.github/workflows/publish_node_sdk.yml
b/.github/workflows/publish_node_sdk.yml
new file mode 100644
index 00000000..5a917139
--- /dev/null
+++ b/.github/workflows/publish_node_sdk.yml
@@ -0,0 +1,129 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: publish_node_sdk
+on:
+ push:
+ tags:
+ - 'node-sdk-*'
+
+env:
+ GITHUB_TOKEN: ${{ github.token }}
+
+jobs:
+ validate:
+ if: startsWith(github.ref, 'refs/tags/node-sdk-')
+ runs-on: ubuntu-latest
+ steps:
+ - name: Extract tag name
+ id: extract
+ run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
+
+ - name: Validate tag format
+ run: |
+ TAG=${TAG}
+ if [[ ! "$TAG" =~
^node-sdk-([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$ ]]; then
+ echo "Tag $TAG does not match strict semver format (node-sdk-X.Y.Z
where 0 <= X,Y,Z <= 999)"
+ exit 1
+ fi
+ echo "Valid tag: $TAG"
+
+ tag:
+ needs: validate
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Extract tag name
+ id: extract_tag
+ run: |
+ tag=${GITHUB_REF#refs/tags/}
+ echo "tag_name=$tag" >> "$GITHUB_OUTPUT"
+ echo "::notice ::Tag that triggered the workflow: $tag"
+
+ - name: Extract node sdk version from package.json
+ id: extract_version
+ run: |
+ version=`grep -n '"version": ' package.json | sed -E 's/^.*
"([^"]*)",/\1/' | tr -d '\n'`
+ echo "node_sdk_version=$version" >> "$GITHUB_OUTPUT"
+ echo "::notice ::Version node sdk package.json version is $version"
+
+ - name: Check if version from package.json is the same as the tag
+ id: check_git_tag
+ run: |
+ if [[ "node-sdk-${{ steps.extract_version.outputs.node_sdk_version
}}" == "${{ steps.extract_tag.outputs.tag_name }}" ]];
+ then
+ echo "::notice ::Tag ${{ steps.extract_tag.outputs.tag_name }}
matches the version in package.json"
+ echo "tag_matches=true" >> "$GITHUB_OUTPUT"
+ else
+ echo "::warning ::Tag ${{ steps.extract_tag.outputs.tag_name }}
does not matche the version from package.json"
+ echo "tag_matches=false" >> "$GITHUB_OUTPUT"
+ fi
+
+ outputs:
+ node_sdk_version: ${{ steps.extract_tag.outputs.tag_name }}
+ tag_created: ${{ steps.check_git_tag.outputs.tag_matches }}
+
+ publish:
+ name: Publish SDK on npmjs
+ needs: tag
+ if: ${{ needs.tag.outputs.tag_created == 'true' }}
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ # Setup .npmrc file to publish to npm
+ - uses: actions/setup-node@v4
+ with:
+ cache-dependency-path: foreign/node/package-lock.json
+ node-version: 22
+ cache: "npm"
+ registry-url: 'https://registry.npmjs.org'
+ - run: npm ci
+ - run: npm run build
+ - run: npm publish --provenance --access public
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
+
+ # github_release:
+ # uses: ./.github/workflows/release_sdk.yml
+ # needs: tag
+ # if: ${{ needs.tag.outputs.tag_created == 'true' }}
+ # with:
+ # tag_name: "${{ needs.tag.outputs.node_sdk_version }}"
+
+ # finalize_sdk:
+ # runs-on: ubuntu-latest
+ # needs:
+ # - publish
+ # - github_release
+ # if: always()
+ # steps:
+ # - uses: actions/checkout@v4
+ # - name: Everything is fine
+ # if: ${{ !(contains(needs.*.result, 'failure')) }}
+ # run: exit 0
+ # - name: Something went wrong
+ # if: ${{ contains(needs.*.result, 'failure') }}
+ # uses: JasonEtco/create-an-issue@v2
+ # env:
+ # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ # GITHUB_BOT_CONTEXT_STRING: "publish to crates.io"
+ # with:
+ # filename: .github/BOT_ISSUE_TEMPLATE.md
diff --git a/foreign/node/README.md b/foreign/node/README.md
index 2c9161a7..575a387a 100644
--- a/foreign/node/README.md
+++ b/foreign/node/README.md
@@ -4,21 +4,20 @@ iggy node.js client for [iggy-rs](https://iggy.rs/)'s binary
protocol, written i
diclaimer: although all iggy commands & basic client/stream are implemented
this is still a WIP, provided as is, and has still a long way to go to be
considered "battle tested".
-note: This lib started as _iggy-bin_ (
[github](https://github.com/T1B0/iggy-bin) /
[npm](https://www.npmjs.com/package/iggy-bin)) before migrating under iggy-rs
org. package [email protected] is equivalent to @iggy.rs/[email protected]
-
+note: This lib started as _iggy-bin_ (
[github](https://github.com/T1B0/iggy-bin) /
[npm](https://www.npmjs.com/package/iggy-bin)) before migrating under iggy-rs
org. package [email protected] is equivalent to @iggy.rs/[email protected] and migrating
again under apache iggy monorepo (
[github](https://github.com/apache/iggy/tree/master/foreign/node) and is now
published on npmjs as @apache-iggy/node-sdk
note: previous works on node.js http client has been moved to
[iggy-node-http-client](<https://github.com/iggy-rs/iggy-node-http-client)
(moved on 04 July 2024)
## install
```
-$ npm i @iggy.rs/sdk
+$ npm i @apache-iggy/node-sdk
```
## basic usage
```ts
-import { Client } from "@iggy.rs/sdk";
+import { Client } from "@apache-iggy/node-sdk";
const credentials = { username: "iggy", password: "iggy" };
diff --git a/foreign/node/package-lock.json b/foreign/node/package-lock.json
index 0b4f9b33..5e4940b9 100644
--- a/foreign/node/package-lock.json
+++ b/foreign/node/package-lock.json
@@ -1,12 +1,12 @@
{
- "name": "@iggy.rs/sdk",
- "version": "1.0.6",
+ "name": "@apache-iggy/node-sdk",
+ "version": "0.5.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
- "name": "@iggy.rs/sdk",
- "version": "1.0.6",
+ "name": "@apache-iggy/node-sdk",
+ "version": "0.5.0",
"license": "Apache-2.0",
"dependencies": {
"debug": "4.3.7",
@@ -14,8 +14,8 @@
"uuidv7": "1.0.2"
},
"devDependencies": {
- "@commitlint/cli": "^19.6.1",
- "@commitlint/config-conventional": "^19.6.0",
+ "@commitlint/cli": "19.6.1",
+ "@commitlint/config-conventional": "19.6.0",
"@semantic-release/changelog": "6.0.3",
"@semantic-release/exec": "6.0.3",
"@semantic-release/git": "10.0.1",
@@ -23,10 +23,10 @@
"@swc-node/register": "1.10.9",
"@types/debug": "4.1.12",
"@types/node": "22.9.3",
- "husky": "^9.1.7",
+ "husky": "9.1.7",
"semantic-release": "24.2.0",
"typescript": "5.7.2",
- "typescript-eslint": "^8.16.0"
+ "typescript-eslint": "8.16.0"
}
},
"node_modules/@babel/code-frame": {
@@ -820,19 +820,36 @@
}
},
"node_modules/@octokit/endpoint": {
- "version": "10.1.1",
- "resolved":
"https://registry.npmjs.org/@octokit/endpoint/-/endpoint-10.1.1.tgz",
- "integrity":
"sha512-JYjh5rMOwXMJyUpj028cu0Gbp7qe/ihxfJMLc8VZBMMqSwLgOxDI1911gV4Enl1QSavAQNJcwmwBF9M0VvLh6Q==",
+ "version": "10.1.4",
+ "resolved":
"https://registry.npmjs.org/@octokit/endpoint/-/endpoint-10.1.4.tgz",
+ "integrity":
"sha512-OlYOlZIsfEVZm5HCSR8aSg02T2lbUWOsCQoPKfTXJwDzcHQBrVBGdGXb89dv2Kw2ToZaRtudp8O3ZIYoaOjKlA==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@octokit/types": "^13.0.0",
+ "@octokit/types": "^14.0.0",
"universal-user-agent": "^7.0.2"
},
"engines": {
"node": ">= 18"
}
},
+ "node_modules/@octokit/endpoint/node_modules/@octokit/openapi-types": {
+ "version": "25.0.0",
+ "resolved":
"https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-25.0.0.tgz",
+ "integrity":
"sha512-FZvktFu7HfOIJf2BScLKIEYjDsw6RKc7rBJCdvCTfKsVnx2GEB/Nbzjr29DUdb7vQhlzS/j8qDzdditP0OC6aw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@octokit/endpoint/node_modules/@octokit/types": {
+ "version": "14.0.0",
+ "resolved":
"https://registry.npmjs.org/@octokit/types/-/types-14.0.0.tgz",
+ "integrity":
"sha512-VVmZP0lEhbo2O1pdq63gZFiGCKkm8PPp8AUOijlwPO6hojEVjspA0MWKP7E4hbvGxzFKNqKr6p0IYtOH/Wf/zA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@octokit/openapi-types": "^25.0.0"
+ }
+ },
"node_modules/@octokit/graphql": {
"version": "8.1.1",
"resolved":
"https://registry.npmjs.org/@octokit/graphql/-/graphql-8.1.1.tgz",
@@ -849,20 +866,20 @@
}
},
"node_modules/@octokit/openapi-types": {
- "version": "22.2.0",
- "resolved":
"https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.2.0.tgz",
- "integrity":
"sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==",
+ "version": "24.2.0",
+ "resolved":
"https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz",
+ "integrity":
"sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==",
"dev": true,
"license": "MIT"
},
"node_modules/@octokit/plugin-paginate-rest": {
- "version": "11.3.5",
- "resolved":
"https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-11.3.5.tgz",
- "integrity":
"sha512-cgwIRtKrpwhLoBi0CUNuY83DPGRMaWVjqVI/bGKsLJ4PzyWZNaEmhHroI2xlrVXkk6nFv0IsZpOp+ZWSWUS2AQ==",
+ "version": "11.6.0",
+ "resolved":
"https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-11.6.0.tgz",
+ "integrity":
"sha512-n5KPteiF7pWKgBIBJSk8qzoZWcUkza2O6A0za97pMGVrGfPdltxrfmfF5GucHYvHGZD8BdaZmmHGz5cX/3gdpw==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@octokit/types": "^13.6.0"
+ "@octokit/types": "^13.10.0"
},
"engines": {
"node": ">= 18"
@@ -907,15 +924,16 @@
}
},
"node_modules/@octokit/request": {
- "version": "9.1.3",
- "resolved":
"https://registry.npmjs.org/@octokit/request/-/request-9.1.3.tgz",
- "integrity":
"sha512-V+TFhu5fdF3K58rs1pGUJIDH5RZLbZm5BI+MNF+6o/ssFNT4vWlCh/tVpF3NxGtP15HUxTTMUbsG5llAuU2CZA==",
+ "version": "9.2.3",
+ "resolved":
"https://registry.npmjs.org/@octokit/request/-/request-9.2.3.tgz",
+ "integrity":
"sha512-Ma+pZU8PXLOEYzsWf0cn/gY+ME57Wq8f49WTXA8FMHp2Ps9djKw//xYJ1je8Hm0pR2lU9FUGeJRWOtxq6olt4w==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@octokit/endpoint": "^10.0.0",
- "@octokit/request-error": "^6.0.1",
- "@octokit/types": "^13.1.0",
+ "@octokit/endpoint": "^10.1.4",
+ "@octokit/request-error": "^6.1.8",
+ "@octokit/types": "^14.0.0",
+ "fast-content-type-parse": "^2.0.0",
"universal-user-agent": "^7.0.2"
},
"engines": {
@@ -923,26 +941,60 @@
}
},
"node_modules/@octokit/request-error": {
- "version": "6.1.5",
- "resolved":
"https://registry.npmjs.org/@octokit/request-error/-/request-error-6.1.5.tgz",
- "integrity":
"sha512-IlBTfGX8Yn/oFPMwSfvugfncK2EwRLjzbrpifNaMY8o/HTEAFqCA1FZxjD9cWvSKBHgrIhc4CSBIzMxiLsbzFQ==",
+ "version": "6.1.8",
+ "resolved":
"https://registry.npmjs.org/@octokit/request-error/-/request-error-6.1.8.tgz",
+ "integrity":
"sha512-WEi/R0Jmq+IJKydWlKDmryPcmdYSVjL3ekaiEL1L9eo1sUnqMJ+grqmC9cjk7CA7+b2/T397tO5d8YLOH3qYpQ==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@octokit/types": "^13.0.0"
+ "@octokit/types": "^14.0.0"
},
"engines": {
"node": ">= 18"
}
},
+ "node_modules/@octokit/request-error/node_modules/@octokit/openapi-types":
{
+ "version": "25.0.0",
+ "resolved":
"https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-25.0.0.tgz",
+ "integrity":
"sha512-FZvktFu7HfOIJf2BScLKIEYjDsw6RKc7rBJCdvCTfKsVnx2GEB/Nbzjr29DUdb7vQhlzS/j8qDzdditP0OC6aw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@octokit/request-error/node_modules/@octokit/types": {
+ "version": "14.0.0",
+ "resolved":
"https://registry.npmjs.org/@octokit/types/-/types-14.0.0.tgz",
+ "integrity":
"sha512-VVmZP0lEhbo2O1pdq63gZFiGCKkm8PPp8AUOijlwPO6hojEVjspA0MWKP7E4hbvGxzFKNqKr6p0IYtOH/Wf/zA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@octokit/openapi-types": "^25.0.0"
+ }
+ },
+ "node_modules/@octokit/request/node_modules/@octokit/openapi-types": {
+ "version": "25.0.0",
+ "resolved":
"https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-25.0.0.tgz",
+ "integrity":
"sha512-FZvktFu7HfOIJf2BScLKIEYjDsw6RKc7rBJCdvCTfKsVnx2GEB/Nbzjr29DUdb7vQhlzS/j8qDzdditP0OC6aw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@octokit/request/node_modules/@octokit/types": {
+ "version": "14.0.0",
+ "resolved":
"https://registry.npmjs.org/@octokit/types/-/types-14.0.0.tgz",
+ "integrity":
"sha512-VVmZP0lEhbo2O1pdq63gZFiGCKkm8PPp8AUOijlwPO6hojEVjspA0MWKP7E4hbvGxzFKNqKr6p0IYtOH/Wf/zA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@octokit/openapi-types": "^25.0.0"
+ }
+ },
"node_modules/@octokit/types": {
- "version": "13.6.1",
- "resolved":
"https://registry.npmjs.org/@octokit/types/-/types-13.6.1.tgz",
- "integrity":
"sha512-PHZE9Z+kWXb23Ndik8MKPirBPziOc0D2/3KH1P+6jK5nGWe96kadZuE4jev2/Jq7FvIfTlT2Ltg8Fv2x1v0a5g==",
+ "version": "13.10.0",
+ "resolved":
"https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz",
+ "integrity":
"sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@octokit/openapi-types": "^22.2.0"
+ "@octokit/openapi-types": "^24.2.0"
}
},
"node_modules/@oxc-resolver/binding-darwin-arm64": {
@@ -3439,6 +3491,23 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/fast-content-type-parse": {
+ "version": "2.0.1",
+ "resolved":
"https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-2.0.1.tgz",
+ "integrity":
"sha512-nGqtvLrj5w0naR6tDPfB4cUmYCqouzyQiz6C5y/LtcDllJdrcc6WaWW6iXyIIOErTa/XRybj28aasdn4LkVk6Q==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/fastify"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/fastify"
+ }
+ ],
+ "license": "MIT"
+ },
"node_modules/fast-deep-equal": {
"version": "3.1.3",
"resolved":
"https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
diff --git a/foreign/node/package.json b/foreign/node/package.json
index b5f211e4..d1f69a16 100644
--- a/foreign/node/package.json
+++ b/foreign/node/package.json
@@ -1,8 +1,8 @@
{
- "name": "@iggy.rs/sdk",
+ "name": "@apache-iggy/node-sdk",
"type": "module",
- "version": "1.0.6",
- "description": "Official nodejs iggy.rs binary client",
+ "version": "0.5.0",
+ "description": "Official apache iggy nodejs binary client",
"keywords": [
"iggy",
"iggy-rs",
@@ -12,7 +12,7 @@
],
"repository": {
"type": "git",
- "url": "git+https://github.com/iggy-rs/iggy-node-client.git"
+ "url": "git+https://github.com/apache/iggy.git"
},
"publishConfig": {
"access": "public",
diff --git a/foreign/node/src/client/tcp.client.ts
b/foreign/node/src/client/tcp.client.ts
deleted file mode 100644
index 887942ce..00000000
--- a/foreign/node/src/client/tcp.client.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-import { createConnection, type TcpSocketConnectOpts } from 'node:net';
-import type { RawClient } from './client.type.js';
-import { wrapSocket, type CommandResponseStream } from './client.socket.js';
-
-export const createTcpSocket =
- (options: TcpSocketConnectOpts): Promise<CommandResponseStream> => {
- const socket = createConnection(options);
- return wrapSocket(socket);
- };
-
-
-export type TcpOption = TcpSocketConnectOpts;
-
-export const TcpClient = ({ host, port, keepAlive = true }: TcpOption):
Promise<RawClient> =>
- createTcpSocket({ host, port, keepAlive });
diff --git a/foreign/node/src/client/tls.client.ts
b/foreign/node/src/client/tls.client.ts
deleted file mode 100644
index d5c38803..00000000
--- a/foreign/node/src/client/tls.client.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-import { connect, type ConnectionOptions } from 'node:tls';
-import type { RawClient } from './client.type.js';
-import { wrapSocket, type CommandResponseStream } from './client.socket.js';
-
-export const createTlsSocket = (
- port: number, options: ConnectionOptions
-): Promise<CommandResponseStream> => {
- const socket = connect(port, options);
- socket.setEncoding('utf8');
- return wrapSocket(socket);
-}
-
-export type TlsOption = { port: number } & ConnectionOptions;
-
-export const TlsClient = ({ port, ...options }: TlsOption): Promise<RawClient>
=> {
- return createTlsSocket(port, options);
-};
diff --git a/foreign/node/src/wire/message/send-messages.command.test.ts
b/foreign/node/src/wire/message/send-messages.command.test.ts
index a0cd676d..36419694 100644
--- a/foreign/node/src/wire/message/send-messages.command.test.ts
+++ b/foreign/node/src/wire/message/send-messages.command.test.ts
@@ -44,7 +44,7 @@ describe('SendMessages', () => {
it('serialize SendMessages into a buffer', () => {
assert.deepEqual(
SEND_MESSAGES.serialize(t1).length,
- 6 + 6 + 2 + 25 * 5
+ 387
);
});