ch-admin-api-client-typescript 5.0.2 → 5.0.4

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.
@@ -20,10 +20,11 @@ import { MediaModel } from '../models';
20
20
  export declare const ImagesApiAxiosParamCreator: (configuration?: Configuration) => {
21
21
  /**
22
22
  *
23
+ * @param {Array<File>} [files]
23
24
  * @param {*} [options] Override http request option.
24
25
  * @throws {RequiredError}
25
26
  */
26
- apiV1ImagesPost: (options?: AxiosRequestConfig) => Promise<RequestArgs>;
27
+ apiV1ImagesPost: (files?: Array<File>, options?: AxiosRequestConfig) => Promise<RequestArgs>;
27
28
  };
28
29
  /**
29
30
  * ImagesApi - functional programming interface
@@ -32,10 +33,11 @@ export declare const ImagesApiAxiosParamCreator: (configuration?: Configuration)
32
33
  export declare const ImagesApiFp: (configuration?: Configuration) => {
33
34
  /**
34
35
  *
36
+ * @param {Array<File>} [files]
35
37
  * @param {*} [options] Override http request option.
36
38
  * @throws {RequiredError}
37
39
  */
38
- apiV1ImagesPost(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<MediaModel>>>;
40
+ apiV1ImagesPost(files?: Array<File>, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<MediaModel>>>;
39
41
  };
40
42
  /**
41
43
  * ImagesApi - factory interface
@@ -44,11 +46,25 @@ export declare const ImagesApiFp: (configuration?: Configuration) => {
44
46
  export declare const ImagesApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
45
47
  /**
46
48
  *
49
+ * @param {Array<File>} [files]
47
50
  * @param {*} [options] Override http request option.
48
51
  * @throws {RequiredError}
49
52
  */
50
- apiV1ImagesPost(options?: any): AxiosPromise<Array<MediaModel>>;
53
+ apiV1ImagesPost(files?: Array<File>, options?: any): AxiosPromise<Array<MediaModel>>;
51
54
  };
55
+ /**
56
+ * Request parameters for apiV1ImagesPost operation in ImagesApi.
57
+ * @export
58
+ * @interface ImagesApiApiV1ImagesPostRequest
59
+ */
60
+ export interface ImagesApiApiV1ImagesPostRequest {
61
+ /**
62
+ *
63
+ * @type {Array<File>}
64
+ * @memberof ImagesApiApiV1ImagesPost
65
+ */
66
+ readonly files?: Array<File>;
67
+ }
52
68
  /**
53
69
  * ImagesApi - object-oriented interface
54
70
  * @export
@@ -58,10 +74,11 @@ export declare const ImagesApiFactory: (configuration?: Configuration, basePath?
58
74
  export declare class ImagesApi extends BaseAPI {
59
75
  /**
60
76
  *
77
+ * @param {ImagesApiApiV1ImagesPostRequest} requestParameters Request parameters.
61
78
  * @param {*} [options] Override http request option.
62
79
  * @throws {RequiredError}
63
80
  * @memberof ImagesApi
64
81
  */
65
- apiV1ImagesPost(options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<MediaModel[], any>>;
82
+ apiV1ImagesPost(requestParameters?: ImagesApiApiV1ImagesPostRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<MediaModel[], any>>;
66
83
  }
67
84
  //# sourceMappingURL=images-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"images-api.d.ts","sourceRoot":"","sources":["../../src/api/images-api.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAGH,OAAoB,EAAE,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKjD,OAAO,EAAiC,WAAW,EAAE,OAAO,EAAiB,MAAM,SAAS,CAAC;AAE7F,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC;;;GAGG;AACH,eAAO,MAAM,0BAA0B,mBAA6B,aAAa;IAEzE;;;;OAIG;gCAC8B,kBAAkB,KAAQ,QAAQ,WAAW,CAAC;CA6BtF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,mBAA4B,aAAa;IAGzD;;;;OAIG;8BAC6B,k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;AACH,MAAM,WAAW,+BAA+B;IAC5C;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;CAC/B;AAED;;;;;GAKG;AACH,qBAAa,SAAU,SAAQ,OAAO;IAClC;;;;;;OAMG;IACI,eAAe,CAAC,iBAAiB,GAAE,+BAAoC,EAAE,OAAO,CAAC,EAAE,kBAAkB;CAG/G"}
@@ -94,13 +94,14 @@ var ImagesApiAxiosParamCreator = function (configuration) {
94
94
  return {
95
95
  /**
96
96
  *
97
+ * @param {Array<File>} [files]
97
98
  * @param {*} [options] Override http request option.
98
99
  * @throws {RequiredError}
99
100
  */
100
- apiV1ImagesPost: function (options) {
101
+ apiV1ImagesPost: function (files, options) {
101
102
  if (options === void 0) { options = {}; }
102
103
  return __awaiter(_this, void 0, void 0, function () {
103
- var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
104
+ var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, localVarFormParams, headersFromBaseOptions;
104
105
  return __generator(this, function (_a) {
105
106
  switch (_a.label) {
106
107
  case 0:
@@ -112,6 +113,7 @@ var ImagesApiAxiosParamCreator = function (configuration) {
112
113
  localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
113
114
  localVarHeaderParameter = {};
114
115
  localVarQueryParameter = {};
116
+ localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
115
117
  // authentication oauth2 required
116
118
  // oauth required
117
119
  return [4 /*yield*/, (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["CloudHospital_admin_api", "IdentityServerApi"], configuration)];
@@ -119,9 +121,16 @@ var ImagesApiAxiosParamCreator = function (configuration) {
119
121
  // authentication oauth2 required
120
122
  // oauth required
121
123
  _a.sent();
124
+ if (files) {
125
+ files.forEach(function (element) {
126
+ localVarFormParams.append('files', element);
127
+ });
128
+ }
129
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
122
130
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
123
131
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
124
132
  localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
133
+ localVarRequestOptions.data = localVarFormParams;
125
134
  return [2 /*return*/, {
126
135
  url: (0, common_1.toPathString)(localVarUrlObj),
127
136
  options: localVarRequestOptions,
@@ -142,15 +151,16 @@ var ImagesApiFp = function (configuration) {
142
151
  return {
143
152
  /**
144
153
  *
154
+ * @param {Array<File>} [files]
145
155
  * @param {*} [options] Override http request option.
146
156
  * @throws {RequiredError}
147
157
  */
148
- apiV1ImagesPost: function (options) {
158
+ apiV1ImagesPost: function (files, options) {
149
159
  return __awaiter(this, void 0, void 0, function () {
150
160
  var localVarAxiosArgs;
151
161
  return __generator(this, function (_a) {
152
162
  switch (_a.label) {
153
- case 0: return [4 /*yield*/, localVarAxiosParamCreator.apiV1ImagesPost(options)];
163
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.apiV1ImagesPost(files, options)];
154
164
  case 1:
155
165
  localVarAxiosArgs = _a.sent();
156
166
  return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
@@ -170,11 +180,12 @@ var ImagesApiFactory = function (configuration, basePath, axios) {
170
180
  return {
171
181
  /**
172
182
  *
183
+ * @param {Array<File>} [files]
173
184
  * @param {*} [options] Override http request option.
174
185
  * @throws {RequiredError}
175
186
  */
176
- apiV1ImagesPost: function (options) {
177
- return localVarFp.apiV1ImagesPost(options).then(function (request) { return request(axios, basePath); });
187
+ apiV1ImagesPost: function (files, options) {
188
+ return localVarFp.apiV1ImagesPost(files, options).then(function (request) { return request(axios, basePath); });
178
189
  },
179
190
  };
180
191
  };
@@ -192,13 +203,15 @@ var ImagesApi = /** @class */ (function (_super) {
192
203
  }
193
204
  /**
194
205
  *
206
+ * @param {ImagesApiApiV1ImagesPostRequest} requestParameters Request parameters.
195
207
  * @param {*} [options] Override http request option.
196
208
  * @throws {RequiredError}
197
209
  * @memberof ImagesApi
198
210
  */
199
- ImagesApi.prototype.apiV1ImagesPost = function (options) {
211
+ ImagesApi.prototype.apiV1ImagesPost = function (requestParameters, options) {
200
212
  var _this = this;
201
- return (0, exports.ImagesApiFp)(this.configuration).apiV1ImagesPost(options).then(function (request) { return request(_this.axios, _this.basePath); });
213
+ if (requestParameters === void 0) { requestParameters = {}; }
214
+ return (0, exports.ImagesApiFp)(this.configuration).apiV1ImagesPost(requestParameters.files, options).then(function (request) { return request(_this.axios, _this.basePath); });
202
215
  };
203
216
  return ImagesApi;
204
217
  }(base_1.BaseAPI));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ch-admin-api-client-typescript",
3
- "version": "5.0.2",
3
+ "version": "5.0.4",
4
4
  "description": "Openapi generated typescript-axios client for CloudHospital admin",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -30,10 +30,11 @@ export const ImagesApiAxiosParamCreator = function (configuration?: Configuratio
30
30
  return {
31
31
  /**
32
32
  *
33
+ * @param {Array<File>} [files]
33
34
  * @param {*} [options] Override http request option.
34
35
  * @throws {RequiredError}
35
36
  */
36
- apiV1ImagesPost: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
37
+ apiV1ImagesPost: async (files?: Array<File>, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
37
38
  const localVarPath = `/api/v1/images`;
38
39
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
39
40
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -45,16 +46,26 @@ export const ImagesApiAxiosParamCreator = function (configuration?: Configuratio
45
46
  const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
46
47
  const localVarHeaderParameter = {} as any;
47
48
  const localVarQueryParameter = {} as any;
49
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
48
50
 
49
51
  // authentication oauth2 required
50
52
  // oauth required
51
53
  await setOAuthToObject(localVarHeaderParameter, "oauth2", ["CloudHospital_admin_api", "IdentityServerApi"], configuration)
52
54
 
55
+ if (files) {
56
+ files.forEach((element) => {
57
+ localVarFormParams.append('files', element as any);
58
+ })
59
+ }
53
60
 
54
61
 
62
+
63
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
64
+
55
65
  setSearchParams(localVarUrlObj, localVarQueryParameter);
56
66
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
57
67
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
68
+ localVarRequestOptions.data = localVarFormParams;
58
69
 
59
70
  return {
60
71
  url: toPathString(localVarUrlObj),
@@ -73,11 +84,12 @@ export const ImagesApiFp = function(configuration?: Configuration) {
73
84
  return {
74
85
  /**
75
86
  *
87
+ * @param {Array<File>} [files]
76
88
  * @param {*} [options] Override http request option.
77
89
  * @throws {RequiredError}
78
90
  */
79
- async apiV1ImagesPost(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<MediaModel>>> {
80
- const localVarAxiosArgs = await localVarAxiosParamCreator.apiV1ImagesPost(options);
91
+ async apiV1ImagesPost(files?: Array<File>, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<MediaModel>>> {
92
+ const localVarAxiosArgs = await localVarAxiosParamCreator.apiV1ImagesPost(files, options);
81
93
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
82
94
  },
83
95
  }
@@ -92,15 +104,30 @@ export const ImagesApiFactory = function (configuration?: Configuration, basePat
92
104
  return {
93
105
  /**
94
106
  *
107
+ * @param {Array<File>} [files]
95
108
  * @param {*} [options] Override http request option.
96
109
  * @throws {RequiredError}
97
110
  */
98
- apiV1ImagesPost(options?: any): AxiosPromise<Array<MediaModel>> {
99
- return localVarFp.apiV1ImagesPost(options).then((request) => request(axios, basePath));
111
+ apiV1ImagesPost(files?: Array<File>, options?: any): AxiosPromise<Array<MediaModel>> {
112
+ return localVarFp.apiV1ImagesPost(files, options).then((request) => request(axios, basePath));
100
113
  },
101
114
  };
102
115
  };
103
116
 
117
+ /**
118
+ * Request parameters for apiV1ImagesPost operation in ImagesApi.
119
+ * @export
120
+ * @interface ImagesApiApiV1ImagesPostRequest
121
+ */
122
+ export interface ImagesApiApiV1ImagesPostRequest {
123
+ /**
124
+ *
125
+ * @type {Array<File>}
126
+ * @memberof ImagesApiApiV1ImagesPost
127
+ */
128
+ readonly files?: Array<File>
129
+ }
130
+
104
131
  /**
105
132
  * ImagesApi - object-oriented interface
106
133
  * @export
@@ -110,11 +137,12 @@ export const ImagesApiFactory = function (configuration?: Configuration, basePat
110
137
  export class ImagesApi extends BaseAPI {
111
138
  /**
112
139
  *
140
+ * @param {ImagesApiApiV1ImagesPostRequest} requestParameters Request parameters.
113
141
  * @param {*} [options] Override http request option.
114
142
  * @throws {RequiredError}
115
143
  * @memberof ImagesApi
116
144
  */
117
- public apiV1ImagesPost(options?: AxiosRequestConfig) {
118
- return ImagesApiFp(this.configuration).apiV1ImagesPost(options).then((request) => request(this.axios, this.basePath));
145
+ public apiV1ImagesPost(requestParameters: ImagesApiApiV1ImagesPostRequest = {}, options?: AxiosRequestConfig) {
146
+ return ImagesApiFp(this.configuration).apiV1ImagesPost(requestParameters.files, options).then((request) => request(this.axios, this.basePath));
119
147
  }
120
148
  }