@simpleapps-com/augur-api 0.2.7 → 0.2.9

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 (104) hide show
  1. package/API-DISCOVERY.md +206 -83
  2. package/QUICKSTART.md +232 -135
  3. package/README.md +368 -97
  4. package/dist/cjs/index.d.ts +3 -1
  5. package/dist/cjs/index.d.ts.map +1 -1
  6. package/dist/cjs/index.js +4 -2
  7. package/dist/cjs/index.js.map +1 -1
  8. package/dist/cjs/services/commerce/client.d.ts +222 -18
  9. package/dist/cjs/services/commerce/client.d.ts.map +1 -1
  10. package/dist/cjs/services/commerce/client.js +156 -17
  11. package/dist/cjs/services/commerce/client.js.map +1 -1
  12. package/dist/cjs/services/p21-sism/client.d.ts +452 -0
  13. package/dist/cjs/services/p21-sism/client.d.ts.map +1 -0
  14. package/dist/cjs/services/p21-sism/client.js +538 -0
  15. package/dist/cjs/services/p21-sism/client.js.map +1 -0
  16. package/dist/cjs/services/p21-sism/index.d.ts +38 -0
  17. package/dist/cjs/services/p21-sism/index.d.ts.map +1 -0
  18. package/dist/cjs/services/p21-sism/index.js +56 -0
  19. package/dist/cjs/services/p21-sism/index.js.map +1 -0
  20. package/dist/cjs/services/p21-sism/schemas/health.d.ts +63 -0
  21. package/dist/cjs/services/p21-sism/schemas/health.d.ts.map +1 -0
  22. package/dist/cjs/services/p21-sism/schemas/health.js +17 -0
  23. package/dist/cjs/services/p21-sism/schemas/health.js.map +1 -0
  24. package/dist/cjs/services/p21-sism/schemas/import.d.ts +289 -0
  25. package/dist/cjs/services/p21-sism/schemas/import.d.ts.map +1 -0
  26. package/dist/cjs/services/p21-sism/schemas/import.js +100 -0
  27. package/dist/cjs/services/p21-sism/schemas/import.js.map +1 -0
  28. package/dist/cjs/services/p21-sism/schemas/index.d.ts +5 -0
  29. package/dist/cjs/services/p21-sism/schemas/index.d.ts.map +1 -0
  30. package/dist/cjs/services/p21-sism/schemas/index.js +25 -0
  31. package/dist/cjs/services/p21-sism/schemas/index.js.map +1 -0
  32. package/dist/cjs/services/p21-sism/schemas/order-entry.d.ts +76 -0
  33. package/dist/cjs/services/p21-sism/schemas/order-entry.d.ts.map +1 -0
  34. package/dist/cjs/services/p21-sism/schemas/order-entry.js +33 -0
  35. package/dist/cjs/services/p21-sism/schemas/order-entry.js.map +1 -0
  36. package/dist/cjs/services/p21-sism/schemas/scheduled-import.d.ts +54 -0
  37. package/dist/cjs/services/p21-sism/schemas/scheduled-import.d.ts.map +1 -0
  38. package/dist/cjs/services/p21-sism/schemas/scheduled-import.js +23 -0
  39. package/dist/cjs/services/p21-sism/schemas/scheduled-import.js.map +1 -0
  40. package/dist/cjs/services/p21-sism/schemas.d.ts +10 -0
  41. package/dist/cjs/services/p21-sism/schemas.d.ts.map +1 -0
  42. package/dist/cjs/services/p21-sism/schemas.js +26 -0
  43. package/dist/cjs/services/p21-sism/schemas.js.map +1 -0
  44. package/dist/esm/index.d.ts +3 -1
  45. package/dist/esm/index.d.ts.map +1 -1
  46. package/dist/esm/index.js +2 -1
  47. package/dist/esm/index.js.map +1 -1
  48. package/dist/esm/services/commerce/client.d.ts +222 -18
  49. package/dist/esm/services/commerce/client.d.ts.map +1 -1
  50. package/dist/esm/services/commerce/client.js +156 -17
  51. package/dist/esm/services/commerce/client.js.map +1 -1
  52. package/dist/esm/services/p21-sism/client.d.ts +452 -0
  53. package/dist/esm/services/p21-sism/client.d.ts.map +1 -0
  54. package/dist/esm/services/p21-sism/client.js +534 -0
  55. package/dist/esm/services/p21-sism/client.js.map +1 -0
  56. package/dist/esm/services/p21-sism/index.d.ts +38 -0
  57. package/dist/esm/services/p21-sism/index.d.ts.map +1 -0
  58. package/dist/esm/services/p21-sism/index.js +38 -0
  59. package/dist/esm/services/p21-sism/index.js.map +1 -0
  60. package/dist/esm/services/p21-sism/schemas/health.d.ts +63 -0
  61. package/dist/esm/services/p21-sism/schemas/health.d.ts.map +1 -0
  62. package/dist/esm/services/p21-sism/schemas/health.js +14 -0
  63. package/dist/esm/services/p21-sism/schemas/health.js.map +1 -0
  64. package/dist/esm/services/p21-sism/schemas/import.d.ts +289 -0
  65. package/dist/esm/services/p21-sism/schemas/import.d.ts.map +1 -0
  66. package/dist/esm/services/p21-sism/schemas/import.js +97 -0
  67. package/dist/esm/services/p21-sism/schemas/import.js.map +1 -0
  68. package/dist/esm/services/p21-sism/schemas/index.d.ts +5 -0
  69. package/dist/esm/services/p21-sism/schemas/index.d.ts.map +1 -0
  70. package/dist/esm/services/p21-sism/schemas/index.js +9 -0
  71. package/dist/esm/services/p21-sism/schemas/index.js.map +1 -0
  72. package/dist/esm/services/p21-sism/schemas/order-entry.d.ts +76 -0
  73. package/dist/esm/services/p21-sism/schemas/order-entry.d.ts.map +1 -0
  74. package/dist/esm/services/p21-sism/schemas/order-entry.js +30 -0
  75. package/dist/esm/services/p21-sism/schemas/order-entry.js.map +1 -0
  76. package/dist/esm/services/p21-sism/schemas/scheduled-import.d.ts +54 -0
  77. package/dist/esm/services/p21-sism/schemas/scheduled-import.d.ts.map +1 -0
  78. package/dist/esm/services/p21-sism/schemas/scheduled-import.js +20 -0
  79. package/dist/esm/services/p21-sism/schemas/scheduled-import.js.map +1 -0
  80. package/dist/esm/services/p21-sism/schemas.d.ts +10 -0
  81. package/dist/esm/services/p21-sism/schemas.d.ts.map +1 -0
  82. package/dist/esm/services/p21-sism/schemas.js +10 -0
  83. package/dist/esm/services/p21-sism/schemas.js.map +1 -0
  84. package/dist/types/index.d.ts +3 -1
  85. package/dist/types/index.d.ts.map +1 -1
  86. package/dist/types/services/commerce/client.d.ts +222 -18
  87. package/dist/types/services/commerce/client.d.ts.map +1 -1
  88. package/dist/types/services/p21-sism/client.d.ts +452 -0
  89. package/dist/types/services/p21-sism/client.d.ts.map +1 -0
  90. package/dist/types/services/p21-sism/index.d.ts +38 -0
  91. package/dist/types/services/p21-sism/index.d.ts.map +1 -0
  92. package/dist/types/services/p21-sism/schemas/health.d.ts +63 -0
  93. package/dist/types/services/p21-sism/schemas/health.d.ts.map +1 -0
  94. package/dist/types/services/p21-sism/schemas/import.d.ts +289 -0
  95. package/dist/types/services/p21-sism/schemas/import.d.ts.map +1 -0
  96. package/dist/types/services/p21-sism/schemas/index.d.ts +5 -0
  97. package/dist/types/services/p21-sism/schemas/index.d.ts.map +1 -0
  98. package/dist/types/services/p21-sism/schemas/order-entry.d.ts +76 -0
  99. package/dist/types/services/p21-sism/schemas/order-entry.d.ts.map +1 -0
  100. package/dist/types/services/p21-sism/schemas/scheduled-import.d.ts +54 -0
  101. package/dist/types/services/p21-sism/schemas/scheduled-import.d.ts.map +1 -0
  102. package/dist/types/services/p21-sism/schemas.d.ts +10 -0
  103. package/dist/types/services/p21-sism/schemas.d.ts.map +1 -0
  104. package/package.json +1 -1
package/API-DISCOVERY.md CHANGED
@@ -1,132 +1,255 @@
1
- # API Discovery Guide
1
+ # AI-Powered Discovery: Code That Almost Writes Itself
2
2
 
3
- Find any functionality across 13 microservices using natural language search.
3
+ Transform API exploration from documentation hunting into natural language conversation with intelligent business context understanding.
4
4
 
5
- ## Quick Reference
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 = new AugurAPI({ siteId: 'your-site', bearerToken: 'token' });
12
+ const api = AugurAPI.fromContext(context);
11
13
 
12
- // Discover all services
13
- const services = await api.discover();
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
- // Find specific functionality
16
- const results = await api.findEndpoint('user management');
17
- const inventory = await api.findEndpoint('stock levels');
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
- ## Core Methods
24
+ ## Semantic Intelligence Engine
22
25
 
23
- ### `api.discover()`
24
- Returns complete service map with all available endpoints.
26
+ ### Business Context Understanding
27
+
28
+ The discovery system doesn't just match keywords - it understands business processes:
25
29
 
26
30
  ```typescript
27
- const services = await api.discover();
28
- services.forEach(service => {
29
- console.log(`${service.serviceName}: ${service.endpointCount} endpoints`);
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
- ### `api.findEndpoint(searchTerm, options?)`
34
- Search across all services for matching functionality.
45
+ ### Cross-Service Workflow Intelligence
46
+
47
+ The platform maps relationships across all 13 microservices:
35
48
 
36
49
  ```typescript
37
- // Basic search
38
- const results = await api.findEndpoint('users');
39
-
40
- // Advanced search with filters
41
- const results = await api.findEndpoint('settings', {
42
- service: 'agrSite', // Filter by service
43
- domain: 'content-management', // Filter by domain
44
- readOnly: true, // Only GET endpoints
45
- maxResults: 5 // Limit results
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
- ## Common Searches
67
+ ## Advanced Discovery Capabilities
50
68
 
51
- | Search Term | Returns |
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
- ## Search Filters
71
+ The discovery engine uses sophisticated scoring across multiple dimensions:
61
72
 
62
73
  ```typescript
63
- interface SearchOptions {
64
- service?: string; // 'joomla', 'vmi', 'commerce', etc.
65
- domain?: string; // 'user-management', 'inventory-management'
66
- readOnly?: boolean; // true = GET only, false = all methods
67
- minScore?: number; // 0.0 to 1.0 relevance threshold
68
- maxResults?: number; // Limit number of results
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 Domains
93
+ ## Business Intelligence Queries
94
+
95
+ The platform understands complex business scenarios and suggests complete workflows:
73
96
 
74
- - **user-management** - Users, authentication, permissions
75
- - **content-management** - Articles, site settings, notifications
76
- - **e-commerce** - Shopping carts, checkout, recommendations
77
- - **inventory-management** - Warehouses, stock levels, transfers
78
- - **product-catalog** - Products, categories, search
79
- - **customer-data** - Customer profiles, orders, addresses
80
- - **order-processing** - Orders, invoicing, payments
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
- ## AI Assistant Integration
106
+ ## Semantic Discovery Architecture
83
107
 
84
- Every method includes semantic tags for AI assistants:
108
+ ### Rich Metadata Integration
109
+
110
+ Every endpoint includes comprehensive semantic metadata for AI agents:
85
111
 
86
112
  ```typescript
87
113
  /**
88
- * @searchTerms ["users", "user management", "authentication"]
89
- * @relatedEndpoints ["api.joomla.users.get", "api.joomla.users.create"]
90
- * @commonPatterns ["List all users", "Get user directory"]
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
- When you ask an AI assistant "help me manage users", it can:
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
- ## Example Workflows
128
+ When you ask an AI assistant for help, the platform provides complete context:
101
129
 
102
- ### User Management
103
130
  ```typescript
104
- const userOps = await api.findEndpoint('user management');
105
- // Returns: api.joomla.users.list, api.joomla.users.get, api.joomla.users.create
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
- const users = await api.joomla.users.list({ limit: 10 });
108
- const user = await api.joomla.users.get('123');
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
- ### Inventory Operations
174
+ ### Intelligent Search Filtering
175
+
176
+ Advanced filtering that understands business context:
177
+
112
178
  ```typescript
113
- const inventory = await api.findEndpoint('inventory levels');
114
- // Returns: api.vmi.inventory.checkAvailability, api.vmi.warehouses.list
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
- const availability = await api.vmi.inventory.checkAvailability(warehouseId);
117
- const warehouses = await api.vmi.warehouses.list({ customerId: 12345 });
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
- ### Product Search
204
+ ## Platform Discovery Mastery
205
+
206
+ ### Complete Service Topology
207
+
121
208
  ```typescript
122
- const search = await api.findEndpoint('product search');
123
- // Returns: api.opensearch.itemSearch.search, api.items.products.list
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
- const results = await api.opensearch.itemSearch.search({
126
- q: 'electrical wire',
127
- searchType: 'query',
128
- size: 20
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 eliminates the need to memorize 13 different microservice APIs. Just describe what you want to accomplish, and find the right endpoints instantly.
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.