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.
package/common.ts CHANGED
@@ -32,6 +32,19 @@ export const assertParamExists = function (functionName: string, paramName: stri
32
32
  }
33
33
  }
34
34
 
35
+ /**
36
+ * Empty values and dot segments survive encoding and collapse or resolve away, which would change the endpoint.
37
+ * @throws {RequiredError}
38
+ * @export
39
+ */
40
+ export const encodePathParam = function (paramName: string, paramValue: unknown) {
41
+ const value = String(paramValue);
42
+ if (value === '' || value === '.' || value === '..') {
43
+ throw new RequiredError(paramName, `Invalid value for path parameter ${paramName}.`);
44
+ }
45
+ return encodeURIComponent(value);
46
+ }
47
+
35
48
  /**
36
49
  *
37
50
  * @export
package/configuration.ts CHANGED
@@ -48,7 +48,7 @@ export class Configuration {
48
48
  this.baseOptions = {
49
49
  ...param.baseOptions,
50
50
  headers: {
51
- 'User-Agent': "hostinger-typescript-sdk/2.6.1",
51
+ 'User-Agent': "hostinger-typescript-sdk/2.6.2",
52
52
  ...param.baseOptions?.headers,
53
53
  },
54
54
  };