From 60fe4586a13c9312235ea18ad474ffaa7afa27ec Mon Sep 17 00:00:00 2001 From: Florian Eisenmenger Date: Thu, 14 Dec 2023 16:38:32 +0100 Subject: [PATCH] api --- matsen-tool/src/app/core/api/v1/.gitignore | 4 + .../app/core/api/v1/.openapi-generator-ignore | 23 + .../app/core/api/v1/.openapi-generator/FILES | 30 ++ .../core/api/v1/.openapi-generator/VERSION | 1 + matsen-tool/src/app/core/api/v1/README.md | 226 +++++++++ matsen-tool/src/app/core/api/v1/api.module.ts | 30 ++ matsen-tool/src/app/core/api/v1/api/api.ts | 5 + .../src/app/core/api/v1/api/post.service.ts | 439 ++++++++++++++++++ .../src/app/core/api/v1/api/user.service.ts | 381 +++++++++++++++ .../src/app/core/api/v1/configuration.ts | 166 +++++++ matsen-tool/src/app/core/api/v1/encoder.ts | 20 + matsen-tool/src/app/core/api/v1/git_push.sh | 57 +++ matsen-tool/src/app/core/api/v1/index.ts | 6 + .../model/apiPostsGetCollection200Response.ts | 23 + .../apiPostsGetCollection200Response1.ts | 22 + .../apiPostsGetCollection200Response1Links.ts | 22 + ...PostsGetCollection200Response1LinksSelf.ts | 17 + ...ostsGetCollection200ResponseHydraSearch.ts | 21 + ...200ResponseHydraSearchHydraMappingInner.ts | 20 + ...iPostsGetCollection200ResponseHydraView.ts | 22 + .../model/apiUsersGetCollection200Response.ts | 23 + .../apiUsersGetCollection200Response1.ts | 22 + .../src/app/core/api/v1/model/models.ts | 16 + matsen-tool/src/app/core/api/v1/model/post.ts | 22 + .../src/app/core/api/v1/model/postJsonhal.ts | 24 + .../app/core/api/v1/model/postJsonhalLinks.ts | 18 + .../src/app/core/api/v1/model/postJsonld.ts | 25 + matsen-tool/src/app/core/api/v1/model/user.ts | 29 ++ .../src/app/core/api/v1/model/userJsonhal.ts | 31 ++ .../src/app/core/api/v1/model/userJsonld.ts | 32 ++ matsen-tool/src/app/core/api/v1/param.ts | 69 +++ matsen-tool/src/app/core/api/v1/variables.ts | 9 + 32 files changed, 1855 insertions(+) create mode 100644 matsen-tool/src/app/core/api/v1/.gitignore create mode 100644 matsen-tool/src/app/core/api/v1/.openapi-generator-ignore create mode 100644 matsen-tool/src/app/core/api/v1/.openapi-generator/FILES create mode 100644 matsen-tool/src/app/core/api/v1/.openapi-generator/VERSION create mode 100644 matsen-tool/src/app/core/api/v1/README.md create mode 100644 matsen-tool/src/app/core/api/v1/api.module.ts create mode 100644 matsen-tool/src/app/core/api/v1/api/api.ts create mode 100644 matsen-tool/src/app/core/api/v1/api/post.service.ts create mode 100644 matsen-tool/src/app/core/api/v1/api/user.service.ts create mode 100644 matsen-tool/src/app/core/api/v1/configuration.ts create mode 100644 matsen-tool/src/app/core/api/v1/encoder.ts create mode 100644 matsen-tool/src/app/core/api/v1/git_push.sh create mode 100644 matsen-tool/src/app/core/api/v1/index.ts create mode 100644 matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200Response.ts create mode 100644 matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200Response1.ts create mode 100644 matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200Response1Links.ts create mode 100644 matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200Response1LinksSelf.ts create mode 100644 matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200ResponseHydraSearch.ts create mode 100644 matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200ResponseHydraSearchHydraMappingInner.ts create mode 100644 matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200ResponseHydraView.ts create mode 100644 matsen-tool/src/app/core/api/v1/model/apiUsersGetCollection200Response.ts create mode 100644 matsen-tool/src/app/core/api/v1/model/apiUsersGetCollection200Response1.ts create mode 100644 matsen-tool/src/app/core/api/v1/model/models.ts create mode 100644 matsen-tool/src/app/core/api/v1/model/post.ts create mode 100644 matsen-tool/src/app/core/api/v1/model/postJsonhal.ts create mode 100644 matsen-tool/src/app/core/api/v1/model/postJsonhalLinks.ts create mode 100644 matsen-tool/src/app/core/api/v1/model/postJsonld.ts create mode 100644 matsen-tool/src/app/core/api/v1/model/user.ts create mode 100644 matsen-tool/src/app/core/api/v1/model/userJsonhal.ts create mode 100644 matsen-tool/src/app/core/api/v1/model/userJsonld.ts create mode 100644 matsen-tool/src/app/core/api/v1/param.ts create mode 100644 matsen-tool/src/app/core/api/v1/variables.ts diff --git a/matsen-tool/src/app/core/api/v1/.gitignore b/matsen-tool/src/app/core/api/v1/.gitignore new file mode 100644 index 0000000..149b576 --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/matsen-tool/src/app/core/api/v1/.openapi-generator-ignore b/matsen-tool/src/app/core/api/v1/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/.openapi-generator-ignore @@ -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 diff --git a/matsen-tool/src/app/core/api/v1/.openapi-generator/FILES b/matsen-tool/src/app/core/api/v1/.openapi-generator/FILES new file mode 100644 index 0000000..ac05bba --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/.openapi-generator/FILES @@ -0,0 +1,30 @@ +.gitignore +.openapi-generator-ignore +README.md +api.module.ts +api/api.ts +api/post.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/apiPostsGetCollection200Response.ts +model/apiPostsGetCollection200Response1.ts +model/apiPostsGetCollection200Response1Links.ts +model/apiPostsGetCollection200Response1LinksSelf.ts +model/apiPostsGetCollection200ResponseHydraSearch.ts +model/apiPostsGetCollection200ResponseHydraSearchHydraMappingInner.ts +model/apiPostsGetCollection200ResponseHydraView.ts +model/apiUsersGetCollection200Response.ts +model/apiUsersGetCollection200Response1.ts +model/models.ts +model/post.ts +model/postJsonhal.ts +model/postJsonhalLinks.ts +model/postJsonld.ts +model/user.ts +model/userJsonhal.ts +model/userJsonld.ts +param.ts +variables.ts diff --git a/matsen-tool/src/app/core/api/v1/.openapi-generator/VERSION b/matsen-tool/src/app/core/api/v1/.openapi-generator/VERSION new file mode 100644 index 0000000..3769235 --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/matsen-tool/src/app/core/api/v1/README.md b/matsen-tool/src/app/core/api/v1/README.md new file mode 100644 index 0000000..de16f95 --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/README.md @@ -0,0 +1,226 @@ +## @ + +### Building + +To install the required dependencies and to build the typescript sources run: +``` +npm install +npm run build +``` + +### publishing + +First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!) + +### consuming + +Navigate to the folder of your consuming project and run one of next commands. + +_published:_ + +``` +npm install @ --save +``` + +_without publishing (not recommended):_ + +``` +npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save +``` + +_It's important to take the tgz file, otherwise you'll get trouble with links on windows_ + +_using `npm link`:_ + +In PATH_TO_GENERATED_PACKAGE/dist: +``` +npm link +``` + +In your project: +``` +npm link +``` + +__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround. +Published packages are not effected by this issue. + + +#### General usage + +In your Angular project: + + +``` +// without configuring providers +import { ApiModule } from ''; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from ''; + +export function apiConfigFactory (): Configuration { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@NgModule({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +// configuring providers with an authentication service that manages your access tokens +import { ApiModule, Configuration } from ''; + +@NgModule({ + imports: [ ApiModule ], + declarations: [ AppComponent ], + providers: [ + { + provide: Configuration, + useFactory: (authService: AuthService) => new Configuration( + { + basePath: environment.apiUrl, + accessToken: authService.getAccessToken.bind(authService) + } + ), + deps: [AuthService], + multi: false + } + ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +import { DefaultApi } from ''; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +Note: The ApiModule is restricted to being instantiated once app wide. +This is to ensure that all services are treated as singletons. + +#### Using multiple OpenAPI files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different OpenAPI files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +import { HttpClientModule } from '@angular/common/http'; + +@NgModule({ + imports: [ + ApiModule, + OtherApiModule, + // make sure to import the HttpClientModule in the AppModule only, + // see https://github.com/angular/angular/issues/20575 + HttpClientModule + ] +}) +export class AppModule { + +} +``` + + +### Set service base path +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +``` +import { BASE_PATH } from ''; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` +or + +``` +import { BASE_PATH } from ''; + +@NgModule({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + + +#### Using @angular/cli +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +``` +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' +}; +``` + +In the src/app/app.module.ts: +``` +import { BASE_PATH } from ''; +import { environment } from '../environments/environment'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }], + bootstrap: [ AppComponent ] +}) +export class AppModule { } +``` + +### Customizing path parameter encoding + +Without further customization, only [path-parameters][parameter-locations-url] of [style][style-values-url] 'simple' +and Dates for format 'date-time' are encoded correctly. + +Other styles (e.g. "matrix") are not that easy to encode +and thus are best delegated to other libraries (e.g.: [@honoluluhenk/http-param-expander]). + +To implement your own parameter encoding (or call another library), +pass an arrow-function or method-reference to the `encodeParam` property of the Configuration-object +(see [General Usage](#general-usage) above). + +Example value for use in your Configuration-Provider: +```typescript +new Configuration({ + encodeParam: (param: Param) => myFancyParamEncoder(param), +}) +``` + +[parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations +[style-values-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values +[@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander diff --git a/matsen-tool/src/app/core/api/v1/api.module.ts b/matsen-tool/src/app/core/api/v1/api.module.ts new file mode 100644 index 0000000..58d341f --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/api.module.ts @@ -0,0 +1,30 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); + } + } +} diff --git a/matsen-tool/src/app/core/api/v1/api/api.ts b/matsen-tool/src/app/core/api/v1/api/api.ts new file mode 100644 index 0000000..742e9c7 --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/api/api.ts @@ -0,0 +1,5 @@ +export * from './post.service'; +import { PostService } from './post.service'; +export * from './user.service'; +import { UserService } from './user.service'; +export const APIS = [PostService, UserService]; diff --git a/matsen-tool/src/app/core/api/v1/api/post.service.ts b/matsen-tool/src/app/core/api/v1/api/post.service.ts new file mode 100644 index 0000000..45c660c --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/api/post.service.ts @@ -0,0 +1,439 @@ +/** + * Matsen API Platform + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { ApiPostsGetCollection200Response } from '../model/apiPostsGetCollection200Response'; +// @ts-ignore +import { ApiPostsGetCollection200Response1 } from '../model/apiPostsGetCollection200Response1'; +// @ts-ignore +import { Post } from '../model/post'; +// @ts-ignore +import { PostJsonhal } from '../model/postJsonhal'; +// @ts-ignore +import { PostJsonld } from '../model/postJsonld'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class PostService { + + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (Array.isArray(basePath) && basePath.length > 0) { + basePath = basePath[0]; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Retrieves the collection of Post resources. + * Retrieves the collection of Post resources. + * @param page The collection page number + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public postsGetCollection(page?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable; + public postsGetCollection(page?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public postsGetCollection(page?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public postsGetCollection(page?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (page !== undefined && page !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/ld+json', + 'application/json', + 'text/html', + 'application/hal+json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/posts`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Removes the Post resource. + * Removes the Post resource. + * @param id PostingApi identifier + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public postsIdDelete(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable; + public postsIdDelete(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public postsIdDelete(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable>; + public postsIdDelete(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling postsIdDelete.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/posts/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Retrieves a Post resource. + * Retrieves a Post resource. + * @param id PostingApi identifier + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public postsIdGet(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable; + public postsIdGet(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public postsIdGet(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public postsIdGet(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling postsIdGet.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/ld+json', + 'application/json', + 'text/html', + 'application/hal+json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/posts/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updates the Post resource. + * Updates the Post resource. + * @param id PostingApi identifier + * @param post The updated Post resource + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public postsIdPatch(id: string, post: Post, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable; + public postsIdPatch(id: string, post: Post, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public postsIdPatch(id: string, post: Post, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public postsIdPatch(id: string, post: Post, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling postsIdPatch.'); + } + if (post === null || post === undefined) { + throw new Error('Required parameter post was null or undefined when calling postsIdPatch.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/ld+json', + 'application/json', + 'text/html', + 'application/hal+json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/merge-patch+json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/posts/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('patch', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: post, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates a Post resource. + * Creates a Post resource. + * @param postJsonld The new Post resource + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public postsPost(postJsonld: PostJsonld, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable; + public postsPost(postJsonld: PostJsonld, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public postsPost(postJsonld: PostJsonld, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public postsPost(postJsonld: PostJsonld, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable { + if (postJsonld === null || postJsonld === undefined) { + throw new Error('Required parameter postJsonld was null or undefined when calling postsPost.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/ld+json', + 'application/json', + 'text/html', + 'application/hal+json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/ld+json', + 'application/json', + 'text/html', + 'application/hal+json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/posts`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: postJsonld, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/matsen-tool/src/app/core/api/v1/api/user.service.ts b/matsen-tool/src/app/core/api/v1/api/user.service.ts new file mode 100644 index 0000000..065f399 --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/api/user.service.ts @@ -0,0 +1,381 @@ +/** + * Matsen API Platform + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { ApiUsersGetCollection200Response } from '../model/apiUsersGetCollection200Response'; +// @ts-ignore +import { ApiUsersGetCollection200Response1 } from '../model/apiUsersGetCollection200Response1'; +// @ts-ignore +import { User } from '../model/user'; +// @ts-ignore +import { UserJsonhal } from '../model/userJsonhal'; +// @ts-ignore +import { UserJsonld } from '../model/userJsonld'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + + +@Injectable({ + providedIn: 'root' +}) +export class UserService { + + protected basePath = 'http://localhost'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (Array.isArray(basePath) && basePath.length > 0) { + basePath = basePath[0]; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Retrieves the collection of User resources. + * Retrieves the collection of User resources. + * @param page The collection page number + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public usersGetCollection(page?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable; + public usersGetCollection(page?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public usersGetCollection(page?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public usersGetCollection(page?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (page !== undefined && page !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/ld+json', + 'application/json', + 'text/html', + 'application/hal+json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/users`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Retrieves a User resource. + * Retrieves a User resource. + * @param id UserApi identifier + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public usersIdGet(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable; + public usersIdGet(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public usersIdGet(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public usersIdGet(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling usersIdGet.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/ld+json', + 'application/json', + 'text/html', + 'application/hal+json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/users/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updates the User resource. + * Updates the User resource. + * @param id UserApi identifier + * @param user The updated User resource + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public usersIdPatch(id: string, user: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable; + public usersIdPatch(id: string, user: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public usersIdPatch(id: string, user: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public usersIdPatch(id: string, user: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling usersIdPatch.'); + } + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling usersIdPatch.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/ld+json', + 'application/json', + 'text/html', + 'application/hal+json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/merge-patch+json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/users/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + return this.httpClient.request('patch', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: user, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates a User resource. + * Creates a User resource. + * @param userJsonld The new User resource + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public usersPost(userJsonld: UserJsonld, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable; + public usersPost(userJsonld: UserJsonld, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public usersPost(userJsonld: UserJsonld, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable>; + public usersPost(userJsonld: UserJsonld, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/ld+json' | 'application/json' | 'text/html' | 'application/hal+json', context?: HttpContext}): Observable { + if (userJsonld === null || userJsonld === undefined) { + throw new Error('Required parameter userJsonld was null or undefined when calling usersPost.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/ld+json', + 'application/json', + 'text/html', + 'application/hal+json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/ld+json', + 'application/json', + 'text/html', + 'application/hal+json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/users`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: userJsonld, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/matsen-tool/src/app/core/api/v1/configuration.ts b/matsen-tool/src/app/core/api/v1/configuration.ts new file mode 100644 index 0000000..526b454 --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/configuration.ts @@ -0,0 +1,166 @@ +import { HttpParameterCodec } from '@angular/common/http'; +import { Param } from './param'; + +export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Override the default method for encoding path parameters in various + * styles. + *

+ * See {@link README.md} for more details + *

+ */ + encodeParam?: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; +} + +export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Encoding of various path parameter + * styles. + *

+ * See {@link README.md} for more details + *

+ */ + encodeParam: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + this.encoder = configurationParameters.encoder; + if (configurationParameters.encodeParam) { + this.encodeParam = configurationParameters.encodeParam; + } + else { + this.encodeParam = param => this.defaultEncodeParam(param); + } + if (configurationParameters.credentials) { + this.credentials = configurationParameters.credentials; + } + else { + this.credentials = {}; + } + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } + + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } + + private defaultEncodeParam(param: Param): string { + // This implementation exists as fallback for missing configuration + // and for backwards compatibility to older typescript-angular generator versions. + // It only works for the 'simple' parameter style. + // Date-handling only works for the 'date-time' format. + // All other styles and Date-formats are probably handled incorrectly. + // + // But: if that's all you need (i.e.: the most common use-case): no need for customization! + + const value = param.dataFormat === 'date-time' && param.value instanceof Date + ? (param.value as Date).toISOString() + : param.value; + + return encodeURIComponent(String(value)); + } +} diff --git a/matsen-tool/src/app/core/api/v1/encoder.ts b/matsen-tool/src/app/core/api/v1/encoder.ts new file mode 100644 index 0000000..138c4d5 --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/encoder.ts @@ -0,0 +1,20 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +/** + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ +export class CustomHttpParameterCodec implements HttpParameterCodec { + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } +} diff --git a/matsen-tool/src/app/core/api/v1/git_push.sh b/matsen-tool/src/app/core/api/v1/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/matsen-tool/src/app/core/api/v1/index.ts b/matsen-tool/src/app/core/api/v1/index.ts new file mode 100644 index 0000000..104dd3d --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/index.ts @@ -0,0 +1,6 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; +export * from './param'; diff --git a/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200Response.ts b/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200Response.ts new file mode 100644 index 0000000..38b38de --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200Response.ts @@ -0,0 +1,23 @@ +/** + * Matsen API Platform + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { ApiPostsGetCollection200ResponseHydraSearch } from './apiPostsGetCollection200ResponseHydraSearch'; +import { PostJsonld } from './postJsonld'; +import { ApiPostsGetCollection200ResponseHydraView } from './apiPostsGetCollection200ResponseHydraView'; + + +export interface ApiPostsGetCollection200Response { + hydramember: Array; + hydratotalItems?: number; + hydraview?: ApiPostsGetCollection200ResponseHydraView; + hydrasearch?: ApiPostsGetCollection200ResponseHydraSearch; +} + diff --git a/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200Response1.ts b/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200Response1.ts new file mode 100644 index 0000000..9e6a4f3 --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200Response1.ts @@ -0,0 +1,22 @@ +/** + * Matsen API Platform + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { PostJsonhal } from './postJsonhal'; +import { ApiPostsGetCollection200Response1Links } from './apiPostsGetCollection200Response1Links'; + + +export interface ApiPostsGetCollection200Response1 { + _embedded: Array; + totalItems?: number; + itemsPerPage?: number; + _links: ApiPostsGetCollection200Response1Links; +} + diff --git a/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200Response1Links.ts b/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200Response1Links.ts new file mode 100644 index 0000000..9a537ff --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200Response1Links.ts @@ -0,0 +1,22 @@ +/** + * Matsen API Platform + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { ApiPostsGetCollection200Response1LinksSelf } from './apiPostsGetCollection200Response1LinksSelf'; + + +export interface ApiPostsGetCollection200Response1Links { + self?: ApiPostsGetCollection200Response1LinksSelf; + first?: ApiPostsGetCollection200Response1LinksSelf; + last?: ApiPostsGetCollection200Response1LinksSelf; + next?: ApiPostsGetCollection200Response1LinksSelf; + previous?: ApiPostsGetCollection200Response1LinksSelf; +} + diff --git a/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200Response1LinksSelf.ts b/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200Response1LinksSelf.ts new file mode 100644 index 0000000..c8718e1 --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200Response1LinksSelf.ts @@ -0,0 +1,17 @@ +/** + * Matsen API Platform + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface ApiPostsGetCollection200Response1LinksSelf { + href?: string; +} + diff --git a/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200ResponseHydraSearch.ts b/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200ResponseHydraSearch.ts new file mode 100644 index 0000000..34c0c5c --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200ResponseHydraSearch.ts @@ -0,0 +1,21 @@ +/** + * Matsen API Platform + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { ApiPostsGetCollection200ResponseHydraSearchHydraMappingInner } from './apiPostsGetCollection200ResponseHydraSearchHydraMappingInner'; + + +export interface ApiPostsGetCollection200ResponseHydraSearch { + type?: string; + hydratemplate?: string; + hydravariableRepresentation?: string; + hydramapping?: Array; +} + diff --git a/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200ResponseHydraSearchHydraMappingInner.ts b/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200ResponseHydraSearchHydraMappingInner.ts new file mode 100644 index 0000000..2912064 --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200ResponseHydraSearchHydraMappingInner.ts @@ -0,0 +1,20 @@ +/** + * Matsen API Platform + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface ApiPostsGetCollection200ResponseHydraSearchHydraMappingInner { + type?: string; + variable?: string; + property?: string | null; + required?: boolean; +} + diff --git a/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200ResponseHydraView.ts b/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200ResponseHydraView.ts new file mode 100644 index 0000000..ca44e03 --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200ResponseHydraView.ts @@ -0,0 +1,22 @@ +/** + * Matsen API Platform + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface ApiPostsGetCollection200ResponseHydraView { + id?: string; + type?: string; + hydrafirst?: string; + hydralast?: string; + hydraprevious?: string; + hydranext?: string; +} + diff --git a/matsen-tool/src/app/core/api/v1/model/apiUsersGetCollection200Response.ts b/matsen-tool/src/app/core/api/v1/model/apiUsersGetCollection200Response.ts new file mode 100644 index 0000000..856978d --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/model/apiUsersGetCollection200Response.ts @@ -0,0 +1,23 @@ +/** + * Matsen API Platform + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { ApiPostsGetCollection200ResponseHydraSearch } from './apiPostsGetCollection200ResponseHydraSearch'; +import { UserJsonld } from './userJsonld'; +import { ApiPostsGetCollection200ResponseHydraView } from './apiPostsGetCollection200ResponseHydraView'; + + +export interface ApiUsersGetCollection200Response { + hydramember: Array; + hydratotalItems?: number; + hydraview?: ApiPostsGetCollection200ResponseHydraView; + hydrasearch?: ApiPostsGetCollection200ResponseHydraSearch; +} + diff --git a/matsen-tool/src/app/core/api/v1/model/apiUsersGetCollection200Response1.ts b/matsen-tool/src/app/core/api/v1/model/apiUsersGetCollection200Response1.ts new file mode 100644 index 0000000..15f4c6b --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/model/apiUsersGetCollection200Response1.ts @@ -0,0 +1,22 @@ +/** + * Matsen API Platform + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { UserJsonhal } from './userJsonhal'; +import { ApiPostsGetCollection200Response1Links } from './apiPostsGetCollection200Response1Links'; + + +export interface ApiUsersGetCollection200Response1 { + _embedded: Array; + totalItems?: number; + itemsPerPage?: number; + _links: ApiPostsGetCollection200Response1Links; +} + diff --git a/matsen-tool/src/app/core/api/v1/model/models.ts b/matsen-tool/src/app/core/api/v1/model/models.ts new file mode 100644 index 0000000..2032e60 --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/model/models.ts @@ -0,0 +1,16 @@ +export * from './apiPostsGetCollection200Response'; +export * from './apiPostsGetCollection200Response1'; +export * from './apiPostsGetCollection200Response1Links'; +export * from './apiPostsGetCollection200Response1LinksSelf'; +export * from './apiPostsGetCollection200ResponseHydraSearch'; +export * from './apiPostsGetCollection200ResponseHydraSearchHydraMappingInner'; +export * from './apiPostsGetCollection200ResponseHydraView'; +export * from './apiUsersGetCollection200Response'; +export * from './apiUsersGetCollection200Response1'; +export * from './post'; +export * from './postJsonhal'; +export * from './postJsonhalLinks'; +export * from './postJsonld'; +export * from './user'; +export * from './userJsonhal'; +export * from './userJsonld'; diff --git a/matsen-tool/src/app/core/api/v1/model/post.ts b/matsen-tool/src/app/core/api/v1/model/post.ts new file mode 100644 index 0000000..29f3942 --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/model/post.ts @@ -0,0 +1,22 @@ +/** + * Matsen API Platform + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + */ +export interface Post { + message: string | null; + owner?: string | null; + readonly createdAt?: string | null; +} + diff --git a/matsen-tool/src/app/core/api/v1/model/postJsonhal.ts b/matsen-tool/src/app/core/api/v1/model/postJsonhal.ts new file mode 100644 index 0000000..3b112e1 --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/model/postJsonhal.ts @@ -0,0 +1,24 @@ +/** + * Matsen API Platform + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { PostJsonhalLinks } from './postJsonhalLinks'; + + +/** + * + */ +export interface PostJsonhal { + _links?: PostJsonhalLinks; + message: string | null; + owner?: string | null; + readonly createdAt?: string | null; +} + diff --git a/matsen-tool/src/app/core/api/v1/model/postJsonhalLinks.ts b/matsen-tool/src/app/core/api/v1/model/postJsonhalLinks.ts new file mode 100644 index 0000000..780cc14 --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/model/postJsonhalLinks.ts @@ -0,0 +1,18 @@ +/** + * Matsen API Platform + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { ApiPostsGetCollection200Response1LinksSelf } from './apiPostsGetCollection200Response1LinksSelf'; + + +export interface PostJsonhalLinks { + self?: ApiPostsGetCollection200Response1LinksSelf; +} + diff --git a/matsen-tool/src/app/core/api/v1/model/postJsonld.ts b/matsen-tool/src/app/core/api/v1/model/postJsonld.ts new file mode 100644 index 0000000..e0bc4ad --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/model/postJsonld.ts @@ -0,0 +1,25 @@ +/** + * Matsen API Platform + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + */ +export interface PostJsonld { + context?: string | null; + readonly id?: string; + readonly type?: string; + message: string | null; + owner?: string | null; + readonly createdAt?: string | null; +} + diff --git a/matsen-tool/src/app/core/api/v1/model/user.ts b/matsen-tool/src/app/core/api/v1/model/user.ts new file mode 100644 index 0000000..b5d1c79 --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/model/user.ts @@ -0,0 +1,29 @@ +/** + * Matsen API Platform + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + */ +export interface User { + email: string | null; + firstName: string | null; + lastName: string | null; + /** + * The plaintext password when being set or changed. + */ + password?: string | null; + active?: boolean; + readonly createdAt?: string | null; + userPosts?: Array; +} + diff --git a/matsen-tool/src/app/core/api/v1/model/userJsonhal.ts b/matsen-tool/src/app/core/api/v1/model/userJsonhal.ts new file mode 100644 index 0000000..a6f93af --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/model/userJsonhal.ts @@ -0,0 +1,31 @@ +/** + * Matsen API Platform + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { PostJsonhalLinks } from './postJsonhalLinks'; + + +/** + * + */ +export interface UserJsonhal { + _links?: PostJsonhalLinks; + email: string | null; + firstName: string | null; + lastName: string | null; + /** + * The plaintext password when being set or changed. + */ + password?: string | null; + active?: boolean; + readonly createdAt?: string | null; + userPosts?: Array; +} + diff --git a/matsen-tool/src/app/core/api/v1/model/userJsonld.ts b/matsen-tool/src/app/core/api/v1/model/userJsonld.ts new file mode 100644 index 0000000..8473b98 --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/model/userJsonld.ts @@ -0,0 +1,32 @@ +/** + * Matsen API Platform + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + */ +export interface UserJsonld { + context?: string | null; + readonly id?: string; + readonly type?: string; + email: string | null; + firstName: string | null; + lastName: string | null; + /** + * The plaintext password when being set or changed. + */ + password?: string | null; + active?: boolean; + readonly createdAt?: string | null; + userPosts?: Array; +} + diff --git a/matsen-tool/src/app/core/api/v1/param.ts b/matsen-tool/src/app/core/api/v1/param.ts new file mode 100644 index 0000000..78a2d20 --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/param.ts @@ -0,0 +1,69 @@ +/** + * Standard parameter styles defined by OpenAPI spec + */ +export type StandardParamStyle = + | 'matrix' + | 'label' + | 'form' + | 'simple' + | 'spaceDelimited' + | 'pipeDelimited' + | 'deepObject' + ; + +/** + * The OpenAPI standard {@link StandardParamStyle}s may be extended by custom styles by the user. + */ +export type ParamStyle = StandardParamStyle | string; + +/** + * Standard parameter locations defined by OpenAPI spec + */ +export type ParamLocation = 'query' | 'header' | 'path' | 'cookie'; + +/** + * Standard types as defined in OpenAPI Specification: Data Types + */ +export type StandardDataType = + | "integer" + | "number" + | "boolean" + | "string" + | "object" + | "array" + ; + +/** + * Standard {@link DataType}s plus your own types/classes. + */ +export type DataType = StandardDataType | string; + +/** + * Standard formats as defined in OpenAPI Specification: Data Types + */ +export type StandardDataFormat = + | "int32" + | "int64" + | "float" + | "double" + | "byte" + | "binary" + | "date" + | "date-time" + | "password" + ; + +export type DataFormat = StandardDataFormat | string; + +/** + * The parameter to encode. + */ +export interface Param { + name: string; + value: unknown; + in: ParamLocation; + style: ParamStyle, + explode: boolean; + dataType: DataType; + dataFormat: DataFormat | undefined; +} diff --git a/matsen-tool/src/app/core/api/v1/variables.ts b/matsen-tool/src/app/core/api/v1/variables.ts new file mode 100644 index 0000000..6fe5854 --- /dev/null +++ b/matsen-tool/src/app/core/api/v1/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +}