@simpleapps-com/augur-api 0.2.7 → 0.2.8
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/API-DISCOVERY.md +206 -83
- package/QUICKSTART.md +232 -135
- package/README.md +368 -97
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/services/commerce/client.d.ts +222 -18
- package/dist/cjs/services/commerce/client.d.ts.map +1 -1
- package/dist/cjs/services/commerce/client.js +156 -17
- package/dist/cjs/services/commerce/client.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/services/commerce/client.d.ts +222 -18
- package/dist/esm/services/commerce/client.d.ts.map +1 -1
- package/dist/esm/services/commerce/client.js +156 -17
- package/dist/esm/services/commerce/client.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/services/commerce/client.d.ts +222 -18
- package/dist/types/services/commerce/client.d.ts.map +1 -1
- package/package.json +1 -1
package/API-DISCOVERY.md
CHANGED
|
@@ -1,132 +1,255 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AI-Powered Discovery: Code That Almost Writes Itself
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Transform API exploration from documentation hunting into natural language conversation with intelligent business context understanding.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## The Discovery Revolution
|
|
6
|
+
|
|
7
|
+
Never memorize endpoints again. Ask for business functionality and let the platform's intelligence find everything you need:
|
|
6
8
|
|
|
7
9
|
```typescript
|
|
8
10
|
import { AugurAPI } from '@simpleapps-com/augur-api';
|
|
9
11
|
|
|
10
|
-
const api =
|
|
12
|
+
const api = AugurAPI.fromContext(context);
|
|
11
13
|
|
|
12
|
-
//
|
|
13
|
-
const
|
|
14
|
+
// Business intent discovery - no technical knowledge required
|
|
15
|
+
const customerOps = await api.findEndpoint('customer lifecycle management');
|
|
16
|
+
const inventoryFlow = await api.findEndpoint('supply chain optimization');
|
|
17
|
+
const ecommerceJourney = await api.findEndpoint('online shopping experience');
|
|
14
18
|
|
|
15
|
-
//
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const pricing = await api.findEndpoint('product pricing');
|
|
19
|
+
// Platform reveals complete business workflows
|
|
20
|
+
const services = await api.discover();
|
|
21
|
+
console.log(`🚀 ${services.length} intelligent business services available`);
|
|
19
22
|
```
|
|
20
23
|
|
|
21
|
-
##
|
|
24
|
+
## Semantic Intelligence Engine
|
|
22
25
|
|
|
23
|
-
###
|
|
24
|
-
|
|
26
|
+
### Business Context Understanding
|
|
27
|
+
|
|
28
|
+
The discovery system doesn't just match keywords - it understands business processes:
|
|
25
29
|
|
|
26
30
|
```typescript
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
// Ask about business outcomes, not technical endpoints
|
|
32
|
+
const results = await api.findEndpoint('customer satisfaction analytics');
|
|
33
|
+
// Intelligently maps to:
|
|
34
|
+
// - api.customers.customer.get (customer profiles)
|
|
35
|
+
// - api.orders.orders.lookup (purchase history)
|
|
36
|
+
// - api.p21Pim.items.suggestWebDescription (product experience)
|
|
37
|
+
|
|
38
|
+
const qualityControl = await api.findEndpoint('inventory quality assurance');
|
|
39
|
+
// Discovers:
|
|
40
|
+
// - api.vmi.inventory.checkAvailability (stock validation)
|
|
41
|
+
// - api.vmi.warehouses.list (distribution quality)
|
|
42
|
+
// - api.nexus.binTransfers.list (movement tracking)
|
|
31
43
|
```
|
|
32
44
|
|
|
33
|
-
###
|
|
34
|
-
|
|
45
|
+
### Cross-Service Workflow Intelligence
|
|
46
|
+
|
|
47
|
+
The platform maps relationships across all 13 microservices:
|
|
35
48
|
|
|
36
49
|
```typescript
|
|
37
|
-
//
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
// Working with users? Platform suggests customer operations
|
|
51
|
+
const userWorkflow = await api.findEndpoint('user account management');
|
|
52
|
+
// Reveals connected workflow:
|
|
53
|
+
// 1. Authentication: api.joomla.users.verifyPassword
|
|
54
|
+
// 2. Profile creation: api.customers.customer.create
|
|
55
|
+
// 3. Permission setup: api.joomla.userGroups.list
|
|
56
|
+
// 4. Order access: api.orders.salesRep.getOrders
|
|
57
|
+
|
|
58
|
+
// Inventory management reveals pricing connections
|
|
59
|
+
const inventoryOps = await api.findEndpoint('warehouse operations');
|
|
60
|
+
// Platform intelligence connects:
|
|
61
|
+
// 1. Stock levels: api.vmi.inventory.checkAvailability
|
|
62
|
+
// 2. Pricing context: api.pricing.getPrice
|
|
63
|
+
// 3. Product details: api.items.products.get
|
|
64
|
+
// 4. Replenishment: api.vmi.inventory.replenish
|
|
47
65
|
```
|
|
48
66
|
|
|
49
|
-
##
|
|
67
|
+
## Advanced Discovery Capabilities
|
|
50
68
|
|
|
51
|
-
|
|
52
|
-
|-------------|---------|
|
|
53
|
-
| `'user management'` | User CRUD, authentication, groups |
|
|
54
|
-
| `'inventory'` | Stock levels, warehouse operations |
|
|
55
|
-
| `'product search'` | OpenSearch, product catalogs |
|
|
56
|
-
| `'site settings'` | Configuration, notifications |
|
|
57
|
-
| `'pricing'` | Price engine, job pricing |
|
|
58
|
-
| `'orders'` | Order management, invoicing |
|
|
69
|
+
### Multi-Dimensional Search
|
|
59
70
|
|
|
60
|
-
|
|
71
|
+
The discovery engine uses sophisticated scoring across multiple dimensions:
|
|
61
72
|
|
|
62
73
|
```typescript
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
domain
|
|
66
|
-
readOnly
|
|
67
|
-
minScore
|
|
68
|
-
maxResults
|
|
69
|
-
|
|
74
|
+
// Natural language with business filters
|
|
75
|
+
const results = await api.findEndpoint('customer service optimization', {
|
|
76
|
+
domain: 'customer-management', // Business domain focus
|
|
77
|
+
readOnly: true, // Query operations only
|
|
78
|
+
minScore: 0.3, // High relevance threshold
|
|
79
|
+
maxResults: 8, // Focused result set
|
|
80
|
+
service: 'customers' // Optional service filter
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// Rich result context for each match
|
|
84
|
+
results.forEach(result => {
|
|
85
|
+
console.log(`🎯 ${result.endpoint.fullPath} (${result.score.toFixed(2)})`);
|
|
86
|
+
console.log(` Business value: ${result.endpoint.description}`);
|
|
87
|
+
console.log(` Match reason: ${result.matchReason}`);
|
|
88
|
+
console.log(` Related ops: ${result.endpoint.relatedEndpoints.slice(0,3).join(', ')}`);
|
|
89
|
+
console.log(` Workflow: ${result.endpoint.domain}`);
|
|
90
|
+
});
|
|
70
91
|
```
|
|
71
92
|
|
|
72
|
-
## Business
|
|
93
|
+
## Business Intelligence Queries
|
|
94
|
+
|
|
95
|
+
The platform understands complex business scenarios and suggests complete workflows:
|
|
73
96
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
97
|
+
| Business Intent | Platform Discovery | Workflow Intelligence |
|
|
98
|
+
|----------------|-------------------|---------------------|
|
|
99
|
+
| `'customer lifecycle management'` | User authentication, customer profiles, order history, payment setup | Cross-service customer journey mapping |
|
|
100
|
+
| `'supply chain optimization'` | Inventory levels, warehouse operations, distributor networks, pricing | End-to-end supply chain visibility |
|
|
101
|
+
| `'e-commerce automation'` | Product search, pricing, cart management, checkout, payments | Complete shopping experience workflow |
|
|
102
|
+
| `'content personalization'` | AI content generation, search optimization, user preferences | Intelligent content delivery |
|
|
103
|
+
| `'order fulfillment intelligence'` | Order processing, inventory allocation, payment processing, shipping | Automated fulfillment workflows |
|
|
104
|
+
| `'business analytics integration'` | Customer data, order patterns, inventory metrics, pricing trends | Cross-service business intelligence |
|
|
81
105
|
|
|
82
|
-
##
|
|
106
|
+
## Semantic Discovery Architecture
|
|
83
107
|
|
|
84
|
-
|
|
108
|
+
### Rich Metadata Integration
|
|
109
|
+
|
|
110
|
+
Every endpoint includes comprehensive semantic metadata for AI agents:
|
|
85
111
|
|
|
86
112
|
```typescript
|
|
87
113
|
/**
|
|
88
|
-
* @
|
|
89
|
-
* @
|
|
90
|
-
* @
|
|
114
|
+
* @fullPath api.vmi.inventory.checkAvailability
|
|
115
|
+
* @service vmi
|
|
116
|
+
* @domain inventory-management
|
|
117
|
+
* @searchTerms ["inventory", "stock levels", "availability", "warehouse"]
|
|
118
|
+
* @relatedEndpoints ["api.vmi.warehouses.list", "api.pricing.getPrice", "api.items.products.get"]
|
|
119
|
+
* @workflow ["inventory-optimization", "supply-chain-management"]
|
|
120
|
+
* @commonPatterns ["Check product availability", "Validate stock levels", "Inventory monitoring"]
|
|
121
|
+
* @businessRules ["Requires valid warehouse access", "Customer-specific inventory visibility"]
|
|
122
|
+
* @performance "Real-time inventory queries, supports bulk operations"
|
|
91
123
|
*/
|
|
92
124
|
```
|
|
93
125
|
|
|
94
|
-
|
|
95
|
-
1. Find `api.joomla.users.list()` through searchTerms
|
|
96
|
-
2. Suggest related operations from relatedEndpoints
|
|
97
|
-
3. Provide examples using commonPatterns
|
|
98
|
-
4. Show complete workflows across services
|
|
126
|
+
### AI Assistant Integration Excellence
|
|
99
127
|
|
|
100
|
-
|
|
128
|
+
When you ask an AI assistant for help, the platform provides complete context:
|
|
101
129
|
|
|
102
|
-
### User Management
|
|
103
130
|
```typescript
|
|
104
|
-
|
|
105
|
-
//
|
|
131
|
+
// AI Assistant: "Help me optimize inventory management"
|
|
132
|
+
// Platform provides:
|
|
133
|
+
const inventoryWorkflow = await api.findEndpoint('inventory optimization');
|
|
134
|
+
|
|
135
|
+
// AI receives complete workflow context:
|
|
136
|
+
// 1. Business intent: Supply chain optimization
|
|
137
|
+
// 2. Primary operations: Stock checking, replenishment, distribution
|
|
138
|
+
// 3. Related services: Pricing, product catalog, warehouse management
|
|
139
|
+
// 4. Workflow patterns: Check → Calculate → Order → Track
|
|
140
|
+
// 5. Performance considerations: Real-time vs batch operations
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Advanced Business Domain Intelligence
|
|
144
|
+
|
|
145
|
+
### Multi-Service Business Processes
|
|
106
146
|
|
|
107
|
-
|
|
108
|
-
|
|
147
|
+
The platform maps complete business processes across service boundaries:
|
|
148
|
+
|
|
149
|
+
```typescript
|
|
150
|
+
// E-commerce customer acquisition workflow
|
|
151
|
+
const customerAcquisition = await api.findEndpoint('new customer onboarding');
|
|
152
|
+
// Platform intelligence suggests:
|
|
153
|
+
// Phase 1: Account Creation
|
|
154
|
+
// - api.joomla.users.create (authentication)
|
|
155
|
+
// - api.customers.customer.create (profile)
|
|
156
|
+
// - api.joomla.userGroups.createMapping (permissions)
|
|
157
|
+
// Phase 2: Shopping Setup
|
|
158
|
+
// - api.commerce.cartHeaders.create (shopping cart)
|
|
159
|
+
// - api.payments.unified.transactionSetup (payment method)
|
|
160
|
+
// Phase 3: Product Discovery
|
|
161
|
+
// - api.opensearch.itemSearch.search (product exploration)
|
|
162
|
+
// - api.pricing.getPrice (personalized pricing)
|
|
163
|
+
|
|
164
|
+
// Supply chain workflow intelligence
|
|
165
|
+
const supplyChain = await api.findEndpoint('inventory replenishment automation');
|
|
166
|
+
// Cross-service workflow mapping:
|
|
167
|
+
// Monitor: api.vmi.inventory.checkAvailability
|
|
168
|
+
// Calculate: api.pricing.getPrice (reorder costs)
|
|
169
|
+
// Execute: api.vmi.inventory.replenish
|
|
170
|
+
// Track: api.nexus.binTransfers.list
|
|
171
|
+
// Verify: api.vmi.warehouses.list (distribution status)
|
|
109
172
|
```
|
|
110
173
|
|
|
111
|
-
###
|
|
174
|
+
### Intelligent Search Filtering
|
|
175
|
+
|
|
176
|
+
Advanced filtering that understands business context:
|
|
177
|
+
|
|
112
178
|
```typescript
|
|
113
|
-
|
|
114
|
-
|
|
179
|
+
// Domain-specific operations
|
|
180
|
+
const customerService = await api.findEndpoint('customer support operations', {
|
|
181
|
+
domain: 'customer-data', // Business domain focus
|
|
182
|
+
readOnly: true, // Query operations only
|
|
183
|
+
minScore: 0.4, // High relevance threshold
|
|
184
|
+
maxResults: 6 // Focused results
|
|
185
|
+
});
|
|
115
186
|
|
|
116
|
-
|
|
117
|
-
const
|
|
187
|
+
// Service-specific functionality
|
|
188
|
+
const inventoryMgmt = await api.findEndpoint('warehouse management', {
|
|
189
|
+
service: 'vmi', // VMI service only
|
|
190
|
+
domain: 'inventory-management', // Inventory domain
|
|
191
|
+
minScore: 0.2, // Include broader matches
|
|
192
|
+
maxResults: 12 // Comprehensive results
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
// Workflow-specific operations
|
|
196
|
+
const ecommerceOps = await api.findEndpoint('online shopping', {
|
|
197
|
+
domain: 'e-commerce', // E-commerce domain
|
|
198
|
+
readOnly: false, // Include all operations
|
|
199
|
+
minScore: 0.1, // Cast wide net
|
|
200
|
+
maxResults: 15 // Complete workflow
|
|
201
|
+
});
|
|
118
202
|
```
|
|
119
203
|
|
|
120
|
-
|
|
204
|
+
## Platform Discovery Mastery
|
|
205
|
+
|
|
206
|
+
### Complete Service Topology
|
|
207
|
+
|
|
121
208
|
```typescript
|
|
122
|
-
|
|
123
|
-
|
|
209
|
+
// Comprehensive platform exploration
|
|
210
|
+
const services = await api.discover();
|
|
211
|
+
|
|
212
|
+
// Platform intelligence reveals:
|
|
213
|
+
services.forEach(service => {
|
|
214
|
+
console.log(`🏢 Service: ${service.serviceName}`);
|
|
215
|
+
console.log(` Business domain: ${service.description}`);
|
|
216
|
+
console.log(` Operations available: ${service.endpointCount}`);
|
|
217
|
+
console.log(` Base architecture: ${service.baseUrl}`);
|
|
218
|
+
|
|
219
|
+
// Sample high-value operations
|
|
220
|
+
const topOps = service.endpoints
|
|
221
|
+
.filter(ep => ep.discoverable)
|
|
222
|
+
.slice(0, 3);
|
|
223
|
+
|
|
224
|
+
topOps.forEach(op => {
|
|
225
|
+
console.log(` 🎯 ${op.fullPath}: ${op.description}`);
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
```
|
|
124
229
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
230
|
+
### Business Workflow Discovery
|
|
231
|
+
|
|
232
|
+
```typescript
|
|
233
|
+
// Discover complete business workflows
|
|
234
|
+
const workflows = await Promise.all([
|
|
235
|
+
api.findEndpoint('customer lifecycle'),
|
|
236
|
+
api.findEndpoint('inventory optimization'),
|
|
237
|
+
api.findEndpoint('order fulfillment'),
|
|
238
|
+
api.findEndpoint('content management'),
|
|
239
|
+
api.findEndpoint('financial operations')
|
|
240
|
+
]);
|
|
241
|
+
|
|
242
|
+
// Platform reveals interconnected business processes
|
|
243
|
+
workflows.forEach((workflow, index) => {
|
|
244
|
+
const domains = ['Customer', 'Inventory', 'Orders', 'Content', 'Finance'];
|
|
245
|
+
console.log(`\n${domains[index]} Workflow (${workflow.length} operations):`);
|
|
246
|
+
|
|
247
|
+
workflow.forEach(result => {
|
|
248
|
+
console.log(` 📋 ${result.endpoint.fullPath}`);
|
|
249
|
+
console.log(` Business value: ${result.endpoint.description}`);
|
|
250
|
+
console.log(` Connects to: ${result.endpoint.relatedEndpoints.slice(0,2).join(', ')}`);
|
|
251
|
+
});
|
|
129
252
|
});
|
|
130
253
|
```
|
|
131
254
|
|
|
132
|
-
The discovery system
|
|
255
|
+
The discovery system transforms API exploration into business conversation. Describe your business intent, and the platform's intelligence reveals complete workflows across all 13 microservices. No documentation hunting, no endpoint memorization - just natural language business queries that unlock enterprise capability.
|