1.2.10 - Upgraded @flare/tuitio-client.
parent
38e79555d7
commit
3779dae50b
|
@ -48,3 +48,4 @@ All tests in the package can be executed by running: `npm test`.
|
|||
1.2.7 - Set react version range in peer dependencies.
|
||||
1.2.8 - Include the src directory in the npm package.
|
||||
1.2.9 - Upgraded @flare/tuitio-client.
|
||||
1.2.10 - Upgraded @flare/tuitio-client.
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
{
|
||||
"name": "@flare/tuitio-client-react",
|
||||
"version": "1.2.9",
|
||||
"version": "1.2.10",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@flare/tuitio-client-react",
|
||||
"version": "1.2.9",
|
||||
"version": "1.2.10",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@flare/js-utils": "^1.1.0",
|
||||
"@flare/tuitio-client": "^1.2.6"
|
||||
"@flare/tuitio-client": "^1.2.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@testing-library/react": "^12.1.5",
|
||||
|
@ -724,12 +724,12 @@
|
|||
"integrity": "sha512-6NBXdZgRrHbLXw4EMgyqCIzOVAlUgr1+8QGHjlA+n5Iw2Lp/+dP3FTgAfPW/cHR/PBI3cj7gUDVUf/zD/qTPOQ=="
|
||||
},
|
||||
"node_modules/@flare/tuitio-client": {
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://lab.code-rove.com/public-node-registry/@flare/tuitio-client/-/tuitio-client-1.2.6.tgz",
|
||||
"integrity": "sha512-xr7S+k0GptyqVYA7NfGY5gsOK9vQPLUsmDs1dYOb5vagPJjKYnSaAXwV3fEdt+V0m13CkuXV7XH0mjjtWAli9A==",
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://lab.code-rove.com/public-node-registry/@flare/tuitio-client/-/tuitio-client-1.2.7.tgz",
|
||||
"integrity": "sha512-vz+C4ZK6w1QyT9Gi7ipjidkb+0qNc/DwUcNiPwOBg+gFPhC1JB3Ikih3IN9PLXyKOCwIkeEwJeIlkcnMTx83xw==",
|
||||
"dependencies": {
|
||||
"@flare/js-utils": "^1.1.0",
|
||||
"axios": "^1.3.2"
|
||||
"axios": "^1.6.8"
|
||||
}
|
||||
},
|
||||
"node_modules/@humanwhocodes/config-array": {
|
||||
|
@ -2031,11 +2031,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.3.4.tgz",
|
||||
"integrity": "sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ==",
|
||||
"version": "1.6.8",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz",
|
||||
"integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.0",
|
||||
"follow-redirects": "^1.15.6",
|
||||
"form-data": "^4.0.0",
|
||||
"proxy-from-env": "^1.1.0"
|
||||
}
|
||||
|
@ -3298,9 +3298,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.15.2",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
|
||||
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==",
|
||||
"version": "1.15.6",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
|
||||
"integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
|
@ -7661,12 +7661,12 @@
|
|||
"integrity": "sha512-6NBXdZgRrHbLXw4EMgyqCIzOVAlUgr1+8QGHjlA+n5Iw2Lp/+dP3FTgAfPW/cHR/PBI3cj7gUDVUf/zD/qTPOQ=="
|
||||
},
|
||||
"@flare/tuitio-client": {
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://lab.code-rove.com/public-node-registry/@flare/tuitio-client/-/tuitio-client-1.2.6.tgz",
|
||||
"integrity": "sha512-xr7S+k0GptyqVYA7NfGY5gsOK9vQPLUsmDs1dYOb5vagPJjKYnSaAXwV3fEdt+V0m13CkuXV7XH0mjjtWAli9A==",
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://lab.code-rove.com/public-node-registry/@flare/tuitio-client/-/tuitio-client-1.2.7.tgz",
|
||||
"integrity": "sha512-vz+C4ZK6w1QyT9Gi7ipjidkb+0qNc/DwUcNiPwOBg+gFPhC1JB3Ikih3IN9PLXyKOCwIkeEwJeIlkcnMTx83xw==",
|
||||
"requires": {
|
||||
"@flare/js-utils": "^1.1.0",
|
||||
"axios": "^1.3.2"
|
||||
"axios": "^1.6.8"
|
||||
}
|
||||
},
|
||||
"@humanwhocodes/config-array": {
|
||||
|
@ -8663,11 +8663,11 @@
|
|||
"dev": true
|
||||
},
|
||||
"axios": {
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.3.4.tgz",
|
||||
"integrity": "sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ==",
|
||||
"version": "1.6.8",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz",
|
||||
"integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==",
|
||||
"requires": {
|
||||
"follow-redirects": "^1.15.0",
|
||||
"follow-redirects": "^1.15.6",
|
||||
"form-data": "^4.0.0",
|
||||
"proxy-from-env": "^1.1.0"
|
||||
}
|
||||
|
@ -9622,9 +9622,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"follow-redirects": {
|
||||
"version": "1.15.2",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
|
||||
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA=="
|
||||
"version": "1.15.6",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
|
||||
"integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA=="
|
||||
},
|
||||
"for-each": {
|
||||
"version": "0.3.3",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@flare/tuitio-client-react",
|
||||
"version": "1.2.9",
|
||||
"version": "1.2.10",
|
||||
"description": "Tuitio client react is an npm package written in typescript that facilitates the integration of a react application with Tuitio.",
|
||||
"main": "./dist/cjs/index.js",
|
||||
"module": "./dist/esm/index.js",
|
||||
|
@ -50,7 +50,7 @@
|
|||
],
|
||||
"dependencies": {
|
||||
"@flare/js-utils": "^1.1.0",
|
||||
"@flare/tuitio-client": "^1.2.6"
|
||||
"@flare/tuitio-client": "^1.2.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=16.14.0 <19.0.0"
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// Copyright (c) 2023 Tudor Stanciu
|
||||
|
||||
import { fetch } from "@flare/tuitio-client";
|
||||
import { acquire } from "@flare/tuitio-client";
|
||||
import type { TuitioReactState, TuitioDispatchActions } from "./types";
|
||||
|
||||
const { token, validUntil, userName } = fetch();
|
||||
const { token, validUntil, userName } = acquire();
|
||||
|
||||
export const initialState: TuitioReactState = {
|
||||
auth: {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) 2023 Tudor Stanciu
|
||||
|
||||
import { Dispatch } from "react";
|
||||
import { fetch } from "@flare/tuitio-client";
|
||||
import { acquire } from "@flare/tuitio-client";
|
||||
import { initialState } from "./initialState";
|
||||
import type { TuitioReactState, TuitioDispatchActions } from "./types";
|
||||
|
||||
|
@ -21,7 +21,7 @@ export const reducer = (state: TuitioReactState = initialState, action: any): Tu
|
|||
case "onLogoutSuccess": {
|
||||
return {
|
||||
...state,
|
||||
auth: { ...fetch() },
|
||||
auth: { ...acquire() },
|
||||
userInfo: undefined
|
||||
};
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ jest.mock("@flare/tuitio-client", () => ({
|
|||
error: null
|
||||
})
|
||||
})),
|
||||
fetch: jest.fn().mockResolvedValue({
|
||||
acquire: jest.fn().mockResolvedValue({
|
||||
token,
|
||||
validUntil,
|
||||
userName
|
||||
|
|
|
@ -20,7 +20,7 @@ jest.mock("@flare/tuitio-client", () => ({
|
|||
error: null
|
||||
})
|
||||
})),
|
||||
fetch: jest.fn().mockResolvedValue({
|
||||
acquire: jest.fn().mockResolvedValue({
|
||||
token,
|
||||
validUntil: new Date(),
|
||||
userName
|
||||
|
|
|
@ -50,7 +50,7 @@ describe("useTuitioClient: dispatchActions", () => {
|
|||
};
|
||||
|
||||
it("onLogoutFailed should be called if logout is called before login", async () => {
|
||||
(axios.request as jest.Mock).mockResolvedValue({
|
||||
(axios as jest.MockedFunction<typeof axios>).mockResolvedValue({
|
||||
data: {
|
||||
result: { userId: 0, userName: "tuitio.user", logoutDate: new Date() },
|
||||
error: null
|
||||
|
|
|
@ -62,7 +62,7 @@ describe("useTuitioUserInfo: dispatchActions", () => {
|
|||
};
|
||||
|
||||
it("useTuitioUserInfo should return the user info obtained from Tuitio's API", async () => {
|
||||
(axios.request as jest.Mock).mockResolvedValue({
|
||||
(axios as jest.MockedFunction<typeof axios>).mockResolvedValue({
|
||||
data: { ...userInfoMock }
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue