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

alphatech

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alphatech - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

4

package.json
{
"name": "alphatech",
"version": "0.0.3",
"version": "0.0.4",
"description": "",

@@ -20,5 +20,5 @@ "main": "index.js",

"dependencies": {
"axios": "^0.19.2",
"file-type": "^14.3.0",
"form-data": "^3.0.0",
"got": "^11.1.2",
"image-size": "^0.8.3",

@@ -25,0 +25,0 @@ "mime": "^2.4.5"

const { api } = require('../utils');
const { wrapper } = require('../wrapper');
module.exports.makePdf = wrapper(async function makePdf(content, options = {}) {
const { path } = options;
const { body } = await api.post('/pdf/make', {
json: {
path,
content,
},
responseType: 'json',
module.exports.makePdf = wrapper(async function makePdf(content, params = {}) {
const { data } = await api.post('/pdf/make', {
...params,
content,
});
return body;
return data;
});

@@ -1,2 +0,2 @@

const got = require('got');
const axios = require('axios');
const { getFormData } = require('./get-form-data');

@@ -20,4 +20,7 @@ const { requestUpload } = require('./request-upload.js');

const { body, headers } = await got.post(signature.url, {
body: form,
const { data, headers } = await axios.post(signature.url, form, {
headers: {
...form.getHeaders(),
'Content-Length': form.getLengthSync(),
},
});

@@ -31,3 +34,3 @@

// local
const matched = body.match(/(?<=<Etag>)(.*)(?=<\/Etag>)/);
const matched = data.match(/(?<=<Etag>)(.*)(?=<\/Etag>)/);
// eslint-disable-next-line no-unneeded-ternary

@@ -34,0 +37,0 @@ [etag] = matched ? matched : [];

const { api } = require('../utils');
module.exports.requestUpload = async function requestUpload(path, json) {
const { body } = await api.post('/file/request-upload', {
json: {
path,
...json,
},
responseType: 'json',
module.exports.requestUpload = async function requestUpload(path, params) {
const { data } = await api.post('/file/request-upload', {
...params,
path,
});
if (!body.signature) {
if (!data.signature) {
throw new Error('Upload request failed');
}
return body;
return data;
};

@@ -1,12 +0,10 @@

const got = require('got');
const axios = require('axios');
const { getConfig } = require('../config');
module.exports.api = {
post: function post(url, options) {
post: function post(url, params) {
const { domain, version, token, teamId } = getConfig();
return got.post(`${domain}${url}`, {
...options,
return axios.post(`${domain}${url}`, params, {
headers: {
...(options.headers || {}),
'x-alphatech-javascript-version': version,

@@ -13,0 +11,0 @@ authorization: `Bearer ${token}.${teamId}`,

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