@teemill/returns 0.1.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.
- package/README.md +84 -0
- package/api.ts +383 -0
- package/base.ts +86 -0
- package/common.ts +150 -0
- package/configuration.ts +115 -0
- package/dist/api.d.ts +246 -0
- package/dist/api.js +235 -0
- package/dist/base.d.ts +66 -0
- package/dist/base.js +65 -0
- package/dist/common.d.ts +65 -0
- package/dist/common.js +161 -0
- package/dist/configuration.d.ts +91 -0
- package/dist/configuration.js +44 -0
- package/dist/esm/api.d.ts +246 -0
- package/dist/esm/api.js +228 -0
- package/dist/esm/base.d.ts +66 -0
- package/dist/esm/base.js +60 -0
- package/dist/esm/common.d.ts +65 -0
- package/dist/esm/common.js +149 -0
- package/dist/esm/configuration.d.ts +91 -0
- package/dist/esm/configuration.js +40 -0
- package/dist/esm/index.d.ts +13 -0
- package/dist/esm/index.js +15 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +31 -0
- package/docs/ApiError.md +22 -0
- package/docs/ReturnReason.md +30 -0
- package/docs/ReturnReasons.md +22 -0
- package/docs/ReturnsApi.md +133 -0
- package/git_push.sh +57 -0
- package/index.ts +18 -0
- package/package.json +33 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +18 -0
package/configuration.ts
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Returns API
|
|
5
|
+
* Manage PodOS Returns
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export interface ConfigurationParameters {
|
|
17
|
+
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
|
18
|
+
username?: string;
|
|
19
|
+
password?: string;
|
|
20
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
21
|
+
basePath?: string;
|
|
22
|
+
serverIndex?: number;
|
|
23
|
+
baseOptions?: any;
|
|
24
|
+
formDataCtor?: new () => any;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export class Configuration {
|
|
28
|
+
/**
|
|
29
|
+
* parameter for apiKey security
|
|
30
|
+
* @param name security name
|
|
31
|
+
* @memberof Configuration
|
|
32
|
+
*/
|
|
33
|
+
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
|
34
|
+
/**
|
|
35
|
+
* parameter for basic security
|
|
36
|
+
*
|
|
37
|
+
* @type {string}
|
|
38
|
+
* @memberof Configuration
|
|
39
|
+
*/
|
|
40
|
+
username?: string;
|
|
41
|
+
/**
|
|
42
|
+
* parameter for basic security
|
|
43
|
+
*
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @memberof Configuration
|
|
46
|
+
*/
|
|
47
|
+
password?: string;
|
|
48
|
+
/**
|
|
49
|
+
* parameter for oauth2 security
|
|
50
|
+
* @param name security name
|
|
51
|
+
* @param scopes oauth2 scope
|
|
52
|
+
* @memberof Configuration
|
|
53
|
+
*/
|
|
54
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
55
|
+
/**
|
|
56
|
+
* override base path
|
|
57
|
+
*
|
|
58
|
+
* @type {string}
|
|
59
|
+
* @memberof Configuration
|
|
60
|
+
*/
|
|
61
|
+
basePath?: string;
|
|
62
|
+
/**
|
|
63
|
+
* override server index
|
|
64
|
+
*
|
|
65
|
+
* @type {number}
|
|
66
|
+
* @memberof Configuration
|
|
67
|
+
*/
|
|
68
|
+
serverIndex?: number;
|
|
69
|
+
/**
|
|
70
|
+
* base options for axios calls
|
|
71
|
+
*
|
|
72
|
+
* @type {any}
|
|
73
|
+
* @memberof Configuration
|
|
74
|
+
*/
|
|
75
|
+
baseOptions?: any;
|
|
76
|
+
/**
|
|
77
|
+
* The FormData constructor that will be used to create multipart form data
|
|
78
|
+
* requests. You can inject this here so that execution environments that
|
|
79
|
+
* do not support the FormData class can still run the generated client.
|
|
80
|
+
*
|
|
81
|
+
* @type {new () => FormData}
|
|
82
|
+
*/
|
|
83
|
+
formDataCtor?: new () => any;
|
|
84
|
+
|
|
85
|
+
constructor(param: ConfigurationParameters = {}) {
|
|
86
|
+
this.apiKey = param.apiKey;
|
|
87
|
+
this.username = param.username;
|
|
88
|
+
this.password = param.password;
|
|
89
|
+
this.accessToken = param.accessToken;
|
|
90
|
+
this.basePath = param.basePath;
|
|
91
|
+
this.serverIndex = param.serverIndex;
|
|
92
|
+
this.baseOptions = {
|
|
93
|
+
...param.baseOptions,
|
|
94
|
+
headers: {
|
|
95
|
+
...param.baseOptions?.headers,
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
this.formDataCtor = param.formDataCtor;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Check if the given MIME is a JSON MIME.
|
|
103
|
+
* JSON MIME examples:
|
|
104
|
+
* application/json
|
|
105
|
+
* application/json; charset=UTF8
|
|
106
|
+
* APPLICATION/JSON
|
|
107
|
+
* application/vnd.company+json
|
|
108
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
109
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
110
|
+
*/
|
|
111
|
+
public isJsonMime(mime: string): boolean {
|
|
112
|
+
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
|
113
|
+
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
|
114
|
+
}
|
|
115
|
+
}
|
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns API
|
|
3
|
+
* Manage PodOS Returns
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.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
|
+
import type { Configuration } from './configuration';
|
|
13
|
+
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
|
14
|
+
import type { RequestArgs } from './base';
|
|
15
|
+
import { BaseAPI } from './base';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface ApiError
|
|
20
|
+
*/
|
|
21
|
+
export interface ApiError {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof ApiError
|
|
26
|
+
*/
|
|
27
|
+
'code'?: string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof ApiError
|
|
32
|
+
*/
|
|
33
|
+
'message': string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @export
|
|
38
|
+
* @interface ReturnReason
|
|
39
|
+
*/
|
|
40
|
+
export interface ReturnReason {
|
|
41
|
+
/**
|
|
42
|
+
* Unique object identifier
|
|
43
|
+
* @type {string}
|
|
44
|
+
* @memberof ReturnReason
|
|
45
|
+
*/
|
|
46
|
+
'id': string;
|
|
47
|
+
/**
|
|
48
|
+
* A reference to the resource location
|
|
49
|
+
* @type {string}
|
|
50
|
+
* @memberof ReturnReason
|
|
51
|
+
*/
|
|
52
|
+
'ref': string;
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @type {string}
|
|
56
|
+
* @memberof ReturnReason
|
|
57
|
+
*/
|
|
58
|
+
'name': string;
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* @type {string}
|
|
62
|
+
* @memberof ReturnReason
|
|
63
|
+
*/
|
|
64
|
+
'code': string;
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* @type {string}
|
|
68
|
+
* @memberof ReturnReason
|
|
69
|
+
*/
|
|
70
|
+
'createdAt': string;
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* @type {string}
|
|
74
|
+
* @memberof ReturnReason
|
|
75
|
+
*/
|
|
76
|
+
'updatedAt': string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
* @export
|
|
81
|
+
* @interface ReturnReasons
|
|
82
|
+
*/
|
|
83
|
+
export interface ReturnReasons {
|
|
84
|
+
/**
|
|
85
|
+
*
|
|
86
|
+
* @type {Array<ReturnReason>}
|
|
87
|
+
* @memberof ReturnReasons
|
|
88
|
+
*/
|
|
89
|
+
'returnReasons': Array<ReturnReason>;
|
|
90
|
+
/**
|
|
91
|
+
*
|
|
92
|
+
* @type {number}
|
|
93
|
+
* @memberof ReturnReasons
|
|
94
|
+
*/
|
|
95
|
+
'nextPageToken': number;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* ReturnsApi - axios parameter creator
|
|
99
|
+
* @export
|
|
100
|
+
*/
|
|
101
|
+
export declare const ReturnsApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
102
|
+
/**
|
|
103
|
+
* Get a return reason
|
|
104
|
+
* @summary Get a return reason
|
|
105
|
+
* @param {string} project What project it is
|
|
106
|
+
* @param {string} id The ID of the return reason
|
|
107
|
+
* @param {*} [options] Override http request option.
|
|
108
|
+
* @throws {RequiredError}
|
|
109
|
+
*/
|
|
110
|
+
getReturnReason: (project: string, id: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
111
|
+
/**
|
|
112
|
+
* List return reasons
|
|
113
|
+
* @summary List return reasons
|
|
114
|
+
* @param {string} project What project it is
|
|
115
|
+
* @param {string} [search] Search term to filter results
|
|
116
|
+
* @param {number} [pageToken] Page reference token
|
|
117
|
+
* @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
|
|
118
|
+
* @param {*} [options] Override http request option.
|
|
119
|
+
* @throws {RequiredError}
|
|
120
|
+
*/
|
|
121
|
+
listReturnReasons: (project: string, search?: string, pageToken?: number, pageSize?: number, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* ReturnsApi - functional programming interface
|
|
125
|
+
* @export
|
|
126
|
+
*/
|
|
127
|
+
export declare const ReturnsApiFp: (configuration?: Configuration) => {
|
|
128
|
+
/**
|
|
129
|
+
* Get a return reason
|
|
130
|
+
* @summary Get a return reason
|
|
131
|
+
* @param {string} project What project it is
|
|
132
|
+
* @param {string} id The ID of the return reason
|
|
133
|
+
* @param {*} [options] Override http request option.
|
|
134
|
+
* @throws {RequiredError}
|
|
135
|
+
*/
|
|
136
|
+
getReturnReason(project: string, id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ReturnReason>>;
|
|
137
|
+
/**
|
|
138
|
+
* List return reasons
|
|
139
|
+
* @summary List return reasons
|
|
140
|
+
* @param {string} project What project it is
|
|
141
|
+
* @param {string} [search] Search term to filter results
|
|
142
|
+
* @param {number} [pageToken] Page reference token
|
|
143
|
+
* @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
|
|
144
|
+
* @param {*} [options] Override http request option.
|
|
145
|
+
* @throws {RequiredError}
|
|
146
|
+
*/
|
|
147
|
+
listReturnReasons(project: string, search?: string, pageToken?: number, pageSize?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ReturnReasons>>;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* ReturnsApi - factory interface
|
|
151
|
+
* @export
|
|
152
|
+
*/
|
|
153
|
+
export declare const ReturnsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
154
|
+
/**
|
|
155
|
+
* Get a return reason
|
|
156
|
+
* @summary Get a return reason
|
|
157
|
+
* @param {ReturnsApiGetReturnReasonRequest} requestParameters Request parameters.
|
|
158
|
+
* @param {*} [options] Override http request option.
|
|
159
|
+
* @throws {RequiredError}
|
|
160
|
+
*/
|
|
161
|
+
getReturnReason(requestParameters: ReturnsApiGetReturnReasonRequest, options?: RawAxiosRequestConfig): AxiosPromise<ReturnReason>;
|
|
162
|
+
/**
|
|
163
|
+
* List return reasons
|
|
164
|
+
* @summary List return reasons
|
|
165
|
+
* @param {ReturnsApiListReturnReasonsRequest} requestParameters Request parameters.
|
|
166
|
+
* @param {*} [options] Override http request option.
|
|
167
|
+
* @throws {RequiredError}
|
|
168
|
+
*/
|
|
169
|
+
listReturnReasons(requestParameters: ReturnsApiListReturnReasonsRequest, options?: RawAxiosRequestConfig): AxiosPromise<ReturnReasons>;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* Request parameters for getReturnReason operation in ReturnsApi.
|
|
173
|
+
* @export
|
|
174
|
+
* @interface ReturnsApiGetReturnReasonRequest
|
|
175
|
+
*/
|
|
176
|
+
export interface ReturnsApiGetReturnReasonRequest {
|
|
177
|
+
/**
|
|
178
|
+
* What project it is
|
|
179
|
+
* @type {string}
|
|
180
|
+
* @memberof ReturnsApiGetReturnReason
|
|
181
|
+
*/
|
|
182
|
+
readonly project: string;
|
|
183
|
+
/**
|
|
184
|
+
* The ID of the return reason
|
|
185
|
+
* @type {string}
|
|
186
|
+
* @memberof ReturnsApiGetReturnReason
|
|
187
|
+
*/
|
|
188
|
+
readonly id: string;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Request parameters for listReturnReasons operation in ReturnsApi.
|
|
192
|
+
* @export
|
|
193
|
+
* @interface ReturnsApiListReturnReasonsRequest
|
|
194
|
+
*/
|
|
195
|
+
export interface ReturnsApiListReturnReasonsRequest {
|
|
196
|
+
/**
|
|
197
|
+
* What project it is
|
|
198
|
+
* @type {string}
|
|
199
|
+
* @memberof ReturnsApiListReturnReasons
|
|
200
|
+
*/
|
|
201
|
+
readonly project: string;
|
|
202
|
+
/**
|
|
203
|
+
* Search term to filter results
|
|
204
|
+
* @type {string}
|
|
205
|
+
* @memberof ReturnsApiListReturnReasons
|
|
206
|
+
*/
|
|
207
|
+
readonly search?: string;
|
|
208
|
+
/**
|
|
209
|
+
* Page reference token
|
|
210
|
+
* @type {number}
|
|
211
|
+
* @memberof ReturnsApiListReturnReasons
|
|
212
|
+
*/
|
|
213
|
+
readonly pageToken?: number;
|
|
214
|
+
/**
|
|
215
|
+
* Max page size. This is the maximum page size that will be returned, but it might be smaller.
|
|
216
|
+
* @type {number}
|
|
217
|
+
* @memberof ReturnsApiListReturnReasons
|
|
218
|
+
*/
|
|
219
|
+
readonly pageSize?: number;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* ReturnsApi - object-oriented interface
|
|
223
|
+
* @export
|
|
224
|
+
* @class ReturnsApi
|
|
225
|
+
* @extends {BaseAPI}
|
|
226
|
+
*/
|
|
227
|
+
export declare class ReturnsApi extends BaseAPI {
|
|
228
|
+
/**
|
|
229
|
+
* Get a return reason
|
|
230
|
+
* @summary Get a return reason
|
|
231
|
+
* @param {ReturnsApiGetReturnReasonRequest} requestParameters Request parameters.
|
|
232
|
+
* @param {*} [options] Override http request option.
|
|
233
|
+
* @throws {RequiredError}
|
|
234
|
+
* @memberof ReturnsApi
|
|
235
|
+
*/
|
|
236
|
+
getReturnReason(requestParameters: ReturnsApiGetReturnReasonRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<ReturnReason, any>>;
|
|
237
|
+
/**
|
|
238
|
+
* List return reasons
|
|
239
|
+
* @summary List return reasons
|
|
240
|
+
* @param {ReturnsApiListReturnReasonsRequest} requestParameters Request parameters.
|
|
241
|
+
* @param {*} [options] Override http request option.
|
|
242
|
+
* @throws {RequiredError}
|
|
243
|
+
* @memberof ReturnsApi
|
|
244
|
+
*/
|
|
245
|
+
listReturnReasons(requestParameters: ReturnsApiListReturnReasonsRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<ReturnReasons, any>>;
|
|
246
|
+
}
|
package/dist/api.js
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Returns API
|
|
6
|
+
* Manage PodOS Returns
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.1.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.ReturnsApi = exports.ReturnsApiFactory = exports.ReturnsApiFp = exports.ReturnsApiAxiosParamCreator = void 0;
|
|
26
|
+
const axios_1 = require("axios");
|
|
27
|
+
// Some imports not used depending on template conditions
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
const common_1 = require("./common");
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
const base_1 = require("./base");
|
|
32
|
+
/**
|
|
33
|
+
* ReturnsApi - axios parameter creator
|
|
34
|
+
* @export
|
|
35
|
+
*/
|
|
36
|
+
const ReturnsApiAxiosParamCreator = function (configuration) {
|
|
37
|
+
return {
|
|
38
|
+
/**
|
|
39
|
+
* Get a return reason
|
|
40
|
+
* @summary Get a return reason
|
|
41
|
+
* @param {string} project What project it is
|
|
42
|
+
* @param {string} id The ID of the return reason
|
|
43
|
+
* @param {*} [options] Override http request option.
|
|
44
|
+
* @throws {RequiredError}
|
|
45
|
+
*/
|
|
46
|
+
getReturnReason: (project_1, id_1, ...args_1) => __awaiter(this, [project_1, id_1, ...args_1], void 0, function* (project, id, options = {}) {
|
|
47
|
+
// verify required parameter 'project' is not null or undefined
|
|
48
|
+
(0, common_1.assertParamExists)('getReturnReason', 'project', project);
|
|
49
|
+
// verify required parameter 'id' is not null or undefined
|
|
50
|
+
(0, common_1.assertParamExists)('getReturnReason', 'id', id);
|
|
51
|
+
const localVarPath = `/v1/returns/reasons/{id}`
|
|
52
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
53
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
54
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
55
|
+
let baseOptions;
|
|
56
|
+
if (configuration) {
|
|
57
|
+
baseOptions = configuration.baseOptions;
|
|
58
|
+
}
|
|
59
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
60
|
+
const localVarHeaderParameter = {};
|
|
61
|
+
const localVarQueryParameter = {};
|
|
62
|
+
// authentication session-oauth required
|
|
63
|
+
// oauth required
|
|
64
|
+
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "session-oauth", [], configuration);
|
|
65
|
+
// authentication api-key required
|
|
66
|
+
yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
|
|
67
|
+
if (project !== undefined) {
|
|
68
|
+
localVarQueryParameter['project'] = project;
|
|
69
|
+
}
|
|
70
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
71
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
72
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
73
|
+
return {
|
|
74
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
75
|
+
options: localVarRequestOptions,
|
|
76
|
+
};
|
|
77
|
+
}),
|
|
78
|
+
/**
|
|
79
|
+
* List return reasons
|
|
80
|
+
* @summary List return reasons
|
|
81
|
+
* @param {string} project What project it is
|
|
82
|
+
* @param {string} [search] Search term to filter results
|
|
83
|
+
* @param {number} [pageToken] Page reference token
|
|
84
|
+
* @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
|
|
85
|
+
* @param {*} [options] Override http request option.
|
|
86
|
+
* @throws {RequiredError}
|
|
87
|
+
*/
|
|
88
|
+
listReturnReasons: (project_1, search_1, pageToken_1, pageSize_1, ...args_1) => __awaiter(this, [project_1, search_1, pageToken_1, pageSize_1, ...args_1], void 0, function* (project, search, pageToken, pageSize, options = {}) {
|
|
89
|
+
// verify required parameter 'project' is not null or undefined
|
|
90
|
+
(0, common_1.assertParamExists)('listReturnReasons', 'project', project);
|
|
91
|
+
const localVarPath = `/v1/returns/reasons`;
|
|
92
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
93
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
94
|
+
let baseOptions;
|
|
95
|
+
if (configuration) {
|
|
96
|
+
baseOptions = configuration.baseOptions;
|
|
97
|
+
}
|
|
98
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
99
|
+
const localVarHeaderParameter = {};
|
|
100
|
+
const localVarQueryParameter = {};
|
|
101
|
+
// authentication session-oauth required
|
|
102
|
+
// oauth required
|
|
103
|
+
yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "session-oauth", [], configuration);
|
|
104
|
+
// authentication api-key required
|
|
105
|
+
yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
|
|
106
|
+
if (project !== undefined) {
|
|
107
|
+
localVarQueryParameter['project'] = project;
|
|
108
|
+
}
|
|
109
|
+
if (search !== undefined) {
|
|
110
|
+
localVarQueryParameter['search'] = search;
|
|
111
|
+
}
|
|
112
|
+
if (pageToken !== undefined) {
|
|
113
|
+
localVarQueryParameter['pageToken'] = pageToken;
|
|
114
|
+
}
|
|
115
|
+
if (pageSize !== undefined) {
|
|
116
|
+
localVarQueryParameter['pageSize'] = pageSize;
|
|
117
|
+
}
|
|
118
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
119
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
120
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
121
|
+
return {
|
|
122
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
123
|
+
options: localVarRequestOptions,
|
|
124
|
+
};
|
|
125
|
+
}),
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
exports.ReturnsApiAxiosParamCreator = ReturnsApiAxiosParamCreator;
|
|
129
|
+
/**
|
|
130
|
+
* ReturnsApi - functional programming interface
|
|
131
|
+
* @export
|
|
132
|
+
*/
|
|
133
|
+
const ReturnsApiFp = function (configuration) {
|
|
134
|
+
const localVarAxiosParamCreator = (0, exports.ReturnsApiAxiosParamCreator)(configuration);
|
|
135
|
+
return {
|
|
136
|
+
/**
|
|
137
|
+
* Get a return reason
|
|
138
|
+
* @summary Get a return reason
|
|
139
|
+
* @param {string} project What project it is
|
|
140
|
+
* @param {string} id The ID of the return reason
|
|
141
|
+
* @param {*} [options] Override http request option.
|
|
142
|
+
* @throws {RequiredError}
|
|
143
|
+
*/
|
|
144
|
+
getReturnReason(project, id, options) {
|
|
145
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
+
var _a, _b, _c;
|
|
147
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getReturnReason(project, id, options);
|
|
148
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
149
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ReturnsApi.getReturnReason']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
150
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
151
|
+
});
|
|
152
|
+
},
|
|
153
|
+
/**
|
|
154
|
+
* List return reasons
|
|
155
|
+
* @summary List return reasons
|
|
156
|
+
* @param {string} project What project it is
|
|
157
|
+
* @param {string} [search] Search term to filter results
|
|
158
|
+
* @param {number} [pageToken] Page reference token
|
|
159
|
+
* @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
|
|
160
|
+
* @param {*} [options] Override http request option.
|
|
161
|
+
* @throws {RequiredError}
|
|
162
|
+
*/
|
|
163
|
+
listReturnReasons(project, search, pageToken, pageSize, options) {
|
|
164
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
165
|
+
var _a, _b, _c;
|
|
166
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listReturnReasons(project, search, pageToken, pageSize, options);
|
|
167
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
168
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ReturnsApi.listReturnReasons']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
169
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
170
|
+
});
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
exports.ReturnsApiFp = ReturnsApiFp;
|
|
175
|
+
/**
|
|
176
|
+
* ReturnsApi - factory interface
|
|
177
|
+
* @export
|
|
178
|
+
*/
|
|
179
|
+
const ReturnsApiFactory = function (configuration, basePath, axios) {
|
|
180
|
+
const localVarFp = (0, exports.ReturnsApiFp)(configuration);
|
|
181
|
+
return {
|
|
182
|
+
/**
|
|
183
|
+
* Get a return reason
|
|
184
|
+
* @summary Get a return reason
|
|
185
|
+
* @param {ReturnsApiGetReturnReasonRequest} requestParameters Request parameters.
|
|
186
|
+
* @param {*} [options] Override http request option.
|
|
187
|
+
* @throws {RequiredError}
|
|
188
|
+
*/
|
|
189
|
+
getReturnReason(requestParameters, options) {
|
|
190
|
+
return localVarFp.getReturnReason(requestParameters.project, requestParameters.id, options).then((request) => request(axios, basePath));
|
|
191
|
+
},
|
|
192
|
+
/**
|
|
193
|
+
* List return reasons
|
|
194
|
+
* @summary List return reasons
|
|
195
|
+
* @param {ReturnsApiListReturnReasonsRequest} requestParameters Request parameters.
|
|
196
|
+
* @param {*} [options] Override http request option.
|
|
197
|
+
* @throws {RequiredError}
|
|
198
|
+
*/
|
|
199
|
+
listReturnReasons(requestParameters, options) {
|
|
200
|
+
return localVarFp.listReturnReasons(requestParameters.project, requestParameters.search, requestParameters.pageToken, requestParameters.pageSize, options).then((request) => request(axios, basePath));
|
|
201
|
+
},
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
exports.ReturnsApiFactory = ReturnsApiFactory;
|
|
205
|
+
/**
|
|
206
|
+
* ReturnsApi - object-oriented interface
|
|
207
|
+
* @export
|
|
208
|
+
* @class ReturnsApi
|
|
209
|
+
* @extends {BaseAPI}
|
|
210
|
+
*/
|
|
211
|
+
class ReturnsApi extends base_1.BaseAPI {
|
|
212
|
+
/**
|
|
213
|
+
* Get a return reason
|
|
214
|
+
* @summary Get a return reason
|
|
215
|
+
* @param {ReturnsApiGetReturnReasonRequest} requestParameters Request parameters.
|
|
216
|
+
* @param {*} [options] Override http request option.
|
|
217
|
+
* @throws {RequiredError}
|
|
218
|
+
* @memberof ReturnsApi
|
|
219
|
+
*/
|
|
220
|
+
getReturnReason(requestParameters, options) {
|
|
221
|
+
return (0, exports.ReturnsApiFp)(this.configuration).getReturnReason(requestParameters.project, requestParameters.id, options).then((request) => request(this.axios, this.basePath));
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* List return reasons
|
|
225
|
+
* @summary List return reasons
|
|
226
|
+
* @param {ReturnsApiListReturnReasonsRequest} requestParameters Request parameters.
|
|
227
|
+
* @param {*} [options] Override http request option.
|
|
228
|
+
* @throws {RequiredError}
|
|
229
|
+
* @memberof ReturnsApi
|
|
230
|
+
*/
|
|
231
|
+
listReturnReasons(requestParameters, options) {
|
|
232
|
+
return (0, exports.ReturnsApiFp)(this.configuration).listReturnReasons(requestParameters.project, requestParameters.search, requestParameters.pageToken, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
exports.ReturnsApi = ReturnsApi;
|
package/dist/base.d.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns API
|
|
3
|
+
* Manage PodOS Returns
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.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
|
+
import type { Configuration } from './configuration';
|
|
13
|
+
import type { AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
|
14
|
+
export declare const BASE_PATH: string;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @export
|
|
18
|
+
*/
|
|
19
|
+
export declare const COLLECTION_FORMATS: {
|
|
20
|
+
csv: string;
|
|
21
|
+
ssv: string;
|
|
22
|
+
tsv: string;
|
|
23
|
+
pipes: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @export
|
|
28
|
+
* @interface RequestArgs
|
|
29
|
+
*/
|
|
30
|
+
export interface RequestArgs {
|
|
31
|
+
url: string;
|
|
32
|
+
options: RawAxiosRequestConfig;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @export
|
|
37
|
+
* @class BaseAPI
|
|
38
|
+
*/
|
|
39
|
+
export declare class BaseAPI {
|
|
40
|
+
protected basePath: string;
|
|
41
|
+
protected axios: AxiosInstance;
|
|
42
|
+
protected configuration: Configuration | undefined;
|
|
43
|
+
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @export
|
|
48
|
+
* @class RequiredError
|
|
49
|
+
* @extends {Error}
|
|
50
|
+
*/
|
|
51
|
+
export declare class RequiredError extends Error {
|
|
52
|
+
field: string;
|
|
53
|
+
constructor(field: string, msg?: string);
|
|
54
|
+
}
|
|
55
|
+
interface ServerMap {
|
|
56
|
+
[key: string]: {
|
|
57
|
+
url: string;
|
|
58
|
+
description: string;
|
|
59
|
+
}[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @export
|
|
64
|
+
*/
|
|
65
|
+
export declare const operationServerMap: ServerMap;
|
|
66
|
+
export {};
|