Skip to content

Commit

Permalink
feat(model-ad): add OpenAPI description and API client for Angular (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaffter authored Jun 17, 2024
1 parent dffe2f1 commit 2f90fd8
Show file tree
Hide file tree
Showing 61 changed files with 1,750 additions and 1 deletion.
4 changes: 4 additions & 0 deletions libs/model-ad/api-client-angular/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": ["../../../.eslintrc.json"],
"ignorePatterns": ["src/**/*.ts"]
}
23 changes: 23 additions & 0 deletions libs/model-ad/api-client-angular/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* eslint-disable */
export default {
displayName: 'model-ad-api-client-angular',
preset: '../../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {},
coverageDirectory: '../../../coverage/libs/model-ad/api-client-angular',
transform: {
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
};
7 changes: 7 additions & 0 deletions libs/model-ad/api-client-angular/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../../dist/libs/model-ad/api-client-angular",
"lib": {
"entryFile": "src/index.ts"
}
}
19 changes: 19 additions & 0 deletions libs/model-ad/api-client-angular/openapitools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "../../../node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "6.1.0",
"generators": {
"api-client-angular": {
"config": "templates/config.yaml",
"generatorName": "typescript-angular",
"inputSpec": "#{cwd}/../api-description/build/openapi.yaml",
"output": "#{cwd}/src/lib/",
"templateDir": "templates",
"additionalProperties": {
"ngVersion": "14.2.11"
}
}
}
}
}
11 changes: 11 additions & 0 deletions libs/model-ad/api-client-angular/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@sagebionetworks/model-ad-api-client-angular",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^13.2.0",
"@angular/core": "^13.2.0"
},
"dependencies": {
"tslib": "2.4.1"
}
}
62 changes: 62 additions & 0 deletions libs/model-ad/api-client-angular/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"name": "model-ad-api-client-angular",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/model-ad/api-client-angular/src",
"projectType": "library",
"prefix": "model-ad",
"targets": {
"build": {
"executor": "@nx/angular:ng-packagr-lite",
"outputs": [
"{workspaceRoot}/dist/libs/model-ad/api-client-angular"
],
"options": {
"project": "libs/model-ad/api-client-angular/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "libs/model-ad/api-client-angular/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "libs/model-ad/api-client-angular/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"executor": "@nx/jest:jest",
"outputs": [
"{workspaceRoot}/coverage/libs/model-ad/api-client-angular"
],
"options": {
"jestConfig": "libs/model-ad/api-client-angular/jest.config.ts"
}
},
"lint-fix": {
"executor": "@nx/eslint:lint",
"options": {
"fix": true
}
},
"generate": {
"executor": "nx:run-commands",
"options": {
"commands": [
"rm -fr src/lib/*",
"openapi-generator-cli generate"
],
"cwd": "{projectRoot}",
"parallel": false
},
"dependsOn": [
"^build"
]
}
},
"tags": [
"language:typescript"
],
"implicitDependencies": [
"model-ad-api-description"
]
}
1 change: 1 addition & 0 deletions libs/model-ad/api-client-angular/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib';
4 changes: 4 additions & 0 deletions libs/model-ad/api-client-angular/src/lib/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
wwwroot/*.js
node_modules
typings
dist
23 changes: 23 additions & 0 deletions libs/model-ad/api-client-angular/src/lib/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
18 changes: 18 additions & 0 deletions libs/model-ad/api-client-angular/src/lib/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.gitignore
.openapi-generator-ignore
README.md
api.module.ts
api/api.ts
api/gene.service.ts
configuration.ts
encoder.ts
git_push.sh
index.ts
model/basicError.ts
model/gene.ts
model/genesPage.ts
model/genesPageAllOf.ts
model/models.ts
model/pageMetadata.ts
param.ts
variables.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.1.0
Loading

0 comments on commit 2f90fd8

Please sign in to comment.