@mediusinc/mng-commons-data-api 5.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +14 -0
  2. package/esm2022/index.mjs +7 -0
  3. package/esm2022/lib/helpers/get-all-params.mjs +186 -0
  4. package/esm2022/lib/models/request-params.model.mjs +2 -0
  5. package/esm2022/lib/types/extract-get-all-params.type.mjs +2 -0
  6. package/esm2022/mediusinc-mng-commons-data-api.mjs +5 -0
  7. package/esm2022/tableview/index.mjs +2 -0
  8. package/esm2022/tableview/mediusinc-mng-commons-data-api-tableview.mjs +5 -0
  9. package/esm2022/tableview/tableview-get-all-params-create.mjs +18 -0
  10. package/fesm2022/mediusinc-mng-commons-data-api-tableview.mjs +25 -0
  11. package/fesm2022/mediusinc-mng-commons-data-api-tableview.mjs.map +1 -0
  12. package/fesm2022/mediusinc-mng-commons-data-api.mjs +195 -0
  13. package/fesm2022/mediusinc-mng-commons-data-api.mjs.map +1 -0
  14. package/index.d.ts +3 -0
  15. package/lib/helpers/get-all-params.d.ts +69 -0
  16. package/lib/models/request-params.model.d.ts +61 -0
  17. package/lib/types/extract-get-all-params.type.d.ts +14 -0
  18. package/openapi/README.mustache +226 -0
  19. package/openapi/api.module.mustache +39 -0
  20. package/openapi/api.service.mustache +253 -0
  21. package/openapi/apiInterface.mustache +47 -0
  22. package/openapi/apis.mustache +12 -0
  23. package/openapi/config.yaml +23 -0
  24. package/openapi/configuration.mustache +128 -0
  25. package/openapi/custom/base-api.service.mustache +14 -0
  26. package/openapi/custom/helpers.mustache +71 -0
  27. package/openapi/custom/modelSchema.mustache +46 -0
  28. package/openapi/custom/schema.mustache +18 -0
  29. package/openapi/encoder.mustache +20 -0
  30. package/openapi/git_push.sh.mustache +57 -0
  31. package/openapi/index.mustache +0 -0
  32. package/openapi/licenseInfo.mustache +11 -0
  33. package/openapi/model.mustache +16 -0
  34. package/openapi/modelAlias.mustache +1 -0
  35. package/openapi/modelEnum.mustache +21 -0
  36. package/openapi/modelGeneric.mustache +14 -0
  37. package/openapi/modelGenericAdditionalProperties.mustache +5 -0
  38. package/openapi/modelGenericEnums.mustache +30 -0
  39. package/openapi/modelOneOf.mustache +14 -0
  40. package/openapi/modelTaggedUnion.mustache +21 -0
  41. package/openapi/models.mustache +5 -0
  42. package/openapi/ng-package.mustache +6 -0
  43. package/openapi/package.mustache +39 -0
  44. package/openapi/param.mustache +69 -0
  45. package/openapi/tsconfig.mustache +28 -0
  46. package/openapi/variables.mustache +9 -0
  47. package/package.json +34 -0
  48. package/tableview/README.md +10 -0
  49. package/tableview/index.d.ts +1 -0
  50. package/tableview/tableview-get-all-params-create.d.ts +15 -0
@@ -0,0 +1,47 @@
1
+ {{>licenseInfo}}
2
+
3
+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types */
4
+
5
+ import { Observable } from 'rxjs';
6
+
7
+ {{#imports}}
8
+ import { {{classname}} } from '../model/models';
9
+ {{/imports}}
10
+
11
+ {{#operations}}
12
+
13
+ {{#useSingleRequestParameter}}
14
+ {{#operation}}
15
+ {{#allParams.0}}
16
+ export interface {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams {
17
+ {{#allParams}}
18
+ {{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#isNullable}} | null{{/isNullable}};
19
+ {{/allParams}}
20
+ }
21
+
22
+ {{/allParams.0}}
23
+ {{/operation}}
24
+ {{/useSingleRequestParameter}}
25
+
26
+ {{#description}}
27
+ /**
28
+ * {{&description}}
29
+ */
30
+ {{/description}}
31
+ export interface {{classname}}Interface {
32
+ {{#operation}}
33
+ /**{{#summary}}
34
+ * {{.}}{{/summary}}{{#notes}}
35
+ * {{.}}{{/notes}}
36
+ {{^useSingleRequestParameter}}
37
+ {{#allParams}}* @param {{paramName}} {{description}}
38
+ {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}* @param requestParameters
39
+ {{/allParams.0}}
40
+ * @param extraParams Extra HTTP Request Parameters to be sent with the request.{{/useSingleRequestParameter}}{{#isDeprecated}}
41
+ * @deprecated{{/isDeprecated}}
42
+ */
43
+ {{nickname}}({{^useSingleRequestParameter}}{{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}{{/useSingleRequestParameter}}{{#useSingleRequestParameter}}{{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams, {{/allParams.0}}{{/useSingleRequestParameter}}extraParams?: any): Observable<{{{returnType}}}{{^returnType}}{}{{/returnType}}>;
44
+
45
+ {{/operation}}
46
+ }
47
+ {{/operations}}
@@ -0,0 +1,12 @@
1
+ {{#apiInfo}}
2
+ {{#apis}}
3
+ {{#operations}}
4
+ export * from './{{ classFilename }}';
5
+ import { {{ classname }} } from './{{ classFilename }}';
6
+ {{/operations}}
7
+ {{#withInterfaces}}
8
+ export * from './{{ classFilename }}Interface';
9
+ {{/withInterfaces}}
10
+ {{/apis}}
11
+ export const APIS = [{{#apis}}{{#operations}}{{ classname }}{{/operations}}{{^-last}}, {{/-last}}{{/apis}}];
12
+ {{/apiInfo}}
@@ -0,0 +1,23 @@
1
+ additionalProperties:
2
+ useSingleRequestParameter: true
3
+ stringEnums: true
4
+ nullSafeAdditionalProps: true
5
+ fileNaming: kebab-case
6
+ modelFileSuffix: .model
7
+ withInterfaces: true
8
+ httpContextInOptions: false
9
+ files:
10
+ custom/schema.mustache:
11
+ destinationFilename: schema.ts
12
+ templateType: SupportingFiles
13
+ custom/modelSchema.mustache:
14
+ folder: schema
15
+ templateType: Model
16
+ destinationFilename: .schema.ts
17
+ custom/helpers.mustache:
18
+ destinationFilename: helpers.ts
19
+ templateType: SupportingFiles
20
+ custom/base-api.service.mustache:
21
+ folder: api
22
+ destinationFilename: base-api.service.ts
23
+ templateType: SupportingFiles
@@ -0,0 +1,128 @@
1
+ import {Injectable} from '@angular/core';
2
+ import {HttpParameterCodec} from '@angular/common/http';
3
+ import {Param} from './param';
4
+
5
+ export interface {{configurationParametersInterfaceName}} {
6
+ basePath?: string;
7
+ withCredentials?: boolean;
8
+ /**
9
+ * Takes care of encoding query- and form-parameters.
10
+ */
11
+ encoder?: HttpParameterCodec;
12
+ /**
13
+ * Override the default method for encoding path parameters in various
14
+ * <a href="https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values">styles</a>.
15
+ * <p>
16
+ * See {@link README.md} for more details
17
+ * </p>
18
+ */
19
+ encodeParam?: (param: Param) => string;
20
+ }
21
+
22
+ {{#isProvidedInNone}}
23
+ @Injectable()
24
+ {{/isProvidedInNone}}
25
+ {{^isProvidedInNone}}
26
+ @Injectable({
27
+ providedIn: '{{providedIn}}'
28
+ })
29
+ {{/isProvidedInNone}}
30
+ export class {{configurationClassName}} {
31
+ basePath?: string;
32
+ withCredentials?: boolean;
33
+ /**
34
+ * Takes care of encoding query- and form-parameters.
35
+ */
36
+ encoder?: HttpParameterCodec;
37
+ /**
38
+ * Encoding of various path parameter
39
+ * <a href="https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values">styles</a>.
40
+ * <p>
41
+ * See {@link README.md} for more details
42
+ * </p>
43
+ */
44
+ encodeParam: (param: Param) => string = param => this.defaultEncodeParam(param);
45
+
46
+ public init(config: {{configurationParametersInterfaceName}} | string = {}) {
47
+ if (typeof config === 'string') {
48
+ this.basePath = config;
49
+ } else {
50
+ this.basePath = config.basePath;
51
+ this.withCredentials = config.withCredentials;
52
+ this.encoder = config.encoder;
53
+ if (config.encodeParam) {
54
+ this.encodeParam = config.encodeParam;
55
+ }
56
+ }
57
+ }
58
+
59
+ /**
60
+ * Select the correct content-type to use for a request.
61
+ * Uses {@link {{configurationClassName}}#isJsonMime} to determine the correct content-type.
62
+ * If no content type is found return the first found type if the contentTypes is not empty
63
+ * @param contentTypes - the array of content types that are available for selection
64
+ * @returns the selected content-type or <code>undefined</code> if no selection could be made.
65
+ */
66
+ public selectHeaderContentType (contentTypes: string[]): string | undefined {
67
+ if (contentTypes.length === 0) {
68
+ return undefined;
69
+ }
70
+
71
+ const type = contentTypes.find((x: string) => this.isJsonMime(x));
72
+ if (type === undefined) {
73
+ return contentTypes[0];
74
+ }
75
+ return type;
76
+ }
77
+
78
+ /**
79
+ * Select the correct accept content-type to use for a request.
80
+ * Uses {@link {{configurationClassName}}#isJsonMime} to determine the correct accept content-type.
81
+ * If no content type is found return the first found type if the contentTypes is not empty
82
+ * @param accepts - the array of content types that are available for selection.
83
+ * @returns the selected content-type or <code>undefined</code> if no selection could be made.
84
+ */
85
+ public selectHeaderAccept(accepts: string[]): string | undefined {
86
+ if (accepts.length === 0) {
87
+ return undefined;
88
+ }
89
+
90
+ const type = accepts.find((x: string) => this.isJsonMime(x));
91
+ if (type === undefined) {
92
+ return accepts[0];
93
+ }
94
+ return type;
95
+ }
96
+
97
+ /**
98
+ * Check if the given MIME is a JSON MIME.
99
+ * JSON MIME examples:
100
+ * application/json
101
+ * application/json; charset=UTF8
102
+ * APPLICATION/JSON
103
+ * application/vnd.company+json
104
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
105
+ * @return True if the given MIME is JSON, false otherwise.
106
+ */
107
+ public isJsonMime(mime: string): boolean {
108
+ // eslint-disable-next-line no-control-regex
109
+ const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
110
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
111
+ }
112
+
113
+ private defaultEncodeParam(param: Param): string {
114
+ // This implementation exists as fallback for missing configuration
115
+ // and for backwards compatibility to older typescript-angular generator versions.
116
+ // It only works for the 'simple' parameter style.
117
+ // Date-handling only works for the 'date-time' format.
118
+ // All other styles and Date-formats are probably handled incorrectly.
119
+ //
120
+ // But: if that's all you need (i.e.: the most common use-case): no need for customization!
121
+
122
+ const value = param.dataFormat === 'date-time' && param.value instanceof Date
123
+ ? (param.value as Date).toISOString()
124
+ : param.value;
125
+
126
+ return encodeURIComponent(String(value));
127
+ }
128
+ }
@@ -0,0 +1,14 @@
1
+ /* eslint-disable */
2
+
3
+ import {HttpClient, HttpHeaders, HttpParameterCodec} from '@angular/common/http';
4
+ import {inject} from '@angular/core';
5
+
6
+ import { {{configurationClassName}} } from '../configuration';
7
+ import {CustomHttpParameterCodec} from '../encoder';
8
+
9
+ export class BaseApiService {
10
+ protected readonly httpClient = inject(HttpClient);
11
+ protected readonly configuration = inject({{configurationClassName}});
12
+ protected readonly encoder: HttpParameterCodec = this.configuration?.encoder ?? new CustomHttpParameterCodec();
13
+ public readonly defaultHeaders = new HttpHeaders();
14
+ }
@@ -0,0 +1,71 @@
1
+ // eslint-disable
2
+
3
+ import {HttpContext, HttpParams} from '@angular/common/http';
4
+
5
+ import { {{configurationClassName}} } from './configuration';
6
+
7
+ export function addToHttpParams(httpParams: HttpParams, value: unknown, key?: string): HttpParams {
8
+ if (typeof value === 'object' && !(value instanceof Date)) {
9
+ httpParams = addToHttpParamsRecursive(httpParams, value);
10
+ } else {
11
+ httpParams = addToHttpParamsRecursive(httpParams, value, key);
12
+ }
13
+ return httpParams;
14
+ }
15
+
16
+ function addToHttpParamsRecursive(httpParams: HttpParams, value?: unknown, key?: string): HttpParams {
17
+ if (value == null) {
18
+ return httpParams;
19
+ }
20
+
21
+ if (typeof value === 'object') {
22
+ if (Array.isArray(value)) {
23
+ value.forEach(elem => (httpParams = addToHttpParamsRecursive(httpParams, elem, key)));
24
+ } else if (value instanceof Date) {
25
+ if (key != null) {
26
+ httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10));
27
+ } else {
28
+ throw Error('key may not be null if value is Date');
29
+ }
30
+ } else {
31
+ Object.keys(value).forEach(k => (httpParams = addToHttpParamsRecursive(httpParams, value[k as keyof object], key != null ? `${key}.${k}` : k)));
32
+ }
33
+ } else if (key != null) {
34
+ httpParams = httpParams.append(key, String(value));
35
+ } else {
36
+ throw Error('key may not be null if value is not object or array');
37
+ }
38
+ return httpParams;
39
+ }
40
+
41
+ export function selectHeaderAccept(producesAccepts: string[], options?: {httpHeaderAccept?: string; context?: HttpContext}, configuration?: {{configurationClassName}}) {
42
+ let accept: string | undefined = options?.httpHeaderAccept;
43
+ if (accept === undefined) {
44
+ // to determine the Accept header
45
+ accept = configuration?.selectHeaderAccept(producesAccepts);
46
+ }
47
+ return accept;
48
+ }
49
+
50
+ export function getResponseType(selectedAcceptHeader?: string, configuration?: {{configurationClassName}}): 'text' | 'json' | 'blob' {
51
+ if (selectedAcceptHeader) {
52
+ if (selectedAcceptHeader.startsWith('text')) {
53
+ return 'text';
54
+ } else if (configuration?.isJsonMime(selectedAcceptHeader)) {
55
+ return 'json';
56
+ } else {
57
+ return 'blob';
58
+ }
59
+ }
60
+ return 'json';
61
+ }
62
+
63
+ export function canConsumeForm(consumes: string[]): boolean {
64
+ const form = 'multipart/form-data';
65
+ for (const consume of consumes) {
66
+ if (form === consume) {
67
+ return true;
68
+ }
69
+ }
70
+ return false;
71
+ }
@@ -0,0 +1,46 @@
1
+ import {Schema} from '../schema';
2
+
3
+ {{#models}}
4
+ {{#model}}
5
+ export const ${{name}}Schema: Schema = {
6
+ name: '{{name}}',
7
+ {{#isEnum}}
8
+ // enums not yet generated
9
+ {{/isEnum}}
10
+ {{^isEnum}}
11
+ {{#isAlias}}
12
+ // aliases not yet generated
13
+ {{/isAlias}}
14
+ {{^isAlias}}
15
+ {{#taggedUnions}}
16
+ // tagged unions not yet generated
17
+ {{/taggedUnions}}
18
+ {{^taggedUnions}}
19
+ {{#oneOf}}
20
+ // one of not yet generated
21
+ {{/oneOf}}
22
+ {{^oneOf}}
23
+ properties: {
24
+ {{#vars}}
25
+ {{name}}: {
26
+ type: '{{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{#isDate}}date{{/isDate}}{{^isDate}}{{#isDateTime}}date-time{{/isDateTime}}{{^isDateTime}}{{{dataType}}}{{/isDateTime}}{{/isDate}}{{/isEnum}}',{{#isReadOnly}}
27
+ isReadOnly: true,{{/isReadOnly}}{{#required}}
28
+ required: true,{{/required}}{{#isNullable}}
29
+ isNullable: true,{{/isNullable}}{{#minLength}}
30
+ minLength: {{.}},{{/minLength}}{{#maxLength}}
31
+ maxLength: {{.}},{{/maxLength}}{{#minimum}}
32
+ minimum: {{.}},{{/minimum}}{{#maximum}}
33
+ maximum: {{.}},{{/maximum}}{{#exclusiveMinimum}}
34
+ exclusiveMinimum: true,{{/exclusiveMinimum}}{{#exclusiveMaximum}}
35
+ exclusiveMaximum: true,{{/exclusiveMaximum}}{{#pattern}}
36
+ pattern: '{{{.}}}'{{/pattern}}
37
+ },
38
+ {{/vars}}
39
+ }
40
+ {{/oneOf}}
41
+ {{/taggedUnions}}
42
+ {{/isAlias}}
43
+ {{/isEnum}}
44
+ };
45
+ {{/model}}
46
+ {{/models}}
@@ -0,0 +1,18 @@
1
+ export interface Schema {
2
+ name: string;
3
+ properties?: Record<string, SchemaProperty>;
4
+ }
5
+
6
+ export interface SchemaProperty {
7
+ type: string;
8
+ isReadOnly?: boolean;
9
+ required?: boolean;
10
+ isNullable?: boolean;
11
+ minLength?: boolean;
12
+ maxLength?: boolean;
13
+ minimum?: boolean;
14
+ maximum?: boolean;
15
+ exclusiveMinimum?: boolean;
16
+ exclusiveMaximum?: boolean;
17
+ pattern?: string;
18
+ }
@@ -0,0 +1,20 @@
1
+ import { HttpParameterCodec } from '@angular/common/http';
2
+
3
+ /**
4
+ * Custom HttpParameterCodec
5
+ * Workaround for https://github.com/angular/angular/issues/18261
6
+ */
7
+ export class CustomHttpParameterCodec implements HttpParameterCodec {
8
+ encodeKey(k: string): string {
9
+ return encodeURIComponent(k);
10
+ }
11
+ encodeValue(v: string): string {
12
+ return encodeURIComponent(v);
13
+ }
14
+ decodeKey(k: string): string {
15
+ return decodeURIComponent(k);
16
+ }
17
+ decodeValue(v: string): string {
18
+ return decodeURIComponent(v);
19
+ }
20
+ }
@@ -0,0 +1,57 @@
1
+ #!/bin/sh
2
+ # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
3
+ #
4
+ # Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
5
+
6
+ git_user_id=$1
7
+ git_repo_id=$2
8
+ release_note=$3
9
+ git_host=$4
10
+
11
+ if [ "$git_host" = "" ]; then
12
+ git_host="{{{gitHost}}}"
13
+ echo "[INFO] No command line input provided. Set \$git_host to $git_host"
14
+ fi
15
+
16
+ if [ "$git_user_id" = "" ]; then
17
+ git_user_id="{{{gitUserId}}}"
18
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
19
+ fi
20
+
21
+ if [ "$git_repo_id" = "" ]; then
22
+ git_repo_id="{{{gitRepoId}}}"
23
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
24
+ fi
25
+
26
+ if [ "$release_note" = "" ]; then
27
+ release_note="{{{releaseNote}}}"
28
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
29
+ fi
30
+
31
+ # Initialize the local directory as a Git repository
32
+ git init
33
+
34
+ # Adds the files in the local repository and stages them for commit.
35
+ git add .
36
+
37
+ # Commits the tracked changes and prepares them to be pushed to a remote repository.
38
+ git commit -m "$release_note"
39
+
40
+ # Sets the new remote
41
+ git_remote=$(git remote)
42
+ if [ "$git_remote" = "" ]; then # git remote not defined
43
+
44
+ if [ "$GIT_TOKEN" = "" ]; then
45
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
46
+ git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
47
+ else
48
+ git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
49
+ fi
50
+
51
+ fi
52
+
53
+ git pull origin master
54
+
55
+ # Pushes (Forces) the changes in the local repository up to the remote repository
56
+ echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
57
+ git push origin master 2>&1 | grep -v 'To https'
File without changes
@@ -0,0 +1,11 @@
1
+ /**
2
+ * {{{appName}}}
3
+ * {{{appDescription}}}
4
+ *
5
+ * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}}
6
+ * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}}
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
@@ -0,0 +1,16 @@
1
+ {{>licenseInfo}}
2
+ {{#models}}
3
+ {{#model}}
4
+ {{#tsImports}}
5
+ import { {{classname}} } from '{{filename}}';
6
+ {{/tsImports}}
7
+
8
+
9
+ {{#description}}
10
+ /**
11
+ * {{{.}}}
12
+ */
13
+ {{/description}}
14
+ {{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#isAlias}}{{>modelAlias}}{{/isAlias}}{{^isAlias}}{{#taggedUnions}}{{>modelTaggedUnion}}{{/taggedUnions}}{{^taggedUnions}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{^oneOf}}{{>modelGeneric}}{{/oneOf}}{{/taggedUnions}}{{/isAlias}}{{/isEnum}}
15
+ {{/model}}
16
+ {{/models}}
@@ -0,0 +1 @@
1
+ export type {{classname}} = {{dataType}};
@@ -0,0 +1,21 @@
1
+ {{#stringEnums}}
2
+ export enum {{classname}} {
3
+ {{#allowableValues}}
4
+ {{#enumVars}}
5
+ {{name}} = {{{value}}}{{^-last}},{{/-last}}
6
+ {{/enumVars}}
7
+ {{/allowableValues}}
8
+ }
9
+
10
+ {{/stringEnums}}
11
+ {{^stringEnums}}
12
+ export type {{classname}} = {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}} | {{/-last}}{{/enumVars}}{{/allowableValues}};
13
+
14
+ export const {{classname}} = {
15
+ {{#allowableValues}}
16
+ {{#enumVars}}
17
+ {{name}}: {{{value}}} as {{classname}}{{^-last}},{{/-last}}
18
+ {{/enumVars}}
19
+ {{/allowableValues}}
20
+ };
21
+ {{/stringEnums}}
@@ -0,0 +1,14 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types */
2
+
3
+ export interface {{classname}}{{#allParents}}{{#-first}} extends {{/-first}}{{{.}}}{{^-last}}, {{/-last}}{{/allParents}} { {{>modelGenericAdditionalProperties}}
4
+ {{#vars}}
5
+ {{#description}}
6
+ /**
7
+ * {{{.}}}
8
+ */
9
+ {{/description}}
10
+ {{#isReadOnly}}readonly {{/isReadOnly}}{{{name}}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}} | null{{/isNullable}};
11
+ {{/vars}}
12
+ }{{>modelGenericEnums}}
13
+
14
+ export const {{classname}}TypeName = '{{classname}}';
@@ -0,0 +1,5 @@
1
+ {{#additionalPropertiesType}}
2
+
3
+ [key: string]: {{{additionalPropertiesType}}}{{#hasVars}} | any{{/hasVars}};
4
+
5
+ {{/additionalPropertiesType}}
@@ -0,0 +1,30 @@
1
+ {{#hasEnums}}
2
+
3
+ {{^stringEnums}}
4
+ export namespace {{classname}} {
5
+ {{/stringEnums}}
6
+ {{#vars}}
7
+ {{#isEnum}}
8
+ {{#stringEnums}}
9
+ export enum {{classname}}{{enumName}} {
10
+ {{#allowableValues}}
11
+ {{#enumVars}}
12
+ {{name}} = {{{value}}}{{^-last}},{{/-last}}
13
+ {{/enumVars}}
14
+ {{/allowableValues}}
15
+ };
16
+ {{/stringEnums}}
17
+ {{^stringEnums}}
18
+ export type {{enumName}} = {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}} | {{/-last}}{{/enumVars}}{{/allowableValues}};
19
+ export const {{enumName}} = {
20
+ {{#allowableValues}}
21
+ {{#enumVars}}
22
+ {{name}}: {{{value}}} as {{enumName}}{{^-last}},{{/-last}}
23
+ {{/enumVars}}
24
+ {{/allowableValues}}
25
+ };
26
+ {{/stringEnums}}
27
+ {{/isEnum}}
28
+ {{/vars}}
29
+ {{^stringEnums}}}{{/stringEnums}}
30
+ {{/hasEnums}}
@@ -0,0 +1,14 @@
1
+ {{#hasImports}}
2
+ import {
3
+ {{#imports}}
4
+ {{{.}}},
5
+ {{/imports}}
6
+ } from './';
7
+
8
+ {{/hasImports}}
9
+ /**
10
+ * @type {{classname}}{{#description}}
11
+ * {{{.}}}{{/description}}
12
+ * @export
13
+ */
14
+ export type {{classname}} = {{#oneOf}}{{{.}}}{{^-last}} | {{/-last}}{{/oneOf}};
@@ -0,0 +1,21 @@
1
+ {{#discriminator}}
2
+ export type {{classname}} = {{#children}}{{^-first}} | {{/-first}}{{classname}}{{/children}};
3
+ {{/discriminator}}
4
+ {{^discriminator}}
5
+ {{#parent}}
6
+ export interface {{classname}} { {{>modelGenericAdditionalProperties}}
7
+ {{#allVars}}
8
+ {{#description}}
9
+ /**
10
+ * {{{.}}}
11
+ */
12
+ {{/description}}
13
+ {{name}}{{^required}}?{{/required}}: {{#discriminatorValue}}'{{.}}'{{/discriminatorValue}}{{^discriminatorValue}}{{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{/discriminatorValue}}{{#isNullable}} | null{{/isNullable}};
14
+ {{/allVars}}
15
+ }
16
+ {{>modelGenericEnums}}
17
+ {{/parent}}
18
+ {{^parent}}
19
+ {{>modelGeneric}}
20
+ {{/parent}}
21
+ {{/discriminator}}
@@ -0,0 +1,5 @@
1
+ {{#models}}
2
+ {{#model}}
3
+ export * from '{{{ classFilename }}}';
4
+ {{/model}}
5
+ {{/models}}
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "./node_modules/ng-packagr/ng-package.schema.json",
3
+ "lib": {
4
+ "entryFile": "index.ts"
5
+ }
6
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "{{{npmName}}}",
3
+ "version": "{{{npmVersion}}}",
4
+ "description": "OpenAPI client for {{{npmName}}}",
5
+ "author": "OpenAPI-Generator Contributors",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}.git"
9
+ },
10
+ "keywords": [
11
+ "openapi-client",
12
+ "openapi-generator"
13
+ ],
14
+ "license": "Unlicense",
15
+ "scripts": {
16
+ "build": "ng-packagr -p ng-package.json"
17
+ },
18
+ "peerDependencies": {
19
+ "@angular/core": "^{{ngVersion}}",
20
+ "rxjs": "^{{rxjsVersion}}"
21
+ },
22
+ "devDependencies": {
23
+ "@angular/common": "^{{ngVersion}}",
24
+ "@angular/compiler": "^{{ngVersion}}",
25
+ "@angular/compiler-cli": "^{{ngVersion}}",
26
+ "@angular/core": "^{{ngVersion}}",
27
+ "@angular/platform-browser": "^{{ngVersion}}",
28
+ "ng-packagr": "^{{ngPackagrVersion}}",
29
+ "reflect-metadata": "^0.1.3",
30
+ "rxjs": "^{{rxjsVersion}}",{{#tsickleVersion}}
31
+ "tsickle": "^{{tsickleVersion}}",{{/tsickleVersion}}
32
+ "typescript": "{{{tsVersion}}}",
33
+ "zone.js": "^{{zonejsVersion}}"
34
+ }{{#npmRepository}},
35
+ "publishConfig": {
36
+ "registry": "{{{npmRepository}}}"
37
+ }
38
+ {{/npmRepository}}
39
+ }