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/README.md +2 -2
- package/api.ts +545 -545
- package/common.ts +13 -0
- package/configuration.ts +1 -1
- package/dist/api.js +544 -544
- package/dist/common.d.ts +6 -0
- package/dist/common.js +14 -1
- package/dist/configuration.js +1 -1
- package/dist/esm/api.js +545 -545
- package/dist/esm/common.d.ts +6 -0
- package/dist/esm/common.js +12 -0
- package/dist/esm/configuration.js +1 -1
- package/package.json +1 -1
package/dist/common.d.ts
CHANGED
|
@@ -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
|
package/dist/common.js
CHANGED
|
@@ -19,7 +19,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setBearerAuthToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
|
|
22
|
+
exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setBearerAuthToObject = exports.encodePathParam = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
|
|
23
23
|
const base_1 = require("./base");
|
|
24
24
|
/**
|
|
25
25
|
*
|
|
@@ -37,6 +37,19 @@ const assertParamExists = function (functionName, paramName, paramValue) {
|
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
exports.assertParamExists = assertParamExists;
|
|
40
|
+
/**
|
|
41
|
+
* Empty values and dot segments survive encoding and collapse or resolve away, which would change the endpoint.
|
|
42
|
+
* @throws {RequiredError}
|
|
43
|
+
* @export
|
|
44
|
+
*/
|
|
45
|
+
const encodePathParam = function (paramName, paramValue) {
|
|
46
|
+
const value = String(paramValue);
|
|
47
|
+
if (value === '' || value === '.' || value === '..') {
|
|
48
|
+
throw new base_1.RequiredError(paramName, `Invalid value for path parameter ${paramName}.`);
|
|
49
|
+
}
|
|
50
|
+
return encodeURIComponent(value);
|
|
51
|
+
};
|
|
52
|
+
exports.encodePathParam = encodePathParam;
|
|
40
53
|
/**
|
|
41
54
|
*
|
|
42
55
|
* @export
|
package/dist/configuration.js
CHANGED
|
@@ -16,7 +16,7 @@ class Configuration {
|
|
|
16
16
|
var _a;
|
|
17
17
|
this.accessToken = param.accessToken;
|
|
18
18
|
this.basePath = param.basePath;
|
|
19
|
-
this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({ 'User-Agent': "hostinger-typescript-sdk/2.6.
|
|
19
|
+
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) });
|
|
20
20
|
this.formDataCtor = param.formDataCtor;
|
|
21
21
|
}
|
|
22
22
|
/**
|