@tennac-booking/sdk 1.0.233 → 1.0.235

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/base.js CHANGED
@@ -32,15 +32,13 @@ exports.COLLECTION_FORMATS = {
32
32
  * @class BaseAPI
33
33
  */
34
34
  class BaseAPI {
35
- basePath;
36
- axios;
37
- configuration;
38
35
  constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
36
+ var _a;
39
37
  this.basePath = basePath;
40
38
  this.axios = axios;
41
39
  if (configuration) {
42
40
  this.configuration = configuration;
43
- this.basePath = configuration.basePath ?? basePath;
41
+ this.basePath = (_a = configuration.basePath) !== null && _a !== void 0 ? _a : basePath;
44
42
  }
45
43
  }
46
44
  }
@@ -53,7 +51,6 @@ exports.BaseAPI = BaseAPI;
53
51
  * @extends {Error}
54
52
  */
55
53
  class RequiredError extends Error {
56
- field;
57
54
  constructor(field, msg) {
58
55
  super(msg);
59
56
  this.field = field;
package/dist/common.js CHANGED
@@ -12,6 +12,15 @@
12
12
  * https://openapi-generator.tech
13
13
  * Do not edit the class manually.
14
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
+ };
15
24
  Object.defineProperty(exports, "__esModule", { value: true });
16
25
  exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
17
26
  const base_1 = require("./base");
@@ -35,13 +44,15 @@ exports.assertParamExists = assertParamExists;
35
44
  *
36
45
  * @export
37
46
  */
38
- const setApiKeyToObject = async function (object, keyParamName, configuration) {
39
- if (configuration && configuration.apiKey) {
40
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
41
- ? await configuration.apiKey(keyParamName)
42
- : await configuration.apiKey;
43
- object[keyParamName] = localVarApiKeyValue;
44
- }
47
+ const setApiKeyToObject = function (object, keyParamName, configuration) {
48
+ return __awaiter(this, void 0, void 0, function* () {
49
+ if (configuration && configuration.apiKey) {
50
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
51
+ ? yield configuration.apiKey(keyParamName)
52
+ : yield configuration.apiKey;
53
+ object[keyParamName] = localVarApiKeyValue;
54
+ }
55
+ });
45
56
  };
46
57
  exports.setApiKeyToObject = setApiKeyToObject;
47
58
  /**
@@ -58,26 +69,30 @@ exports.setBasicAuthToObject = setBasicAuthToObject;
58
69
  *
59
70
  * @export
60
71
  */
61
- const setBearerAuthToObject = async function (object, configuration) {
62
- if (configuration && configuration.accessToken) {
63
- const accessToken = typeof configuration.accessToken === 'function'
64
- ? await configuration.accessToken()
65
- : await configuration.accessToken;
66
- object["Authorization"] = "Bearer " + accessToken;
67
- }
72
+ const setBearerAuthToObject = function (object, configuration) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ if (configuration && configuration.accessToken) {
75
+ const accessToken = typeof configuration.accessToken === 'function'
76
+ ? yield configuration.accessToken()
77
+ : yield configuration.accessToken;
78
+ object["Authorization"] = "Bearer " + accessToken;
79
+ }
80
+ });
68
81
  };
69
82
  exports.setBearerAuthToObject = setBearerAuthToObject;
70
83
  /**
71
84
  *
72
85
  * @export
73
86
  */
74
- const setOAuthToObject = async function (object, name, scopes, configuration) {
75
- if (configuration && configuration.accessToken) {
76
- const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
77
- ? await configuration.accessToken(name, scopes)
78
- : await configuration.accessToken;
79
- object["Authorization"] = "Bearer " + localVarAccessTokenValue;
80
- }
87
+ const setOAuthToObject = function (object, name, scopes, configuration) {
88
+ return __awaiter(this, void 0, void 0, function* () {
89
+ if (configuration && configuration.accessToken) {
90
+ const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
91
+ ? yield configuration.accessToken(name, scopes)
92
+ : yield configuration.accessToken;
93
+ object["Authorization"] = "Bearer " + localVarAccessTokenValue;
94
+ }
95
+ });
81
96
  };
82
97
  exports.setOAuthToObject = setOAuthToObject;
83
98
  function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
@@ -138,7 +153,8 @@ exports.toPathString = toPathString;
138
153
  */
139
154
  const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
140
155
  return (axios = globalAxios, basePath = BASE_PATH) => {
141
- const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url };
156
+ var _a;
157
+ 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 });
142
158
  return axios.request(axiosRequestArgs);
143
159
  };
144
160
  };
@@ -15,75 +15,15 @@
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.Configuration = void 0;
17
17
  class Configuration {
18
- /**
19
- * parameter for apiKey security
20
- * @param name security name
21
- * @memberof Configuration
22
- */
23
- apiKey;
24
- /**
25
- * parameter for basic security
26
- *
27
- * @type {string}
28
- * @memberof Configuration
29
- */
30
- username;
31
- /**
32
- * parameter for basic security
33
- *
34
- * @type {string}
35
- * @memberof Configuration
36
- */
37
- password;
38
- /**
39
- * parameter for oauth2 security
40
- * @param name security name
41
- * @param scopes oauth2 scope
42
- * @memberof Configuration
43
- */
44
- accessToken;
45
- /**
46
- * override base path
47
- *
48
- * @type {string}
49
- * @memberof Configuration
50
- */
51
- basePath;
52
- /**
53
- * override server index
54
- *
55
- * @type {number}
56
- * @memberof Configuration
57
- */
58
- serverIndex;
59
- /**
60
- * base options for axios calls
61
- *
62
- * @type {any}
63
- * @memberof Configuration
64
- */
65
- baseOptions;
66
- /**
67
- * The FormData constructor that will be used to create multipart form data
68
- * requests. You can inject this here so that execution environments that
69
- * do not support the FormData class can still run the generated client.
70
- *
71
- * @type {new () => FormData}
72
- */
73
- formDataCtor;
74
18
  constructor(param = {}) {
19
+ var _a;
75
20
  this.apiKey = param.apiKey;
76
21
  this.username = param.username;
77
22
  this.password = param.password;
78
23
  this.accessToken = param.accessToken;
79
24
  this.basePath = param.basePath;
80
25
  this.serverIndex = param.serverIndex;
81
- this.baseOptions = {
82
- ...param.baseOptions,
83
- headers: {
84
- ...param.baseOptions?.headers,
85
- },
86
- };
26
+ this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({}, (_a = param.baseOptions) === null || _a === void 0 ? void 0 : _a.headers) });
87
27
  this.formDataCtor = param.formDataCtor;
88
28
  }
89
29
  /**