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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ jobs:
run: npm ci
- name: Compile files
run: npm run build
- name: Test
run: npm test
- name: Run tests
run: npm run test

2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,7 @@ jobs:
run: npm version ${{ github.ref_name }} --git-tag-version=false
- name: Compile files
run: npm run build
- name: Run tests
run: npm run test
- name: Publish package
run: npm publish
6 changes: 3 additions & 3 deletions ts/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
See examples to use the sdk here: [/examples](https://github.com/code0-tech/hercules/tree/main/ts/examples)
See examples to use the sdk here: [/examples](https://github.com/code0-tech/hercules/tree/main/examples)

To run a simple example use:

```bash
cd ts
cd examples/simple-examples-ts
npm install
npx tsx examples/simple_example.ts
npm run dev
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import {createSdk, HerculesActionProjectConfiguration, RuntimeErrorException} from "../src";
import {HerculesFunctionContext} from "../src";
import {constructValue} from "@code0-tech/tucana/helpers";
import {
createSdk,
HerculesActionProjectConfiguration,
HerculesFunctionContext,
RuntimeErrorException
} from "@code0-tech/hercules";

const sdk = createSdk({
authToken: "someToken",
Expand Down Expand Up @@ -64,7 +67,7 @@ connectToSdk();
function connectToSdk() {
sdk.connect().then((configs: HerculesActionProjectConfiguration[]) => {
console.log("SDK connected successfully");
sdk.dispatchEvent("test_flow", configs[0].projectId, constructValue("Hello, World! Configs loaded: " + configs.length)).then(() => {
sdk.dispatchEvent("test_flow", configs[0].projectId, "Hello, World! Configs loaded: " + configs.length).then(() => {
console.log("Event dispatched successfully");
})
}).catch((_error) => {
Expand Down
Loading