Skip to content
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

Add output flag for listing available data types #190

Merged
merged 1 commit into from
Jul 11, 2022
Merged

Conversation

Pytal
Copy link
Member

@Pytal Pytal commented Jul 8, 2022

Close #170

occ user:export --list

calendar
contacts
trashbin
account
files

occ user:export --list --output=json

["calendar","contacts","trashbin","account","files"]

occ user:export --list --output=json_pretty

[
    "calendar",
    "contacts",
    "trashbin",
    "account",
    "files"
]

occ user:export --list=full

--------------------- ---------- ---------------------------------------------------------------------------------- 
  Name                  Id         Description                                                                       
 --------------------- ---------- ---------------------------------------------------------------------------------- 
  Calendar              calendar   Calendars including events, details and attendees                                 
  Contacts              contacts   Contacts and groups                                                               
  Deleted files         trashbin   Deleted files and folders in the trash bin (may expire during export if you are   
                                   low on storage space)                                                             
  Profile information   account    Profile picture, full name, email, phone number, address, website, Twitter, orga  
                                   nisation, role, headline, biography, and whether your profile is enabled          
  Files                 files      Files including versions, comments, collaborative tags, and favorites             
 --------------------- ---------- ---------------------------------------------------------------------------------- 

occ user:export --list=full --output=json

{"calendar":{"name":"Calendar","description":"Calendars including events, details and attendees"},"contacts":{"name":"Contacts","description":"Contacts and groups"},"trashbin":{"name":"Deleted files","description":"Deleted files and folders in the trash bin (may expire during export if you are low on storage space)"},"account":{"name":"Profile information","description":"Profile picture, full name, email, phone number, address, website, Twitter, organisation, role, headline, biography, and whether your profile is enabled"},"files":{"name":"Files","description":"Files including versions, comments, collaborative tags, and favorites"}}

occ user:export --list=full --output=json_pretty

{
    "calendar": {
        "name": "Calendar",
        "description": "Calendars including events, details and attendees"
    },
    "contacts": {
        "name": "Contacts",
        "description": "Contacts and groups"
    },
    "trashbin": {
        "name": "Deleted files",
        "description": "Deleted files and folders in the trash bin (may expire during export if you are low on storage space)"
    },
    "account": {
        "name": "Profile information",
        "description": "Profile picture, full name, email, phone number, address, website, Twitter, organisation, role, headline, biography, and whether your profile is enabled"
    },
    "files": {
        "name": "Files",
        "description": "Files including versions, comments, collaborative tags, and favorites"
    }
}

@Pytal Pytal added the 2. developing Work in progress label Jul 8, 2022
@Pytal Pytal added this to the 1.1 milestone Jul 8, 2022
@Pytal Pytal self-assigned this Jul 8, 2022
@Pytal Pytal force-pushed the enh/list-types-output branch 6 times, most recently from 7b0fab7 to 8e05bd9 Compare July 8, 2022 19:15
@Pytal Pytal marked this pull request as ready for review July 8, 2022 19:23
@Pytal Pytal added 3. to review Waiting for reviews enhancement New feature request and removed 2. developing Work in progress labels Jul 8, 2022
@Pytal Pytal requested a review from come-nc July 8, 2022 19:26
@Pytal Pytal force-pushed the enh/list-types-output branch from 8e05bd9 to 432f4cb Compare July 8, 2022 23:07
Copy link
Collaborator

@come-nc come-nc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +37 to +41
<file src="lib/Command/Export.php">
<InvalidArgument occurrences="1">
<code>$this</code>
</InvalidArgument>
</file>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that triggered?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed the failure in the CI. Is it not possible to add the property to the stub?
Otherwise we should just move OC\Core\Command\Base to OCP, it makes sense to make it available for applications.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok moving Command\Base to OCP was refused in nextcloud/server#32332 so we have to wait on nextcloud/server#32780
In the mean time add the property in the stub if possible, if not add it to the baseline.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that triggered?

It's from the call to $help->setCommand($this)

In the mean time add the property in the stub if possible, if not add it to the baseline.

Stubbed

Signed-off-by: Christopher Ng <chrng8@gmail.com>
@Pytal Pytal force-pushed the enh/list-types-output branch from 432f4cb to d954212 Compare July 11, 2022 22:42
@Pytal Pytal added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Jul 11, 2022
@Pytal Pytal merged commit b69a6ef into main Jul 11, 2022
@Pytal Pytal deleted the enh/list-types-output branch July 11, 2022 22:55
@Pytal
Copy link
Member Author

Pytal commented Jul 11, 2022

/backport to stable24

@backportbot-nextcloud backportbot-nextcloud bot added the backport-request A backport was requested for this pull request label Jul 11, 2022
@backportbot-nextcloud backportbot-nextcloud bot removed the backport-request A backport was requested for this pull request label Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish enhancement New feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add output flag to the CLI for listing of available data types
2 participants