From 6ebf937f74dacce4318788c23ffeea7e40fffe3b Mon Sep 17 00:00:00 2001 From: Artur Jankowski Date: Fri, 17 Apr 2026 15:19:43 +0200 Subject: [PATCH] feat: Add support for `Box Hub Collaborations` endpoints --- docs/hubs.md | 303 ++++++++++++++++++ src/commands/hubs/collaborations/create.js | 95 ++++++ src/commands/hubs/collaborations/delete.js | 35 ++ src/commands/hubs/collaborations/get.js | 36 +++ src/commands/hubs/collaborations/index.js | 47 +++ src/commands/hubs/collaborations/update.js | 49 +++ test/commands/hubs.test.js | 200 ++++++++++++ .../fixtures/hubs/get_hub_collaborations.json | 21 ++ .../hubs/get_hub_collaborations_id.json | 16 + .../hubs/post_hub_collaborations.json | 16 + .../hubs/put_hub_collaborations_id.json | 16 + 11 files changed, 834 insertions(+) create mode 100644 src/commands/hubs/collaborations/create.js create mode 100644 src/commands/hubs/collaborations/delete.js create mode 100644 src/commands/hubs/collaborations/get.js create mode 100644 src/commands/hubs/collaborations/index.js create mode 100644 src/commands/hubs/collaborations/update.js create mode 100644 test/fixtures/hubs/get_hub_collaborations.json create mode 100644 test/fixtures/hubs/get_hub_collaborations_id.json create mode 100644 test/fixtures/hubs/post_hub_collaborations.json create mode 100644 test/fixtures/hubs/put_hub_collaborations_id.json diff --git a/docs/hubs.md b/docs/hubs.md index 08ebb75e..19752626 100644 --- a/docs/hubs.md +++ b/docs/hubs.md @@ -4,6 +4,13 @@ List Box Hubs for the current user * [`box hubs`](#box-hubs) +* [`box hubs:collaborations ID`](#box-hubscollaborations-id) +* [`box hubs:collaborations:add ID`](#box-hubscollaborationsadd-id) +* [`box hubs:collaborations:create ID`](#box-hubscollaborationscreate-id) +* [`box hubs:collaborations:delete ID`](#box-hubscollaborationsdelete-id) +* [`box hubs:collaborations:get ID`](#box-hubscollaborationsget-id) +* [`box hubs:collaborations:list ID`](#box-hubscollaborationslist-id) +* [`box hubs:collaborations:update ID`](#box-hubscollaborationsupdate-id) * [`box hubs:copy ID`](#box-hubscopy-id) * [`box hubs:create TITLE`](#box-hubscreate-title) * [`box hubs:delete ID`](#box-hubsdelete-id) @@ -71,6 +78,302 @@ EXAMPLES _See code: [src/commands/hubs/index.js](https://github.com/box/boxcli/blob/v4.7.0/src/commands/hubs/index.js)_ +## `box hubs:collaborations ID` + +List collaborations for a Box Hub + +``` +USAGE + $ box hubs:collaborations ID [-t ] [--as-user ] [--no-color] [--json | --csv] [-s | --save-to-file-path + ] [--fields ] [--bulk-file-path ] [-h] [-v] [-y] [-q] [--max-items ] + +ARGUMENTS + ID ID of the Box Hub + +FLAGS + -h, --help Show CLI help + -q, --quiet Suppress any non-error output to stderr + -s, --save Save report to default reports folder on disk + -t, --token= Provide a token to perform this call + -v, --verbose Show verbose output, which can be helpful for debugging + -y, --yes Automatically respond yes to all confirmation prompts + --as-user= Provide an ID for a user + --bulk-file-path= File path to bulk .csv or .json objects + --csv Output formatted CSV + --fields= Comma separated list of fields to show + --json Output formatted JSON + --max-items= A value that indicates the maximum number of results to return. This only specifies a + maximum boundary and will not guarantee the minimum number of results returned. When + the max-items (x) is greater than 1000, then the maximum ceil(x/1000) requests will + be made. + --no-color Turn off colors for logging + --save-to-file-path= Override default file path to save report + +DESCRIPTION + List collaborations for a Box Hub + +ALIASES + $ box hubs:collaborations:list + +EXAMPLES + $ box hubs:collaborations 12345 + + $ box hubs:collaborations 12345 --max-items 50 +``` + +_See code: [src/commands/hubs/collaborations/index.js](https://github.com/box/boxcli/blob/v4.7.0/src/commands/hubs/collaborations/index.js)_ + +## `box hubs:collaborations:add ID` + +Adds a collaboration with a specific role for a single user or a single group to a Box Hub. Collaborations can be created using email address, user IDs, or group IDs + +``` +USAGE + $ box hubs:collaborations:add ID -r editor|viewer|co-owner [-t ] [--as-user ] [--no-color] [--json | --csv] + [-s | --save-to-file-path ] [--fields ] [--bulk-file-path ] [-h] [-v] [-y] [-q] [--user-id + | --group-id | --login ] + +ARGUMENTS + ID ID of the Box Hub + +FLAGS + -h, --help Show CLI help + -q, --quiet Suppress any non-error output to stderr + -r, --role=