sharepoint-cli-rs 0.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. sharepoint_cli_rs-0.0.4/.github/workflows/ci.yml +50 -0
  2. sharepoint_cli_rs-0.0.4/.github/workflows/release.yml +173 -0
  3. sharepoint_cli_rs-0.0.4/.gitignore +8 -0
  4. sharepoint_cli_rs-0.0.4/CHANGELOG.md +62 -0
  5. sharepoint_cli_rs-0.0.4/Cargo.lock +2344 -0
  6. sharepoint_cli_rs-0.0.4/Cargo.toml +38 -0
  7. sharepoint_cli_rs-0.0.4/Makefile +45 -0
  8. sharepoint_cli_rs-0.0.4/PKG-INFO +93 -0
  9. sharepoint_cli_rs-0.0.4/README.md +71 -0
  10. sharepoint_cli_rs-0.0.4/docs/superpowers/plans/2026-04-30-sharepoint-cli-foundation-and-reads.md +5303 -0
  11. sharepoint_cli_rs-0.0.4/docs/superpowers/specs/2026-04-30-sharepoint-cli-design.html +398 -0
  12. sharepoint_cli_rs-0.0.4/docs/superpowers/specs/2026-04-30-sharepoint-cli-design.md +381 -0
  13. sharepoint_cli_rs-0.0.4/prek.toml +36 -0
  14. sharepoint_cli_rs-0.0.4/pyproject.toml +36 -0
  15. sharepoint_cli_rs-0.0.4/sharepoint_cli/__init__.py +8 -0
  16. sharepoint_cli_rs-0.0.4/sharepoint_cli/__main__.py +50 -0
  17. sharepoint_cli_rs-0.0.4/sharepoint_cli/py.typed +0 -0
  18. sharepoint_cli_rs-0.0.4/src/auth/device_code.rs +333 -0
  19. sharepoint_cli_rs-0.0.4/src/auth/mod.rs +218 -0
  20. sharepoint_cli_rs-0.0.4/src/auth/token_cache.rs +206 -0
  21. sharepoint_cli_rs-0.0.4/src/cli.rs +201 -0
  22. sharepoint_cli_rs-0.0.4/src/commands/auth.rs +151 -0
  23. sharepoint_cli_rs-0.0.4/src/commands/config.rs +34 -0
  24. sharepoint_cli_rs-0.0.4/src/commands/drives.rs +79 -0
  25. sharepoint_cli_rs-0.0.4/src/commands/files.rs +340 -0
  26. sharepoint_cli_rs-0.0.4/src/commands/init.rs +78 -0
  27. sharepoint_cli_rs-0.0.4/src/commands/mod.rs +11 -0
  28. sharepoint_cli_rs-0.0.4/src/commands/sites.rs +103 -0
  29. sharepoint_cli_rs-0.0.4/src/config.rs +268 -0
  30. sharepoint_cli_rs-0.0.4/src/error.rs +141 -0
  31. sharepoint_cli_rs-0.0.4/src/graph/download.rs +43 -0
  32. sharepoint_cli_rs-0.0.4/src/graph/drives.rs +396 -0
  33. sharepoint_cli_rs-0.0.4/src/graph/mod.rs +216 -0
  34. sharepoint_cli_rs-0.0.4/src/graph/search.rs +107 -0
  35. sharepoint_cli_rs-0.0.4/src/graph/sites.rs +189 -0
  36. sharepoint_cli_rs-0.0.4/src/lib.rs +10 -0
  37. sharepoint_cli_rs-0.0.4/src/main.rs +17 -0
  38. sharepoint_cli_rs-0.0.4/src/output.rs +134 -0
  39. sharepoint_cli_rs-0.0.4/src/reference.rs +336 -0
  40. sharepoint_cli_rs-0.0.4/tests/auth_refresh.rs +68 -0
  41. sharepoint_cli_rs-0.0.4/tests/cmd_auth_logout.rs +99 -0
  42. sharepoint_cli_rs-0.0.4/tests/cmd_auth_status.rs +40 -0
  43. sharepoint_cli_rs-0.0.4/tests/cmd_config.rs +45 -0
  44. sharepoint_cli_rs-0.0.4/tests/cmd_drives_list.rs +137 -0
  45. sharepoint_cli_rs-0.0.4/tests/cmd_files_find.rs +163 -0
  46. sharepoint_cli_rs-0.0.4/tests/cmd_files_ls.rs +101 -0
  47. sharepoint_cli_rs-0.0.4/tests/cmd_files_stat_download.rs +121 -0
  48. sharepoint_cli_rs-0.0.4/tests/cmd_init_quiet.rs +17 -0
  49. sharepoint_cli_rs-0.0.4/tests/cmd_sites_list.rs +65 -0
  50. sharepoint_cli_rs-0.0.4/tests/cmd_sites_use.rs +68 -0
  51. sharepoint_cli_rs-0.0.4/tests/device_code_polling.rs +132 -0
  52. sharepoint_cli_rs-0.0.4/tests/graph_download.rs +39 -0
  53. sharepoint_cli_rs-0.0.4/tests/graph_retry.rs +57 -0
@@ -0,0 +1,50 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ jobs:
14
+ lint:
15
+ name: Lint
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: dtolnay/rust-toolchain@stable
20
+ with:
21
+ components: rustfmt, clippy
22
+ - run: make fmt-check
23
+ - run: make lint
24
+
25
+ test:
26
+ name: Test
27
+ strategy:
28
+ matrix:
29
+ os: [ubuntu-latest, macos-latest]
30
+ runs-on: ${{ matrix.os }}
31
+ steps:
32
+ - uses: actions/checkout@v4
33
+ - uses: dtolnay/rust-toolchain@stable
34
+ - uses: taiki-e/install-action@v2
35
+ with:
36
+ tool: nextest
37
+ - run: make test
38
+
39
+ all-checks-passed:
40
+ name: All checks passed
41
+ runs-on: ubuntu-latest
42
+ needs: [lint, test]
43
+ if: always()
44
+ steps:
45
+ - run: |
46
+ if [ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]; then
47
+ echo "Some checks failed or were cancelled"
48
+ exit 1
49
+ fi
50
+ echo "All checks passed"
@@ -0,0 +1,173 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ jobs:
9
+ check:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: dtolnay/rust-toolchain@stable
14
+ with:
15
+ components: rustfmt, clippy
16
+ - uses: Swatinem/rust-cache@v2
17
+ - uses: taiki-e/install-action@nextest
18
+ - run: make fmt-check
19
+ - run: make lint
20
+ - run: make test
21
+
22
+ build:
23
+ needs: check
24
+ if: github.event_name != 'pull_request'
25
+ strategy:
26
+ matrix:
27
+ include:
28
+ - target: x86_64-unknown-linux-gnu
29
+ os: ubuntu-latest
30
+ maturin_args: --compatibility manylinux_2_28 --zig
31
+ - target: aarch64-unknown-linux-gnu
32
+ os: ubuntu-latest
33
+ maturin_args: --compatibility manylinux_2_28 --zig
34
+ - target: x86_64-apple-darwin
35
+ os: macos-latest
36
+ maturin_args: ""
37
+ - target: aarch64-apple-darwin
38
+ os: macos-latest
39
+ maturin_args: ""
40
+ - target: x86_64-pc-windows-msvc
41
+ os: windows-latest
42
+ maturin_args: ""
43
+ runs-on: ${{ matrix.os }}
44
+ permissions:
45
+ contents: write
46
+ steps:
47
+ - uses: actions/checkout@v4
48
+
49
+ - uses: dtolnay/rust-toolchain@stable
50
+ with:
51
+ targets: ${{ matrix.target }}
52
+
53
+ - uses: astral-sh/setup-uv@v6
54
+
55
+ - name: Install maturin and zig
56
+ shell: bash
57
+ run: |
58
+ uv venv "${RUNNER_TEMP}/build-venv"
59
+ if [[ "$RUNNER_OS" == "Windows" ]]; then
60
+ VENV_BIN="${RUNNER_TEMP}/build-venv/Scripts"
61
+ PYTHON="${VENV_BIN}/python.exe"
62
+ else
63
+ VENV_BIN="${RUNNER_TEMP}/build-venv/bin"
64
+ PYTHON="${VENV_BIN}/python"
65
+ fi
66
+ uv pip install --python "$PYTHON" maturin ziglang
67
+ echo "$VENV_BIN" >> "$GITHUB_PATH"
68
+
69
+ - name: Build wheel and binary
70
+ run: maturin build --release --target ${{ matrix.target }} ${{ matrix.maturin_args }}
71
+ shell: bash
72
+
73
+ - name: Package binary (unix)
74
+ if: matrix.os != 'windows-latest'
75
+ run: |
76
+ cd target/${{ matrix.target }}/release
77
+ tar czf ../../../sharepoint-${{ github.ref_name }}-${{ matrix.target }}.tar.gz sharepoint
78
+ shell: bash
79
+
80
+ - name: Package binary (windows)
81
+ if: matrix.os == 'windows-latest'
82
+ run: |
83
+ cd target/${{ matrix.target }}/release
84
+ 7z a ../../../sharepoint-${{ github.ref_name }}-${{ matrix.target }}.zip sharepoint.exe
85
+ shell: bash
86
+
87
+ - name: Compute SHA256 (unix)
88
+ if: matrix.os != 'windows-latest'
89
+ run: |
90
+ if [[ "${{ runner.os }}" == "macOS" ]]; then
91
+ shasum -a 256 sharepoint-${{ github.ref_name }}-${{ matrix.target }}.tar.gz > sharepoint-${{ github.ref_name }}-${{ matrix.target }}.tar.gz.sha256
92
+ else
93
+ sha256sum sharepoint-${{ github.ref_name }}-${{ matrix.target }}.tar.gz > sharepoint-${{ github.ref_name }}-${{ matrix.target }}.tar.gz.sha256
94
+ fi
95
+ shell: bash
96
+
97
+ - name: Upload binary artifact
98
+ uses: actions/upload-artifact@v4
99
+ with:
100
+ name: binary-${{ matrix.target }}
101
+ path: sharepoint-${{ github.ref_name }}-${{ matrix.target }}.*
102
+
103
+ - name: Upload wheel artifact
104
+ uses: actions/upload-artifact@v4
105
+ with:
106
+ name: wheel-${{ matrix.target }}
107
+ path: target/wheels/*.whl
108
+
109
+ sdist:
110
+ needs: check
111
+ runs-on: ubuntu-latest
112
+ steps:
113
+ - uses: actions/checkout@v4
114
+ - uses: astral-sh/setup-uv@v6
115
+ - name: Install maturin
116
+ shell: bash
117
+ run: |
118
+ uv venv "${RUNNER_TEMP}/build-venv"
119
+ uv pip install --python "${RUNNER_TEMP}/build-venv/bin/python" maturin
120
+ echo "${RUNNER_TEMP}/build-venv/bin" >> "$GITHUB_PATH"
121
+ - run: maturin sdist
122
+ - uses: actions/upload-artifact@v4
123
+ with:
124
+ name: sdist
125
+ path: target/wheels/*.tar.gz
126
+
127
+ release:
128
+ needs: build
129
+ runs-on: ubuntu-latest
130
+ permissions:
131
+ contents: write
132
+ steps:
133
+ - uses: actions/download-artifact@v4
134
+ with:
135
+ pattern: binary-*
136
+ merge-multiple: true
137
+
138
+ - name: Create GitHub Release
139
+ uses: softprops/action-gh-release@v2
140
+ with:
141
+ generate_release_notes: true
142
+ files: |
143
+ sharepoint-*.tar.gz
144
+ sharepoint-*.tar.gz.sha256
145
+ sharepoint-*.zip
146
+
147
+ publish-crates:
148
+ needs: release
149
+ runs-on: ubuntu-latest
150
+ steps:
151
+ - uses: actions/checkout@v4
152
+ - uses: dtolnay/rust-toolchain@stable
153
+ - run: cargo publish --locked
154
+ env:
155
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
156
+
157
+ publish-pypi:
158
+ needs: [build, sdist]
159
+ runs-on: ubuntu-latest
160
+ steps:
161
+ - uses: actions/download-artifact@v4
162
+ with:
163
+ pattern: wheel-*
164
+ path: artifacts/wheels
165
+ - uses: actions/download-artifact@v4
166
+ with:
167
+ name: sdist
168
+ path: artifacts/sdist
169
+ - uses: astral-sh/setup-uv@v6
170
+ - name: Publish to PyPI
171
+ env:
172
+ UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
173
+ run: uv publish artifacts/wheels/wheel-*/*.whl artifacts/sdist/*.tar.gz
@@ -0,0 +1,8 @@
1
+ /target
2
+ .DS_Store
3
+ *.swp
4
+ .idea/
5
+ .vscode/
6
+ __pycache__/
7
+ *.pyc
8
+ /dist/
@@ -0,0 +1,62 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/).
6
+
7
+
8
+
9
+
10
+ ## [0.0.4](https://github.com/rvben/sharepoint-cli/compare/v0.0.3...v0.0.4) - 2026-05-04
11
+
12
+ ### Fixed
13
+
14
+ - **release**: rename PyPI distribution to sharepoint-cli-rs ([b1c17c4](https://github.com/rvben/sharepoint-cli/commit/b1c17c4f719d4c33770aab3c07c7eeab61d39380))
15
+
16
+ ## [0.0.3](https://github.com/rvben/sharepoint-cli/compare/v0.0.2...v0.0.3) - 2026-05-04
17
+
18
+ ### Fixed
19
+
20
+ - **release**: use uv publish instead of twine for PyPI ([b679f57](https://github.com/rvben/sharepoint-cli/commit/b679f57d44ce793ef766f7e8b9472a055225682a))
21
+
22
+ ## [0.0.2](https://github.com/rvben/sharepoint-cli/compare/v0.0.1...v0.0.2) - 2026-05-04
23
+
24
+ ### Added
25
+
26
+ - **release**: add maturin/PyPI scaffolding and release workflow ([020f4fa](https://github.com/rvben/sharepoint-cli/commit/020f4fa1861056ad76b7a118610b7ca4fde71eec))
27
+
28
+ ## [0.0.1] - 2026-05-04
29
+
30
+ ### Added
31
+
32
+ - **drives**: accept spo:// URI form in drives list site argument ([20fcf2d](https://github.com/rvben/sharepoint-cli/commit/20fcf2d80060e9f6aab2ecd0cdb7f110bded53a1))
33
+ - implement config show/path with masked secrets ([fe60fe1](https://github.com/rvben/sharepoint-cli/commit/fe60fe1a8815389db0649538e91cf4c307039a34))
34
+ - implement init with interactive setup and device-code login ([209648d](https://github.com/rvben/sharepoint-cli/commit/209648d20096fb034b6870f6c43f995eac19247e))
35
+ - **files**: implement ls/stat/download/find ([fb5bd4a](https://github.com/rvben/sharepoint-cli/commit/fb5bd4ab61b7f0ae7b6d7c988060e44339e9ddad))
36
+ - **drives**: list libraries on a site ([9121d98](https://github.com/rvben/sharepoint-cli/commit/9121d98824f4d1e942cd3f57e16bd18e715a636f))
37
+ - **sites**: reject sites use in read-only mode ([899013c](https://github.com/rvben/sharepoint-cli/commit/899013cbeb712e9bfc75555c51e2dc4e38e1dc80))
38
+ - **sites**: implement list (followed/search) and use ([3283798](https://github.com/rvben/sharepoint-cli/commit/32837985772279ffcfe86eb421f22117fd7d438e))
39
+ - **auth**: implement login, logout, status commands ([ebf3e15](https://github.com/rvben/sharepoint-cli/commit/ebf3e154caa361c169ff1e002c5a6f5376bdd385))
40
+ - **cli**: add scaffold with clap derive subcommands and dispatcher ([1ef986c](https://github.com/rvben/sharepoint-cli/commit/1ef986cff880c8a6c60ad405e7a8e806423d33d4))
41
+ - **graph**: add drive-scoped search with shell-glob matcher ([93518a0](https://github.com/rvben/sharepoint-cli/commit/93518a0f7fb3e9fbc6afb1db54fbca59c09ac252))
42
+ - **graph**: add streaming download ([fa1c245](https://github.com/rvben/sharepoint-cli/commit/fa1c245348a5ba180fb2d5ff9141099e898e7a3a))
43
+ - **graph**: add drive lookup, item listing, and canonical-shape mapper ([0fd78fa](https://github.com/rvben/sharepoint-cli/commit/0fd78fac8bbc668adfde241d9b3a58553d3892ef))
44
+ - **graph**: add site discovery with alias map and pagination ([87524ac](https://github.com/rvben/sharepoint-cli/commit/87524ac05ac357d61cdd66970724f13d6c7840e9))
45
+ - **graph**: add GraphClient with retry/backoff and paging ([264cf7f](https://github.com/rvben/sharepoint-cli/commit/264cf7f0298613959482127ba400f1cfa27f5106))
46
+ - **auth**: add AuthContext with auto-refresh and 60s margin ([c5aa3f7](https://github.com/rvben/sharepoint-cli/commit/c5aa3f7b99fe30d19bada6a9905eb32a7b23bfe9))
47
+ - **auth**: add device-code flow with polling state machine ([ce0fec5](https://github.com/rvben/sharepoint-cli/commit/ce0fec5b5d585d5c9017ffd1ef5b9f8b7c43cbf7))
48
+ - add token cache with atomic 0600 writes ([3253223](https://github.com/rvben/sharepoint-cli/commit/32532235b2b603adb2e3f07a25eb34bce0f4e8b8))
49
+ - add reference parser supporting all 5 input forms ([e339721](https://github.com/rvben/sharepoint-cli/commit/e339721b2981bf78074a459b7c688b39b2aabbad))
50
+ - add config module with profiles, env overrides, and resolution order ([5a57136](https://github.com/rvben/sharepoint-cli/commit/5a57136abfdcb6e2118c4e686f149e46993049e3))
51
+ - add OutputConfig with JSON-error-on-stdout contract ([d17bb32](https://github.com/rvben/sharepoint-cli/commit/d17bb32845ea6812e7904d1dc9f2eddac045c146))
52
+ - add CliError with structured exit codes ([f3e96d2](https://github.com/rvben/sharepoint-cli/commit/f3e96d244db9e4cf4c06cb932de7f9942fc448f9))
53
+
54
+ ### Fixed
55
+
56
+ - **files**: paginate find to match plan spec ([78ddba2](https://github.com/rvben/sharepoint-cli/commit/78ddba28ca2abee25a4273ff7d3f6fcd372fdfe3))
57
+ - **files**: align ls/download/find with plan spec ([80e6408](https://github.com/rvben/sharepoint-cli/commit/80e6408b32f77ddba6ae1a0e9b8bdf54c7d45b52))
58
+ - **tests**: write auth-status fixture cache to binary's actual path ([1bf6f18](https://github.com/rvben/sharepoint-cli/commit/1bf6f1885b56c22de2de00d7bbe7b0002c689c3e))
59
+ - **graph**: percent-encode drive paths and drop unwrap in canonical mapper ([f09d593](https://github.com/rvben/sharepoint-cli/commit/f09d593ade6b57b69ea7629a227006b0ae339396))
60
+ - **graph**: derive list source from decoded page token path ([bbb5838](https://github.com/rvben/sharepoint-cli/commit/bbb5838b8259f66dc75bdfae5e7ff29cfbb1b273))
61
+ - **graph**: cap Retry-After at 60s and drop dead pow guard ([10c509a](https://github.com/rvben/sharepoint-cli/commit/10c509a81b14a37c9a5c9cebaea5b7fe9a0df24a))
62
+ - **auth**: make refresh_token and Account.name Option<String> ([1c4cabe](https://github.com/rvben/sharepoint-cli/commit/1c4cabe48d746779f7e76cb00f89da7587bbc71a))