New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@internetarchive/search-service

Package Overview
Dependencies
Maintainers
18
Versions
158
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@internetarchive/search-service - npm Package Compare versions

Comparing version 1.2.5-alpha.26 to 1.2.5-alpha.27

8

dist/src/models/hit-types/item-hit.d.ts

@@ -5,2 +5,3 @@ import type { Metadata } from '../metadata';

import { StringField } from '../metadata-fields/field-types/string';
import { Review } from '../../responses/page-elements';
/**

@@ -143,2 +144,9 @@ * A model that describes an item hit from a Metadata Search via the PPS endpoint.

/**
* Optional.
* Only present when requesting the reviews page_element of an account_details page.
* Contains data about the target user's review on this item.
* Note: this property is not a standard field type and there is no need to call `.value`/`.values` on it.
*/
get review(): Review | undefined;
/**
* Format varies.

@@ -145,0 +153,0 @@ * Optional.

@@ -287,2 +287,23 @@ import { __decorate } from "tslib";

/**
* Optional.
* Only present when requesting the reviews page_element of an account_details page.
* Contains data about the target user's review on this item.
* Note: this property is not a standard field type and there is no need to call `.value`/`.values` on it.
*/
get review() {
var _a;
const reviewData = (_a = this.rawMetadata) === null || _a === void 0 ? void 0 : _a.review;
return reviewData
? {
body: reviewData.reviewbody,
title: reviewData.reviewtitle,
author: reviewData.reviewer,
updatedate: new Date(reviewData.reviewdate),
createdate: new Date(reviewData.createdate),
stars: Number(reviewData.stars) || 0,
__href__: reviewData.__href__,
}
: undefined;
}
/**
* Format varies.

@@ -435,2 +456,5 @@ * Optional.

Memoize()
], ItemHit.prototype, "review", null);
__decorate([
Memoize()
], ItemHit.prototype, "source", null);

@@ -437,0 +461,0 @@ __decorate([

@@ -43,2 +43,18 @@ import { Aggregation } from '../models/aggregation';

}
export interface Review {
/** A preview of the review's body text, truncated to 100 characters */
body: string;
/** The title of the review */
title: string;
/** The screen name of the review author */
author: string;
/** The date on which the review was last edited */
updatedate: Date;
/** The date on which the review was first created */
createdate: Date;
/** The star rating (out of 5) attached to the review */
stars: number;
/** A URL linking directly to the review on its item page */
__href__: string;
}
export declare type UploadsPageElement = HitsAggregationsPageElement;

@@ -45,0 +61,0 @@ export declare type ReviewsPageElement = HitsAggregationsPageElement;

@@ -111,2 +111,8 @@ import { Aggregation } from '../models/aggregation';

/**
* Constructs Aggregation objects from raw aggregations data and applies them
* to this instance's aggregations property.
* @param aggregations The raw aggregations data from the PPS
*/
private buildAggregations;
/**
* Special handling for when the 'lending' page element is present on the response.

@@ -113,0 +119,0 @@ * @returns An array of raw hits representing current loans.

16

dist/src/responses/search-response-details.js

@@ -49,6 +49,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

if (aggregations) {
this.aggregations = Object.entries(aggregations).reduce((acc, [key, val]) => {
acc[key] = new Aggregation(val);
return acc;
}, {});
this.buildAggregations(aggregations);
}

@@ -66,2 +63,13 @@ if (body === null || body === void 0 ? void 0 : body.collection_titles) {

/**
* Constructs Aggregation objects from raw aggregations data and applies them
* to this instance's aggregations property.
* @param aggregations The raw aggregations data from the PPS
*/
buildAggregations(aggregations) {
this.aggregations = Object.entries(aggregations).reduce((acc, [key, val]) => {
acc[key] = new Aggregation(val);
return acc;
}, {});
}
/**
* Special handling for when the 'lending' page element is present on the response.

@@ -68,0 +76,0 @@ * @returns An array of raw hits representing current loans.

{
"name": "@internetarchive/search-service",
"version": "1.2.5-alpha.26",
"version": "1.2.5-alpha.27",
"description": "A search service for the Internet Archive",

@@ -5,0 +5,0 @@ "license": "AGPL-3.0-only",

@@ -10,2 +10,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

import { StringField } from '../metadata-fields/field-types/string';
import { Review } from '../../responses/page-elements';

@@ -298,2 +299,23 @@ /**

/**
* Optional.
* Only present when requesting the reviews page_element of an account_details page.
* Contains data about the target user's review on this item.
* Note: this property is not a standard field type and there is no need to call `.value`/`.values` on it.
*/
@Memoize() get review(): Review | undefined {
const reviewData = this.rawMetadata?.review;
return reviewData
? {
body: reviewData.reviewbody,
title: reviewData.reviewtitle,
author: reviewData.reviewer,
updatedate: new Date(reviewData.reviewdate),
createdate: new Date(reviewData.createdate),
stars: Number(reviewData.stars) || 0,
__href__: reviewData.__href__,
}
: undefined;
}
/**
* Format varies.

@@ -300,0 +322,0 @@ * Optional.

@@ -55,2 +55,19 @@ import { Aggregation } from '../models/aggregation';

export interface Review {
/** A preview of the review's body text, truncated to 100 characters */
body: string;
/** The title of the review */
title: string;
/** The screen name of the review author */
author: string;
/** The date on which the review was last edited */
updatedate: Date;
/** The date on which the review was first created */
createdate: Date;
/** The star rating (out of 5) attached to the review */
stars: number;
/** A URL linking directly to the review on its item page */
__href__: string;
}
export type UploadsPageElement = HitsAggregationsPageElement;

@@ -57,0 +74,0 @@ export type ReviewsPageElement = HitsAggregationsPageElement;

@@ -184,9 +184,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

if (aggregations) {
this.aggregations = Object.entries(aggregations).reduce(
(acc, [key, val]) => {
acc[key] = new Aggregation(val);
return acc;
},
{} as Record<string, Aggregation>
);
this.buildAggregations(aggregations);
}

@@ -208,2 +202,17 @@

/**
* Constructs Aggregation objects from raw aggregations data and applies them
* to this instance's aggregations property.
* @param aggregations The raw aggregations data from the PPS
*/
private buildAggregations(aggregations: Record<string, Aggregation>): void {
this.aggregations = Object.entries(aggregations).reduce(
(acc, [key, val]) => {
acc[key] = new Aggregation(val);
return acc;
},
{} as Record<string, Aggregation>
);
}
/**
* Special handling for when the 'lending' page element is present on the response.

@@ -210,0 +219,0 @@ * @returns An array of raw hits representing current loans.

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc