@simpleapps-com/augur-api 2026.10.11 → 2026.10.13

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/dist/index.mjs CHANGED
@@ -848,6 +848,7 @@ var endpoints = [
848
848
  pathPatterns: {},
849
849
  queryParams: [],
850
850
  edgeCache: false,
851
+ readOnly: true,
851
852
  responseSchema: AkashaGenerateCreateDataSchema,
852
853
  responseType: "scalar"
853
854
  },
@@ -874,6 +875,7 @@ var endpoints = [
874
875
  pathPatterns: {},
875
876
  queryParams: [],
876
877
  edgeCache: false,
878
+ readOnly: true,
877
879
  responseSchema: JoomlaGenerateCreateDataSchema,
878
880
  responseType: "scalar"
879
881
  },
@@ -1962,6 +1964,7 @@ var endpoints2 = [
1962
1964
  pathPatterns: {},
1963
1965
  queryParams: [],
1964
1966
  edgeCache: false,
1967
+ readOnly: true,
1965
1968
  responseSchema: UsersValidateCreateDataSchema,
1966
1969
  responseType: "object"
1967
1970
  },
@@ -2102,7 +2105,8 @@ var FyxerTranscriptListParamsSchema = v4.looseObject({
2102
2105
  v4.array(v4.pipe(v4.unknown(), v4.transform(Number))),
2103
2106
  v4.pipe(v4.unknown(), v4.transform(Number))
2104
2107
  ])
2105
- )
2108
+ ),
2109
+ transcriptLength: v4.optional(v4.pipe(v4.unknown(), v4.transform(Number)))
2106
2110
  });
2107
2111
  var GeoCodesPostalCodesListParamsSchema = v4.looseObject({
2108
2112
  ...EdgeCacheParamsSchema.entries,
@@ -2467,7 +2471,7 @@ var endpoints3 = [
2467
2471
  aliases: [],
2468
2472
  pathParams: [],
2469
2473
  pathPatterns: {},
2470
- queryParams: ["limit", "offset", "orderBy", "q", "statusCd"],
2474
+ queryParams: ["limit", "offset", "orderBy", "q", "statusCd", "transcriptLength"],
2471
2475
  edgeCache: true,
2472
2476
  responseSchema: FyxerTranscriptListDataSchema,
2473
2477
  responseType: "array"
@@ -8705,6 +8709,7 @@ var endpoints11 = [
8705
8709
  pathPatterns: {},
8706
8710
  queryParams: [],
8707
8711
  edgeCache: false,
8712
+ readOnly: true,
8708
8713
  responseSchema: AttributesResolveCreateDataSchema,
8709
8714
  responseType: "object"
8710
8715
  },
@@ -9213,6 +9218,7 @@ var endpoints11 = [
9213
9218
  pathPatterns: {},
9214
9219
  queryParams: [],
9215
9220
  edgeCache: false,
9221
+ readOnly: true,
9216
9222
  responseSchema: InternalPdfCreateDataSchema,
9217
9223
  responseType: "scalar"
9218
9224
  },
@@ -9317,6 +9323,7 @@ var endpoints11 = [
9317
9323
  pathPatterns: {},
9318
9324
  queryParams: [],
9319
9325
  edgeCache: false,
9326
+ readOnly: true,
9320
9327
  responseSchema: InvMastAttributesBulkCreateDataSchema,
9321
9328
  responseType: "object"
9322
9329
  },
@@ -17138,6 +17145,7 @@ var endpoints22 = [
17138
17145
  pathPatterns: {},
17139
17146
  queryParams: [],
17140
17147
  edgeCache: false,
17148
+ readOnly: true,
17141
17149
  responseSchema: PriceEngineCreateDataSchema,
17142
17150
  responseType: "object"
17143
17151
  },
@@ -17151,6 +17159,7 @@ var endpoints22 = [
17151
17159
  pathPatterns: {},
17152
17160
  queryParams: [],
17153
17161
  edgeCache: false,
17162
+ readOnly: true,
17154
17163
  responseSchema: TaxEngineCreateDataSchema,
17155
17164
  responseType: "object"
17156
17165
  },
@@ -17312,6 +17321,7 @@ var endpoints23 = [
17312
17321
  pathPatterns: {},
17313
17322
  queryParams: [],
17314
17323
  edgeCache: false,
17324
+ readOnly: true,
17315
17325
  responseSchema: RatesCreateDataSchema2,
17316
17326
  responseType: "array"
17317
17327
  }
@@ -18852,7 +18862,8 @@ function fromRow(service, row) {
18852
18862
  aliases: Object.freeze([...row.aliases]),
18853
18863
  hasBody: row.method === "POST" || row.method === "PUT",
18854
18864
  auth: "bearer",
18855
- edgeCache: row.edgeCache
18865
+ edgeCache: row.edgeCache,
18866
+ ...row.readOnly && { readOnly: true }
18856
18867
  });
18857
18868
  }
18858
18869
  function baseEntries(service) {
@@ -18981,20 +18992,6 @@ var CommonWhoamiResponseSchema = BaseResponseSchema(WhoamiDataSchema);
18981
18992
 
18982
18993
  // src/core/base-client.ts
18983
18994
  import * as v27 from "valibot";
18984
- function toDiscoveryEndpoint(entry) {
18985
- return {
18986
- fullPath: `api.${entry.id}`,
18987
- service: entry.service,
18988
- domain: entry.service,
18989
- method: entry.method,
18990
- path: entry.path,
18991
- description: `${entry.method} ${entry.path}`,
18992
- searchTerms: [],
18993
- relatedEndpoints: [],
18994
- commonPatterns: [],
18995
- discoverable: true
18996
- };
18997
- }
18998
18995
  var BaseServiceClient = class {
18999
18996
  /**
19000
18997
  * Create a new service client instance
@@ -19178,29 +19175,6 @@ var BaseServiceClient = class {
19178
19175
  }
19179
19176
  return path;
19180
19177
  }
19181
- /**
19182
- * Get discovery metadata for this service client
19183
- *
19184
- * Built from the endpoint registry, so it lists every endpoint this service
19185
- * exposes, including healthCheck, ping and whoami.
19186
- *
19187
- * @returns ServiceDiscoveryMetadata containing service info and endpoint metadata
19188
- */
19189
- getDiscoveryMetadata() {
19190
- const endpoints27 = registryEntries().filter((entry) => entry.service === this.serviceName).map(toDiscoveryEndpoint);
19191
- return {
19192
- serviceName: this.serviceName,
19193
- description: this.getServiceDescription(),
19194
- baseUrl: this.baseUrl,
19195
- endpoints: endpoints27
19196
- };
19197
- }
19198
- /**
19199
- * Get service description - can be overridden by subclasses
19200
- */
19201
- getServiceDescription() {
19202
- return `${this.serviceName} service client for Augur API`;
19203
- }
19204
19178
  };
19205
19179
 
19206
19180
  // src/core/service-proxy.ts
@@ -19366,9 +19340,6 @@ var JoomlaClient = class extends BaseServiceClient {
19366
19340
  this.usergroupsData = dataProxy.usergroups;
19367
19341
  this.usersData = dataProxy.users;
19368
19342
  }
19369
- getServiceDescription() {
19370
- return "Joomla CMS integration syncing content, users, categories, menus, and extensions";
19371
- }
19372
19343
  };
19373
19344
 
19374
19345
  // src/services/commerce/client.ts
@@ -19391,9 +19362,6 @@ var CommerceClient = class extends BaseServiceClient {
19391
19362
  this.cartLineData = dataProxy.cartLine;
19392
19363
  this.checkoutData = dataProxy.checkout;
19393
19364
  }
19394
- getServiceDescription() {
19395
- return "Shopping cart and checkout engine managing cart state, checkout flow, and Prophet 21 order submission";
19396
- }
19397
19365
  };
19398
19366
 
19399
19367
  // src/services/pricing/client.ts
@@ -19414,9 +19382,6 @@ var PricingClient = class extends BaseServiceClient {
19414
19382
  this.taxEngineData = dataProxy.taxEngine;
19415
19383
  this.webPricingData = dataProxy.webPricing;
19416
19384
  }
19417
- getServiceDescription() {
19418
- return "Pricing engine with 4-stage waterfall calculation, price books, tax groups, and customer-specific rules";
19419
- }
19420
19385
  };
19421
19386
 
19422
19387
  // src/services/vmi/client.ts
@@ -19441,9 +19406,6 @@ var VMIClient = class extends BaseServiceClient {
19441
19406
  this.sectionsData = dataProxy.sections;
19442
19407
  this.warehouseData = dataProxy.warehouse;
19443
19408
  }
19444
- getServiceDescription() {
19445
- return "Vendor-managed inventory for distributor profiles, warehouse stock levels, restocking, and usage tracking";
19446
- }
19447
19409
  };
19448
19410
 
19449
19411
  // src/services/open-search/client.ts
@@ -19470,9 +19432,6 @@ var OpenSearchClient = class extends BaseServiceClient {
19470
19432
  this.queryStringRedirectData = dataProxy.queryStringRedirect;
19471
19433
  this.suggestionsData = dataProxy.suggestions;
19472
19434
  }
19473
- getServiceDescription() {
19474
- return "Product search engine powered by OpenSearch with autocomplete, faceted filtering, and query analytics";
19475
- }
19476
19435
  };
19477
19436
 
19478
19437
  // src/services/items/client.ts
@@ -19521,9 +19480,6 @@ var ItemsClient = class extends BaseServiceClient {
19521
19480
  this.p21Data = dataProxy.p21;
19522
19481
  this.variantsData = dataProxy.variants;
19523
19482
  }
19524
- getServiceDescription() {
19525
- return "Product catalog and inventory management \u2014 items, categories, attributes, variants, brands, wishlists, and P21 inventory master data";
19526
- }
19527
19483
  };
19528
19484
 
19529
19485
  // src/services/legacy/client.ts
@@ -19542,9 +19498,6 @@ var LegacyClient = class extends BaseServiceClient {
19542
19498
  this.itemCategoryData = dataProxy.itemCategory;
19543
19499
  this.legacyData = dataProxy.legacy;
19544
19500
  }
19545
- getServiceDescription() {
19546
- return "Legacy Prophet 21 data mirror for inventory, customers, orders, pricing, and product attributes";
19547
- }
19548
19501
  };
19549
19502
 
19550
19503
  // src/services/agr-site/client.ts
@@ -19579,9 +19532,6 @@ var AgrSiteClient = class extends BaseServiceClient {
19579
19532
  this.settingsData = dataProxy.settings;
19580
19533
  this.usersData = dataProxy.users;
19581
19534
  }
19582
- getServiceDescription() {
19583
- return "Central site configuration hub managing settings, notifications, and cross-service integrations per client";
19584
- }
19585
19535
  };
19586
19536
 
19587
19537
  // src/services/customers/client.ts
@@ -19604,9 +19554,6 @@ var CustomersClient = class extends BaseServiceClient {
19604
19554
  this.contactsUdData = dataProxy.contactsUd;
19605
19555
  this.customerData = dataProxy.customer;
19606
19556
  }
19607
- getServiceDescription() {
19608
- return "Customer master data including contacts, shipping addresses, invoices, rewards, and P21 customer sync";
19609
- }
19610
19557
  };
19611
19558
 
19612
19559
  // src/services/orders/client.ts
@@ -19629,9 +19576,6 @@ var OrdersClient = class extends BaseServiceClient {
19629
19576
  this.poHdrData = dataProxy.poHdr;
19630
19577
  this.poLineData = dataProxy.poLine;
19631
19578
  }
19632
- getServiceDescription() {
19633
- return "Order lifecycle management for sales orders, invoices, payments, RMAs, and accounts receivable from P21";
19634
- }
19635
19579
  };
19636
19580
 
19637
19581
  // src/services/p21-pim/client.ts
@@ -19654,9 +19598,6 @@ var P21PimClient = class extends BaseServiceClient {
19654
19598
  this.itemsData = dataProxy.items;
19655
19599
  this.podcastsData = dataProxy.podcasts;
19656
19600
  }
19657
- getServiceDescription() {
19658
- return "Product information management for rich content, media assets, and extended item descriptions";
19659
- }
19660
19601
  };
19661
19602
 
19662
19603
  // src/services/payments/client.ts
@@ -19683,9 +19624,6 @@ var PaymentsClient = class extends BaseServiceClient {
19683
19624
  this.paytraceData = dataProxy.paytrace;
19684
19625
  this.unifiedData = dataProxy.unified;
19685
19626
  }
19686
- getServiceDescription() {
19687
- return "Unified payment processing gateway supporting Moneris, PayTrace, and Element card transactions and PayPal orders";
19688
- }
19689
19627
  };
19690
19628
 
19691
19629
  // src/services/agr-info/client.ts
@@ -19712,9 +19650,6 @@ var AgrInfoClient = class extends BaseServiceClient {
19712
19650
  this.sitesData = dataProxy.sites;
19713
19651
  this.workflowsData = dataProxy.workflows;
19714
19652
  }
19715
- getServiceDescription() {
19716
- return "Knowledge management and contextual information aggregation from Basecamp, Joomla, and AI sources";
19717
- }
19718
19653
  };
19719
19654
 
19720
19655
  // src/services/agr-int/client.ts
@@ -19737,9 +19672,6 @@ var AgrIntClient = class extends BaseServiceClient {
19737
19672
  this.rolesData = dataProxy.roles;
19738
19673
  this.usersData = dataProxy.users;
19739
19674
  }
19740
- getServiceDescription() {
19741
- return "Access control for Augur API users and clients: users, roles, bundles, resources, per-user table access grants, and client credentials";
19742
- }
19743
19675
  };
19744
19676
 
19745
19677
  // src/services/agr-work/client.ts
@@ -19747,9 +19679,6 @@ var AgrWorkClient = class extends BaseServiceClient {
19747
19679
  constructor(http, baseUrl = "https://agr-work.augur-api.com") {
19748
19680
  super("agr-work", http, baseUrl);
19749
19681
  }
19750
- getServiceDescription() {
19751
- return "Work tracking and task management for internal operations and job scheduling";
19752
- }
19753
19682
  };
19754
19683
 
19755
19684
  // src/services/avalara/client.ts
@@ -19764,9 +19693,6 @@ var AvalaraClient = class extends BaseServiceClient {
19764
19693
  this.rates = proxy.rates;
19765
19694
  this.ratesData = dataProxy.rates;
19766
19695
  }
19767
- getServiceDescription() {
19768
- return "Avalara tax rate calculation API integration for real-time sales tax on e-commerce transactions";
19769
- }
19770
19696
  };
19771
19697
 
19772
19698
  // src/services/brand-folder/client.ts
@@ -19785,9 +19711,6 @@ var BrandFolderClient = class extends BaseServiceClient {
19785
19711
  this.categories = proxy.categories;
19786
19712
  this.categoriesData = dataProxy.categories;
19787
19713
  }
19788
- getServiceDescription() {
19789
- return "Digital asset management for brand images, documents, and media with tagging and categorization";
19790
- }
19791
19714
  };
19792
19715
 
19793
19716
  // src/services/gregorovich/client.ts
@@ -19806,9 +19729,6 @@ var GregorovichClient = class extends BaseServiceClient {
19806
19729
  this.documents = proxy.documents;
19807
19730
  this.documentsData = dataProxy.documents;
19808
19731
  }
19809
- getServiceDescription() {
19810
- return "AI and LLM gateway providing RAG, embeddings, and chat via OpenAI, Groq, Ollama, and vLLM backends";
19811
- }
19812
19732
  };
19813
19733
 
19814
19734
  // src/services/logistics/client.ts
@@ -19837,9 +19757,6 @@ var LogisticsClient = class extends BaseServiceClient {
19837
19757
  this.speedshipData = dataProxy.speedship;
19838
19758
  this.upsData = dataProxy.ups;
19839
19759
  }
19840
- getServiceDescription() {
19841
- return "Multi-carrier shipping logistics for label generation, tracking, and delivery coordination";
19842
- }
19843
19760
  };
19844
19761
 
19845
19762
  // src/services/p21-apis/client.ts
@@ -19864,9 +19781,6 @@ var P21ApisClient = class extends BaseServiceClient {
19864
19781
  this.transUserData = dataProxy.transUser;
19865
19782
  this.transWebDisplayTypeData = dataProxy.transWebDisplayType;
19866
19783
  }
19867
- getServiceDescription() {
19868
- return "Prophet 21 REST API abstraction for normalized CRUD operations on ERP entities";
19869
- }
19870
19784
  };
19871
19785
 
19872
19786
  // src/services/p21-core/client.ts
@@ -19893,9 +19807,6 @@ var P21CoreClient = class extends BaseServiceClient {
19893
19807
  this.locationData = dataProxy.location;
19894
19808
  this.paymentTypesData = dataProxy.paymentTypes;
19895
19809
  }
19896
- getServiceDescription() {
19897
- return "Prophet 21 core reference data including companies, locations, users, payment types, and system settings";
19898
- }
19899
19810
  };
19900
19811
 
19901
19812
  // src/services/p21-sism/client.ts
@@ -19914,9 +19825,6 @@ var P21SismClient = class extends BaseServiceClient {
19914
19825
  this.scheduledImportMasterData = dataProxy.scheduledImportMaster;
19915
19826
  this.scheduledImportMetadataData = dataProxy.scheduledImportMetadata;
19916
19827
  }
19917
- getServiceDescription() {
19918
- return "Prophet 21 staged import engine for batch processing orders, inventory, customers, and transactions";
19919
- }
19920
19828
  };
19921
19829
 
19922
19830
  // src/services/shipping/client.ts
@@ -19935,9 +19843,6 @@ var ShippingClient = class extends BaseServiceClient {
19935
19843
  this.rates = proxy.rates;
19936
19844
  this.ratesData = dataProxy.rates;
19937
19845
  }
19938
- getServiceDescription() {
19939
- return "Shipping rate aggregation and calculation across multiple carrier integrations";
19940
- }
19941
19846
  };
19942
19847
 
19943
19848
  // src/services/smarty-streets/client.ts
@@ -19956,9 +19861,6 @@ var SmartyStreetsClient = class extends BaseServiceClient {
19956
19861
  this.us = proxy.us;
19957
19862
  this.usData = dataProxy.us;
19958
19863
  }
19959
- getServiceDescription() {
19960
- return "SmartyStreets address validation and geocoding for shipping address standardization";
19961
- }
19962
19864
  };
19963
19865
 
19964
19866
  // src/services/ups/client.ts
@@ -19973,9 +19875,6 @@ var UPSClient = class extends BaseServiceClient {
19973
19875
  this.ratesShop = proxy.ratesShop;
19974
19876
  this.ratesShopData = dataProxy.ratesShop;
19975
19877
  }
19976
- getServiceDescription() {
19977
- return "UPS shipping integration for address validation, rate quoting, and OAuth-based API access";
19978
- }
19979
19878
  };
19980
19879
 
19981
19880
  // src/services/basecamp2/client.ts
@@ -20008,9 +19907,6 @@ var Basecamp2Client = class extends BaseServiceClient {
20008
19907
  this.todosData = dataProxy.todos;
20009
19908
  this.todosSummaryData = dataProxy.todosSummary;
20010
19909
  }
20011
- getServiceDescription() {
20012
- return "Basecamp project management integration syncing todos, projects, people, and conversation data with AI analytics";
20013
- }
20014
19910
  };
20015
19911
 
20016
19912
  // src/client.ts
@@ -20421,436 +20317,6 @@ var _AugurAPI = class _AugurAPI {
20421
20317
  this._ups = void 0;
20422
20318
  this._basecamp2 = void 0;
20423
20319
  }
20424
- /**
20425
- * Discover all available services and their capabilities
20426
- *
20427
- * Returns a complete service map showing all discoverable endpoints across
20428
- * all microservices, enabling AI agents to understand the full API topology.
20429
- *
20430
- * @returns Promise<ServiceMap[]> Array of service maps with endpoint metadata
20431
- *
20432
- * @example
20433
- * ```typescript
20434
- * const api = new AugurAPI({ siteId: 'my-site', bearerToken: 'token' });
20435
- * const services = await api.discover();
20436
- *
20437
- * // Find all user-related endpoints
20438
- * const userEndpoints = services.flatMap(s => s.endpoints)
20439
- * .filter(e => e.searchTerms.some(term => term.includes('user')));
20440
- *
20441
- * // Show service capabilities
20442
- * services.forEach(service => {
20443
- * console.log(`${service.serviceName}: ${service.endpointCount} endpoints`);
20444
- * service.endpoints.forEach(endpoint => {
20445
- * console.log(` ${endpoint.fullPath} - ${endpoint.description}`);
20446
- * });
20447
- * });
20448
- * ```
20449
- */
20450
- async discover() {
20451
- const clients = [
20452
- this.joomla,
20453
- this.commerce,
20454
- this.pricing,
20455
- this.vmi,
20456
- this.openSearch,
20457
- this.items,
20458
- this.legacy,
20459
- this.agrSite,
20460
- this.customers,
20461
- this.orders,
20462
- this.p21Pim,
20463
- this.payments,
20464
- this.agrInfo,
20465
- this.agrInt,
20466
- this.agrWork,
20467
- this.avalara,
20468
- this.brandFolder,
20469
- this.gregorovich,
20470
- this.logistics,
20471
- this.p21Apis,
20472
- this.p21Core,
20473
- this.p21Sism,
20474
- this.shipping,
20475
- this.smartyStreets,
20476
- this.ups,
20477
- this.basecamp2
20478
- ];
20479
- return clients.map((client) => {
20480
- const metadata = client.getDiscoveryMetadata();
20481
- return {
20482
- serviceName: metadata.serviceName,
20483
- description: metadata.description,
20484
- baseUrl: metadata.baseUrl,
20485
- endpointCount: metadata.endpoints.length,
20486
- endpoints: metadata.endpoints
20487
- };
20488
- });
20489
- }
20490
- /**
20491
- * Find endpoints by search term or functionality description
20492
- *
20493
- * Searches across all services to find endpoints that match the given search term.
20494
- * Uses intelligent matching against endpoint descriptions, search terms, domains,
20495
- * and common usage patterns.
20496
- *
20497
- * @param searchTerm The functionality or term to search for
20498
- * @param options Search options for filtering and ranking
20499
- * @returns Promise<EndpointSearchResult[]> Array of matching endpoints with relevance scores
20500
- *
20501
- * @example
20502
- * ```typescript
20503
- * const api = new AugurAPI({ siteId: 'my-site', bearerToken: 'token' });
20504
- *
20505
- * // Find user-related endpoints
20506
- * const userEndpoints = await api.findEndpoint('users');
20507
- * console.log(`Found ${userEndpoints.length} user-related endpoints`);
20508
- *
20509
- * // Find authentication endpoints
20510
- * const authEndpoints = await api.findEndpoint('authentication');
20511
- *
20512
- * // Find inventory management
20513
- * const inventoryEndpoints = await api.findEndpoint('inventory management');
20514
- *
20515
- * // Show results with scores
20516
- * userEndpoints.forEach(result => {
20517
- * console.log(`${result.endpoint.fullPath} (${result.score.toFixed(2)}) - ${result.matchReason}`);
20518
- * });
20519
- * ```
20520
- */
20521
- async findEndpoint(searchTerm, options = {}) {
20522
- const { minScore = 0.1, maxResults = 10, service, domain, readOnly = false } = options;
20523
- if (!searchTerm.trim()) {
20524
- return [];
20525
- }
20526
- const filteredEndpoints = await this.getFilteredEndpoints({ service, domain, readOnly });
20527
- const results = this.searchAndScoreEndpoints(filteredEndpoints, searchTerm, {
20528
- domain,
20529
- minScore
20530
- });
20531
- return results.sort((a, b) => b.score - a.score).slice(0, maxResults);
20532
- }
20533
- /**
20534
- * Get endpoints filtered by service, domain, and method options
20535
- */
20536
- async getFilteredEndpoints(filters) {
20537
- const { service, domain, readOnly } = filters;
20538
- const services = await this.discover();
20539
- let filteredEndpoints = services.flatMap((s) => s.endpoints);
20540
- if (service) {
20541
- filteredEndpoints = filteredEndpoints.filter((e) => e.service === service);
20542
- }
20543
- if (domain) {
20544
- filteredEndpoints = filteredEndpoints.filter((e) => e.domain === domain);
20545
- }
20546
- if (readOnly) {
20547
- filteredEndpoints = filteredEndpoints.filter((e) => e.method === "GET");
20548
- }
20549
- return filteredEndpoints;
20550
- }
20551
- /**
20552
- * Search and score endpoints against search term
20553
- */
20554
- searchAndScoreEndpoints(endpoints27, searchTerm, options) {
20555
- const { domain, minScore } = options;
20556
- const results = [];
20557
- const searchTermLower = searchTerm.toLowerCase();
20558
- for (const endpoint of endpoints27) {
20559
- if (!this.isValidEndpoint(endpoint)) {
20560
- continue;
20561
- }
20562
- const { finalScore, finalMatchReason } = this.calculateFinalScore(
20563
- endpoint,
20564
- searchTermLower,
20565
- domain
20566
- );
20567
- if (finalScore >= minScore) {
20568
- results.push({
20569
- endpoint,
20570
- score: finalScore,
20571
- matchReason: finalMatchReason
20572
- });
20573
- }
20574
- }
20575
- return results;
20576
- }
20577
- /**
20578
- * Check if endpoint has required fields
20579
- */
20580
- isValidEndpoint(endpoint) {
20581
- return !!(endpoint.domain && endpoint.description && endpoint.method);
20582
- }
20583
- /**
20584
- * Calculate final score with domain filter adjustments
20585
- */
20586
- calculateFinalScore(endpoint, searchTermLower, domain) {
20587
- const { score, matchReason } = this.calculateEndpointRelevance(endpoint, searchTermLower);
20588
- if (domain && score === 0) {
20589
- return {
20590
- finalScore: 0.1,
20591
- finalMatchReason: "Domain filter match"
20592
- };
20593
- }
20594
- return {
20595
- finalScore: score,
20596
- finalMatchReason: matchReason
20597
- };
20598
- }
20599
- /**
20600
- * Calculate relevance score for an endpoint against a search term
20601
- */
20602
- calculateEndpointRelevance(endpoint, searchTermLower) {
20603
- const exactMatches = this.calculateExactMatches(endpoint, searchTermLower);
20604
- const partialMatches = this.calculatePartialMatches(endpoint, searchTermLower);
20605
- if (exactMatches.score > 0) {
20606
- return this.processExactMatches(exactMatches, partialMatches);
20607
- }
20608
- return this.processFallbackMatches(endpoint, searchTermLower, partialMatches);
20609
- }
20610
- /**
20611
- * Process exact matches with appropriate combining logic
20612
- */
20613
- processExactMatches(exactMatches, partialMatches) {
20614
- if (this.isExclusiveMatch(exactMatches.reason)) {
20615
- return {
20616
- score: exactMatches.score,
20617
- matchReason: exactMatches.reason
20618
- };
20619
- }
20620
- if (this.isCombinableMatch(exactMatches.reason)) {
20621
- const totalScore = Math.min(exactMatches.score + partialMatches.score, 1);
20622
- return {
20623
- score: totalScore,
20624
- matchReason: exactMatches.reason
20625
- };
20626
- }
20627
- return {
20628
- score: exactMatches.score,
20629
- matchReason: exactMatches.reason
20630
- };
20631
- }
20632
- /**
20633
- * Check if match type should be exclusive (no combining)
20634
- */
20635
- isExclusiveMatch(reason) {
20636
- return reason === "Service match" || reason.startsWith("Search term match");
20637
- }
20638
- /**
20639
- * Check if match type can be combined with partial matches
20640
- */
20641
- isCombinableMatch(reason) {
20642
- const combinableReasons = [
20643
- "Description match",
20644
- "Full path match",
20645
- "Path substring match",
20646
- "Domain match",
20647
- "Usage pattern match"
20648
- ];
20649
- return combinableReasons.includes(reason);
20650
- }
20651
- /**
20652
- * Process fallback matches when no exact match found
20653
- */
20654
- processFallbackMatches(endpoint, searchTermLower, partialMatches) {
20655
- const multiWordMatches = this.calculateMultiWordMatches(endpoint, searchTermLower);
20656
- if (multiWordMatches.score > partialMatches.score) {
20657
- return {
20658
- score: multiWordMatches.score,
20659
- matchReason: multiWordMatches.reason
20660
- };
20661
- }
20662
- return {
20663
- score: partialMatches.score,
20664
- matchReason: partialMatches.reason || "Low relevance match"
20665
- };
20666
- }
20667
- /**
20668
- * Calculate exact field matches with high scores
20669
- */
20670
- calculateExactMatches(endpoint, searchTermLower) {
20671
- const exactMatch = this.checkExactFieldMatches(endpoint, searchTermLower);
20672
- if (exactMatch.score > 0) {
20673
- return exactMatch;
20674
- }
20675
- const pathMatch = this.checkPathSubstringMatch(endpoint, searchTermLower);
20676
- if (pathMatch.score > 0) {
20677
- return pathMatch;
20678
- }
20679
- const descSubstringMatch = this.checkDescriptionSubstringMatch(endpoint, searchTermLower);
20680
- if (descSubstringMatch.score > 0) {
20681
- return descSubstringMatch;
20682
- }
20683
- const termMatch = this.checkSearchTermsAndPatterns(endpoint, searchTermLower);
20684
- if (termMatch.score > 0) {
20685
- return termMatch;
20686
- }
20687
- const otherSubstringMatch = this.checkOtherSubstringMatches(endpoint, searchTermLower);
20688
- if (otherSubstringMatch.score > 0) {
20689
- return otherSubstringMatch;
20690
- }
20691
- return { score: 0, reason: "" };
20692
- }
20693
- /**
20694
- * Check for path substring matches
20695
- */
20696
- checkPathSubstringMatch(endpoint, searchTermLower) {
20697
- if (endpoint.fullPath && (endpoint.fullPath.toLowerCase().includes(searchTermLower) || searchTermLower.includes(endpoint.fullPath.toLowerCase()))) {
20698
- return { score: 0.9, reason: "Path substring match" };
20699
- }
20700
- return { score: 0, reason: "" };
20701
- }
20702
- /**
20703
- * Check for description substring matches
20704
- */
20705
- checkDescriptionSubstringMatch(endpoint, searchTermLower) {
20706
- if (endpoint.description && endpoint.description.toLowerCase().includes(searchTermLower)) {
20707
- return { score: 0.65, reason: "Description substring match" };
20708
- }
20709
- return { score: 0, reason: "" };
20710
- }
20711
- /**
20712
- * Check for other substring matches (domain, service)
20713
- */
20714
- checkOtherSubstringMatches(endpoint, searchTermLower) {
20715
- if (endpoint.domain && endpoint.domain.toLowerCase().includes(searchTermLower)) {
20716
- return { score: 0.5, reason: "Domain match" };
20717
- }
20718
- if (endpoint.service && endpoint.service.toLowerCase().includes(searchTermLower)) {
20719
- return { score: 0.3, reason: "Service match" };
20720
- }
20721
- return { score: 0, reason: "" };
20722
- }
20723
- /**
20724
- * Check for exact field matches
20725
- */
20726
- checkExactFieldMatches(endpoint, searchTermLower) {
20727
- if (endpoint.domain && endpoint.domain.toLowerCase() === searchTermLower) {
20728
- return { score: 0.6, reason: "Domain match" };
20729
- }
20730
- if (endpoint.service && endpoint.service.toLowerCase() === searchTermLower) {
20731
- return { score: 0.3, reason: "Service match" };
20732
- }
20733
- if (endpoint.fullPath && endpoint.fullPath.toLowerCase() === searchTermLower) {
20734
- return { score: 1, reason: "Full path match" };
20735
- }
20736
- if (endpoint.description && endpoint.description.toLowerCase() === searchTermLower) {
20737
- return { score: 0.8, reason: "Description match" };
20738
- }
20739
- return { score: 0, reason: "" };
20740
- }
20741
- /**
20742
- * Check search terms and common patterns
20743
- */
20744
- checkSearchTermsAndPatterns(endpoint, searchTermLower) {
20745
- if (Array.isArray(endpoint.searchTerms)) {
20746
- const searchTermMatches = endpoint.searchTerms.filter(
20747
- (term) => term && typeof term === "string" && term.toLowerCase().includes(searchTermLower)
20748
- );
20749
- if (searchTermMatches.length > 0) {
20750
- return { score: 0.7, reason: `Search term match: ${searchTermMatches[0]}` };
20751
- }
20752
- }
20753
- if (Array.isArray(endpoint.commonPatterns)) {
20754
- const patternMatches = endpoint.commonPatterns.filter((pattern) => {
20755
- if (!pattern || typeof pattern !== "string") return false;
20756
- const patternLower = pattern.toLowerCase();
20757
- return patternLower.includes(searchTermLower);
20758
- });
20759
- if (patternMatches.length > 0) {
20760
- return { score: 0.5, reason: "Usage pattern match" };
20761
- }
20762
- }
20763
- return { score: 0, reason: "" };
20764
- }
20765
- /**
20766
- * Calculate partial word matches with lower scores
20767
- */
20768
- calculatePartialMatches(endpoint, searchTermLower) {
20769
- const allText = this.buildSearchableText(endpoint);
20770
- const wordMatches = this.countWordMatches(searchTermLower, allText);
20771
- return this.buildPartialMatchResult(wordMatches, searchTermLower);
20772
- }
20773
- /**
20774
- * Build searchable text from endpoint fields
20775
- */
20776
- buildSearchableText(endpoint) {
20777
- const searchTerms = Array.isArray(endpoint.searchTerms) ? endpoint.searchTerms : [];
20778
- const commonPatterns = Array.isArray(endpoint.commonPatterns) ? endpoint.commonPatterns : [];
20779
- return [
20780
- endpoint.fullPath || "",
20781
- endpoint.description || "",
20782
- endpoint.domain || "",
20783
- endpoint.service || "",
20784
- ...searchTerms,
20785
- ...commonPatterns
20786
- ].filter((text) => typeof text === "string").join(" ").toLowerCase();
20787
- }
20788
- /**
20789
- * Count matching words in text
20790
- */
20791
- countWordMatches(searchTermLower, allText) {
20792
- const searchWords = searchTermLower.split(/\s+/).filter((word) => word.length > 0);
20793
- let wordMatches = 0;
20794
- for (const word of searchWords) {
20795
- if (word.length > 2 && allText.includes(word)) {
20796
- wordMatches++;
20797
- }
20798
- }
20799
- return wordMatches;
20800
- }
20801
- /**
20802
- * Build partial match result with score and reason
20803
- */
20804
- buildPartialMatchResult(wordMatches, searchTermLower) {
20805
- if (wordMatches > 0) {
20806
- const searchWords = searchTermLower.split(/\s+/).filter((word) => word.length > 0);
20807
- const partialScore = wordMatches / searchWords.length * 0.2;
20808
- const reasonText = `Partial word match (${wordMatches}/${searchWords.length})`;
20809
- return {
20810
- score: partialScore,
20811
- reason: reasonText,
20812
- matchReason: reasonText
20813
- };
20814
- }
20815
- return { score: 0, reason: "", matchReason: "" };
20816
- }
20817
- /**
20818
- * Calculate multi-word matches by finding the best match for each word
20819
- */
20820
- calculateMultiWordMatches(endpoint, searchTermLower) {
20821
- const searchWords = searchTermLower.split(/\s+/).filter((word) => word.length > 0);
20822
- if (searchWords.length <= 1) {
20823
- return { score: 0, reason: "" };
20824
- }
20825
- let bestScore = 0;
20826
- let bestReason = "";
20827
- const matchedWords = [];
20828
- for (const word of searchWords) {
20829
- const wordMatch = this.calculateExactMatches(endpoint, word);
20830
- if (wordMatch.score > 0) {
20831
- if (wordMatch.score > bestScore) {
20832
- bestScore = wordMatch.score;
20833
- bestReason = wordMatch.reason;
20834
- }
20835
- matchedWords.push(word);
20836
- }
20837
- }
20838
- if (matchedWords.length > 1) {
20839
- const bonusScore = Math.min((matchedWords.length - 1) * 0.1, 0.3);
20840
- const finalScore = Math.min(bestScore + bonusScore, 1);
20841
- return {
20842
- score: finalScore,
20843
- reason: `Multi-word match (${matchedWords.length}/${searchWords.length} words): ${bestReason}`
20844
- };
20845
- }
20846
- if (bestScore > 0) {
20847
- return {
20848
- score: bestScore,
20849
- reason: bestReason
20850
- };
20851
- }
20852
- return { score: 0, reason: "" };
20853
- }
20854
20320
  };
20855
20321
  /** Endpoint registry contract version (see shared/REGISTRY.md). */
20856
20322
  _AugurAPI.registryVersion = REGISTRY_VERSION;
@@ -20910,7 +20376,7 @@ function createCrossSiteAuthenticator(augurInfoToken) {
20910
20376
  }
20911
20377
 
20912
20378
  // src/index.ts
20913
- var VERSION = "2026.10.11";
20379
+ var VERSION = "2026.10.13";
20914
20380
  export {
20915
20381
  AgrInfoClient,
20916
20382
  AgrIntClient,