@aptly-as/app-sdk
Advanced tools
Comparing version 1.1.6 to 1.2.0
@@ -25,2 +25,3 @@ /// <reference types="node" /> | ||
delete<T>(path: string, init?: Omit<RequestInit, 'body' | 'method'>): Promise<T>; | ||
postAppWebhook(body: object): Promise<any>; | ||
downloadDocumentWithToken(downloadToken: string): Promise<{ | ||
@@ -27,0 +28,0 @@ buffer: Buffer; |
@@ -44,2 +44,21 @@ import { AptlyError } from '@aptly-as/types'; | ||
} | ||
async postAppWebhook(body) { | ||
const res = await fetch('/api/apps/webhook', { | ||
method: 'POST', | ||
headers: { | ||
Authorization: this.basicAuth(), | ||
'Content-Type': 'application/json', | ||
}, | ||
body: JSON.stringify(body), | ||
}); | ||
if (!res.ok) { | ||
throw new AptlyError({ | ||
id: 'none', | ||
status: res.status, | ||
title: res.statusText, | ||
detail: await res.text(), | ||
}); | ||
} | ||
return await res.json(); | ||
} | ||
async downloadDocumentWithToken(downloadToken) { | ||
@@ -46,0 +65,0 @@ return this.downloadDocument(`/documents/${downloadToken}`); |
{ | ||
"name": "@aptly-as/app-sdk", | ||
"version": "1.1.6", | ||
"version": "1.2.0", | ||
"description": "Aptly app SDK library for app communication and frontend development", | ||
@@ -5,0 +5,0 @@ "type": "module", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39697
38
1039
7