@hedra/sdk 1.0.0 → 2.0.0
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/cjs/BaseClient.d.ts +2 -2
- package/dist/cjs/BaseClient.js +3 -3
- package/dist/cjs/api/resources/billing/client/Client.js +2 -2
- package/dist/cjs/api/resources/files/client/Client.js +1 -1
- package/dist/cjs/api/resources/jobs/client/Client.js +81 -81
- package/dist/cjs/api/resources/keys/client/Client.js +4 -4
- package/dist/cjs/api/resources/logDrains/client/Client.js +6 -6
- package/dist/cjs/api/resources/models/client/Client.js +6 -6
- package/dist/cjs/api/resources/tokens/client/Client.js +1 -1
- package/dist/cjs/api/resources/webhooks/client/Client.js +7 -7
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +2 -2
- package/dist/esm/BaseClient.mjs +3 -3
- package/dist/esm/api/resources/billing/client/Client.mjs +2 -2
- package/dist/esm/api/resources/files/client/Client.mjs +1 -1
- package/dist/esm/api/resources/jobs/client/Client.mjs +81 -81
- package/dist/esm/api/resources/keys/client/Client.mjs +4 -4
- package/dist/esm/api/resources/logDrains/client/Client.mjs +6 -6
- package/dist/esm/api/resources/models/client/Client.mjs +6 -6
- package/dist/esm/api/resources/tokens/client/Client.mjs +1 -1
- package/dist/esm/api/resources/webhooks/client/Client.mjs +7 -7
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
package/dist/cjs/BaseClient.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type BaseClientOptions = {
|
|
|
7
7
|
/** Specify a custom URL to connect the client to. */
|
|
8
8
|
baseUrl?: core.Supplier<string>;
|
|
9
9
|
/** Override the X-Hedra-Spec-Version header */
|
|
10
|
-
specVersion?: "3.
|
|
10
|
+
specVersion?: "3.3.0";
|
|
11
11
|
/** Additional headers to include in requests. */
|
|
12
12
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
13
13
|
/** The default maximum time to wait for a response in seconds. */
|
|
@@ -34,7 +34,7 @@ export interface BaseRequestOptions {
|
|
|
34
34
|
/** A hook to abort the request. */
|
|
35
35
|
abortSignal?: AbortSignal;
|
|
36
36
|
/** Override the X-Hedra-Spec-Version header */
|
|
37
|
-
specVersion?: "3.
|
|
37
|
+
specVersion?: "3.3.0";
|
|
38
38
|
/** Additional query string parameters to include in the request. */
|
|
39
39
|
queryParams?: Record<string, unknown>;
|
|
40
40
|
/** A dictionary containing additional parameters to spread into the request's body. */
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -44,11 +44,11 @@ function normalizeClientOptions(options) {
|
|
|
44
44
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
45
45
|
"X-Fern-Language": "JavaScript",
|
|
46
46
|
"X-Fern-SDK-Name": "@hedra/sdk",
|
|
47
|
-
"X-Fern-SDK-Version": "
|
|
48
|
-
"User-Agent": "@hedra/sdk/
|
|
47
|
+
"X-Fern-SDK-Version": "2.0.0",
|
|
48
|
+
"User-Agent": "@hedra/sdk/2.0.0",
|
|
49
49
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
50
50
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
51
|
-
"X-Hedra-Spec-Version": (_a = options === null || options === void 0 ? void 0 : options.specVersion) !== null && _a !== void 0 ? _a : "3.
|
|
51
|
+
"X-Hedra-Spec-Version": (_a = options === null || options === void 0 ? void 0 : options.specVersion) !== null && _a !== void 0 ? _a : "3.3.0",
|
|
52
52
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
53
53
|
return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });
|
|
54
54
|
}
|
|
@@ -80,7 +80,7 @@ class BillingClient {
|
|
|
80
80
|
return __awaiter(this, void 0, void 0, function* () {
|
|
81
81
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
82
82
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
83
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Hedra-Spec-Version": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.specVersion) !== null && _b !== void 0 ? _b : "3.
|
|
83
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Hedra-Spec-Version": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.specVersion) !== null && _b !== void 0 ? _b : "3.3.0" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
84
84
|
const _response = yield core.fetcher({
|
|
85
85
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HedraEnvironment.Production, "balance"),
|
|
86
86
|
method: "GET",
|
|
@@ -149,7 +149,7 @@ class BillingClient {
|
|
|
149
149
|
group_by: groupBy != null ? groupBy : undefined,
|
|
150
150
|
};
|
|
151
151
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
152
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Hedra-Spec-Version": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.specVersion) !== null && _b !== void 0 ? _b : "3.
|
|
152
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Hedra-Spec-Version": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.specVersion) !== null && _b !== void 0 ? _b : "3.3.0" }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
153
153
|
const _response = yield core.fetcher({
|
|
154
154
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HedraEnvironment.Production, "usage"),
|
|
155
155
|
method: "GET",
|
|
@@ -90,7 +90,7 @@ class FilesClient {
|
|
|
90
90
|
yield _body.appendFile("file", request.file);
|
|
91
91
|
const _maybeEncodedRequest = yield _body.getRequest();
|
|
92
92
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
93
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ "X-Hedra-Spec-Version": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.specVersion) !== null && _b !== void 0 ? _b : "3.
|
|
93
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ "X-Hedra-Spec-Version": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.specVersion) !== null && _b !== void 0 ? _b : "3.3.0" }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
94
94
|
const _response = yield core.fetcher({
|
|
95
95
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HedraEnvironment.Production, "files"),
|
|
96
96
|
method: "POST",
|