Skip to content

Commit

Permalink
Merge pull request #722 from luomus/trait-db-186748322
Browse files Browse the repository at this point in the history
Trait-db v0
  • Loading branch information
Blodir authored Feb 4, 2025
2 parents 06c5a1c + ef2496e commit 575bae1
Show file tree
Hide file tree
Showing 68 changed files with 18,531 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module.exports = {
"root": true,
"ignorePatterns": [
"projects/laji/src/test.ts"
"projects/laji/src/test.ts",
"projects/laji-api-client-b/generated/*"
],
"overrides": [
{
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ settings.json
/projects/kerttu-global/generate-spectrograms/input*
/projects/kerttu-global/generate-spectrograms/output*

projects/laji-api-client-b/node_modules

# Don't include script with this repo!
**/*.sh

Expand Down
33 changes: 33 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -1553,6 +1553,39 @@
}
}
}
},
"laji-api-client-b": {
"projectType": "library",
"root": "projects/laji-api-client-b",
"sourceRoot": "projects/laji-api-client-b/src",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"project": "projects/laji-api-client-b/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/laji-api-client-b/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "projects/laji-api-client-b/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"tsConfig": "projects/laji-api-client-b/tsconfig.spec.json",
"polyfills": [
"zone.js",
"zone.js/testing"
]
}
}
}
}
},
"schematics": {
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions projects/laji-api-client-b/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Updating api type definitions:

```
npm i
// update types based on the new API openapi schema
npm run updateNew
```

Usage:
```typescript
export class ExampleComponent {
constructor(private lajiApiClientService: LajiApiClientBService) {}
function f() {
const a$ = this.lajiApiClientService.fetch('/collections', 'get', { query: { page: 1 } });
}
}
```

Queries are cached by default based on the path and the query params. Whenever a new non-get request is sent to the same path, the cache is flushed automatically.
Loading

0 comments on commit 575bae1

Please sign in to comment.