+ * 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 = {}; + } + + // init default petstore_auth credential + if (!this.credentials['petstore_auth']) { + this.credentials['petstore_auth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } + + // init default api_key credential + if (!this.credentials['api_key']) { + this.credentials['api_key'] = () => { + if (this.apiKeys === null || this.apiKeys === undefined) { + return undefined; + } else { + return this.apiKeys['api_key'] || this.apiKeys['api_key']; + } + }; + } + } + + /** + * 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 orundefined
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/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/encoder.ts b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/encoder.ts
new file mode 100644
index 00000000000..138c4d5cf2c
--- /dev/null
+++ b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/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/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/git_push.sh b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/git_push.sh
new file mode 100644
index 00000000000..f53a75d4fab
--- /dev/null
+++ b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/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/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/index.ts b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/index.ts
new file mode 100644
index 00000000000..104dd3d21e3
--- /dev/null
+++ b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/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/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/model/apiResponse.ts b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/model/apiResponse.ts
new file mode 100644
index 00000000000..682ba478921
--- /dev/null
+++ b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/model/apiResponse.ts
@@ -0,0 +1,22 @@
+/**
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * 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.
+ */
+
+
+/**
+ * Describes the result of uploading an image resource
+ */
+export interface ApiResponse {
+ code?: number;
+ type?: string;
+ message?: string;
+}
+
diff --git a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/model/category.ts b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/model/category.ts
new file mode 100644
index 00000000000..b988b6827a0
--- /dev/null
+++ b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/model/category.ts
@@ -0,0 +1,21 @@
+/**
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * 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.
+ */
+
+
+/**
+ * A category for a pet
+ */
+export interface Category {
+ id?: number;
+ name?: string;
+}
+
diff --git a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/model/models.ts b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/model/models.ts
new file mode 100644
index 00000000000..8607c5dabd0
--- /dev/null
+++ b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/model/models.ts
@@ -0,0 +1,6 @@
+export * from './apiResponse';
+export * from './category';
+export * from './order';
+export * from './pet';
+export * from './tag';
+export * from './user';
diff --git a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/model/order.ts
new file mode 100644
index 00000000000..a29bebe4906
--- /dev/null
+++ b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/model/order.ts
@@ -0,0 +1,37 @@
+/**
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * 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.
+ */
+
+
+/**
+ * An order for a pets from the pet store
+ */
+export interface Order {
+ id?: number;
+ petId?: number;
+ quantity?: number;
+ shipDate?: string;
+ /**
+ * Order Status
+ */
+ status?: Order.StatusEnum;
+ complete?: boolean;
+}
+export namespace Order {
+ export type StatusEnum = 'placed' | 'approved' | 'delivered';
+ export const StatusEnum = {
+ Placed: 'placed' as StatusEnum,
+ Approved: 'approved' as StatusEnum,
+ Delivered: 'delivered' as StatusEnum
+ };
+}
+
+
diff --git a/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/model/pet.ts
new file mode 100644
index 00000000000..e0404395f91
--- /dev/null
+++ b/samples/client/petstore/typescript-angular-v17-provided-in-root/builds/default/model/pet.ts
@@ -0,0 +1,39 @@
+/**
+ * OpenAPI Petstore
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * 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 { Category } from './category';
+import { Tag } from './tag';
+
+
+/**
+ * A pet for sale in the pet store
+ */
+export interface Pet {
+ id?: number;
+ category?: Category;
+ name: string;
+ photoUrls: Array