Skip to content

Commit e1d95ad

Browse files
committed
generate sdks
1 parent 7c24bc2 commit e1d95ad

31 files changed

+4049
-1
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
wwwroot/*.js
2+
node_modules
3+
typings
4+
dist

.konfig/generate-id.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
b184a758-6db7-4c6b-bcd2-4cdf2cf19c9f

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
2+
registry=https://registry.npmjs.org/
3+
always-auth=true

README.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,65 @@
1-
F
1+
# automation-test-with-submodule-typescript-sdk
2+
3+
[![npm](https://img.shields.io/badge/npm-v1.0.0-blue)](https://www.npmjs.com/package/automation-test-with-submodule-typescript-sdk/v/1.0.0)
4+
5+
SDKs (no submodules) to test automation workflows.
6+
7+
## Table of Contents
8+
9+
<!-- toc -->
10+
11+
## Installing
12+
13+
### npm
14+
```
15+
npm install automation-test-with-submodule-typescript-sdk --save
16+
```
17+
18+
### yarn
19+
```
20+
yarn add automation-test-with-submodule-typescript-sdk
21+
```
22+
23+
## Getting Started
24+
25+
```typescript
26+
import { AutomationTestWithSubmodule } from "automation-test-with-submodule-typescript-sdk";
27+
28+
const automationtestwithsubmodule = new AutomationTestWithSubmodule({
29+
// Defining the base path is optional and defaults to http://google.com
30+
// basePath: "http://google.com",
31+
apiKey: "API_KEY",
32+
});
33+
34+
const helloResponse = await automationtestwithsubmodule.greetings.hello();
35+
36+
console.log(helloResponse);
37+
```
38+
39+
## Reference
40+
41+
42+
### `automationtestwithsubmodule.greetings.hello`
43+
44+
Get a simple greeting
45+
46+
#### 🛠️ Usage
47+
48+
```typescript
49+
const helloResponse = await automationtestwithsubmodule.greetings.hello();
50+
```
51+
52+
#### 🔄 Return
53+
[HelloResponse](./models/hello-response.ts)
54+
55+
#### 🌐 Endpoint
56+
57+
`/hello` `GET`
58+
59+
[🔙 Back to Table of Contents](#table-of-contents)
60+
61+
---
62+
63+
64+
## Author
65+
This TypeScript package is automatically generated by [Konfig](https://konfigthis.com)

api.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/*
4+
Test Automation (No submodules)
5+
6+
SDKs (no submodules) to test automation workflows.
7+
8+
The version of the OpenAPI document: 1.0.0
9+
10+
11+
NOTE: This file is auto generated by Konfig (https://konfigthis.com).
12+
*/
13+
14+
15+
export * from './api/greetings-api';
16+

api/greetings-api-generated.ts

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/*
4+
Test Automation (No submodules)
5+
6+
SDKs (no submodules) to test automation workflows.
7+
8+
The version of the OpenAPI document: 1.0.0
9+
10+
11+
NOTE: This file is auto generated by Konfig (https://konfigthis.com).
12+
*/
13+
14+
import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
15+
import { Configuration } from '../configuration';
16+
// Some imports not used depending on template conditions
17+
// @ts-ignore
18+
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, isBrowser } from '../common';
19+
// @ts-ignore
20+
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
21+
// @ts-ignore
22+
import { HelloResponse } from '../models';
23+
import { paginate } from "../pagination/paginate";
24+
import { requestBeforeHook } from '../requestBeforeHook';
25+
/**
26+
* GreetingsApi - axios parameter creator
27+
* @export
28+
*/
29+
export const GreetingsApiAxiosParamCreator = function (configuration?: Configuration) {
30+
return {
31+
/**
32+
*
33+
* @summary Get a simple greeting
34+
* @param {*} [options] Override http request option.
35+
* @throws {RequiredError}
36+
*/
37+
hello: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
38+
const localVarPath = `/hello`;
39+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
40+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
41+
let baseOptions;
42+
if (configuration) {
43+
baseOptions = configuration.baseOptions;
44+
}
45+
46+
const localVarRequestOptions: AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
47+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {} as any;
48+
const localVarQueryParameter = {} as any;
49+
50+
51+
52+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
53+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
54+
requestBeforeHook({
55+
queryParameters: localVarQueryParameter,
56+
requestConfig: localVarRequestOptions,
57+
path: localVarPath,
58+
configuration
59+
});
60+
61+
setSearchParams(localVarUrlObj, localVarQueryParameter);
62+
return {
63+
url: toPathString(localVarUrlObj),
64+
options: localVarRequestOptions,
65+
};
66+
},
67+
}
68+
};
69+
70+
/**
71+
* GreetingsApi - functional programming interface
72+
* @export
73+
*/
74+
export const GreetingsApiFp = function(configuration?: Configuration) {
75+
const localVarAxiosParamCreator = GreetingsApiAxiosParamCreator(configuration)
76+
return {
77+
/**
78+
*
79+
* @summary Get a simple greeting
80+
* @param {*} [options] Override http request option.
81+
* @throws {RequiredError}
82+
*/
83+
async hello(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<HelloResponse>> {
84+
const localVarAxiosArgs = await localVarAxiosParamCreator.hello(options);
85+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
86+
},
87+
}
88+
};
89+
90+
/**
91+
* GreetingsApi - factory interface
92+
* @export
93+
*/
94+
export const GreetingsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
95+
const localVarFp = GreetingsApiFp(configuration)
96+
return {
97+
/**
98+
*
99+
* @summary Get a simple greeting
100+
* @param {*} [options] Override http request option.
101+
* @throws {RequiredError}
102+
*/
103+
hello(options?: AxiosRequestConfig): AxiosPromise<HelloResponse> {
104+
return localVarFp.hello(options).then((request) => request(axios, basePath));
105+
},
106+
};
107+
};
108+
109+
/**
110+
* GreetingsApiGenerated - object-oriented interface
111+
* @export
112+
* @class GreetingsApiGenerated
113+
* @extends {BaseAPI}
114+
*/
115+
export class GreetingsApiGenerated extends BaseAPI {
116+
/**
117+
*
118+
* @summary Get a simple greeting
119+
* @param {*} [options] Override http request option.
120+
* @throws {RequiredError}
121+
* @memberof GreetingsApiGenerated
122+
*/
123+
public hello(options?: AxiosRequestConfig) {
124+
return GreetingsApiFp(this.configuration).hello(options).then((request) => request(this.axios, this.basePath));
125+
}
126+
}

api/greetings-api.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { GreetingsApiGenerated } from "./greetings-api-generated";
2+
export * from "./greetings-api-generated";
3+
4+
export class GreetingsApi extends GreetingsApiGenerated {}

base.ts

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/*
4+
Test Automation (No submodules)
5+
6+
SDKs (no submodules) to test automation workflows.
7+
8+
The version of the OpenAPI document: 1.0.0
9+
10+
11+
NOTE: This file is auto generated by Konfig (https://konfigthis.com).
12+
*/
13+
14+
import { Configuration } from "./configuration";
15+
// Some imports not used depending on template conditions
16+
// @ts-ignore
17+
import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
18+
19+
export const BASE_PATH = "http://google.com".replace(/\/+$/, "");
20+
21+
/**
22+
*
23+
* @export
24+
*/
25+
export const COLLECTION_FORMATS = {
26+
csv: ",",
27+
ssv: " ",
28+
tsv: "\t",
29+
pipes: "|",
30+
};
31+
32+
/**
33+
*
34+
* @export
35+
* @interface RequestArgs
36+
*/
37+
export interface RequestArgs {
38+
url: string;
39+
options: AxiosRequestConfig;
40+
}
41+
42+
/**
43+
*
44+
* @export
45+
* @class BaseAPI
46+
*/
47+
export class BaseAPI {
48+
protected configuration: Configuration | undefined;
49+
50+
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
51+
if (configuration) {
52+
this.configuration = configuration;
53+
this.basePath = configuration.basePath || this.basePath;
54+
}
55+
}
56+
};
57+
58+
/**
59+
*
60+
* @export
61+
* @class RequiredError
62+
* @extends {Error}
63+
*/
64+
export class RequiredError extends Error {
65+
name: "RequiredError" = "RequiredError";
66+
constructor(public field: string, msg?: string) {
67+
super(msg);
68+
}
69+
}

client-custom.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { ConfigurationParameters } from "./configuration";
2+
3+
export class AutomationTestWithSubmoduleCustom {
4+
constructor(configurationParameters: ConfigurationParameters) {}
5+
}

client.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
Test Automation (No submodules)
3+
4+
SDKs (no submodules) to test automation workflows.
5+
6+
The version of the OpenAPI document: 1.0.0
7+
8+
9+
NOTE: This file is auto generated by Konfig (https://konfigthis.com).
10+
*/
11+
12+
import { AxiosRequestConfig } from "axios";
13+
import {
14+
GreetingsApi,
15+
} from "./api";
16+
import { Configuration, ConfigurationParameters } from "./configuration";
17+
import { AutomationTestWithSubmoduleCustom } from "./client-custom";
18+
19+
export class AutomationTestWithSubmodule extends AutomationTestWithSubmoduleCustom {
20+
readonly greetings: GreetingsApi;
21+
22+
constructor(configurationParameters: ConfigurationParameters = {}) {
23+
super(configurationParameters);
24+
const configuration = new Configuration(configurationParameters);
25+
this.greetings = new GreetingsApi(configuration);
26+
}
27+
28+
}

0 commit comments

Comments
 (0)