Skip to content

Commit f72afbd

Browse files
authored
Merge pull request #53 from windingtree/beta
Bump
2 parents f0b0074 + 6df7b70 commit f72afbd

File tree

390 files changed

+30388
-37273
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

390 files changed

+30388
-37273
lines changed

.editorconfig

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# EditorConfig is awesome: https://EditorConfig.org
2-
31
root = true
42

53
[*]
4+
charset = utf-8
65
end_of_line = lf
6+
indent_style = space
7+
indent_size = 2
78
trim_trailing_whitespace = true
89
insert_final_newline = true
9-
indent_style = space
10-
indent_size = 2
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.env.example

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# LOCAL_NODE=true
2+
EXAMPLE_ENTITY_SIGNER_MNEMONIC=
3+
# EXAMPLE_ENTITY_SIGNER_PK=
4+
EXAMPLE_ENTITY_ID=
5+
EXAMPLE_ENTITY_OWNER_ADDRESS=

.eslintrc

-14
This file was deleted.

.eslintrc.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"extends": [
4+
"eslint:recommended",
5+
"plugin:@typescript-eslint/recommended",
6+
"plugin:@typescript-eslint/recommended-type-checked",
7+
"plugin:prettier/recommended"
8+
],
9+
"plugins": ["@typescript-eslint"],
10+
"parserOptions": {
11+
"ecmaVersion": 2022,
12+
"sourceType": "module",
13+
"project": ["./tsconfig.json"]
14+
},
15+
"rules": {},
16+
"root": true,
17+
"overrides": [
18+
{
19+
"files": ["*.js"],
20+
"extends": ["plugin:@typescript-eslint/disable-type-checked"]
21+
}
22+
]
23+
}

.github/ISSUE_TEMPLATE/bug_report.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'triage needed'
6+
assignees: ''
7+
---
8+
9+
**⚠️ CAUTION: Any issue related to trading / price / not related with the code directly within this repository will be closed without comment**
10+
11+
**🆘 SECURITY: Any bug related to smart contract security should be addressed to [email protected]**
12+
13+
**Describe the bug**
14+
A clear and concise description of what the bug is.
15+
16+
**To Reproduce**
17+
Steps to reproduce the behavior:
18+
19+
1. Go to '...'
20+
2. Click on '....'
21+
3. Scroll down to '....'
22+
4. See error
23+
24+
**Expected behavior**
25+
A clear and concise description of what you expected to happen.
26+
27+
**Screenshots**
28+
If applicable, add screenshots to help explain your problem.
29+
30+
**Desktop (please complete the following information):**
31+
32+
- OS: [e.g. iOS]
33+
- Browser [e.g. chrome, safari]
34+
- Version [e.g. 22]
35+
36+
**Smartphone (please complete the following information):**
37+
38+
- Device: [e.g. iPhone6]
39+
- OS: [e.g. iOS8.1]
40+
- Browser [e.g. stock browser, safari]
41+
- Version [e.g. 22]
42+
43+
**Additional context**
44+
Add any other context about the problem here.
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: 'triage needed'
6+
assignees: ''
7+
---
8+
9+
**⚠️ CAUTION: Any issue related to trading / price / not related with the code directly within this repository will be closed without comment**
10+
11+
**🆘 SECURITY: Any bug related to smart contract security should be addressed to [email protected]**
12+
13+
**Is your feature request related to a problem? Please describe.**
14+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
15+
16+
**Describe the solution you'd like**
17+
A clear and concise description of what you want to happen.
18+
19+
**Describe alternatives you've considered**
20+
A clear and concise description of any alternative solutions or features you've considered.
21+
22+
**Additional context**
23+
Add any other context or screenshots about the feature request here.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "Install dependencies"
2+
description: "Prepare repository and all dependencies"
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Set up pnpm
8+
uses: pnpm/action-setup@v2
9+
with:
10+
version: latest
11+
12+
- name: Set up node
13+
uses: actions/setup-node@v3
14+
with:
15+
cache: pnpm
16+
node-version: "lts/*"
17+
18+
- name: Install dependencies
19+
shell: bash
20+
run: pnpm install --frozen-lockfile --ignore-scripts
21+
22+
- name: Build packages
23+
shell: bash
24+
run: pnpm build:ci

.github/workflows/release.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- beta
7+
jobs:
8+
release:
9+
name: Release
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
token: ${{ secrets.PAT }}
17+
- name: Install dependencies
18+
uses: ./.github/actions/install-dependencies
19+
- name: Lint
20+
run: pnpm lint
21+
- name: Test
22+
run: pnpm test
23+
- name: Import GPG key
24+
uses: crazy-max/ghaction-import-gpg@v5
25+
with:
26+
gpg_private_key: ${{secrets.GPG_PRIVATE_KEY}}
27+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
28+
- name: Setup Git user and use GPG for commit signing
29+
run: |
30+
git config --global user.name 'github-actions[bot]'
31+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
32+
git remote set-url origin https://x-access-token:${{ secrets.PAT }}@github.com/$GITHUB_REPOSITORY
33+
git config --global commit.gpgSign true
34+
git config --global user.signingKey $(gpg --list-secret-keys --keyid-format LONG --with-colons | grep sec | head -n 1 | cut -d ':' -f 5)
35+
echo "@windingtree:https://registry.npmjs.org/" > .npmrc
36+
echo "registry=https://registry.npmjs.org/" >> .npmrc
37+
echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> .npmrc
38+
- name: Version Packages
39+
run: |
40+
if [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
41+
pnpm lerna version --concurrency 1 --allow-branch master --create-release github
42+
elif [[ "${{ github.ref }}" == "refs/heads/beta" ]]; then
43+
pnpm lerna version --concurrency 1 --conventional-prerelease --preid beta --allow-branch beta
44+
fi
45+
env:
46+
GH_TOKEN: ${{ secrets.PAT }}
47+
- name: Publish to npm
48+
run: pnpm lerna publish from-package
49+
env:
50+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Test
2+
on:
3+
push:
4+
branches:
5+
- develop
6+
pull_request:
7+
branches:
8+
- develop
9+
workflow_dispatch:
10+
jobs:
11+
test:
12+
name: Test
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
- name: Install dependencies
20+
uses: ./.github/actions/install-dependencies
21+
- name: Lint
22+
run: pnpm lint
23+
- name: Test
24+
run: pnpm test

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.yarn
12
.env
23
.env*
34
!.env.example
@@ -10,3 +11,8 @@ lib
1011
temp
1112
*.level
1213
coverage
14+
typedoc
15+
typechain
16+
17+
#ide
18+
.idea

.husky/commit-msg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
npx --no-install commitlint --edit ""
4+
npx --no-install commitlint --edit "$1"

.husky/pre-commit

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npx lint-staged
4+
pnpm lint:fix
5+
pnpm test

.eslintignore renamed to .lintignore

+2
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ dist
55
lib
66
coverage
77
typedoc
8+
temp
9+
OLD_CODEBASE

.lintstagedrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"*.{ts,js}": ["prettier --write", "eslint --cache --fix"],
2+
"*.{ts,js}": ["prettier --write --ignore-unknown", "eslint --fix"],
33
"*.md": ["prettier --write"]
44
}

.mocharc.json

-4
This file was deleted.

.prettierignore

-6
This file was deleted.

.prettierrc renamed to .prettierrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"semi": true,
33
"trailingComma": "all",
44
"singleQuote": true,
5-
"printWidth": 100,
5+
"printWidth": 80,
66
"tabWidth": 2
77
}

README.md

+16-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[![@windingtree/sdk](https://img.shields.io/npm/v/@windingtree/sdk)](https://www.npmjs.com/package/@windingtree/sdk)
2+
[![Beta Release](https://github.com/windingtree/sdk/actions/workflows/release.yml/badge.svg?branch=beta)](https://github.com/windingtree/sdk/actions/workflows/release.yml)
3+
14
# @windingtree/sdk
25

36
The WindingTree market protocol SDK
@@ -6,23 +9,31 @@ The WindingTree market protocol SDK
69
710
## Setup
811

12+
> This repository uses [`pnpm` package manager](https://pnpm.io/installation).
13+
914
```bash
10-
yarn
15+
pnpm install
16+
pnpm build
1117
```
1218

1319
## Testing
1420

1521
```bash
16-
yarn test
22+
pnpm test
1723
```
1824

19-
## Tests coverage
25+
After finishing of tests code coverage script, you can find reports in `./coverage/index.html`
26+
27+
## Examples
2028

2129
```bash
22-
yarn coverage
30+
pnpm example:server
31+
pnpm example:node
32+
pnpm example:client
33+
# pnpm example:manager
2334
```
2435

25-
After finishing of tests code coverage script, you can find reports in `./coverage/index.html`
36+
> When started the protocol client web-app example will be available on http://localhost:5173 and the node manager app on http://localhost:5174
2637
2738
## Contributing
2839

File renamed without changes.

docs/docs/availability.md renamed to docs/availability.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# Availability management
1+
# Availability Management
22

3-
Supplier's services availability management is not a part of the protocol but the information from such systems is the foundation of offers generation. Every offer should represent the availability of service to the buyer.
3+
> **Note**: This functionality is not implemented yet. Use these guidelines to review potential future features.
44
5-
Here is the list of common use cases of availability management systems that can be implemented in the frame of the protocol:
5+
Supplier's services availability management is not a part of the protocol, but the information from such systems is the foundation of offer generation. Every offer should represent the availability of a service to the buyer.
66

7-
- availability lookup. Allows to search for available services.
8-
- temporary locking. Allows to lock available service for prevention of double booking.
9-
- booking/selling. Allows to book or sell the service and make it unavailable according to the supplier use case logic.
10-
- change. Allows to change booked service.
11-
- canceling. Allows to cancel already booked service.
7+
The following are common use cases of availability management systems that can be implemented within the protocol:
128

13-
The protocol supplier node instances have tools that automate access and communication with external availability management systems. To support earlier mentioned use cases the node configuration has special options to define callback functions.
9+
- **Availability Lookup**: Allows searching for available services.
10+
- **Temporary Locking**: Allows locking an available service to prevent double booking.
11+
- **Booking/Selling**: Allows booking or selling the service and making it unavailable according to the supplier's use case logic.
12+
- **Change**: Allows changing a booked service.
13+
- **Canceling**: Allows canceling an already booked service.
1414

15-
> This API is experimental and may be changed
15+
The protocol's supplier node instances have tools that automate access and communication with external availability management systems. To support the aforementioned use cases, the node configuration has special options to define callback functions.
1616

1717
```typescript
1818
import { GenericQuery, GenericAvailabilityResponse, GenericAvailabilityLockQuery, GenericAvailabilityBookQuery, GenericAvailabilityCancelQuery, NodeOptions, createNode } from '@windingtree/sdk';
@@ -31,7 +31,7 @@ interface AvailabilityManagerOptions {
3131
api: AvailabilityManagerApiOptions;
3232
}
3333

34-
// You set of custom callbacks
34+
// Your set of custom callbacks
3535
const lookup = async (query: RequestQuery): Promise<AvailabilityResponse> => {/**/};
3636
const lock = async (query: LockQuery): Promise<boolean> => {/**/};
3737
const unlock = async (query: LockQuery): Promise<boolean> => {/**/};
@@ -57,4 +57,4 @@ const options: NodeOptions = {
5757
const node = createNode(options);
5858
```
5959
60-
Once the properly configured node is started registered API functions become available under the `node.availabilityManager`.
60+
Once the properly configured node is started, the registered API functions become available under `node.availabilityManager`. These API functions can then be used to manage the availability of services and support various availability-related use cases within the WindingTree market protocol.

0 commit comments

Comments
 (0)