@devbookhq/extension-admin
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -24,7 +24,10 @@ export declare enum APIVersion { | ||
private request; | ||
search(indexes: string[] | string, query: string, page?: number, pageSize?: number): Promise<Entry[]>; | ||
search(indexes: string[] | string, query: string, pageSize?: number, pageNumber?: number): Promise<Entry[]>; | ||
index(index: string, entries: Entry[]): Promise<void>; | ||
delete(index: string, ids: string[]): Promise<void>; | ||
delete(index: string): Promise<void>; | ||
entry(index: string, id: string): Promise<Entry>; | ||
entries(index: string, page: number, pageSize: number): Promise<Entry[]>; | ||
entries(index: string, pageSize?: number, pageID?: string): Promise<{ | ||
entries: Entry[]; | ||
pageID: string; | ||
}>; | ||
info(): Promise<ExtensionInfo>; | ||
@@ -31,0 +34,0 @@ } |
@@ -80,5 +80,5 @@ "use strict"; | ||
}; | ||
Devbook.prototype.search = function (indexes, query, page, pageSize) { | ||
if (page === void 0) { page = 1; } | ||
Devbook.prototype.search = function (indexes, query, pageSize, pageNumber) { | ||
if (pageSize === void 0) { pageSize = 10; } | ||
if (pageNumber === void 0) { pageNumber = 0; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -89,10 +89,10 @@ return __generator(this, function (_a) { | ||
route: '/entry/query', | ||
params: { | ||
indexes: indexes, | ||
pageSize: pageSize, | ||
pageNumber: pageNumber, | ||
}, | ||
data: { | ||
indexes: indexes, | ||
query: query, | ||
}, | ||
params: { | ||
page: page, | ||
pageSize: pageSize, | ||
}, | ||
})]; | ||
@@ -109,5 +109,7 @@ }); | ||
route: '/entry', | ||
params: { | ||
index: index, | ||
}, | ||
data: { | ||
entries: entries, | ||
index: index, | ||
}, | ||
@@ -122,3 +124,3 @@ })]; | ||
}; | ||
Devbook.prototype.delete = function (index, ids) { | ||
Devbook.prototype.delete = function (index) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -130,4 +132,3 @@ return __generator(this, function (_a) { | ||
route: '/entry', | ||
data: { | ||
ids: ids, | ||
params: { | ||
index: index, | ||
@@ -148,5 +149,6 @@ }, | ||
method: 'GET', | ||
route: "/entry/" + id, | ||
data: { | ||
route: "/entry", | ||
params: { | ||
index: index, | ||
entryID: id, | ||
}, | ||
@@ -157,3 +159,4 @@ })]; | ||
}; | ||
Devbook.prototype.entries = function (index, page, pageSize) { | ||
Devbook.prototype.entries = function (index, pageSize, pageID) { | ||
if (pageSize === void 0) { pageSize = 100; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -164,8 +167,6 @@ return __generator(this, function (_a) { | ||
route: '/entry', | ||
data: { | ||
params: { | ||
index: index, | ||
}, | ||
params: { | ||
page: page, | ||
pageSize: pageSize, | ||
pageID: pageID, | ||
} | ||
@@ -172,0 +173,0 @@ })]; |
{ | ||
"name": "@devbookhq/extension-admin", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"lockfileVersion": 1, | ||
@@ -5,0 +5,0 @@ "requires": true, |
{ | ||
"name": "@devbookhq/extension-admin", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "NodeJS wrapper around the Devbook extension API", | ||
@@ -13,3 +13,3 @@ "main": "lib/index.js", | ||
"email": "hello@usedevbook.com", | ||
"url": "https://usedevbook.com/" | ||
"url": "https://usedevbook.com" | ||
}, | ||
@@ -16,0 +16,0 @@ "repository": { |
@@ -40,7 +40,7 @@ # Devbook Extension Node.js library | ||
// - Query you want to search for. | ||
// - Page number (optional, default is 1). | ||
// - Page size (optional, default is 10) | ||
const pageNumber = 1; | ||
// - Page size (optional, default is 10). | ||
// - Page number (optional, default is 0). | ||
const pageSize = 10; | ||
const results = await devbook.search(['index1', 'index2'], query, pageNumber, pageSize); | ||
const pageNumber = 0; | ||
const results = await devbook.search(['index1', 'index2'], query, pageSize, pageNumber); | ||
@@ -62,9 +62,11 @@ // Delete indexed data. | ||
// - Name of the index. | ||
// - Page number. | ||
// - Page size | ||
const pageNumber = 1; | ||
const pageSize = 10; | ||
const entries = await devbook.entries('indexName', pageNumber, pageSize); | ||
// - Page size (optional, default is 100). | ||
// - Page ID used for pagination of results | ||
// (optional, page ID for retrieving the next page of entries. | ||
// Is returned from the `devbook.entries` function in the `pageID` field of the return object.). | ||
const pageSize = 100; | ||
const pageID = 'pageID'; | ||
const entries = await devbook.entries('indexName', pageSize, pageID); | ||
// Get information about the extension | ||
// Get information about the extension. | ||
const info = await devbook.info(); | ||
@@ -71,0 +73,0 @@ ``` |
Sorry, the diff of this file is not supported yet
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
59436
895
75