@tradecafe/offer-service-sdk 0.0.1

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.
@@ -0,0 +1,14 @@
1
+ .gitignore
2
+ .openapi-generator-ignore
3
+ api.ts
4
+ api/apis.ts
5
+ api/healthApi.ts
6
+ api/matchedOffersApi.ts
7
+ api/offersApi.ts
8
+ git_push.sh
9
+ model/healthControllerPing200Response.ts
10
+ model/healthControllerPing200ResponseInfoValue.ts
11
+ model/healthControllerPing503Response.ts
12
+ model/models.ts
13
+ package.json
14
+ tsconfig.json
@@ -0,0 +1 @@
1
+ 6.0.1
@@ -0,0 +1,23 @@
1
+ # OpenAPI Generator Ignore
2
+ # Generated by openapi-generator https://github.com/openapitools/openapi-generator
3
+
4
+ # Use this file to prevent files from being overwritten by the generator.
5
+ # The patterns follow closely to .gitignore or .dockerignore.
6
+
7
+ # As an example, the C# client generator defines ApiClient.cs.
8
+ # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9
+ #ApiClient.cs
10
+
11
+ # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12
+ #foo/*/qux
13
+ # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14
+
15
+ # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16
+ #foo/**/qux
17
+ # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18
+
19
+ # You can also negate patterns with an exclamation (!).
20
+ # For example, you can ignore all files in a docs folder with the file extension .md:
21
+ #docs/*.md
22
+ # Then explicitly reverse the ignore rule for a single file:
23
+ #!docs/README.md
package/api/apis.ts ADDED
@@ -0,0 +1,18 @@
1
+ export * from './healthApi';
2
+ import { HealthApi } from './healthApi';
3
+ export * from './matchedOffersApi';
4
+ import { MatchedOffersApi } from './matchedOffersApi';
5
+ export * from './offersApi';
6
+ import { OffersApi } from './offersApi';
7
+ import * as http from 'http';
8
+
9
+ export class HttpError extends Error {
10
+ constructor (public response: http.IncomingMessage, public body: any, public statusCode?: number) {
11
+ super('HTTP request failed');
12
+ this.name = 'HttpError';
13
+ }
14
+ }
15
+
16
+ export { RequestFile } from '../model/models';
17
+
18
+ export const APIS = [HealthApi, MatchedOffersApi, OffersApi];
@@ -0,0 +1,151 @@
1
+ /**
2
+ * TradeCafé Offer Service
3
+ * Offer Service allows supplies to submit product offers into the TradeCafe platform
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ *
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
+ */
12
+
13
+
14
+ import localVarRequest from 'request';
15
+ import http from 'http';
16
+
17
+ /* tslint:disable:no-unused-locals */
18
+ import { HealthControllerPing200Response } from '../model/healthControllerPing200Response';
19
+ import { HealthControllerPing503Response } from '../model/healthControllerPing503Response';
20
+
21
+ import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
22
+
23
+ import { HttpError, RequestFile } from './apis';
24
+
25
+ let defaultBasePath = 'http://localhost';
26
+
27
+ // ===============================================
28
+ // This file is autogenerated - Please do not edit
29
+ // ===============================================
30
+
31
+ export enum HealthApiApiKeys {
32
+ }
33
+
34
+ export class HealthApi {
35
+ protected _basePath = defaultBasePath;
36
+ protected _defaultHeaders : any = {};
37
+ protected _useQuerystring : boolean = false;
38
+
39
+ protected authentications = {
40
+ 'default': <Authentication>new VoidAuth(),
41
+ }
42
+
43
+ protected interceptors: Interceptor[] = [];
44
+
45
+ constructor(basePath?: string);
46
+ constructor(basePathOrUsername: string, password?: string, basePath?: string) {
47
+ if (password) {
48
+ if (basePath) {
49
+ this.basePath = basePath;
50
+ }
51
+ } else {
52
+ if (basePathOrUsername) {
53
+ this.basePath = basePathOrUsername
54
+ }
55
+ }
56
+ }
57
+
58
+ set useQuerystring(value: boolean) {
59
+ this._useQuerystring = value;
60
+ }
61
+
62
+ set basePath(basePath: string) {
63
+ this._basePath = basePath;
64
+ }
65
+
66
+ set defaultHeaders(defaultHeaders: any) {
67
+ this._defaultHeaders = defaultHeaders;
68
+ }
69
+
70
+ get defaultHeaders() {
71
+ return this._defaultHeaders;
72
+ }
73
+
74
+ get basePath() {
75
+ return this._basePath;
76
+ }
77
+
78
+ public setDefaultAuthentication(auth: Authentication) {
79
+ this.authentications.default = auth;
80
+ }
81
+
82
+ public setApiKey(key: HealthApiApiKeys, value: string) {
83
+ (this.authentications as any)[HealthApiApiKeys[key]].apiKey = value;
84
+ }
85
+
86
+ public addInterceptor(interceptor: Interceptor) {
87
+ this.interceptors.push(interceptor);
88
+ }
89
+
90
+ /**
91
+ *
92
+ */
93
+ public async healthControllerPing (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: HealthControllerPing200Response; }> {
94
+ const localVarPath = this.basePath + '/ping';
95
+ let localVarQueryParameters: any = {};
96
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
97
+ const produces = ['application/json'];
98
+ // give precedence to 'application/json'
99
+ if (produces.indexOf('application/json') >= 0) {
100
+ localVarHeaderParams.Accept = 'application/json';
101
+ } else {
102
+ localVarHeaderParams.Accept = produces.join(',');
103
+ }
104
+ let localVarFormParams: any = {};
105
+
106
+ (<any>Object).assign(localVarHeaderParams, options.headers);
107
+
108
+ let localVarUseFormData = false;
109
+
110
+ let localVarRequestOptions: localVarRequest.Options = {
111
+ method: 'GET',
112
+ qs: localVarQueryParameters,
113
+ headers: localVarHeaderParams,
114
+ uri: localVarPath,
115
+ useQuerystring: this._useQuerystring,
116
+ json: true,
117
+ };
118
+
119
+ let authenticationPromise = Promise.resolve();
120
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
121
+
122
+ let interceptorPromise = authenticationPromise;
123
+ for (const interceptor of this.interceptors) {
124
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
125
+ }
126
+
127
+ return interceptorPromise.then(() => {
128
+ if (Object.keys(localVarFormParams).length) {
129
+ if (localVarUseFormData) {
130
+ (<any>localVarRequestOptions).formData = localVarFormParams;
131
+ } else {
132
+ localVarRequestOptions.form = localVarFormParams;
133
+ }
134
+ }
135
+ return new Promise<{ response: http.IncomingMessage; body: HealthControllerPing200Response; }>((resolve, reject) => {
136
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
137
+ if (error) {
138
+ reject(error);
139
+ } else {
140
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
141
+ body = ObjectSerializer.deserialize(body, "HealthControllerPing200Response");
142
+ resolve({ response: response, body: body });
143
+ } else {
144
+ reject(new HttpError(response, body, response.statusCode));
145
+ }
146
+ }
147
+ });
148
+ });
149
+ });
150
+ }
151
+ }