@sokol111/ecommerce-category-query-service-api 1.0.2

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/dist/api.d.ts ADDED
@@ -0,0 +1,160 @@
1
+ /**
2
+ * Category API
3
+ * API for querying categories
4
+ *
5
+ * The version of the OpenAPI document: 1.0.2
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 CategoryResponse
20
+ */
21
+ export interface CategoryResponse {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof CategoryResponse
26
+ */
27
+ 'id': string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof CategoryResponse
32
+ */
33
+ 'name': string;
34
+ }
35
+ /**
36
+ *
37
+ * @export
38
+ * @interface ErrorResponse
39
+ */
40
+ export interface ErrorResponse {
41
+ /**
42
+ *
43
+ * @type {number}
44
+ * @memberof ErrorResponse
45
+ */
46
+ 'code': number;
47
+ /**
48
+ *
49
+ * @type {string}
50
+ * @memberof ErrorResponse
51
+ */
52
+ 'message': string;
53
+ /**
54
+ *
55
+ * @type {string}
56
+ * @memberof ErrorResponse
57
+ */
58
+ 'details'?: string;
59
+ }
60
+ /**
61
+ * DefaultApi - axios parameter creator
62
+ * @export
63
+ */
64
+ export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration) => {
65
+ /**
66
+ *
67
+ * @summary Get a list of all categories
68
+ * @param {*} [options] Override http request option.
69
+ * @throws {RequiredError}
70
+ */
71
+ getAll: (options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
72
+ /**
73
+ *
74
+ * @summary Get a category by ID
75
+ * @param {string} id
76
+ * @param {*} [options] Override http request option.
77
+ * @throws {RequiredError}
78
+ */
79
+ getCategoryById: (id: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
80
+ };
81
+ /**
82
+ * DefaultApi - functional programming interface
83
+ * @export
84
+ */
85
+ export declare const DefaultApiFp: (configuration?: Configuration) => {
86
+ /**
87
+ *
88
+ * @summary Get a list of all categories
89
+ * @param {*} [options] Override http request option.
90
+ * @throws {RequiredError}
91
+ */
92
+ getAll(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<CategoryResponse>>>;
93
+ /**
94
+ *
95
+ * @summary Get a category by ID
96
+ * @param {string} id
97
+ * @param {*} [options] Override http request option.
98
+ * @throws {RequiredError}
99
+ */
100
+ getCategoryById(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CategoryResponse>>;
101
+ };
102
+ /**
103
+ * DefaultApi - factory interface
104
+ * @export
105
+ */
106
+ export declare const DefaultApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
107
+ /**
108
+ *
109
+ * @summary Get a list of all categories
110
+ * @param {*} [options] Override http request option.
111
+ * @throws {RequiredError}
112
+ */
113
+ getAll(options?: RawAxiosRequestConfig): AxiosPromise<Array<CategoryResponse>>;
114
+ /**
115
+ *
116
+ * @summary Get a category by ID
117
+ * @param {DefaultApiGetCategoryByIdRequest} requestParameters Request parameters.
118
+ * @param {*} [options] Override http request option.
119
+ * @throws {RequiredError}
120
+ */
121
+ getCategoryById(requestParameters: DefaultApiGetCategoryByIdRequest, options?: RawAxiosRequestConfig): AxiosPromise<CategoryResponse>;
122
+ };
123
+ /**
124
+ * Request parameters for getCategoryById operation in DefaultApi.
125
+ * @export
126
+ * @interface DefaultApiGetCategoryByIdRequest
127
+ */
128
+ export interface DefaultApiGetCategoryByIdRequest {
129
+ /**
130
+ *
131
+ * @type {string}
132
+ * @memberof DefaultApiGetCategoryById
133
+ */
134
+ readonly id: string;
135
+ }
136
+ /**
137
+ * DefaultApi - object-oriented interface
138
+ * @export
139
+ * @class DefaultApi
140
+ * @extends {BaseAPI}
141
+ */
142
+ export declare class DefaultApi extends BaseAPI {
143
+ /**
144
+ *
145
+ * @summary Get a list of all categories
146
+ * @param {*} [options] Override http request option.
147
+ * @throws {RequiredError}
148
+ * @memberof DefaultApi
149
+ */
150
+ getAll(options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<CategoryResponse[], any>>;
151
+ /**
152
+ *
153
+ * @summary Get a category by ID
154
+ * @param {DefaultApiGetCategoryByIdRequest} requestParameters Request parameters.
155
+ * @param {*} [options] Override http request option.
156
+ * @throws {RequiredError}
157
+ * @memberof DefaultApi
158
+ */
159
+ getCategoryById(requestParameters: DefaultApiGetCategoryByIdRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<CategoryResponse, any>>;
160
+ }
package/dist/api.js ADDED
@@ -0,0 +1,187 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Category API
5
+ * API for querying categories
6
+ *
7
+ * The version of the OpenAPI document: 1.0.2
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import globalAxios from 'axios';
24
+ // Some imports not used depending on template conditions
25
+ // @ts-ignore
26
+ import { DUMMY_BASE_URL, assertParamExists, setSearchParams, toPathString, createRequestFunction } from './common';
27
+ // @ts-ignore
28
+ import { BASE_PATH, BaseAPI, operationServerMap } from './base';
29
+ /**
30
+ * DefaultApi - axios parameter creator
31
+ * @export
32
+ */
33
+ export const DefaultApiAxiosParamCreator = function (configuration) {
34
+ return {
35
+ /**
36
+ *
37
+ * @summary Get a list of all categories
38
+ * @param {*} [options] Override http request option.
39
+ * @throws {RequiredError}
40
+ */
41
+ getAll: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) {
42
+ const localVarPath = `/category/list`;
43
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
44
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
45
+ let baseOptions;
46
+ if (configuration) {
47
+ baseOptions = configuration.baseOptions;
48
+ }
49
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
50
+ const localVarHeaderParameter = {};
51
+ const localVarQueryParameter = {};
52
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
53
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
54
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
55
+ return {
56
+ url: toPathString(localVarUrlObj),
57
+ options: localVarRequestOptions,
58
+ };
59
+ }),
60
+ /**
61
+ *
62
+ * @summary Get a category by ID
63
+ * @param {string} id
64
+ * @param {*} [options] Override http request option.
65
+ * @throws {RequiredError}
66
+ */
67
+ getCategoryById: (id_1, ...args_1) => __awaiter(this, [id_1, ...args_1], void 0, function* (id, options = {}) {
68
+ // verify required parameter 'id' is not null or undefined
69
+ assertParamExists('getCategoryById', 'id', id);
70
+ const localVarPath = `/category/get/{id}`
71
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
72
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
73
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
74
+ let baseOptions;
75
+ if (configuration) {
76
+ baseOptions = configuration.baseOptions;
77
+ }
78
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
79
+ const localVarHeaderParameter = {};
80
+ const localVarQueryParameter = {};
81
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
82
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
83
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
84
+ return {
85
+ url: toPathString(localVarUrlObj),
86
+ options: localVarRequestOptions,
87
+ };
88
+ }),
89
+ };
90
+ };
91
+ /**
92
+ * DefaultApi - functional programming interface
93
+ * @export
94
+ */
95
+ export const DefaultApiFp = function (configuration) {
96
+ const localVarAxiosParamCreator = DefaultApiAxiosParamCreator(configuration);
97
+ return {
98
+ /**
99
+ *
100
+ * @summary Get a list of all categories
101
+ * @param {*} [options] Override http request option.
102
+ * @throws {RequiredError}
103
+ */
104
+ getAll(options) {
105
+ return __awaiter(this, void 0, void 0, function* () {
106
+ var _a, _b, _c;
107
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getAll(options);
108
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
109
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['DefaultApi.getAll']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
110
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
111
+ });
112
+ },
113
+ /**
114
+ *
115
+ * @summary Get a category by ID
116
+ * @param {string} id
117
+ * @param {*} [options] Override http request option.
118
+ * @throws {RequiredError}
119
+ */
120
+ getCategoryById(id, options) {
121
+ return __awaiter(this, void 0, void 0, function* () {
122
+ var _a, _b, _c;
123
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getCategoryById(id, options);
124
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
125
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['DefaultApi.getCategoryById']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
126
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
127
+ });
128
+ },
129
+ };
130
+ };
131
+ /**
132
+ * DefaultApi - factory interface
133
+ * @export
134
+ */
135
+ export const DefaultApiFactory = function (configuration, basePath, axios) {
136
+ const localVarFp = DefaultApiFp(configuration);
137
+ return {
138
+ /**
139
+ *
140
+ * @summary Get a list of all categories
141
+ * @param {*} [options] Override http request option.
142
+ * @throws {RequiredError}
143
+ */
144
+ getAll(options) {
145
+ return localVarFp.getAll(options).then((request) => request(axios, basePath));
146
+ },
147
+ /**
148
+ *
149
+ * @summary Get a category by ID
150
+ * @param {DefaultApiGetCategoryByIdRequest} requestParameters Request parameters.
151
+ * @param {*} [options] Override http request option.
152
+ * @throws {RequiredError}
153
+ */
154
+ getCategoryById(requestParameters, options) {
155
+ return localVarFp.getCategoryById(requestParameters.id, options).then((request) => request(axios, basePath));
156
+ },
157
+ };
158
+ };
159
+ /**
160
+ * DefaultApi - object-oriented interface
161
+ * @export
162
+ * @class DefaultApi
163
+ * @extends {BaseAPI}
164
+ */
165
+ export class DefaultApi extends BaseAPI {
166
+ /**
167
+ *
168
+ * @summary Get a list of all categories
169
+ * @param {*} [options] Override http request option.
170
+ * @throws {RequiredError}
171
+ * @memberof DefaultApi
172
+ */
173
+ getAll(options) {
174
+ return DefaultApiFp(this.configuration).getAll(options).then((request) => request(this.axios, this.basePath));
175
+ }
176
+ /**
177
+ *
178
+ * @summary Get a category by ID
179
+ * @param {DefaultApiGetCategoryByIdRequest} requestParameters Request parameters.
180
+ * @param {*} [options] Override http request option.
181
+ * @throws {RequiredError}
182
+ * @memberof DefaultApi
183
+ */
184
+ getCategoryById(requestParameters, options) {
185
+ return DefaultApiFp(this.configuration).getCategoryById(requestParameters.id, options).then((request) => request(this.axios, this.basePath));
186
+ }
187
+ }
package/dist/base.d.ts ADDED
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Category API
3
+ * API for querying categories
4
+ *
5
+ * The version of the OpenAPI document: 1.0.2
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 {};
package/dist/base.js ADDED
@@ -0,0 +1,60 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Category API
5
+ * API for querying categories
6
+ *
7
+ * The version of the OpenAPI document: 1.0.2
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
+ import globalAxios from 'axios';
15
+ export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
16
+ /**
17
+ *
18
+ * @export
19
+ */
20
+ export const COLLECTION_FORMATS = {
21
+ csv: ",",
22
+ ssv: " ",
23
+ tsv: "\t",
24
+ pipes: "|",
25
+ };
26
+ /**
27
+ *
28
+ * @export
29
+ * @class BaseAPI
30
+ */
31
+ export class BaseAPI {
32
+ constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
33
+ var _a;
34
+ this.basePath = basePath;
35
+ this.axios = axios;
36
+ if (configuration) {
37
+ this.configuration = configuration;
38
+ this.basePath = (_a = configuration.basePath) !== null && _a !== void 0 ? _a : basePath;
39
+ }
40
+ }
41
+ }
42
+ ;
43
+ /**
44
+ *
45
+ * @export
46
+ * @class RequiredError
47
+ * @extends {Error}
48
+ */
49
+ export class RequiredError extends Error {
50
+ constructor(field, msg) {
51
+ super(msg);
52
+ this.field = field;
53
+ this.name = "RequiredError";
54
+ }
55
+ }
56
+ /**
57
+ *
58
+ * @export
59
+ */
60
+ export const operationServerMap = {};
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Category API
3
+ * API for querying categories
4
+ *
5
+ * The version of the OpenAPI document: 1.0.2
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 { RequestArgs } from "./base";
14
+ import type { AxiosInstance, AxiosResponse } from 'axios';
15
+ /**
16
+ *
17
+ * @export
18
+ */
19
+ export declare const DUMMY_BASE_URL = "https://example.com";
20
+ /**
21
+ *
22
+ * @throws {RequiredError}
23
+ * @export
24
+ */
25
+ export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
26
+ /**
27
+ *
28
+ * @export
29
+ */
30
+ export declare const setApiKeyToObject: (object: any, keyParamName: string, configuration?: Configuration) => Promise<void>;
31
+ /**
32
+ *
33
+ * @export
34
+ */
35
+ export declare const setBasicAuthToObject: (object: any, configuration?: Configuration) => void;
36
+ /**
37
+ *
38
+ * @export
39
+ */
40
+ export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
41
+ /**
42
+ *
43
+ * @export
44
+ */
45
+ export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
46
+ /**
47
+ *
48
+ * @export
49
+ */
50
+ export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
51
+ /**
52
+ *
53
+ * @export
54
+ */
55
+ export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
56
+ /**
57
+ *
58
+ * @export
59
+ */
60
+ export declare const toPathString: (url: URL) => string;
61
+ /**
62
+ *
63
+ * @export
64
+ */
65
+ export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
package/dist/common.js ADDED
@@ -0,0 +1,149 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Category API
5
+ * API for querying categories
6
+ *
7
+ * The version of the OpenAPI document: 1.0.2
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import { RequiredError } from "./base";
24
+ /**
25
+ *
26
+ * @export
27
+ */
28
+ export const DUMMY_BASE_URL = 'https://example.com';
29
+ /**
30
+ *
31
+ * @throws {RequiredError}
32
+ * @export
33
+ */
34
+ export const assertParamExists = function (functionName, paramName, paramValue) {
35
+ if (paramValue === null || paramValue === undefined) {
36
+ throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
37
+ }
38
+ };
39
+ /**
40
+ *
41
+ * @export
42
+ */
43
+ export const setApiKeyToObject = function (object, keyParamName, configuration) {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ if (configuration && configuration.apiKey) {
46
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
47
+ ? yield configuration.apiKey(keyParamName)
48
+ : yield configuration.apiKey;
49
+ object[keyParamName] = localVarApiKeyValue;
50
+ }
51
+ });
52
+ };
53
+ /**
54
+ *
55
+ * @export
56
+ */
57
+ export const setBasicAuthToObject = function (object, configuration) {
58
+ if (configuration && (configuration.username || configuration.password)) {
59
+ object["auth"] = { username: configuration.username, password: configuration.password };
60
+ }
61
+ };
62
+ /**
63
+ *
64
+ * @export
65
+ */
66
+ export const setBearerAuthToObject = function (object, configuration) {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ if (configuration && configuration.accessToken) {
69
+ const accessToken = typeof configuration.accessToken === 'function'
70
+ ? yield configuration.accessToken()
71
+ : yield configuration.accessToken;
72
+ object["Authorization"] = "Bearer " + accessToken;
73
+ }
74
+ });
75
+ };
76
+ /**
77
+ *
78
+ * @export
79
+ */
80
+ export const setOAuthToObject = function (object, name, scopes, configuration) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ if (configuration && configuration.accessToken) {
83
+ const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
84
+ ? yield configuration.accessToken(name, scopes)
85
+ : yield configuration.accessToken;
86
+ object["Authorization"] = "Bearer " + localVarAccessTokenValue;
87
+ }
88
+ });
89
+ };
90
+ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
91
+ if (parameter == null)
92
+ return;
93
+ if (typeof parameter === "object") {
94
+ if (Array.isArray(parameter)) {
95
+ parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
96
+ }
97
+ else {
98
+ Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
99
+ }
100
+ }
101
+ else {
102
+ if (urlSearchParams.has(key)) {
103
+ urlSearchParams.append(key, parameter);
104
+ }
105
+ else {
106
+ urlSearchParams.set(key, parameter);
107
+ }
108
+ }
109
+ }
110
+ /**
111
+ *
112
+ * @export
113
+ */
114
+ export const setSearchParams = function (url, ...objects) {
115
+ const searchParams = new URLSearchParams(url.search);
116
+ setFlattenedQueryParams(searchParams, objects);
117
+ url.search = searchParams.toString();
118
+ };
119
+ /**
120
+ *
121
+ * @export
122
+ */
123
+ export const serializeDataIfNeeded = function (value, requestOptions, configuration) {
124
+ const nonString = typeof value !== 'string';
125
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
126
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
127
+ : nonString;
128
+ return needsSerialization
129
+ ? JSON.stringify(value !== undefined ? value : {})
130
+ : (value || "");
131
+ };
132
+ /**
133
+ *
134
+ * @export
135
+ */
136
+ export const toPathString = function (url) {
137
+ return url.pathname + url.search + url.hash;
138
+ };
139
+ /**
140
+ *
141
+ * @export
142
+ */
143
+ export const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
144
+ return (axios = globalAxios, basePath = BASE_PATH) => {
145
+ var _a;
146
+ const axiosRequestArgs = Object.assign(Object.assign({}, axiosArgs.options), { url: (axios.defaults.baseURL ? '' : (_a = configuration === null || configuration === void 0 ? void 0 : configuration.basePath) !== null && _a !== void 0 ? _a : basePath) + axiosArgs.url });
147
+ return axios.request(axiosRequestArgs);
148
+ };
149
+ };
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Category API
3
+ * API for querying categories
4
+ *
5
+ * The version of the OpenAPI document: 1.0.2
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
+ export interface ConfigurationParameters {
13
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
14
+ username?: string;
15
+ password?: string;
16
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
17
+ basePath?: string;
18
+ serverIndex?: number;
19
+ baseOptions?: any;
20
+ formDataCtor?: new () => any;
21
+ }
22
+ export declare class Configuration {
23
+ /**
24
+ * parameter for apiKey security
25
+ * @param name security name
26
+ * @memberof Configuration
27
+ */
28
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
29
+ /**
30
+ * parameter for basic security
31
+ *
32
+ * @type {string}
33
+ * @memberof Configuration
34
+ */
35
+ username?: string;
36
+ /**
37
+ * parameter for basic security
38
+ *
39
+ * @type {string}
40
+ * @memberof Configuration
41
+ */
42
+ password?: string;
43
+ /**
44
+ * parameter for oauth2 security
45
+ * @param name security name
46
+ * @param scopes oauth2 scope
47
+ * @memberof Configuration
48
+ */
49
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
50
+ /**
51
+ * override base path
52
+ *
53
+ * @type {string}
54
+ * @memberof Configuration
55
+ */
56
+ basePath?: string;
57
+ /**
58
+ * override server index
59
+ *
60
+ * @type {number}
61
+ * @memberof Configuration
62
+ */
63
+ serverIndex?: number;
64
+ /**
65
+ * base options for axios calls
66
+ *
67
+ * @type {any}
68
+ * @memberof Configuration
69
+ */
70
+ baseOptions?: any;
71
+ /**
72
+ * The FormData constructor that will be used to create multipart form data
73
+ * requests. You can inject this here so that execution environments that
74
+ * do not support the FormData class can still run the generated client.
75
+ *
76
+ * @type {new () => FormData}
77
+ */
78
+ formDataCtor?: new () => any;
79
+ constructor(param?: ConfigurationParameters);
80
+ /**
81
+ * Check if the given MIME is a JSON MIME.
82
+ * JSON MIME examples:
83
+ * application/json
84
+ * application/json; charset=UTF8
85
+ * APPLICATION/JSON
86
+ * application/vnd.company+json
87
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
88
+ * @return True if the given MIME is JSON, false otherwise.
89
+ */
90
+ isJsonMime(mime: string): boolean;
91
+ }
@@ -0,0 +1,40 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Category API
5
+ * API for querying categories
6
+ *
7
+ * The version of the OpenAPI document: 1.0.2
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
+ export class Configuration {
15
+ constructor(param = {}) {
16
+ var _a;
17
+ this.apiKey = param.apiKey;
18
+ this.username = param.username;
19
+ this.password = param.password;
20
+ this.accessToken = param.accessToken;
21
+ this.basePath = param.basePath;
22
+ this.serverIndex = param.serverIndex;
23
+ this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({}, (_a = param.baseOptions) === null || _a === void 0 ? void 0 : _a.headers) });
24
+ this.formDataCtor = param.formDataCtor;
25
+ }
26
+ /**
27
+ * Check if the given MIME is a JSON MIME.
28
+ * JSON MIME examples:
29
+ * application/json
30
+ * application/json; charset=UTF8
31
+ * APPLICATION/JSON
32
+ * application/vnd.company+json
33
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
34
+ * @return True if the given MIME is JSON, false otherwise.
35
+ */
36
+ isJsonMime(mime) {
37
+ const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
38
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
39
+ }
40
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Category API
3
+ * API for querying categories
4
+ *
5
+ * The version of the OpenAPI document: 1.0.2
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
+ export * from "./api";
13
+ export * from "./configuration";
package/dist/index.js ADDED
@@ -0,0 +1,15 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Category API
5
+ * API for querying categories
6
+ *
7
+ * The version of the OpenAPI document: 1.0.2
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
+ export * from "./api";
15
+ export * from "./configuration";
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@sokol111/ecommerce-category-query-service-api",
3
+ "description": "Generated TypeScript Axios client from OpenAPI for ecommerce-category-query-service-api",
4
+ "version": "v1.0.2",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "module": "dist/index.js",
8
+ "scripts": {
9
+ "build": "tsc",
10
+ "prepare": "npm run build"
11
+ },
12
+ "keywords": ["openapi", "typescript", "axios", "sdk"],
13
+ "author": "Sokol111",
14
+ "license": "MIT",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/Sokol111/ecommerce-category-query-service-api.git"
18
+ },
19
+ "dependencies": {
20
+ "axios": "^1.6.1"
21
+ },
22
+ "devDependencies": {
23
+ "typescript": "^5.4.0"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "files": [
29
+ "dist"
30
+ ]
31
+ }