Socket
Socket
Sign inDemoInstall

zerosec

Package Overview
Dependencies
9
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.4 to 1.0.5

7

lib/index.d.ts

@@ -1,7 +0,10 @@

import { ObfuscationPayload, ObfuscationResult, ObfuscationNode } from './interfaces';
import { ObfuscationPayload, ObfuscationResult, ObfuscationNode, ApiKeyInfo, Obfuscation } from './interfaces';
export default class ZeroSecAPI {
private api;
private apiKey;
constructor(apiKey: string);
obfuscate(payload: ObfuscationPayload): Promise<ObfuscationResult>;
getApiKeyInfo(): Promise<ApiKeyInfo>;
getObfuscations(): Promise<Obfuscation[]>;
}
export { ObfuscationNode, ObfuscationResult, ObfuscationPayload };
export { ObfuscationNode, ObfuscationResult, ObfuscationPayload, ApiKeyInfo, Obfuscation };

@@ -20,2 +20,3 @@ "use strict";

throw new Error('API key is required');
this.apiKey = apiKey;
this.api = axios_1.default.create({

@@ -36,3 +37,19 @@ baseURL: 'https://api.zero.sex/v1',

}
getApiKeyInfo() {
return __awaiter(this, void 0, void 0, function* () {
const { data, status } = yield this.api.get(`/key/${this.apiKey}/info`);
if (status !== 200)
throw new Error(data.error);
return data;
});
}
getObfuscations() {
return __awaiter(this, void 0, void 0, function* () {
const { data, status } = yield this.api.get(`/key/${this.apiKey}/obfuscations`);
if (status !== 200)
throw new Error(data.error);
return data;
});
}
}
exports.default = ZeroSecAPI;

@@ -37,2 +37,4 @@ /**

platformLock?: "lua" | "roblox" | "csgo" | "fivem";
/** The watermark for the obfuscated file */
watermark?: string;
/** Enables prevention of tampering with the script. Requires support for `loadstring` or `load` in the environment. */

@@ -49,2 +51,44 @@ antiTamper?: boolean;

}
export { ObfuscationNode, ObfuscationResult, ObfuscationPayload };
/**
* Represents the result of an api-key info request.
*/
interface ApiKeyInfo {
/** The ID of the API key. */
id: number;
/** The API key. */
apiKey: string;
/** The author of the API key. */
author: string;
/** The amount of authentications made with the API key. */
authentications: number;
/** Whether the API key is enabled or not. This can be changed by admins. */
enabled: boolean;
/** The date at which the API key expires. */
expiresAt: string;
/** The date at which the API key was created. */
createdAt: string;
/** The date at which the API key was last updated. */
updatedAt: string;
/** Whether the API key is active or not based on the expiration date. */
active: boolean;
}
/**
* Represents the result of an obfuscation request.
*/
interface Obfuscation {
/** The ID of the obfuscation. */
id: number;
/** The fingerprint of the obfuscation. */
fingerprint: string;
/** The API key used for the obfuscation. */
apiKey: string;
/** The size of the obfuscated file. */
fileSize: number;
/** The IP address of the server that requested the obfuscation. */
ip: string;
/** Whether the obfuscation was successful or not. */
success: boolean;
/** The date at which the obfuscation was requested. */
createdAt: string;
}
export { ObfuscationNode, ObfuscationResult, ObfuscationPayload, ApiKeyInfo, Obfuscation };
{
"name": "zerosec",
"version": "1.0.4",
"version": "1.0.5",
"description": "ZeroSec API binding as npm package for NodeJS",

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc