@internetarchive/search-service
Advanced tools
Comparing version 0.4.3 to 0.4.4
@@ -137,2 +137,6 @@ import type { Metadata } from '../metadata'; | ||
get num_reviews(): typeof Metadata.prototype.num_reviews; | ||
/** Optional. */ | ||
get publicdate(): typeof Metadata.prototype.publicdate; | ||
/** Optional. */ | ||
get reviewdate(): typeof Metadata.prototype.reviewdate; | ||
/** | ||
@@ -139,0 +143,0 @@ * Format varies. |
@@ -272,2 +272,16 @@ import { __decorate } from "tslib"; | ||
} | ||
/** Optional. */ | ||
get publicdate() { | ||
var _a, _b; | ||
return ((_b = (_a = this.rawMetadata) === null || _a === void 0 ? void 0 : _a.fields) === null || _b === void 0 ? void 0 : _b.publicdate) | ||
? new DateField(this.rawMetadata.fields.publicdate) | ||
: undefined; | ||
} | ||
/** Optional. */ | ||
get reviewdate() { | ||
var _a, _b; | ||
return ((_b = (_a = this.rawMetadata) === null || _a === void 0 ? void 0 : _a.fields) === null || _b === void 0 ? void 0 : _b.reviewdate) | ||
? new DateField(this.rawMetadata.fields.reviewdate) | ||
: undefined; | ||
} | ||
/** | ||
@@ -415,2 +429,8 @@ * Format varies. | ||
Memoize() | ||
], ItemHit.prototype, "publicdate", null); | ||
__decorate([ | ||
Memoize() | ||
], ItemHit.prototype, "reviewdate", null); | ||
__decorate([ | ||
Memoize() | ||
], ItemHit.prototype, "source", null); | ||
@@ -417,0 +437,0 @@ __decorate([ |
@@ -33,2 +33,4 @@ import { DateParser } from '@internetarchive/field-parsers'; | ||
'num_reviews', | ||
'publicdate', | ||
'reviewdate', | ||
'source', | ||
@@ -66,3 +68,3 @@ 'subject', | ||
it('constructs item hit with partial fields', () => { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w; | ||
const json = { | ||
@@ -123,5 +125,7 @@ fields: { | ||
expect((_r = hit.num_reviews) === null || _r === void 0 ? void 0 : _r.value).to.be.undefined; | ||
expect((_s = hit.source) === null || _s === void 0 ? void 0 : _s.value).to.be.undefined; | ||
expect((_t = hit.type) === null || _t === void 0 ? void 0 : _t.value).to.be.undefined; | ||
expect((_u = hit.volume) === null || _u === void 0 ? void 0 : _u.value).to.be.undefined; | ||
expect((_s = hit.publicdate) === null || _s === void 0 ? void 0 : _s.value).to.be.undefined; | ||
expect((_t = hit.reviewdate) === null || _t === void 0 ? void 0 : _t.value).to.be.undefined; | ||
expect((_u = hit.source) === null || _u === void 0 ? void 0 : _u.value).to.be.undefined; | ||
expect((_v = hit.type) === null || _v === void 0 ? void 0 : _v.value).to.be.undefined; | ||
expect((_w = hit.volume) === null || _w === void 0 ? void 0 : _w.value).to.be.undefined; | ||
}); | ||
@@ -163,2 +167,4 @@ it('constructs item hit with all fields', () => { | ||
num_reviews: 127, | ||
publicdate: '2011-07-20T00:00:00Z', | ||
reviewdate: '2011-07-20T00:00:00Z', | ||
source: 'foo-source', | ||
@@ -165,0 +171,0 @@ type: 'foo-type', |
@@ -0,0 +0,0 @@ export { Metadata } from './src/models/metadata'; |
{ | ||
"name": "@internetarchive/search-service", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"description": "A search service for the Internet Archive", | ||
@@ -5,0 +5,0 @@ "license": "AGPL-3.0-only", |
@@ -0,0 +0,0 @@ import { FilterConstraint, FilterMap } from './search-params'; |
@@ -282,2 +282,16 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
/** Optional. */ | ||
@Memoize() get publicdate(): typeof Metadata.prototype.publicdate { | ||
return this.rawMetadata?.fields?.publicdate | ||
? new DateField(this.rawMetadata.fields.publicdate) | ||
: undefined; | ||
} | ||
/** Optional. */ | ||
@Memoize() get reviewdate(): typeof Metadata.prototype.reviewdate { | ||
return this.rawMetadata?.fields?.reviewdate | ||
? new DateField(this.rawMetadata.fields.reviewdate) | ||
: undefined; | ||
} | ||
/** | ||
@@ -284,0 +298,0 @@ * Format varies. |
@@ -0,0 +0,0 @@ import { |
@@ -0,0 +0,0 @@ export interface AggregateSearchParam { |
@@ -0,0 +0,0 @@ import { expect } from '@open-wc/testing'; |
@@ -34,2 +34,4 @@ import { DateParser } from '@internetarchive/field-parsers'; | ||
'num_reviews', | ||
'publicdate', | ||
'reviewdate', | ||
'source', | ||
@@ -130,2 +132,4 @@ 'subject', | ||
expect(hit.num_reviews?.value).to.be.undefined; | ||
expect(hit.publicdate?.value).to.be.undefined; | ||
expect(hit.reviewdate?.value).to.be.undefined; | ||
expect(hit.source?.value).to.be.undefined; | ||
@@ -170,2 +174,4 @@ expect(hit.type?.value).to.be.undefined; | ||
num_reviews: 127, | ||
publicdate: '2011-07-20T00:00:00Z', | ||
reviewdate: '2011-07-20T00:00:00Z', | ||
source: 'foo-source', | ||
@@ -172,0 +178,0 @@ type: 'foo-type', |
@@ -0,0 +0,0 @@ import { expect } from '@open-wc/testing'; |
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
766509
10958