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
64 changes: 64 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Publish to npm

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org/'

- name: Install Yarn
run: npm install -g yarn

- name: Install dependencies
run: yarn install

- name: Lint code
run: yarn lint:check

- name: Run tests
run: yarn test

- name: Update package.json version
id: version
run: |
# Extract the version from the release tag
TAG_VERSION=${GITHUB_REF#refs/tags/}
VERSION=${TAG_VERSION#v} # Remove 'v' prefix if present

# Update package.json version
yarn version --new-version $VERSION --no-git-tag-version

# Output the version for later steps
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV
env:
GITHUB_REF: ${{ github.ref }}

- name: Commit updated package.json
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add package.json yarn.lock
git commit -m "chore: update package.json to version $PACKAGE_VERSION" || echo "No changes to commit"
git push origin ${{ github.ref }} || echo "Nothing to push"

# 8. Build the project
- name: Build project
run: yarn build

# 9. Publish to npm
- name: Publish to npm
run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,44 @@
# basyx-typescript-sdk

BaSyx TypeScript SDK for developing applications and components for the Asset Administration Shell (AAS)

## Features

Clients for the AAS API components:
- AAS Repository
- Submodel Repository (coming soon)
- Concept Description Repository (coming soon)
- AAS Registry (coming soon)
- Submodel Registry (coming soon)
- AAS Discovery Service (coming soon)
- AASX File Service (coming soon)

Utility functions for working with AAS data:
- Coming soon

## Installation

```bash
npm install basyx-typescript-sdk
```

## Usage

```typescript
import { AasRepositoryClient } from 'basyx-typescript-sdk';

async function getAllShells() {
const baseURL = 'http://localhost:8081';
const client = new AasRepositoryClient();

try {
const response = await client.getAllAssetAdministrationShells(baseURL);
console.log('Asset Administration Shells fetched successfully:', response);
// You can now use the response as needed
} catch (error) {
console.error('Error fetching Asset Administration Shells:', error);
}
}

getAllShells();
```
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
{
"name": "basyx-typescript-sdk",
"version": "0.0.1",
"version": "0.1.0",
"description": "BaSyx TypeScript SDK for developing applications and components for the Asset Administration Shell (AAS)",
"main": "index.ts",
"main": "dist/index.js",
"repository": "https://github.com/eclipse-basyx/basyx-typescript-sdk.git",
"author": "Aaron Zielstorff <aaron.zielstorff@iese.fraunhofer.de>",
"license": "MIT",
"files": [
"dist",
"src",
"README.md",
"LICENSE"
],
"scripts": {
"gen:aasrepository": "openapi-ts -c @hey-api/client-fetch -i ./openapi/Plattform_i40-AssetAdministrationShellRepositoryServiceSpecification-V3.0.3_SSP-001-resolved.json -o ./src/generated/aas-repository",
"build": "tsc",
Expand Down
107 changes: 0 additions & 107 deletions src/PoweredByBaSyx.svg

This file was deleted.

78 changes: 0 additions & 78 deletions src/testFunctions.ts

This file was deleted.

Loading