@flarehr/apollo-super-campaign
Advanced tools
Comparing version 0.1.45 to 0.1.46
{ | ||
"name": "@flarehr/apollo-super-campaign", | ||
"version": "0.1.45", | ||
"version": "0.1.46", | ||
"description": "Flare Apollo Campaign", | ||
@@ -10,3 +10,4 @@ "license": "SEE LICENSE IN LICENSE.md", | ||
"build": "tsc && vite build", | ||
"preview": "vite preview" | ||
"preview": "vite preview", | ||
"lint": "eslint . --ext .ts,.tsx" | ||
}, | ||
@@ -21,4 +22,13 @@ "dependencies": { | ||
"@types/preact-custom-element": "^4.0.4", | ||
"@typescript-eslint/eslint-plugin": "^6.16.0", | ||
"@typescript-eslint/parser": "^6.16.0", | ||
"autoprefixer": "^10.4.16", | ||
"eslint": "^8.56.0", | ||
"eslint-config-preact": "^1.3.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.1.2", | ||
"eslint-plugin-simple-import-sort": "^10.0.0", | ||
"eslint-plugin-unused-imports": "^3.0.0", | ||
"postcss": "^8.4.32", | ||
"prettier": "^3.1.1", | ||
"tailwindcss": "^3.4.0", | ||
@@ -25,0 +35,0 @@ "typescript": "^5.2.2", |
@@ -1,26 +0,22 @@ | ||
import axios, { AxiosInstance } from "axios"; | ||
import axios, { AxiosInstance } from 'axios'; | ||
export class ApolloBackednApi { | ||
private static _axiosInstance : AxiosInstance; | ||
private static _axiosInstance: AxiosInstance; | ||
public static init(baseUrl: string, accessToken: string):void | ||
{ | ||
ApolloBackednApi._axiosInstance = axios.create( | ||
{ | ||
baseURL: `${baseUrl}`, | ||
headers: { | ||
Authorization: `Bearer ${accessToken}`, | ||
// Uncomment below for local dev against local backend | ||
// 'x-partner-id': '123', | ||
// 'x-account-id': '83A9F426-8E73-4781-B6CA-ABC374510C54', | ||
// 'x-profile-id': 'AP-C14DF031-A764-40B2-87C0-77884F4BD303' | ||
} | ||
} | ||
); | ||
} | ||
public static init(baseUrl: string, accessToken: string): void { | ||
ApolloBackednApi._axiosInstance = axios.create({ | ||
baseURL: `${baseUrl}`, | ||
headers: { | ||
Authorization: `Bearer ${accessToken}` | ||
// Uncomment below for local dev against local backend | ||
// 'x-partner-id': '123', | ||
// 'x-account-id': '83A9F426-8E73-4781-B6CA-ABC374510C54', | ||
// 'x-profile-id': 'AP-C14DF031-A764-40B2-87C0-77884F4BD303' | ||
} | ||
}); | ||
} | ||
public static get axiosInstance(): AxiosInstance{ | ||
return ApolloBackednApi._axiosInstance; | ||
} | ||
public static get axiosInstance(): AxiosInstance { | ||
return ApolloBackednApi._axiosInstance; | ||
} | ||
} |
@@ -1,10 +0,10 @@ | ||
import {ApolloBackednApi} from "../apollo-backend-api" | ||
import { ApolloBackednApi } from '../apollo-backend-api'; | ||
const helloUrl: string = "super-campaign/backend/hello" | ||
const helloUrl: string = 'super-campaign/backend/hello'; | ||
export class HelloApi { | ||
public async hello(): Promise<string> { | ||
var response = await ApolloBackednApi.axiosInstance.get<string>(helloUrl); | ||
return response.data; | ||
} | ||
} | ||
public async hello(): Promise<string> { | ||
const response = await ApolloBackednApi.axiosInstance.get<string>(helloUrl); | ||
return response.data; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
249938
21
409
16
2