nemar-cli 0.3.7 → 0.3.8-dev.163
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.
- package/README.md +82 -0
- package/dist/index.js +384 -130
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -298,13 +298,36 @@ nemar dataset pr update <pr-id> # Push updates to PR
|
|
|
298
298
|
nemar dataset pr close <pr-id> # Close PR without merging
|
|
299
299
|
```
|
|
300
300
|
|
|
301
|
+
### Publication Workflow
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
# User: Request publication
|
|
305
|
+
nemar dataset publish request <dataset-id> # Submit publication request
|
|
306
|
+
nemar dataset publish status <dataset-id> # Check publication status
|
|
307
|
+
nemar dataset publish resend <dataset-id> # Resend admin notification
|
|
308
|
+
|
|
309
|
+
# Admin: Manage publication requests
|
|
310
|
+
nemar admin publish list # List all publication requests
|
|
311
|
+
nemar admin publish list --pending # List pending requests only
|
|
312
|
+
nemar admin publish approve <dataset-id> # Approve and publish dataset
|
|
313
|
+
nemar admin publish deny <dataset-id> # Deny publication request
|
|
314
|
+
```
|
|
315
|
+
|
|
301
316
|
### Admin Commands
|
|
302
317
|
|
|
303
318
|
```bash
|
|
319
|
+
# User management
|
|
304
320
|
nemar admin users # List all users
|
|
305
321
|
nemar admin users --pending # List pending approvals
|
|
306
322
|
nemar admin approve <username> # Approve user
|
|
307
323
|
nemar admin revoke <username> # Revoke user access
|
|
324
|
+
|
|
325
|
+
# Dataset publication
|
|
326
|
+
nemar admin publish list # List publication requests
|
|
327
|
+
nemar admin publish approve <dataset-id> # Approve and publish dataset
|
|
328
|
+
nemar admin publish deny <dataset-id> # Deny publication request
|
|
329
|
+
|
|
330
|
+
# DOI management
|
|
308
331
|
nemar admin doi create <dataset-id> # Create concept DOI
|
|
309
332
|
```
|
|
310
333
|
|
|
@@ -349,14 +372,73 @@ graph TB
|
|
|
349
372
|
REL -->|Archive| DOI
|
|
350
373
|
```
|
|
351
374
|
|
|
375
|
+
## Testing
|
|
376
|
+
|
|
377
|
+
### Running Tests
|
|
378
|
+
|
|
379
|
+
```bash
|
|
380
|
+
# All tests
|
|
381
|
+
bun test
|
|
382
|
+
|
|
383
|
+
# Specific test file
|
|
384
|
+
bun test test/cli.test.ts
|
|
385
|
+
bun test test/api.test.ts
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
### Zenodo Sandbox Tests
|
|
389
|
+
|
|
390
|
+
DOI workflows can be tested using Zenodo's sandbox environment without affecting production:
|
|
391
|
+
|
|
392
|
+
```bash
|
|
393
|
+
# Run Zenodo sandbox tests (requires configuration)
|
|
394
|
+
RUN_ZENODO_TESTS=true TEST_DATASET_ID=nm099999 bun test test/zenodo-sandbox.test.ts
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
**Setup requirements:**
|
|
398
|
+
1. Create account on [sandbox.zenodo.org](https://sandbox.zenodo.org)
|
|
399
|
+
2. Generate API token with `deposit:write` scope
|
|
400
|
+
3. Add to `test/.env.test`:
|
|
401
|
+
```bash
|
|
402
|
+
ZENODO_SANDBOX_API_KEY=your_sandbox_token
|
|
403
|
+
RUN_ZENODO_TESTS=true
|
|
404
|
+
TEST_DATASET_ID=nm099999
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
**Test coverage:**
|
|
408
|
+
- Concept DOI creation and retrieval
|
|
409
|
+
- Version DOI publishing workflows
|
|
410
|
+
- Metadata updates (title, keywords, related identifiers)
|
|
411
|
+
- Error handling (401, 404, 400 responses)
|
|
412
|
+
- Rate limiting and request throttling
|
|
413
|
+
- Deposition lifecycle (create → upload → publish)
|
|
414
|
+
- File uploads with checksum verification
|
|
415
|
+
|
|
416
|
+
See [docs/development/zenodo-testing.md](docs/development/zenodo-testing.md) for comprehensive guide.
|
|
417
|
+
|
|
352
418
|
## Environment Variables
|
|
353
419
|
|
|
420
|
+
### CLI Usage
|
|
421
|
+
|
|
354
422
|
```bash
|
|
355
423
|
NEMAR_API_KEY # API key (alternative to login)
|
|
356
424
|
NEMAR_API_URL # Custom API endpoint (default: https://api.nemar.org)
|
|
357
425
|
NEMAR_NO_COLOR # Disable colored output
|
|
358
426
|
```
|
|
359
427
|
|
|
428
|
+
### Testing
|
|
429
|
+
|
|
430
|
+
```bash
|
|
431
|
+
# Required for Zenodo sandbox tests
|
|
432
|
+
ZENODO_SANDBOX_API_KEY # Sandbox Zenodo API token
|
|
433
|
+
RUN_ZENODO_TESTS # Enable Zenodo tests (set to "true")
|
|
434
|
+
TEST_DATASET_ID # Test dataset ID (default: nm099999)
|
|
435
|
+
|
|
436
|
+
# API testing
|
|
437
|
+
TEST_API_URL # Test API endpoint (dev environment)
|
|
438
|
+
TEST_ADMIN_API_KEY # Admin API key for tests
|
|
439
|
+
TEST_USER_API_KEY # User API key for tests
|
|
440
|
+
```
|
|
441
|
+
|
|
360
442
|
## Troubleshooting
|
|
361
443
|
|
|
362
444
|
### Upload Issues
|