Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/stream-multipart-uploads.md

This file was deleted.

30 changes: 0 additions & 30 deletions .changeset/upload-content-type.md

This file was deleted.

36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# @googleworkspace/cli

## 0.14.0

### Minor Changes

- dc561e0: Add `--upload-content-type` flag and smart MIME inference for multipart uploads

Previously, multipart uploads used the metadata `mimeType` field for both the Drive
metadata and the media part's `Content-Type` header. This made it impossible to upload
a file in one format (e.g. Markdown) and have Drive convert it to another (e.g. Google Docs),
because the media `Content-Type` and the target `mimeType` must differ for import conversions.

The new `--upload-content-type` flag allows setting the media `Content-Type` explicitly.
When omitted, the media type is now inferred from the file extension before falling back
to the metadata `mimeType`. This matches Google Drive's model where metadata `mimeType`
is the _target_ type (what the file should become) while the media `Content-Type` is the
_source_ type (what the bytes are).

This means import conversions now work automatically:

```bash
# Extension inference detects text/markdown → conversion just works
gws drive files create \
--json '{"name":"My Doc","mimeType":"application/vnd.google-apps.document"}' \
--upload notes.md

# Explicit flag still available as an override
gws drive files create \
--json '{"name":"My Doc","mimeType":"application/vnd.google-apps.document"}' \
--upload notes.md \
--upload-content-type text/markdown
```

### Patch Changes

- 945ac91: Stream multipart uploads to avoid OOM on large files. File content is now streamed in chunks via `ReaderStream` instead of being read entirely into memory, reducing memory usage from O(file_size) to O(64 KB).

## 0.13.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

[package]
name = "gws"
version = "0.13.3"
version = "0.14.0"
edition = "2021"
description = "Google Workspace CLI — dynamic command surface from Discovery Service"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@googleworkspace/cli",
"version": "0.13.3",
"version": "0.14.0",
"private": true,
"description": "Google Workspace CLI — dynamic command surface from Discovery Service",
"license": "Apache-2.0",
Expand Down
Loading