@1password/connect
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -15,2 +15,10 @@ [//]: # (START/LATEST) | ||
[//]: # (START/v1.3.0) | ||
# v1.3.0 | ||
## Features | ||
* Add functionality to fetch a list of the items by title containing provided string {#82} | ||
--- | ||
[//]: # (START/v1.2.0) | ||
@@ -17,0 +25,0 @@ # v1.2.0 |
@@ -83,2 +83,11 @@ import { FullItem } from "../model/fullItem"; | ||
/** | ||
* Returns a list of Items that contain provided string. | ||
* | ||
* | ||
* @param {string} vaultId | ||
* @param {string} titleSearchStr | ||
* @returns {Promise<FullItem[]>} | ||
*/ | ||
listItemsByTitleContains(vaultId: string, titleSearchStr: string): Promise<FullItem[]>; | ||
/** | ||
* Get details about a specific Item in a Vault. | ||
@@ -85,0 +94,0 @@ * |
@@ -128,2 +128,15 @@ "use strict"; | ||
/** | ||
* Returns a list of Items that contain provided string. | ||
* | ||
* | ||
* @param {string} vaultId | ||
* @param {string} titleSearchStr | ||
* @returns {Promise<FullItem[]>} | ||
*/ | ||
listItemsByTitleContains(vaultId, titleSearchStr) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.items.listItemsByTitleContains(vaultId, titleSearchStr); | ||
}); | ||
} | ||
/** | ||
* Get details about a specific Item in a Vault. | ||
@@ -130,0 +143,0 @@ * |
@@ -95,2 +95,10 @@ import { Item as SimpleItem, FullItem, ItemFile, Vault } from "../model/models"; | ||
/** | ||
* Search for the Items in which the Title contains a provided string. | ||
* | ||
* @param {string} vaultId | ||
* @param {string} titleSearchStr | ||
* @returns {Promise<FullItem[]>} | ||
*/ | ||
listItemsByTitleContains(vaultId: string, titleSearchStr: string): Promise<FullItem[]>; | ||
/** | ||
* Searches for an Item with exact match on title. | ||
@@ -97,0 +105,0 @@ * If found, queries for complete item details and returns result. |
@@ -203,2 +203,15 @@ "use strict"; | ||
/** | ||
* Search for the Items in which the Title contains a provided string. | ||
* | ||
* @param {string} vaultId | ||
* @param {string} titleSearchStr | ||
* @returns {Promise<FullItem[]>} | ||
*/ | ||
listItemsByTitleContains(vaultId, titleSearchStr) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { data } = yield this.adapter.sendRequest("get", `${this.basePath(vaultId)}?${utils_1.QueryBuilder.searchByTitle(titleSearchStr)}`); | ||
return Promise.all(data.map((item) => this.getById(vaultId, item.id))); | ||
}); | ||
} | ||
/** | ||
* Searches for an Item with exact match on title. | ||
@@ -205,0 +218,0 @@ * If found, queries for complete item details and returns result. |
@@ -8,1 +8,2 @@ export declare const QUERY_PARAM_NAME: { | ||
export declare const filterByTitle: (title: string) => string; | ||
export declare const searchByTitle: (title: string) => string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.filterByTitle = exports.FILTER_PARAM = exports.QUERY_PARAM_NAME = void 0; | ||
exports.searchByTitle = exports.filterByTitle = exports.FILTER_PARAM = exports.QUERY_PARAM_NAME = void 0; | ||
exports.QUERY_PARAM_NAME = { | ||
@@ -11,2 +11,3 @@ FILTER: "filter", | ||
const eqByTitle = (title) => `${exports.FILTER_PARAM.TITLE} eq "${title}"`; | ||
const coByTitle = (title) => `${exports.FILTER_PARAM.TITLE} co "${title}"`; | ||
const buildKeyValuePair = (queryParamName) => (queryParamValue) => `${queryParamName}=${queryParamValue}`; | ||
@@ -16,2 +17,4 @@ const buildFilterQuery = buildKeyValuePair(exports.QUERY_PARAM_NAME.FILTER); | ||
exports.filterByTitle = filterByTitle; | ||
const searchByTitle = (title) => buildFilterQuery(coByTitle(title)); | ||
exports.searchByTitle = searchByTitle; | ||
//# sourceMappingURL=query-builder.js.map |
{ | ||
"name": "@1password/connect", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"homepage": "https://1password.com/secrets/", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/1Password/connect-sdk-js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
146316
3009