feat: bump versions
This commit is contained in:
parent
e45fa5ea7a
commit
3270822cc1
3 changed files with 2270 additions and 1443 deletions
|
@ -1,6 +1,6 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { LhispOauthClient } from "../src/lhisp-oauth-client";
|
import { LhispOauthClient } from "../src/lhisp-oauth-client";
|
||||||
import { ContentType, LhispOauthClientConstructorParams, defaultAuthContentType } from "../src/lhisp-oauth-client.t";
|
import { ContentType, LhispOauthClientConstructorParams } from "../src/lhisp-oauth-client.t";
|
||||||
|
|
||||||
// Mock jest and set the type
|
// Mock jest and set the type
|
||||||
jest.mock("axios");
|
jest.mock("axios");
|
||||||
|
@ -35,7 +35,7 @@ describe("Get Access Token", () => {
|
||||||
authHeaderName: "CustomAuthorizationHeader",
|
authHeaderName: "CustomAuthorizationHeader",
|
||||||
});
|
});
|
||||||
await accessTokenValidator(cli);
|
await accessTokenValidator(cli);
|
||||||
expect(mockedAxios.request).toBeCalledWith(
|
expect(mockedAxios.request).toHaveBeenCalledWith(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
url: authUrl,
|
url: authUrl,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
@ -54,7 +54,7 @@ describe("Get Access Token", () => {
|
||||||
grantType: "PermissaoCustom",
|
grantType: "PermissaoCustom",
|
||||||
});
|
});
|
||||||
await accessTokenValidator(cli);
|
await accessTokenValidator(cli);
|
||||||
expect(mockedAxios.request).toBeCalledWith(
|
expect(mockedAxios.request).toHaveBeenCalledWith(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
url: authUrl,
|
url: authUrl,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
@ -73,7 +73,7 @@ describe("Get Access Token", () => {
|
||||||
authScope: "EscopoCustom",
|
authScope: "EscopoCustom",
|
||||||
});
|
});
|
||||||
await accessTokenValidator(cli);
|
await accessTokenValidator(cli);
|
||||||
expect(mockedAxios.request).toBeCalledWith(
|
expect(mockedAxios.request).toHaveBeenCalledWith(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
url: authUrl,
|
url: authUrl,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
@ -93,7 +93,7 @@ describe("Get Access Token", () => {
|
||||||
sendAuthCredentialsOnRequestBody: true,
|
sendAuthCredentialsOnRequestBody: true,
|
||||||
});
|
});
|
||||||
await accessTokenValidator(cli);
|
await accessTokenValidator(cli);
|
||||||
expect(mockedAxios.request).toBeCalledWith(
|
expect(mockedAxios.request).toHaveBeenCalledWith(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
url: authUrl,
|
url: authUrl,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
@ -118,7 +118,7 @@ describe("Request", () => {
|
||||||
const cli = getOauthClient();
|
const cli = getOauthClient();
|
||||||
const resp = await cli.get({ path: "/my-test-url" });
|
const resp = await cli.get({ path: "/my-test-url" });
|
||||||
validateDefaultGetAccessToken();
|
validateDefaultGetAccessToken();
|
||||||
expect(mockedAxios.request).toBeCalledWith(
|
expect(mockedAxios.request).toHaveBeenCalledWith(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
url: `${apiUrl}/my-test-url`,
|
url: `${apiUrl}/my-test-url`,
|
||||||
method: "GET",
|
method: "GET",
|
||||||
|
@ -136,7 +136,7 @@ describe("Request", () => {
|
||||||
const cli = getOauthClient();
|
const cli = getOauthClient();
|
||||||
const resp = await cli.get({ path: "/my-test-url", params: { id: 1 } });
|
const resp = await cli.get({ path: "/my-test-url", params: { id: 1 } });
|
||||||
validateDefaultGetAccessToken();
|
validateDefaultGetAccessToken();
|
||||||
expect(mockedAxios.request).toBeCalledWith(
|
expect(mockedAxios.request).toHaveBeenCalledWith(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
url: `${apiUrl}/my-test-url`,
|
url: `${apiUrl}/my-test-url`,
|
||||||
method: "GET",
|
method: "GET",
|
||||||
|
@ -155,7 +155,7 @@ describe("Request", () => {
|
||||||
const cli = getOauthClient();
|
const cli = getOauthClient();
|
||||||
const resp = await cli.post({ path: "/my-test-url-post", data: { id: 1, user: "test" } });
|
const resp = await cli.post({ path: "/my-test-url-post", data: { id: 1, user: "test" } });
|
||||||
validateDefaultGetAccessToken();
|
validateDefaultGetAccessToken();
|
||||||
expect(mockedAxios.request).toBeCalledWith(
|
expect(mockedAxios.request).toHaveBeenCalledWith(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
url: `${apiUrl}/my-test-url-post`,
|
url: `${apiUrl}/my-test-url-post`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
@ -177,7 +177,7 @@ describe("Request", () => {
|
||||||
contentType: ContentType.APPLICATION_X_WWW_FORM_URLENCODED,
|
contentType: ContentType.APPLICATION_X_WWW_FORM_URLENCODED,
|
||||||
});
|
});
|
||||||
validateDefaultGetAccessToken();
|
validateDefaultGetAccessToken();
|
||||||
expect(mockedAxios.request).toBeCalledWith(
|
expect(mockedAxios.request).toHaveBeenCalledWith(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
url: `${apiUrl}/my-test-url-post`,
|
url: `${apiUrl}/my-test-url-post`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
@ -202,7 +202,7 @@ describe("Request", () => {
|
||||||
contentType: ContentType.APPLICATION_X_WWW_FORM_URLENCODED,
|
contentType: ContentType.APPLICATION_X_WWW_FORM_URLENCODED,
|
||||||
});
|
});
|
||||||
validateDefaultGetAccessToken();
|
validateDefaultGetAccessToken();
|
||||||
expect(mockedAxios.request).toBeCalledWith(
|
expect(mockedAxios.request).toHaveBeenCalledWith(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
url: `${apiUrl}/my-test-url-post`,
|
url: `${apiUrl}/my-test-url-post`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
@ -218,7 +218,7 @@ describe("Request", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
function validateDefaultGetAccessToken() {
|
function validateDefaultGetAccessToken() {
|
||||||
expect(mockedAxios.request).toBeCalledWith(
|
expect(mockedAxios.request).toHaveBeenCalledWith(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
url: authUrl,
|
url: authUrl,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
|
3677
package-lock.json
generated
3677
package-lock.json
generated
File diff suppressed because it is too large
Load diff
14
package.json
14
package.json
|
@ -15,14 +15,14 @@
|
||||||
"test:watch": "jest --watchAll"
|
"test:watch": "jest --watchAll"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^29.5.8",
|
"@types/jest": "^30.0.0",
|
||||||
"@types/node": "^20.9.0",
|
"@types/node": "^24.0.4",
|
||||||
"jest": "^29.7.0",
|
"jest": "^30.0.3",
|
||||||
"ts-jest": "^29.1.1",
|
"ts-jest": "^29.4.0",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^5.8.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.6.1",
|
"axios": "^1.10.0",
|
||||||
"lhisp-logger": "^1.0.14"
|
"lhisp-logger": "^1.0.16"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue