New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

glitch-javascript-sdk

Package Overview
Dependencies
Maintainers
1
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glitch-javascript-sdk - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

36

dist/esm/config/Config.d.ts

@@ -8,8 +8,34 @@ /**

declare class Config {
baseUrl: string;
authToken: string;
constructor(baseUrl: string, authToken: string);
setBaseUrl(baseUrl: string): void;
setAuthToken(authToken: string): void;
private static _baseUrl;
private static _authToken;
private static _baseUrlLocked;
/**
* Set the configuration
*
* @param baseUrl The url base endpoint of the api
* @param authToken The JSON Web Token
*/
static setConfig(baseUrl: string, authToken: string, lock?: boolean): void;
/**
* Sets the endpoint for the API
*
* @param baseUrl The url that connects to the APIs base
* @param lock If set to true, will lock the baseUrl so it cannot be changed
*/
static setBaseUrl(baseUrl: string, lock?: boolean): void;
/**
* Set the JSON Web Token (JWT) that will be passed to the API
*
* @param authToken The JWT
*/
static setAuthToken(authToken: string): void;
/**
* Gets base url
*/
static get baseUrl(): string;
/**
* Gets auth token
*/
static get authToken(): string;
}
export default Config;

6

dist/esm/util/Requests.d.ts

@@ -11,8 +11,2 @@ import Config from '../config/Config';

/**
* Sets the configuration of the system.
*
* @param config Config The config class.
*/
static setConfig(config: Config): void;
/**
* Sets the base url of the API.

@@ -19,0 +13,0 @@ *

@@ -10,7 +10,33 @@ import { AxiosPromise } from 'axios';

declare class Config {
baseUrl: string;
authToken: string;
constructor(baseUrl: string, authToken: string);
setBaseUrl(baseUrl: string): void;
setAuthToken(authToken: string): void;
private static _baseUrl;
private static _authToken;
private static _baseUrlLocked;
/**
* Set the configuration
*
* @param baseUrl The url base endpoint of the api
* @param authToken The JSON Web Token
*/
static setConfig(baseUrl: string, authToken: string, lock?: boolean): void;
/**
* Sets the endpoint for the API
*
* @param baseUrl The url that connects to the APIs base
* @param lock If set to true, will lock the baseUrl so it cannot be changed
*/
static setBaseUrl(baseUrl: string, lock?: boolean): void;
/**
* Set the JSON Web Token (JWT) that will be passed to the API
*
* @param authToken The JWT
*/
static setAuthToken(authToken: string): void;
/**
* Gets base url
*/
static get baseUrl(): string;
/**
* Gets auth token
*/
static get authToken(): string;
}

@@ -17,0 +43,0 @@

{
"name": "glitch-javascript-sdk",
"version": "0.0.6",
"version": "0.0.7",
"description": "Javascrip SDK for GLitch",

@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js",

@@ -10,29 +10,69 @@ import Requests from "../util/Requests";

class Config {
//The base url of the API, ie: http://api.example.com/v1/
baseUrl: string;
//The JWT token used to access the api.
authToken: string;
constructor(baseUrl: string, authToken: string) {
this.baseUrl = baseUrl;
this.authToken = authToken;
private static _baseUrl: string;
private static _authToken: string;
Requests.setConfig(this);
}
private static _baseUrlLocked: boolean = false;
setBaseUrl(baseUrl: string) {
this.baseUrl = baseUrl;
/**
* Set the configuration
*
* @param baseUrl The url base endpoint of the api
* @param authToken The JSON Web Token
*/
static setConfig(baseUrl: string, authToken: string, lock? : boolean) {
this.setBaseUrl(baseUrl, lock);
this.setAuthToken(authToken);
Requests.setBaseUrl(baseUrl);
Requests.setAuthToken(authToken);
}
/**
* Sets the endpoint for the API
*
* @param baseUrl The url that connects to the APIs base
* @param lock If set to true, will lock the baseUrl so it cannot be changed
*/
static setBaseUrl(baseUrl: string, lock? : boolean) {
if(!this._baseUrlLocked) {
Config._baseUrl = baseUrl;
Requests.setBaseUrl(baseUrl);
}
setAuthToken(authToken: string) {
this.authToken = authToken;
Requests.setAuthToken(authToken);
if(lock) {
this._baseUrlLocked = true;
}
}
/**
* Set the JSON Web Token (JWT) that will be passed to the API
*
* @param authToken The JWT
*/
static setAuthToken(authToken: string) {
Config._authToken = authToken;
Requests.setAuthToken(authToken);
}
export default Config;
/**
* Gets base url
*/
static get baseUrl(): string {
return Config._baseUrl;
}
/**
* Gets auth token
*/
static get authToken(): string {
return Config._authToken;
}
}
export default Config;

@@ -23,14 +23,2 @@ import axios from 'axios';

/**
* Sets the configuration of the system.
*
* @param config Config The config class.
*/
public static setConfig(config: Config) {
this.baseUrl = config.baseUrl;
this.authToken = config.authToken;
}
/**
* Sets the base url of the API.

@@ -37,0 +25,0 @@ *

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