danielbonifacio-sdk
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -41,3 +41,3 @@ import { Post } from "../@types"; | ||
}>; | ||
static getExistingPost(id: number): Promise<{ | ||
static getExistingPost(id: number, token?: string): Promise<{ | ||
id: number; | ||
@@ -44,0 +44,0 @@ editor: { |
@@ -17,2 +17,13 @@ "use strict"; | ||
})(); | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -33,4 +44,8 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
PostService.getExistingPost = function (id) { | ||
return this.Http.get("/posts/" + id).then(this.getData); | ||
PostService.getExistingPost = function (id, token) { | ||
return this.Http.get("/posts/" + id, { | ||
headers: __assign({}, (token && { | ||
Authorization: "Bearer " + token, | ||
})), | ||
}).then(this.getData); | ||
}; | ||
@@ -37,0 +52,0 @@ PostService.insertNewPost = function (post) { |
{ | ||
"name": "danielbonifacio-sdk", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
@@ -13,4 +13,10 @@ import { Post } from "../@types"; | ||
static getExistingPost(id: number) { | ||
return this.Http.get<Post.Detailed>(`/posts/${id}`).then(this.getData); | ||
static getExistingPost(id: number, token?: string) { | ||
return this.Http.get<Post.Detailed>(`/posts/${id}`, { | ||
headers: { | ||
...(token && { | ||
Authorization: `Bearer ${token}`, | ||
}), | ||
}, | ||
}).then(this.getData); | ||
} | ||
@@ -17,0 +23,0 @@ |
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
177418
4925