@gpt-core/admin 0.8.11 → 0.8.20

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 CHANGED
@@ -8,6 +8,48 @@ The official TypeScript Admin SDK for the GPT Core Platform - platform administr
8
8
 
9
9
  ⚠️ **This SDK requires admin privileges and should only be used in secure server environments.**
10
10
 
11
+ ---
12
+
13
+ <!-- AI_CONTEXT_START
14
+ This SDK provides TypeScript bindings for GPT Core ADMIN operations.
15
+ Use this for: webhooks, storage admin, account credits, bulk operations, API key management.
16
+ NOT for: user-facing operations (use @gpt-core/client instead).
17
+ SECURITY: Server-side only. Never expose admin tokens in client code.
18
+
19
+ Quick patterns:
20
+ - Initialize: new GptAdmin({ baseUrl, token, applicationId? })
21
+ - Webhooks: admin.webhooks.configs.list() / .create(name, url, events, appId)
22
+ - Storage: admin.storage.stats() / .buckets.list()
23
+ - Accounts: admin.accounts.credit(id, amount, description)
24
+ - Documents: admin.documents.bulkDelete(ids[])
25
+ - API Keys: admin.apiKeys.allocate(id, amount) / .revoke(id) / .rotate(id)
26
+
27
+ All methods return typed responses. Uses class-based API with namespaced methods.
28
+ AI_CONTEXT_END -->
29
+
30
+ ## For AI Coding Assistants
31
+
32
+ > **TL;DR for Claude, Cursor, Copilot, and other AI assistants:**
33
+ >
34
+ > ```typescript
35
+ > import { GptAdmin } from '@gpt-core/admin';
36
+ > const admin = new GptAdmin({ baseUrl: 'https://api.example.com', token: 'admin-jwt' });
37
+ > ```
38
+ >
39
+ > **Common operations:**
40
+ > | Task | Code |
41
+ > |------|------|
42
+ > | Storage stats | `await admin.storage.stats()` |
43
+ > | List webhooks | `await admin.webhooks.configs.list()` |
44
+ > | Create webhook | `await admin.webhooks.configs.create(name, url, events, appId)` |
45
+ > | Credit account | `await admin.accounts.credit(id, amount, 'reason')` |
46
+ > | Bulk delete docs | `await admin.documents.bulkDelete(ids)` |
47
+ > | Rotate API key | `await admin.apiKeys.rotate(keyId)` |
48
+ >
49
+ > **See [llms.txt](llms.txt) for complete AI-readable SDK reference.**
50
+
51
+ ---
52
+
11
53
  ## Features
12
54
 
13
55
  ✅ **Fully Typed** - Complete TypeScript support with auto-generated types from OpenAPI specs
@@ -231,8 +273,6 @@ Available webhook events:
231
273
  - `workspace.created`
232
274
  - `user.registered`
233
275
 
234
- [See full webhook documentation](docs/WEBHOOKS.md)
235
-
236
276
  ## Bulk Operations
237
277
 
238
278
  All bulk operations support:
@@ -299,58 +339,6 @@ import type {
299
339
  } from '@gpt-core/admin';
300
340
  ```
301
341
 
302
- ## Documentation
303
-
304
- ### For ISV Developers
305
-
306
- - **[ISV Integration Guide](docs/ISV_GUIDE.md)** - Complete production-ready integration guide
307
- - Environment setup and authentication
308
- - Common workflows (webhooks, storage, billing, bulk ops)
309
- - Production best practices and security
310
- - Monitoring, observability, error handling
311
- - Rate limiting and troubleshooting
312
-
313
- - **[AI-Assisted Integration](docs/AI_INTEGRATION_GUIDE.md)** - Quick-start for AI coding assistants
314
- - Copy-paste integration patterns
315
- - Ready-to-use code snippets for common use cases
316
- - AI prompt templates for Cursor/Copilot/Claude
317
-
318
- ### Topic Guides
319
-
320
- - **[Authentication](docs/AUTHENTICATION.md)** - Admin token management and security
321
- - JWT token authentication
322
- - Token refresh strategies
323
- - Secret management integration (AWS, Vault, GCP)
324
- - Multi-environment configuration
325
-
326
- - **[Error Handling](docs/ERROR_HANDLING.md)** - Comprehensive error handling strategies
327
- - Validation errors (Zod)
328
- - HTTP errors (401, 403, 404, 429, 500)
329
- - Retry strategies (exponential backoff, jitter)
330
- - Circuit breaker pattern
331
- - Graceful degradation
332
-
333
- - **[Bulk Operations](docs/BULK_OPERATIONS.md)** - Efficient batch processing guide
334
- - Document bulk delete and reprocess
335
- - Webhook bulk enable/disable
336
- - Batching strategies and performance optimization
337
- - Progress tracking and monitoring
338
- - Error handling for partial failures
339
-
340
- - **[Webhook Management](docs/WEBHOOKS.md)** - Webhook configuration and monitoring
341
- - Creating and configuring webhooks
342
- - Signature verification
343
- - Event handling
344
- - Monitoring deliveries
345
- - Troubleshooting
346
-
347
- ### For SDK Contributors
348
-
349
- - **[llms.txt](llms.txt)** - AI agent context for SDK maintenance
350
- - SDK architecture and patterns
351
- - Generated vs handwritten code
352
- - Development workflows
353
-
354
342
  ## Testing
355
343
 
356
344
  ```bash