jupyterlab_notifications_extension 1.1.21 → 1.1.22

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 (2) hide show
  1. package/README.md +25 -22
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -128,44 +128,47 @@ await app.commands.execute('jupyterlab-notifications:send', {
128
128
  });
129
129
  ```
130
130
 
131
- ### Python Script
131
+ ### CLI Tool
132
132
 
133
- The included script auto-detects tokens from `JUPYTERHUB_API_TOKEN`, `JPY_API_TOKEN`, or `JUPYTER_TOKEN` environment variables:
133
+ The `jupyter-notify` command is installed with the extension:
134
134
 
135
135
  ```bash
136
- # Basic notification
137
- ./scripts/send_notification.py --message "Deployment complete" --type success
136
+ # Basic notification (localhost, no auth needed)
137
+ jupyter-notify -m "Deployment complete" -t success
138
138
 
139
139
  # Persistent warning (no auto-close)
140
- ./scripts/send_notification.py --message "System maintenance in 1 hour" --type warning --no-auto-close
140
+ jupyter-notify -m "System maintenance in 1 hour" -t warning --no-auto-close
141
141
 
142
- # Silent mode (notification center only)
143
- ./scripts/send_notification.py --message "Background task finished" --auto-close 0
142
+ # JupyterHub with base path
143
+ jupyter-notify --url "http://127.0.0.1:8888/jupyterhub/user/alice" -m "Hello"
144
+
145
+ # Silent mode (notification center only, no toast)
146
+ jupyter-notify -m "Background task finished" --auto-close 0
147
+
148
+ # With dismiss button
149
+ jupyter-notify -m "Action required" -t warning --no-auto-close --action "Dismiss"
144
150
  ```
145
151
 
152
+ Auto-detects tokens from `JUPYTERHUB_API_TOKEN`, `JPY_API_TOKEN`, or `JUPYTER_TOKEN` for remote servers.
153
+
146
154
  ### cURL
147
155
 
148
156
  ```bash
149
- # Basic info notification
157
+ # Localhost - no authentication required
150
158
  curl -X POST http://localhost:8888/jupyterlab-notifications-extension/ingest \
151
159
  -H "Content-Type: application/json" \
152
- -H "Authorization: token YOUR_TOKEN" \
153
- -d '{"message": "Build completed", "type": "info"}'
160
+ -d '{"message": "Build completed", "type": "success"}'
154
161
 
155
- # Error notification with action button
162
+ # Localhost - warning that stays until dismissed
156
163
  curl -X POST http://localhost:8888/jupyterlab-notifications-extension/ingest \
157
164
  -H "Content-Type: application/json" \
158
- -H "Authorization: token YOUR_TOKEN" \
159
- -d '{
160
- "message": "Build failed on main branch",
161
- "type": "error",
162
- "autoClose": false,
163
- "actions": [{
164
- "label": "View Logs",
165
- "caption": "Open build logs",
166
- "displayType": "accent"
167
- }]
168
- }'
165
+ -d '{"message": "System maintenance in 1 hour", "type": "warning", "autoClose": false}'
166
+
167
+ # Remote - requires authentication token
168
+ curl -X POST http://jupyterhub.example.com/user/alice/jupyterlab-notifications-extension/ingest \
169
+ -H "Content-Type: application/json" \
170
+ -H "Authorization: token YOUR_JUPYTER_TOKEN" \
171
+ -d '{"message": "Deployment complete", "type": "info"}'
169
172
  ```
170
173
 
171
174
  ## Architecture
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jupyterlab_notifications_extension",
3
- "version": "1.1.21",
3
+ "version": "1.1.22",
4
4
  "description": "Jupyterlab extension to receive and display notifications in the main panel. Those can be from the jupyterjub administrator or from other places.",
5
5
  "keywords": [
6
6
  "jupyter",