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

@aptly-as/app-sdk

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aptly-as/app-sdk - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

7

dist/aptly/AptlyApi.d.ts

@@ -23,3 +23,3 @@ /// <reference types="node" />

delete<T>(path: string, init?: Omit<RequestInit, 'body' | 'method'>): Promise<T>;
downloadDocument(urlOrToken: string): Promise<{
downloadDocumentWithToken(downloadToken: string): Promise<{
buffer: Buffer;

@@ -29,2 +29,7 @@ filename: string;

}>;
downloadDocument(path: string): Promise<{
buffer: Buffer;
filename: string;
contentType: string;
}>;
fetchJSON<T>(path: string, init?: RequestInit): Promise<T>;

@@ -31,0 +36,0 @@ fetch(path: string, init?: RequestInit): Promise<Response>;

13

dist/aptly/AptlyApi.js

@@ -38,6 +38,10 @@ import { AptlyApiError, AptlyErrorCode } from '@aptly-as/types';

}
async downloadDocument(urlOrToken) {
async downloadDocumentWithToken(downloadToken) {
return this.downloadDocument(`/documents/${downloadToken}`);
}
async downloadDocument(path) {
try {
const documentUrl = urlOrToken.startsWith('http') ? urlOrToken : `${this.url}/documents/${urlOrToken}`;
const response = await fetch(documentUrl);
const response = await (path.startsWith('http')
? fetch(path)
: this.fetch(path));
if (response.status !== 200) {

@@ -110,3 +114,4 @@ throw new AptlyApiError({

}
response = await fetch(`${this.url}/${path}`, {
const url = path.startsWith('http') ? path : `${this.url}/${path}`;
response = await fetch(url, {
headers: this.getJSONHeaders(init),

@@ -113,0 +118,0 @@ ...init,

@@ -35,2 +35,3 @@ /// <reference types="node" />

getAuthorizeRedirect(organization: string, path: string): string;
getReinstallRedirect(organization: string): string;
validateAuthorizeCode(code: string): AptlyAppAuthorizeCode;

@@ -37,0 +38,0 @@ verifyToken(token: string): AptlyAppAuthorizeToken;

@@ -88,2 +88,5 @@ import jwt from 'jsonwebtoken';

}
getReinstallRedirect(organization) {
return `${this.url}/api/v1/organizations/${organization}/apps/${this.client_id}/install`;
}
validateAuthorizeCode(code) {

@@ -90,0 +93,0 @@ return this.crypto.verifyCode(this.client_id, code, this.client_secret);

{
"name": "@aptly-as/app-sdk",
"version": "0.3.0",
"version": "0.3.1",
"description": "Aptly app SDK library for app communication and frontend development",

@@ -5,0 +5,0 @@ "type": "module",

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