-
Notifications
You must be signed in to change notification settings - Fork 14
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
F/content metadata #375
F/content metadata #375
Conversation
AFFECTS PACKAGES: @esri/hub-common @esri/hub-content
…eturn it as JSON AFFECTS PACKAGES: @esri/hub-content ISSUES CLOSED: #353
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.
LGTM
@@ -0,0 +1,28 @@ | |||
import { getItemMetadata } from "@esri/arcgis-rest-portal"; | |||
import { IHubRequestOptions } from "@esri/hub-common"; | |||
import { parse } from "fast-xml-parser"; |
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.
Is this what we use in the indexer @mikeringrose ?
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.
it is, though this PR is using v3.x, but indexer uses 2.x, and there are a few differences in the configuration settings and default behavior between the versions. I've made the equivalent configuration in this PR, but there are still slight differences in how the XML is parsed. For example, the peXml
node is not parsed by v2 b/c it contains a nested XML document, but v3 parses that XML in place. See https://github.com/Esri/hub.js/pull/375/files#diff-720828cca6aaaac8de88dda7278ca80fR317-R324
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 what we use. I wish we would have turned to it into nicer json, but it is what it is.
AFFECTS PACKAGES: @esri/hub-content
…xists" This reverts commit 3ed2ffe.
introduces
getContenMetadata()
that fetches item metadata and parses it as JSON.@mikeringrose as mentioned in #353 (comment), this uses same library (although a more recent version) and equivalent configuration as TheDuke does to parse the metadata as JSON. The major difference is that
getContentMetadata()
uses@esri/arcgis-rest-portal
under the hood to fetch the metadata from portal. The long term hope is that we could use this code in TheDuke (someday). Can you please look for anything that would prohibit that.