-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No ref/phase 3 endpoints #258
base: main
Are you sure you want to change the base?
Changes from all commits
6856c63
3e58ea7
92a4a44
503eddf
f4d6023
58d3fdd
4792612
7831a54
a354764
948ddba
1fef1a2
ab9b210
0616d2f
23d1ee3
7b077e5
0c65cc7
932b466
836cf3e
e7daa53
05f5d37
176125f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { NextResponse } from "next/server"; | ||
import collectionsLandingPageSchema from "../../../../src/data/schemas/collectionsLandingPageSchema"; | ||
|
||
export const GET = async () => { | ||
return NextResponse.json(collectionsLandingPageSchema, { status: 200 }); | ||
}; | ||
|
||
// http://localhost:3000/api/schema/collections/:uuid |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { NextResponse } from "next/server"; | ||
import collectionsStructureSchema from "../../../../../src/data/schemas/collectionsStructureSchema"; | ||
|
||
export const GET = async () => { | ||
return NextResponse.json(collectionsStructureSchema, { status: 200 }); | ||
}; | ||
|
||
// http://localhost:3000/api/schema/collections/:uuid/structure |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { NextResponse } from "next/server"; | ||
import collectionsSchema from "../../../src/data/schemas/collectionsSchema"; | ||
|
||
export const GET = async () => { | ||
return NextResponse.json(collectionsSchema, { status: 200 }); | ||
}; | ||
|
||
// http://localhost:3000/api/schema/collections/:uuid |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { NextResponse } from "next/server"; | ||
import searchFacetsSchema from "../../../../src/data/schemas/searchFacetsSchema"; | ||
|
||
export const GET = async () => { | ||
return NextResponse.json(searchFacetsSchema, { status: 200 }); | ||
}; | ||
|
||
// http://localhost:3000/api/schema/search/facets |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { NextResponse } from "next/server"; | ||
import searchSchema from "../../../src/data/schemas/searchSchema"; | ||
|
||
export const GET = async () => { | ||
return NextResponse.json(searchSchema, { status: 200 }); | ||
}; | ||
|
||
// http://localhost:3000/api/schema/search |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const collectionObject = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where is this being used? Or is it for reference? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just for reference |
||
uuid: "string", | ||
recordType: "collection | sub-collection", | ||
title: "string", | ||
url: "string", | ||
imageID: "string | null", | ||
imageURL: "string", | ||
numberOfDigitizedItems: "number", | ||
containsOnSiteMaterials: "boolean", | ||
highlights: "{ highlighted_field_name:[ string ] }", | ||
firstIndexed_dt: "date", | ||
}; | ||
|
||
export default collectionObject; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const collectionsLandingPageSchema = { | ||
response: { | ||
numResults: "6", | ||
page: "1", | ||
perPage: "40", | ||
Comment on lines
+3
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For consistency, use "string" instead of specific values. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^^ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But |
||
items: [ | ||
{ | ||
uuid: "string", | ||
recordType: "item", | ||
title: "string", | ||
url: "string", | ||
imageID: "string | null", | ||
imageURL: "string", | ||
contentType: "image | multiple images | audio | video | pdf", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a way for this to express that these are the 5 strings we're interested in, but that we expect (I think) that there are actually more content types returned on the item. So we just want a string here, then on the model we would transform it as needed? |
||
onSiteOnly: "boolean", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would an item have an 'isAVMaterial' field There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or would that be covered by |
||
}, | ||
{ | ||
uuid: "string", | ||
recordType: "item", | ||
title: "string", | ||
url: "string", | ||
imageID: "string | null", | ||
imageURL: "string", | ||
contentType: "image | multiple images | audio | video | pdf", | ||
onSiteOnly: "boolean", | ||
}, | ||
{ | ||
uuid: "string", | ||
recordType: "item", | ||
title: "string", | ||
url: "string", | ||
imageID: "string | null", | ||
imageURL: "string", | ||
contentType: "image | multiple images | audio | video | pdf", | ||
onSiteOnly: "boolean", | ||
}, | ||
], | ||
}, | ||
}; | ||
|
||
export default collectionsLandingPageSchema; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
const collectionsSchema = { | ||
response: { | ||
numResults: "6", | ||
page: "1", | ||
perPage: "40", | ||
// move from "collection" to "collections" | ||
collections: [ | ||
{ | ||
title: "string", | ||
uuid: "string", | ||
url: "string", | ||
imageID: "string", | ||
numberOfDigitizedItems: "string", // remove numItems | ||
containsAVMaterial: "boolean", | ||
constainsOnSiteMaterials: "boolean", | ||
Comment on lines
+14
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These will always be either |
||
}, | ||
{ | ||
title: "string", | ||
uuid: "string", | ||
url: "string", | ||
imageID: "string", | ||
numberOfDigitizedItems: "string", | ||
containsAVMaterial: "boolean", | ||
constainsOnSiteMaterials: "boolean", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit but contains, not constains. Just in case this is what gets copy pasted into new api |
||
}, | ||
{ | ||
title: "string", | ||
uuid: "string", | ||
url: "string", | ||
imageID: "string", | ||
numberOfDigitizedItems: "string", | ||
containsAVMaterial: "boolean", | ||
constainsOnSiteMaterials: "boolean", | ||
}, | ||
{ | ||
title: "string", | ||
uuid: "string", | ||
url: "string", | ||
imageID: "string", | ||
numberOfDigitizedItems: "string", | ||
containsAVMaterial: "boolean", | ||
constainsOnSiteMaterials: "boolean", | ||
}, | ||
], | ||
}, | ||
}; | ||
|
||
export default collectionsSchema; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const collectionsStructureSchema = { | ||
response: { | ||
numResults: "6", | ||
page: "1", | ||
perPage: "40", | ||
}, | ||
}; | ||
|
||
export default collectionsStructureSchema; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const itemObject = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also not being used yet. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think either of these will be "used" until they exist in new repo api but the idea was have an expected shape to base models off of |
||
uuid: "string", | ||
recordType: "item", | ||
title: "string", | ||
url: "string", | ||
imageID: "string | null", | ||
imageURL: "string", | ||
contentType: "image | multiple images | audio | video | pdf", | ||
onSiteOnly: "boolean", | ||
highlights: "{ highlighted_field_name:[ string ] }", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "highlights" is plural but the value is a single object. Is that right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm also a little confused by this one. Can you give an example of what this might return as |
||
firstIndexed_dt: "date", | ||
}; | ||
|
||
export default itemObject; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const searchFacetsSchema = { | ||
response: { | ||
numResults: "6", | ||
page: "1", | ||
perPage: "40", | ||
}, | ||
}; | ||
|
||
export default searchFacetsSchema; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
const searchSchema = { | ||
response: { | ||
// Keyword included in search | ||
keyword: "string", | ||
// Pagination fields | ||
numResults: "integer", | ||
page: "integer", | ||
perPage: "integer", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reiterating comment from collectionsSchema: |
||
// Sort fields | ||
sort: "string ie: title DESC", | ||
// Filter fields | ||
filterField: "string", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this an array of strings? Can you give an example of what this might return as |
||
// Results | ||
results: [ | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. after reading the requirements for the modal in the brd, I think we can include the list of filter categories and the first 10 filters per category in this endpoint. each category would have a field for the total count of filters so the app knows when to display the "View all" button that loads the modal. |
||
uuid: "string", | ||
recordType: "collection | sub-collection | item", | ||
title: "string", | ||
url: "string", | ||
imageID: "string | null", | ||
imageURL: "string", | ||
numberOfDigitizedItems: "number", | ||
containsOnSiteMaterials: "boolean | null if type is `item`", | ||
contentType: "image | multiple images | audio | video | pdf | null", | ||
onSiteOnly: | ||
"boolean | null if type is `collection` or `sub-collection`", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We briefly talked about this but it might be easier to make it more typescript-y and give each object "collection", "sub-collection", and "item" a type. Then it's could be
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like this idea. In general, this schema makes it really clear what the search results row card will have available to it |
||
highlights: "{ highlighted_field_name:[ string ] }", | ||
firstIndexed_dt: "date", | ||
}, | ||
{ | ||
uuid: "string", | ||
recordType: "collection | sub-collection | item", | ||
title: "string", | ||
url: "string", | ||
imageID: "string | null", | ||
imageURL: "string", | ||
numberOfDigitizedItems: "number", | ||
containsOnSiteMaterials: "boolean | null if type is `item`", | ||
contentType: "image | multiple images | audio | video | pdf | null", | ||
onSiteOnly: | ||
"boolean | null if type is `collection` or `sub-collection`", | ||
highlights: "{ highlighted_field_name:[ string ] }", | ||
firstIndexed_dt: "date", | ||
}, | ||
{ | ||
uuid: "string", | ||
recordType: "collection | sub-collection | item", | ||
title: "string", | ||
url: "string", | ||
imageID: "string | null", | ||
imageURL: "string", | ||
numberOfDigitizedItems: "number", | ||
containsOnSiteMaterials: "boolean | null if type is `item`", | ||
contentType: "image | multiple images | audio | video | pdf | null", | ||
onSiteOnly: | ||
"boolean | null if type is `collection` or `sub-collection`", | ||
highlights: "{ highlighted_field_name:[ string ] }", | ||
firstIndexed_dt: "date", | ||
}, | ||
], | ||
}, | ||
}; | ||
|
||
export default searchSchema; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the intended api to use for the modal.
idk if
facets
is the right term to use here?filters
is kind of more implicit of what is actually being searched.regardless, interacting with the api to get the list of the filters in the modal would require a keyword search ie.
q=
and a way to identify the category we are searching, ie.category=
.