@rss3/js-sdk
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -41,3 +41,2 @@ "use strict"; | ||
var openapi_fetch_1 = require("openapi-fetch"); | ||
var utils_1 = require("../utils"); | ||
var constants_1 = require("../constants"); | ||
@@ -60,3 +59,4 @@ function client(opt) { | ||
_a = _b.sent(), data = _a.data, error = _a.error; | ||
(0, utils_1.guardError)(error); | ||
if (error || !data) | ||
throw error; | ||
return [2 /*return*/, data]; | ||
@@ -75,3 +75,4 @@ } | ||
_a = _b.sent(), data = _a.data, error = _a.error; | ||
(0, utils_1.guardError)(error); | ||
if (error || !data) | ||
throw error; | ||
return [2 /*return*/, data]; | ||
@@ -78,0 +79,0 @@ } |
@@ -318,3 +318,3 @@ import { paths } from '../types/search'; | ||
}[] | undefined; | ||
} | undefined>; | ||
}>; | ||
}; |
@@ -41,3 +41,2 @@ "use strict"; | ||
var openapi_fetch_1 = require("openapi-fetch"); | ||
var utils_1 = require("../utils"); | ||
var constants_1 = require("../constants"); | ||
@@ -55,8 +54,18 @@ function client(opt) { | ||
switch (_b.label) { | ||
case 0: return [4 /*yield*/, client.post('/api/Feed/v2/search', { | ||
body: query, | ||
})]; | ||
case 0: | ||
if (!query.platform) | ||
query.platform = ['ALL']; | ||
if (!query.network) | ||
query.network = ['ALL']; | ||
if (!query.sort) | ||
query.sort = 'NONE'; | ||
if (!query.between) | ||
query.between = { lte: -1, gte: -1 }; | ||
return [4 /*yield*/, client.post('/api/Feed/v2/search', { | ||
body: query, | ||
})]; | ||
case 1: | ||
_a = _b.sent(), data = _a.data, error = _a.error; | ||
(0, utils_1.guardError)(error); | ||
if (error || !data) | ||
throw error; | ||
return [2 /*return*/, data]; | ||
@@ -63,0 +72,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.guardError = void 0; | ||
function guardError(error) { | ||
if (error) | ||
throw error; | ||
} | ||
exports.guardError = guardError; |
{ | ||
"name": "@rss3/js-sdk", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "engines": { |
@@ -13,3 +13,3 @@ # Overview | ||
Basic code example: [link](examples/basic/index.js). | ||
Basic code example: [link](examples/basic/index.ts). | ||
@@ -16,0 +16,0 @@ For more examples see [examples](examples). |
Sorry, the diff of this file is too big to display
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
312785
6329