feat: facet argument for content item commands #111
Conversation
easen-amp
left a comment
There was a problem hiding this comment.
As this removes and existing argument, it should be flagged as a breaking change see https://github.com/googleapis/release-please#how-should-i-write-my-commits
As it's pre v1.0.0, all this would do is bump the minor version.
|
I've changed the title to indicate the breaking change. It should be used as the commit message when squashed. |
187d4c0 to
d16770c
Compare
easen-amp
left a comment
There was a problem hiding this comment.
👍 For adding the old options back in. Can the help text be added back in, but mention that it is now deprecated.
Can the readme be updated to include mention that these options are now deprecated and document how to migrate to the new facet option.
|
The option description was removed because the old options were hidden. Should they be unhidden? |
…utputs schema facet
|
The PR has been updated to fix a few issues with the old argument support. |
This PR replaces the existing
--nameand--schemaIdarguments with an all encompassing--facetargument, which adds filtering by locale and date modified.These filters can be applied to any array of content items, and can currently be used on
content-itemarchiveunarchivecopymoveandexport. As of right now, the facets are applied in software after fetching all content items (within the requested hub/repo/folder), though it is possible in the future to extend this to request content with the facets to save time in future. Note that the regex faceting mode will likely not see this treatment.A full explanation of the
--facetargument has been added to theHOW_TO_USE.mdfile. I'll dupe it below for ease of access:FACETS
The content item export, copy, move, archive and unarchive commands allow the user to provide a facet string to filter the content that the commands work on. Multiple of these can be applied at a time, and you can even match on regex string. Note that you will need to surround your facet in quotes if it contains a space, which will change how backslash escaping works.
name: Filter on content item label. Example:--facet "name:exact name match"schema: Filter on schema ids. Example:--facet schema:http://example.com/schema.jsonlocale: Filter on content item locale. Example:--facet locale:en-GBlastModifiedDate: Filter on last modified date. Example:--facet "lastModifiedDate:Last 7 days"Multiple facets can be applied at once when separated by a comma. Example:
--facet "schema:http://example.com/schema.json, name:/name regex/"Commas can be escaped with a backslash, if they are used in your values. The whitespace after a comma is optional.
PRESET DATE RANGES
The preset date ranges are the same as DC provides:
Last 7 daysLast 14 daysLast 30 daysLast 60 daysOver 60 daysREGEX
You can use regex values on string fields when filtering content. They cannot be used on date ranges. Regex are surronded by two forward slashes:
--facet "name:/ends with this$/"