Skip to content
Open
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
54 changes: 42 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ jobs:
name: build
path: dist

test:
name: Test
generate:
name: Generate SDK
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
target: [node, node.rx, browser, browser.rx]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -49,16 +53,23 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Run tests
run: npm run test
- name: Download dist files
uses: actions/download-artifact@v4
with:
name: build
path: dist

generate:
name: Generate SDK
- name: Generate SDK
run: |
chmod +x ./bin/cli.js
./bin/cli.js test/openapi.json --target ${{ matrix.target }}
./bin/cli.js test/openapi_v2.json --target ${{ matrix.target }}
./bin/cli.js test/openapi_v3.json --target ${{ matrix.target }}

test:
name: Test
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
target: [node, node.rx, browser, browser.rx]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -77,11 +88,30 @@ jobs:
name: build
path: dist

- name: Generate SDK
- name: Run generator tests
run: npm run test:generator

- name: Generate SDK for tests with former query syntax
run: |
chmod +x ./bin/cli.js
./bin/cli.js test/openapi.json --target ${{ matrix.target }}
./bin/cli.js test/openapi_v2.json --target ${{ matrix.target }}
./bin/cli.js test/openapi_v3.json --target browser

- name: Run type-check (former-queries)
run: npm run type-check:former-queries

- name: Run tests (former-queries)
run: npm run test:former-queries

- name: Generate SDK for tests with query language
run: |
chmod +x ./bin/cli.js
./bin/cli.js test/openapi_v3.json --target browser --use-query-language

- name: Run type-check (query-language)
run: npm run type-check:query-language

- name: Run tests (query-language)
run: npm run test:query-language

publish:
name: Publish release version
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,14 +349,22 @@ wServices['article'].some({
where: {
AND: [
{
OR: [{ name: { LIKE: '%test%', lower: true } }, { articleNumber: { LIKE: '%345%' } }]
OR: [{ name: { LIKE: '%test%', LOWER: true } }, { articleNumber: { LIKE: '%345%' } }]
},
{ batchNumberRequired: { EQ: true } }
]
}
});
```

Some API operations like the arithmetic ones are not supported as type, due to their complexity. In this case a raw filter expression can be passed as string to `where`

```ts
wServices['article'].some({
where: '(articleLength * articleWidth * articleHeight) <= 3000'
});
```

"where" parameters are ANDed with other filter parameters.

It is also possible to set an empty list within an IN-query:
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import tsEslint from 'typescript-eslint';
export default tsEslint.config(
{
name: 'app/files-to-ignore',
ignores: ['**/*.d.ts', '**/.*', '**/dist', '**/sdk', '**/node_modules']
ignores: ['**/*.d.ts', '**/.*', '**/dist', '**/sdk', '**/node_modules', 'test/**']
},
{
extends: [...tsEslint.configs.recommendedTypeChecked],
Expand Down
Loading
Loading