hostinger-api-sdk 2.6.1 → 2.6.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.
@@ -20,6 +20,12 @@ export declare const DUMMY_BASE_URL = "https://example.com";
20
20
  * @export
21
21
  */
22
22
  export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
23
+ /**
24
+ * Empty values and dot segments survive encoding and collapse or resolve away, which would change the endpoint.
25
+ * @throws {RequiredError}
26
+ * @export
27
+ */
28
+ export declare const encodePathParam: (paramName: string, paramValue: unknown) => string;
23
29
  /**
24
30
  *
25
31
  * @export
@@ -33,6 +33,18 @@ export const assertParamExists = function (functionName, paramName, paramValue)
33
33
  throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
34
34
  }
35
35
  };
36
+ /**
37
+ * Empty values and dot segments survive encoding and collapse or resolve away, which would change the endpoint.
38
+ * @throws {RequiredError}
39
+ * @export
40
+ */
41
+ export const encodePathParam = function (paramName, paramValue) {
42
+ const value = String(paramValue);
43
+ if (value === '' || value === '.' || value === '..') {
44
+ throw new RequiredError(paramName, `Invalid value for path parameter ${paramName}.`);
45
+ }
46
+ return encodeURIComponent(value);
47
+ };
36
48
  /**
37
49
  *
38
50
  * @export
@@ -13,7 +13,7 @@ export class Configuration {
13
13
  var _a;
14
14
  this.accessToken = param.accessToken;
15
15
  this.basePath = param.basePath;
16
- this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({ 'User-Agent': "hostinger-typescript-sdk/2.6.1" }, (_a = param.baseOptions) === null || _a === void 0 ? void 0 : _a.headers) });
16
+ this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({ 'User-Agent': "hostinger-typescript-sdk/2.6.2" }, (_a = param.baseOptions) === null || _a === void 0 ? void 0 : _a.headers) });
17
17
  this.formDataCtor = param.formDataCtor;
18
18
  }
19
19
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hostinger-api-sdk",
3
- "version": "2.6.1",
3
+ "version": "2.6.2",
4
4
  "description": "Hostinger API TypeScript SDK",
5
5
  "author": "Hostinger",
6
6
  "repository": {