Copyright (c) 2023 Tudor Stanciu

master
Tudor Stanciu 2023-03-14 20:11:11 +02:00
parent b22c4c3cf6
commit e788ecbe63
9 changed files with 18 additions and 0 deletions

View File

@ -2,6 +2,8 @@
* @jest-environment jsdom
*/
// Copyright (c) 2023 Tudor Stanciu
import axios from "axios";
import { TuitioClient, fetch, invalidate } from "../client";

View File

@ -1,3 +1,5 @@
// Copyright (c) 2023 Tudor Stanciu
import { getUrlTemplates } from "../config";
import { TuitioClient } from "../client";
import type { TuitioAuthenticationResult, TuitioToken } from "../client";

View File

@ -2,6 +2,8 @@
* @jest-environment jsdom
*/
// Copyright (c) 2023 Tudor Stanciu
import { fetch, invalidate } from "../client";
test("Tuitio empty storage", () => {

View File

@ -1,3 +1,5 @@
// Copyright (c) 2023 Tudor Stanciu
import { combineUrls, isValidURL } from "../utils";
test("Combine urls with trailing slash", () => {

View File

@ -1,3 +1,5 @@
// Copyright (c) 2023 Tudor Stanciu
import axios from "axios";
import { localStorage } from "@flare/js-utils";
import { storageKeys } from "./constants";

View File

@ -1,3 +1,5 @@
// Copyright (c) 2023 Tudor Stanciu
import { combineUrls } from "./utils";
type UrlTemplates = {

View File

@ -1,3 +1,5 @@
// Copyright (c) 2023 Tudor Stanciu
export const storageKeys: { TOKEN: string; USER: string } = {
TOKEN: "TUITIO_AUTHORIZATION_TOKEN",
USER: "TUITIO_USER_NAME"

View File

@ -1,3 +1,5 @@
// Copyright (c) 2023 Tudor Stanciu
import { TuitioClient, invalidate, fetch } from "./client";
import type { TuitioToken, TuitioAuthenticationResult, TuitioState } from "./client";

View File

@ -1,3 +1,5 @@
// Copyright (c) 2023 Tudor Stanciu
const combineUrls = (piece1: string, piece2: string): string => {
let baseElement = piece1;
if (baseElement.endsWith("/")) baseElement = baseElement.substring(0, baseElement.length - 1);