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