digitalocean-js
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -20,3 +20,3 @@ import { DigitalOcean } from '../../digitalocean'; | ||
*/ | ||
getAllDistributionImages(): Promise<Image[]>; | ||
getAllDistributionImages(page?: number, perPage?: number): Promise<Image[]>; | ||
/** | ||
@@ -28,3 +28,3 @@ * Get all application images | ||
*/ | ||
getAllApplicationImages(): Promise<Image[]>; | ||
getAllApplicationImages(page?: number, perPage?: number): Promise<Image[]>; | ||
/** | ||
@@ -36,3 +36,3 @@ * Get the private images of a user | ||
*/ | ||
getUserImages(): Promise<Image[]>; | ||
getUserImages(page?: number, perPage?: number): Promise<Image[]>; | ||
/** | ||
@@ -39,0 +39,0 @@ * Get all actions that have been executed on an image |
@@ -34,5 +34,7 @@ import Axios from 'axios'; | ||
*/ | ||
getAllDistributionImages() { | ||
getAllDistributionImages(page, perPage) { | ||
return new Promise((resolve, reject) => { | ||
Axios.get(`${this.baseUrl}/images?type=distribution`).then((response) => { | ||
page = page ? page : 1; | ||
perPage = perPage ? perPage : 25; | ||
Axios.get(`${this.baseUrl}/images?type=distribution&page=${page}&perPage=${perPage}`).then((response) => { | ||
// Return actual images instead of wrapped images | ||
@@ -51,5 +53,7 @@ resolve(response.data.images); | ||
*/ | ||
getAllApplicationImages() { | ||
getAllApplicationImages(page, perPage) { | ||
return new Promise((resolve, reject) => { | ||
Axios.get(`${this.baseUrl}/images?type=application`).then((response) => { | ||
page = page ? page : 1; | ||
perPage = perPage ? perPage : 25; | ||
Axios.get(`${this.baseUrl}/images?type=application&page=${page}&perPage=${perPage}`).then((response) => { | ||
// Return actual images instead of wrapped images | ||
@@ -68,5 +72,7 @@ resolve(response.data.images); | ||
*/ | ||
getUserImages() { | ||
getUserImages(page, perPage) { | ||
return new Promise((resolve, reject) => { | ||
Axios.get(`${this.baseUrl}/images?private=true`).then((response) => { | ||
page = page ? page : 1; | ||
perPage = perPage ? perPage : 25; | ||
Axios.get(`${this.baseUrl}/images?private=true&page=${page}&perPage=${perPage}`).then((response) => { | ||
// Return actual images instead of wrapped images | ||
@@ -73,0 +79,0 @@ resolve(response.data.images); |
{ | ||
"name": "digitalocean-js", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "JavaScript library for the DigitalOcean API", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -42,5 +42,7 @@ import Axios from 'axios'; | ||
*/ | ||
public getAllDistributionImages(): Promise<Image[]> { | ||
public getAllDistributionImages(page?: number, perPage?: number): Promise<Image[]> { | ||
return new Promise((resolve, reject) => { | ||
Axios.get(`${this.baseUrl}/images?type=distribution`).then((response) => { | ||
page = page ? page : 1; | ||
perPage = perPage ? perPage : 25; | ||
Axios.get(`${this.baseUrl}/images?type=distribution&page=${page}&perPage=${perPage}`).then((response) => { | ||
// Return actual images instead of wrapped images | ||
@@ -60,5 +62,7 @@ resolve(response.data.images); | ||
*/ | ||
public getAllApplicationImages(): Promise<Image[]> { | ||
public getAllApplicationImages(page?: number, perPage?: number): Promise<Image[]> { | ||
return new Promise((resolve, reject) => { | ||
Axios.get(`${this.baseUrl}/images?type=application`).then((response) => { | ||
page = page ? page : 1; | ||
perPage = perPage ? perPage : 25; | ||
Axios.get(`${this.baseUrl}/images?type=application&page=${page}&perPage=${perPage}`).then((response) => { | ||
// Return actual images instead of wrapped images | ||
@@ -78,5 +82,7 @@ resolve(response.data.images); | ||
*/ | ||
public getUserImages(): Promise<Image[]> { | ||
public getUserImages(page?: number, perPage?: number): Promise<Image[]> { | ||
return new Promise((resolve, reject) => { | ||
Axios.get(`${this.baseUrl}/images?private=true`).then((response) => { | ||
page = page ? page : 1; | ||
perPage = perPage ? perPage : 25; | ||
Axios.get(`${this.baseUrl}/images?private=true&page=${page}&perPage=${perPage}`).then((response) => { | ||
// Return actual images instead of wrapped images | ||
@@ -83,0 +89,0 @@ resolve(response.data.images); |
Sorry, the diff of this file is not supported yet
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
191271
4314