Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

adm-super-search-modal-2

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adm-super-search-modal-2 - npm Package Compare versions

Comparing version 0.0.22 to 0.0.23

4

package.json
{
"name": "adm-super-search-modal-2",
"version": "0.0.22",
"version": "0.0.23",
"type": "module",

@@ -33,3 +33,2 @@ "files": [

"@testing-library/vue": "^8.0.3",
"@types/axios": "^0.14.0",
"@types/node": "^20.11.28",

@@ -40,3 +39,2 @@ "@typescript-eslint/eslint-plugin": "^6.4.0",

"autoprefixer": "^10.4.18",
"axios": "^1.6.8",
"element-plus": "^2.6.1",

@@ -43,0 +41,0 @@ "eslint": "^8.0.1",

@@ -1,43 +0,43 @@

import axios, { AxiosInstance } from 'axios';
import { ISearchInfoResponse, ISearchQueryParams, ISearchQueryResponse } from './types';
function createApiClient(baseUrl: string, clientName?: string): AxiosInstance {
return axios.create({
baseURL: baseUrl,
withCredentials: false,
headers: {
common: {
'Access-Control-Allow-Origin': '*',
'Content-Type': 'application/json',
'Access-Control-Allow-Methods': 'GET, PUT, POST, DELETE, OPTIONS',
'Api-Client': clientName,
},
},
});
}
export default class SearchAPI {
private apiClient: AxiosInstance | null;
constructor(baseUrl: string, clientName?: string) {
this.apiClient = createApiClient(baseUrl, clientName);
}
public async getSearchInfo() {
const response = await this.apiClient?.get<ISearchInfoResponse>('/v1/search/info/');
return response?.data;
}
public async searchInstruments(query: ISearchQueryParams) {
const response = await this.apiClient?.post<ISearchQueryResponse>(
'/v1/search/query/',
{
...query
}
);
return response?.data;
}
}
// import axios, { AxiosInstance } from 'axios';
// import { ISearchInfoResponse, ISearchQueryParams, ISearchQueryResponse } from './types';
//
// function createApiClient(baseUrl: string, clientName?: string): AxiosInstance {
// return axios.create({
// baseURL: baseUrl,
// withCredentials: false,
// headers: {
// common: {
// 'Access-Control-Allow-Origin': '*',
// 'Content-Type': 'application/json',
// 'Access-Control-Allow-Methods': 'GET, PUT, POST, DELETE, OPTIONS',
// 'Api-Client': clientName,
// },
// },
// });
// }
//
//
// export default class SearchAPI {
// private apiClient: AxiosInstance | null;
//
// constructor(baseUrl: string, clientName?: string) {
// this.apiClient = createApiClient(baseUrl, clientName);
// }
//
// public async getSearchInfo() {
// const response = await this.apiClient?.get<ISearchInfoResponse>('/v1/search/info/');
//
// return response?.data;
// }
//
// public async searchInstruments(query: ISearchQueryParams) {
// const response = await this.apiClient?.post<ISearchQueryResponse>(
// '/v1/search/query/',
// {
// ...query
// }
// );
//
// return response?.data;
// }
// }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc