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 * @jest-environment jsdom
*/ */
// Copyright (c) 2023 Tudor Stanciu
import axios from "axios"; import axios from "axios";
import { TuitioClient, fetch, invalidate } from "../client"; import { TuitioClient, fetch, invalidate } from "../client";

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,5 @@
// Copyright (c) 2023 Tudor Stanciu
import { TuitioClient, invalidate, fetch } from "./client"; import { TuitioClient, invalidate, fetch } from "./client";
import type { TuitioToken, TuitioAuthenticationResult, TuitioState } 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 => { const combineUrls = (piece1: string, piece2: string): string => {
let baseElement = piece1; let baseElement = piece1;
if (baseElement.endsWith("/")) baseElement = baseElement.substring(0, baseElement.length - 1); if (baseElement.endsWith("/")) baseElement = baseElement.substring(0, baseElement.length - 1);