@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.js CHANGED
@@ -924,6 +924,7 @@ var endpoints = [
924
924
  pathPatterns: {},
925
925
  queryParams: [],
926
926
  edgeCache: false,
927
+ readOnly: true,
927
928
  responseSchema: AkashaGenerateCreateDataSchema,
928
929
  responseType: "scalar"
929
930
  },
@@ -950,6 +951,7 @@ var endpoints = [
950
951
  pathPatterns: {},
951
952
  queryParams: [],
952
953
  edgeCache: false,
954
+ readOnly: true,
953
955
  responseSchema: JoomlaGenerateCreateDataSchema,
954
956
  responseType: "scalar"
955
957
  },
@@ -2038,6 +2040,7 @@ var endpoints2 = [
2038
2040
  pathPatterns: {},
2039
2041
  queryParams: [],
2040
2042
  edgeCache: false,
2043
+ readOnly: true,
2041
2044
  responseSchema: UsersValidateCreateDataSchema,
2042
2045
  responseType: "object"
2043
2046
  },
@@ -2178,7 +2181,8 @@ var FyxerTranscriptListParamsSchema = v4.looseObject({
2178
2181
  v4.array(v4.pipe(v4.unknown(), v4.transform(Number))),
2179
2182
  v4.pipe(v4.unknown(), v4.transform(Number))
2180
2183
  ])
2181
- )
2184
+ ),
2185
+ transcriptLength: v4.optional(v4.pipe(v4.unknown(), v4.transform(Number)))
2182
2186
  });
2183
2187
  var GeoCodesPostalCodesListParamsSchema = v4.looseObject({
2184
2188
  ...EdgeCacheParamsSchema.entries,
@@ -2543,7 +2547,7 @@ var endpoints3 = [
2543
2547
  aliases: [],
2544
2548
  pathParams: [],
2545
2549
  pathPatterns: {},
2546
- queryParams: ["limit", "offset", "orderBy", "q", "statusCd"],
2550
+ queryParams: ["limit", "offset", "orderBy", "q", "statusCd", "transcriptLength"],
2547
2551
  edgeCache: true,
2548
2552
  responseSchema: FyxerTranscriptListDataSchema,
2549
2553
  responseType: "array"
@@ -8781,6 +8785,7 @@ var endpoints11 = [
8781
8785
  pathPatterns: {},
8782
8786
  queryParams: [],
8783
8787
  edgeCache: false,
8788
+ readOnly: true,
8784
8789
  responseSchema: AttributesResolveCreateDataSchema,
8785
8790
  responseType: "object"
8786
8791
  },
@@ -9289,6 +9294,7 @@ var endpoints11 = [
9289
9294
  pathPatterns: {},
9290
9295
  queryParams: [],
9291
9296
  edgeCache: false,
9297
+ readOnly: true,
9292
9298
  responseSchema: InternalPdfCreateDataSchema,
9293
9299
  responseType: "scalar"
9294
9300
  },
@@ -9393,6 +9399,7 @@ var endpoints11 = [
9393
9399
  pathPatterns: {},
9394
9400
  queryParams: [],
9395
9401
  edgeCache: false,
9402
+ readOnly: true,
9396
9403
  responseSchema: InvMastAttributesBulkCreateDataSchema,
9397
9404
  responseType: "object"
9398
9405
  },
@@ -17214,6 +17221,7 @@ var endpoints22 = [
17214
17221
  pathPatterns: {},
17215
17222
  queryParams: [],
17216
17223
  edgeCache: false,
17224
+ readOnly: true,
17217
17225
  responseSchema: PriceEngineCreateDataSchema,
17218
17226
  responseType: "object"
17219
17227
  },
@@ -17227,6 +17235,7 @@ var endpoints22 = [
17227
17235
  pathPatterns: {},
17228
17236
  queryParams: [],
17229
17237
  edgeCache: false,
17238
+ readOnly: true,
17230
17239
  responseSchema: TaxEngineCreateDataSchema,
17231
17240
  responseType: "object"
17232
17241
  },
@@ -17388,6 +17397,7 @@ var endpoints23 = [
17388
17397
  pathPatterns: {},
17389
17398
  queryParams: [],
17390
17399
  edgeCache: false,
17400
+ readOnly: true,
17391
17401
  responseSchema: RatesCreateDataSchema2,
17392
17402
  responseType: "array"
17393
17403
  }
@@ -18928,7 +18938,8 @@ function fromRow(service, row) {
18928
18938
  aliases: Object.freeze([...row.aliases]),
18929
18939
  hasBody: row.method === "POST" || row.method === "PUT",
18930
18940
  auth: "bearer",
18931
- edgeCache: row.edgeCache
18941
+ edgeCache: row.edgeCache,
18942
+ ...row.readOnly && { readOnly: true }
18932
18943
  });
18933
18944
  }
18934
18945
  function baseEntries(service) {
@@ -19057,20 +19068,6 @@ var CommonWhoamiResponseSchema = BaseResponseSchema(WhoamiDataSchema);
19057
19068
 
19058
19069
  // src/core/base-client.ts
19059
19070
  var v27 = __toESM(require("valibot"));
19060
- function toDiscoveryEndpoint(entry) {
19061
- return {
19062
- fullPath: `api.${entry.id}`,
19063
- service: entry.service,
19064
- domain: entry.service,
19065
- method: entry.method,
19066
- path: entry.path,
19067
- description: `${entry.method} ${entry.path}`,
19068
- searchTerms: [],
19069
- relatedEndpoints: [],
19070
- commonPatterns: [],
19071
- discoverable: true
19072
- };
19073
- }
19074
19071
  var BaseServiceClient = class {
19075
19072
  /**
19076
19073
  * Create a new service client instance
@@ -19254,29 +19251,6 @@ var BaseServiceClient = class {
19254
19251
  }
19255
19252
  return path;
19256
19253
  }
19257
- /**
19258
- * Get discovery metadata for this service client
19259
- *
19260
- * Built from the endpoint registry, so it lists every endpoint this service
19261
- * exposes, including healthCheck, ping and whoami.
19262
- *
19263
- * @returns ServiceDiscoveryMetadata containing service info and endpoint metadata
19264
- */
19265
- getDiscoveryMetadata() {
19266
- const endpoints27 = registryEntries().filter((entry) => entry.service === this.serviceName).map(toDiscoveryEndpoint);
19267
- return {
19268
- serviceName: this.serviceName,
19269
- description: this.getServiceDescription(),
19270
- baseUrl: this.baseUrl,
19271
- endpoints: endpoints27
19272
- };
19273
- }
19274
- /**
19275
- * Get service description - can be overridden by subclasses
19276
- */
19277
- getServiceDescription() {
19278
- return `${this.serviceName} service client for Augur API`;
19279
- }
19280
19254
  };
19281
19255
 
19282
19256
  // src/core/service-proxy.ts
@@ -19442,9 +19416,6 @@ var JoomlaClient = class extends BaseServiceClient {
19442
19416
  this.usergroupsData = dataProxy.usergroups;
19443
19417
  this.usersData = dataProxy.users;
19444
19418
  }
19445
- getServiceDescription() {
19446
- return "Joomla CMS integration syncing content, users, categories, menus, and extensions";
19447
- }
19448
19419
  };
19449
19420
 
19450
19421
  // src/services/commerce/client.ts
@@ -19467,9 +19438,6 @@ var CommerceClient = class extends BaseServiceClient {
19467
19438
  this.cartLineData = dataProxy.cartLine;
19468
19439
  this.checkoutData = dataProxy.checkout;
19469
19440
  }
19470
- getServiceDescription() {
19471
- return "Shopping cart and checkout engine managing cart state, checkout flow, and Prophet 21 order submission";
19472
- }
19473
19441
  };
19474
19442
 
19475
19443
  // src/services/pricing/client.ts
@@ -19490,9 +19458,6 @@ var PricingClient = class extends BaseServiceClient {
19490
19458
  this.taxEngineData = dataProxy.taxEngine;
19491
19459
  this.webPricingData = dataProxy.webPricing;
19492
19460
  }
19493
- getServiceDescription() {
19494
- return "Pricing engine with 4-stage waterfall calculation, price books, tax groups, and customer-specific rules";
19495
- }
19496
19461
  };
19497
19462
 
19498
19463
  // src/services/vmi/client.ts
@@ -19517,9 +19482,6 @@ var VMIClient = class extends BaseServiceClient {
19517
19482
  this.sectionsData = dataProxy.sections;
19518
19483
  this.warehouseData = dataProxy.warehouse;
19519
19484
  }
19520
- getServiceDescription() {
19521
- return "Vendor-managed inventory for distributor profiles, warehouse stock levels, restocking, and usage tracking";
19522
- }
19523
19485
  };
19524
19486
 
19525
19487
  // src/services/open-search/client.ts
@@ -19546,9 +19508,6 @@ var OpenSearchClient = class extends BaseServiceClient {
19546
19508
  this.queryStringRedirectData = dataProxy.queryStringRedirect;
19547
19509
  this.suggestionsData = dataProxy.suggestions;
19548
19510
  }
19549
- getServiceDescription() {
19550
- return "Product search engine powered by OpenSearch with autocomplete, faceted filtering, and query analytics";
19551
- }
19552
19511
  };
19553
19512
 
19554
19513
  // src/services/items/client.ts
@@ -19597,9 +19556,6 @@ var ItemsClient = class extends BaseServiceClient {
19597
19556
  this.p21Data = dataProxy.p21;
19598
19557
  this.variantsData = dataProxy.variants;
19599
19558
  }
19600
- getServiceDescription() {
19601
- return "Product catalog and inventory management \u2014 items, categories, attributes, variants, brands, wishlists, and P21 inventory master data";
19602
- }
19603
19559
  };
19604
19560
 
19605
19561
  // src/services/legacy/client.ts
@@ -19618,9 +19574,6 @@ var LegacyClient = class extends BaseServiceClient {
19618
19574
  this.itemCategoryData = dataProxy.itemCategory;
19619
19575
  this.legacyData = dataProxy.legacy;
19620
19576
  }
19621
- getServiceDescription() {
19622
- return "Legacy Prophet 21 data mirror for inventory, customers, orders, pricing, and product attributes";
19623
- }
19624
19577
  };
19625
19578
 
19626
19579
  // src/services/agr-site/client.ts
@@ -19655,9 +19608,6 @@ var AgrSiteClient = class extends BaseServiceClient {
19655
19608
  this.settingsData = dataProxy.settings;
19656
19609
  this.usersData = dataProxy.users;
19657
19610
  }
19658
- getServiceDescription() {
19659
- return "Central site configuration hub managing settings, notifications, and cross-service integrations per client";
19660
- }
19661
19611
  };
19662
19612
 
19663
19613
  // src/services/customers/client.ts
@@ -19680,9 +19630,6 @@ var CustomersClient = class extends BaseServiceClient {
19680
19630
  this.contactsUdData = dataProxy.contactsUd;
19681
19631
  this.customerData = dataProxy.customer;
19682
19632
  }
19683
- getServiceDescription() {
19684
- return "Customer master data including contacts, shipping addresses, invoices, rewards, and P21 customer sync";
19685
- }
19686
19633
  };
19687
19634
 
19688
19635
  // src/services/orders/client.ts
@@ -19705,9 +19652,6 @@ var OrdersClient = class extends BaseServiceClient {
19705
19652
  this.poHdrData = dataProxy.poHdr;
19706
19653
  this.poLineData = dataProxy.poLine;
19707
19654
  }
19708
- getServiceDescription() {
19709
- return "Order lifecycle management for sales orders, invoices, payments, RMAs, and accounts receivable from P21";
19710
- }
19711
19655
  };
19712
19656
 
19713
19657
  // src/services/p21-pim/client.ts
@@ -19730,9 +19674,6 @@ var P21PimClient = class extends BaseServiceClient {
19730
19674
  this.itemsData = dataProxy.items;
19731
19675
  this.podcastsData = dataProxy.podcasts;
19732
19676
  }
19733
- getServiceDescription() {
19734
- return "Product information management for rich content, media assets, and extended item descriptions";
19735
- }
19736
19677
  };
19737
19678
 
19738
19679
  // src/services/payments/client.ts
@@ -19759,9 +19700,6 @@ var PaymentsClient = class extends BaseServiceClient {
19759
19700
  this.paytraceData = dataProxy.paytrace;
19760
19701
  this.unifiedData = dataProxy.unified;
19761
19702
  }
19762
- getServiceDescription() {
19763
- return "Unified payment processing gateway supporting Moneris, PayTrace, and Element card transactions and PayPal orders";
19764
- }
19765
19703
  };
19766
19704
 
19767
19705
  // src/services/agr-info/client.ts
@@ -19788,9 +19726,6 @@ var AgrInfoClient = class extends BaseServiceClient {
19788
19726
  this.sitesData = dataProxy.sites;
19789
19727
  this.workflowsData = dataProxy.workflows;
19790
19728
  }
19791
- getServiceDescription() {
19792
- return "Knowledge management and contextual information aggregation from Basecamp, Joomla, and AI sources";
19793
- }
19794
19729
  };
19795
19730
 
19796
19731
  // src/services/agr-int/client.ts
@@ -19813,9 +19748,6 @@ var AgrIntClient = class extends BaseServiceClient {
19813
19748
  this.rolesData = dataProxy.roles;
19814
19749
  this.usersData = dataProxy.users;
19815
19750
  }
19816
- getServiceDescription() {
19817
- return "Access control for Augur API users and clients: users, roles, bundles, resources, per-user table access grants, and client credentials";
19818
- }
19819
19751
  };
19820
19752
 
19821
19753
  // src/services/agr-work/client.ts
@@ -19823,9 +19755,6 @@ var AgrWorkClient = class extends BaseServiceClient {
19823
19755
  constructor(http, baseUrl = "https://agr-work.augur-api.com") {
19824
19756
  super("agr-work", http, baseUrl);
19825
19757
  }
19826
- getServiceDescription() {
19827
- return "Work tracking and task management for internal operations and job scheduling";
19828
- }
19829
19758
  };
19830
19759
 
19831
19760
  // src/services/avalara/client.ts
@@ -19840,9 +19769,6 @@ var AvalaraClient = class extends BaseServiceClient {
19840
19769
  this.rates = proxy.rates;
19841
19770
  this.ratesData = dataProxy.rates;
19842
19771
  }
19843
- getServiceDescription() {
19844
- return "Avalara tax rate calculation API integration for real-time sales tax on e-commerce transactions";
19845
- }
19846
19772
  };
19847
19773
 
19848
19774
  // src/services/brand-folder/client.ts
@@ -19861,9 +19787,6 @@ var BrandFolderClient = class extends BaseServiceClient {
19861
19787
  this.categories = proxy.categories;
19862
19788
  this.categoriesData = dataProxy.categories;
19863
19789
  }
19864
- getServiceDescription() {
19865
- return "Digital asset management for brand images, documents, and media with tagging and categorization";
19866
- }
19867
19790
  };
19868
19791
 
19869
19792
  // src/services/gregorovich/client.ts
@@ -19882,9 +19805,6 @@ var GregorovichClient = class extends BaseServiceClient {
19882
19805
  this.documents = proxy.documents;
19883
19806
  this.documentsData = dataProxy.documents;
19884
19807
  }
19885
- getServiceDescription() {
19886
- return "AI and LLM gateway providing RAG, embeddings, and chat via OpenAI, Groq, Ollama, and vLLM backends";
19887
- }
19888
19808
  };
19889
19809
 
19890
19810
  // src/services/logistics/client.ts
@@ -19913,9 +19833,6 @@ var LogisticsClient = class extends BaseServiceClient {
19913
19833
  this.speedshipData = dataProxy.speedship;
19914
19834
  this.upsData = dataProxy.ups;
19915
19835
  }
19916
- getServiceDescription() {
19917
- return "Multi-carrier shipping logistics for label generation, tracking, and delivery coordination";
19918
- }
19919
19836
  };
19920
19837
 
19921
19838
  // src/services/p21-apis/client.ts
@@ -19940,9 +19857,6 @@ var P21ApisClient = class extends BaseServiceClient {
19940
19857
  this.transUserData = dataProxy.transUser;
19941
19858
  this.transWebDisplayTypeData = dataProxy.transWebDisplayType;
19942
19859
  }
19943
- getServiceDescription() {
19944
- return "Prophet 21 REST API abstraction for normalized CRUD operations on ERP entities";
19945
- }
19946
19860
  };
19947
19861
 
19948
19862
  // src/services/p21-core/client.ts
@@ -19969,9 +19883,6 @@ var P21CoreClient = class extends BaseServiceClient {
19969
19883
  this.locationData = dataProxy.location;
19970
19884
  this.paymentTypesData = dataProxy.paymentTypes;
19971
19885
  }
19972
- getServiceDescription() {
19973
- return "Prophet 21 core reference data including companies, locations, users, payment types, and system settings";
19974
- }
19975
19886
  };
19976
19887
 
19977
19888
  // src/services/p21-sism/client.ts
@@ -19990,9 +19901,6 @@ var P21SismClient = class extends BaseServiceClient {
19990
19901
  this.scheduledImportMasterData = dataProxy.scheduledImportMaster;
19991
19902
  this.scheduledImportMetadataData = dataProxy.scheduledImportMetadata;
19992
19903
  }
19993
- getServiceDescription() {
19994
- return "Prophet 21 staged import engine for batch processing orders, inventory, customers, and transactions";
19995
- }
19996
19904
  };
19997
19905
 
19998
19906
  // src/services/shipping/client.ts
@@ -20011,9 +19919,6 @@ var ShippingClient = class extends BaseServiceClient {
20011
19919
  this.rates = proxy.rates;
20012
19920
  this.ratesData = dataProxy.rates;
20013
19921
  }
20014
- getServiceDescription() {
20015
- return "Shipping rate aggregation and calculation across multiple carrier integrations";
20016
- }
20017
19922
  };
20018
19923
 
20019
19924
  // src/services/smarty-streets/client.ts
@@ -20032,9 +19937,6 @@ var SmartyStreetsClient = class extends BaseServiceClient {
20032
19937
  this.us = proxy.us;
20033
19938
  this.usData = dataProxy.us;
20034
19939
  }
20035
- getServiceDescription() {
20036
- return "SmartyStreets address validation and geocoding for shipping address standardization";
20037
- }
20038
19940
  };
20039
19941
 
20040
19942
  // src/services/ups/client.ts
@@ -20049,9 +19951,6 @@ var UPSClient = class extends BaseServiceClient {
20049
19951
  this.ratesShop = proxy.ratesShop;
20050
19952
  this.ratesShopData = dataProxy.ratesShop;
20051
19953
  }
20052
- getServiceDescription() {
20053
- return "UPS shipping integration for address validation, rate quoting, and OAuth-based API access";
20054
- }
20055
19954
  };
20056
19955
 
20057
19956
  // src/services/basecamp2/client.ts
@@ -20084,9 +19983,6 @@ var Basecamp2Client = class extends BaseServiceClient {
20084
19983
  this.todosData = dataProxy.todos;
20085
19984
  this.todosSummaryData = dataProxy.todosSummary;
20086
19985
  }
20087
- getServiceDescription() {
20088
- return "Basecamp project management integration syncing todos, projects, people, and conversation data with AI analytics";
20089
- }
20090
19986
  };
20091
19987
 
20092
19988
  // src/client.ts
@@ -20497,436 +20393,6 @@ var _AugurAPI = class _AugurAPI {
20497
20393
  this._ups = void 0;
20498
20394
  this._basecamp2 = void 0;
20499
20395
  }
20500
- /**
20501
- * Discover all available services and their capabilities
20502
- *
20503
- * Returns a complete service map showing all discoverable endpoints across
20504
- * all microservices, enabling AI agents to understand the full API topology.
20505
- *
20506
- * @returns Promise<ServiceMap[]> Array of service maps with endpoint metadata
20507
- *
20508
- * @example
20509
- * ```typescript
20510
- * const api = new AugurAPI({ siteId: 'my-site', bearerToken: 'token' });
20511
- * const services = await api.discover();
20512
- *
20513
- * // Find all user-related endpoints
20514
- * const userEndpoints = services.flatMap(s => s.endpoints)
20515
- * .filter(e => e.searchTerms.some(term => term.includes('user')));
20516
- *
20517
- * // Show service capabilities
20518
- * services.forEach(service => {
20519
- * console.log(`${service.serviceName}: ${service.endpointCount} endpoints`);
20520
- * service.endpoints.forEach(endpoint => {
20521
- * console.log(` ${endpoint.fullPath} - ${endpoint.description}`);
20522
- * });
20523
- * });
20524
- * ```
20525
- */
20526
- async discover() {
20527
- const clients = [
20528
- this.joomla,
20529
- this.commerce,
20530
- this.pricing,
20531
- this.vmi,
20532
- this.openSearch,
20533
- this.items,
20534
- this.legacy,
20535
- this.agrSite,
20536
- this.customers,
20537
- this.orders,
20538
- this.p21Pim,
20539
- this.payments,
20540
- this.agrInfo,
20541
- this.agrInt,
20542
- this.agrWork,
20543
- this.avalara,
20544
- this.brandFolder,
20545
- this.gregorovich,
20546
- this.logistics,
20547
- this.p21Apis,
20548
- this.p21Core,
20549
- this.p21Sism,
20550
- this.shipping,
20551
- this.smartyStreets,
20552
- this.ups,
20553
- this.basecamp2
20554
- ];
20555
- return clients.map((client) => {
20556
- const metadata = client.getDiscoveryMetadata();
20557
- return {
20558
- serviceName: metadata.serviceName,
20559
- description: metadata.description,
20560
- baseUrl: metadata.baseUrl,
20561
- endpointCount: metadata.endpoints.length,
20562
- endpoints: metadata.endpoints
20563
- };
20564
- });
20565
- }
20566
- /**
20567
- * Find endpoints by search term or functionality description
20568
- *
20569
- * Searches across all services to find endpoints that match the given search term.
20570
- * Uses intelligent matching against endpoint descriptions, search terms, domains,
20571
- * and common usage patterns.
20572
- *
20573
- * @param searchTerm The functionality or term to search for
20574
- * @param options Search options for filtering and ranking
20575
- * @returns Promise<EndpointSearchResult[]> Array of matching endpoints with relevance scores
20576
- *
20577
- * @example
20578
- * ```typescript
20579
- * const api = new AugurAPI({ siteId: 'my-site', bearerToken: 'token' });
20580
- *
20581
- * // Find user-related endpoints
20582
- * const userEndpoints = await api.findEndpoint('users');
20583
- * console.log(`Found ${userEndpoints.length} user-related endpoints`);
20584
- *
20585
- * // Find authentication endpoints
20586
- * const authEndpoints = await api.findEndpoint('authentication');
20587
- *
20588
- * // Find inventory management
20589
- * const inventoryEndpoints = await api.findEndpoint('inventory management');
20590
- *
20591
- * // Show results with scores
20592
- * userEndpoints.forEach(result => {
20593
- * console.log(`${result.endpoint.fullPath} (${result.score.toFixed(2)}) - ${result.matchReason}`);
20594
- * });
20595
- * ```
20596
- */
20597
- async findEndpoint(searchTerm, options = {}) {
20598
- const { minScore = 0.1, maxResults = 10, service, domain, readOnly = false } = options;
20599
- if (!searchTerm.trim()) {
20600
- return [];
20601
- }
20602
- const filteredEndpoints = await this.getFilteredEndpoints({ service, domain, readOnly });
20603
- const results = this.searchAndScoreEndpoints(filteredEndpoints, searchTerm, {
20604
- domain,
20605
- minScore
20606
- });
20607
- return results.sort((a, b) => b.score - a.score).slice(0, maxResults);
20608
- }
20609
- /**
20610
- * Get endpoints filtered by service, domain, and method options
20611
- */
20612
- async getFilteredEndpoints(filters) {
20613
- const { service, domain, readOnly } = filters;
20614
- const services = await this.discover();
20615
- let filteredEndpoints = services.flatMap((s) => s.endpoints);
20616
- if (service) {
20617
- filteredEndpoints = filteredEndpoints.filter((e) => e.service === service);
20618
- }
20619
- if (domain) {
20620
- filteredEndpoints = filteredEndpoints.filter((e) => e.domain === domain);
20621
- }
20622
- if (readOnly) {
20623
- filteredEndpoints = filteredEndpoints.filter((e) => e.method === "GET");
20624
- }
20625
- return filteredEndpoints;
20626
- }
20627
- /**
20628
- * Search and score endpoints against search term
20629
- */
20630
- searchAndScoreEndpoints(endpoints27, searchTerm, options) {
20631
- const { domain, minScore } = options;
20632
- const results = [];
20633
- const searchTermLower = searchTerm.toLowerCase();
20634
- for (const endpoint of endpoints27) {
20635
- if (!this.isValidEndpoint(endpoint)) {
20636
- continue;
20637
- }
20638
- const { finalScore, finalMatchReason } = this.calculateFinalScore(
20639
- endpoint,
20640
- searchTermLower,
20641
- domain
20642
- );
20643
- if (finalScore >= minScore) {
20644
- results.push({
20645
- endpoint,
20646
- score: finalScore,
20647
- matchReason: finalMatchReason
20648
- });
20649
- }
20650
- }
20651
- return results;
20652
- }
20653
- /**
20654
- * Check if endpoint has required fields
20655
- */
20656
- isValidEndpoint(endpoint) {
20657
- return !!(endpoint.domain && endpoint.description && endpoint.method);
20658
- }
20659
- /**
20660
- * Calculate final score with domain filter adjustments
20661
- */
20662
- calculateFinalScore(endpoint, searchTermLower, domain) {
20663
- const { score, matchReason } = this.calculateEndpointRelevance(endpoint, searchTermLower);
20664
- if (domain && score === 0) {
20665
- return {
20666
- finalScore: 0.1,
20667
- finalMatchReason: "Domain filter match"
20668
- };
20669
- }
20670
- return {
20671
- finalScore: score,
20672
- finalMatchReason: matchReason
20673
- };
20674
- }
20675
- /**
20676
- * Calculate relevance score for an endpoint against a search term
20677
- */
20678
- calculateEndpointRelevance(endpoint, searchTermLower) {
20679
- const exactMatches = this.calculateExactMatches(endpoint, searchTermLower);
20680
- const partialMatches = this.calculatePartialMatches(endpoint, searchTermLower);
20681
- if (exactMatches.score > 0) {
20682
- return this.processExactMatches(exactMatches, partialMatches);
20683
- }
20684
- return this.processFallbackMatches(endpoint, searchTermLower, partialMatches);
20685
- }
20686
- /**
20687
- * Process exact matches with appropriate combining logic
20688
- */
20689
- processExactMatches(exactMatches, partialMatches) {
20690
- if (this.isExclusiveMatch(exactMatches.reason)) {
20691
- return {
20692
- score: exactMatches.score,
20693
- matchReason: exactMatches.reason
20694
- };
20695
- }
20696
- if (this.isCombinableMatch(exactMatches.reason)) {
20697
- const totalScore = Math.min(exactMatches.score + partialMatches.score, 1);
20698
- return {
20699
- score: totalScore,
20700
- matchReason: exactMatches.reason
20701
- };
20702
- }
20703
- return {
20704
- score: exactMatches.score,
20705
- matchReason: exactMatches.reason
20706
- };
20707
- }
20708
- /**
20709
- * Check if match type should be exclusive (no combining)
20710
- */
20711
- isExclusiveMatch(reason) {
20712
- return reason === "Service match" || reason.startsWith("Search term match");
20713
- }
20714
- /**
20715
- * Check if match type can be combined with partial matches
20716
- */
20717
- isCombinableMatch(reason) {
20718
- const combinableReasons = [
20719
- "Description match",
20720
- "Full path match",
20721
- "Path substring match",
20722
- "Domain match",
20723
- "Usage pattern match"
20724
- ];
20725
- return combinableReasons.includes(reason);
20726
- }
20727
- /**
20728
- * Process fallback matches when no exact match found
20729
- */
20730
- processFallbackMatches(endpoint, searchTermLower, partialMatches) {
20731
- const multiWordMatches = this.calculateMultiWordMatches(endpoint, searchTermLower);
20732
- if (multiWordMatches.score > partialMatches.score) {
20733
- return {
20734
- score: multiWordMatches.score,
20735
- matchReason: multiWordMatches.reason
20736
- };
20737
- }
20738
- return {
20739
- score: partialMatches.score,
20740
- matchReason: partialMatches.reason || "Low relevance match"
20741
- };
20742
- }
20743
- /**
20744
- * Calculate exact field matches with high scores
20745
- */
20746
- calculateExactMatches(endpoint, searchTermLower) {
20747
- const exactMatch = this.checkExactFieldMatches(endpoint, searchTermLower);
20748
- if (exactMatch.score > 0) {
20749
- return exactMatch;
20750
- }
20751
- const pathMatch = this.checkPathSubstringMatch(endpoint, searchTermLower);
20752
- if (pathMatch.score > 0) {
20753
- return pathMatch;
20754
- }
20755
- const descSubstringMatch = this.checkDescriptionSubstringMatch(endpoint, searchTermLower);
20756
- if (descSubstringMatch.score > 0) {
20757
- return descSubstringMatch;
20758
- }
20759
- const termMatch = this.checkSearchTermsAndPatterns(endpoint, searchTermLower);
20760
- if (termMatch.score > 0) {
20761
- return termMatch;
20762
- }
20763
- const otherSubstringMatch = this.checkOtherSubstringMatches(endpoint, searchTermLower);
20764
- if (otherSubstringMatch.score > 0) {
20765
- return otherSubstringMatch;
20766
- }
20767
- return { score: 0, reason: "" };
20768
- }
20769
- /**
20770
- * Check for path substring matches
20771
- */
20772
- checkPathSubstringMatch(endpoint, searchTermLower) {
20773
- if (endpoint.fullPath && (endpoint.fullPath.toLowerCase().includes(searchTermLower) || searchTermLower.includes(endpoint.fullPath.toLowerCase()))) {
20774
- return { score: 0.9, reason: "Path substring match" };
20775
- }
20776
- return { score: 0, reason: "" };
20777
- }
20778
- /**
20779
- * Check for description substring matches
20780
- */
20781
- checkDescriptionSubstringMatch(endpoint, searchTermLower) {
20782
- if (endpoint.description && endpoint.description.toLowerCase().includes(searchTermLower)) {
20783
- return { score: 0.65, reason: "Description substring match" };
20784
- }
20785
- return { score: 0, reason: "" };
20786
- }
20787
- /**
20788
- * Check for other substring matches (domain, service)
20789
- */
20790
- checkOtherSubstringMatches(endpoint, searchTermLower) {
20791
- if (endpoint.domain && endpoint.domain.toLowerCase().includes(searchTermLower)) {
20792
- return { score: 0.5, reason: "Domain match" };
20793
- }
20794
- if (endpoint.service && endpoint.service.toLowerCase().includes(searchTermLower)) {
20795
- return { score: 0.3, reason: "Service match" };
20796
- }
20797
- return { score: 0, reason: "" };
20798
- }
20799
- /**
20800
- * Check for exact field matches
20801
- */
20802
- checkExactFieldMatches(endpoint, searchTermLower) {
20803
- if (endpoint.domain && endpoint.domain.toLowerCase() === searchTermLower) {
20804
- return { score: 0.6, reason: "Domain match" };
20805
- }
20806
- if (endpoint.service && endpoint.service.toLowerCase() === searchTermLower) {
20807
- return { score: 0.3, reason: "Service match" };
20808
- }
20809
- if (endpoint.fullPath && endpoint.fullPath.toLowerCase() === searchTermLower) {
20810
- return { score: 1, reason: "Full path match" };
20811
- }
20812
- if (endpoint.description && endpoint.description.toLowerCase() === searchTermLower) {
20813
- return { score: 0.8, reason: "Description match" };
20814
- }
20815
- return { score: 0, reason: "" };
20816
- }
20817
- /**
20818
- * Check search terms and common patterns
20819
- */
20820
- checkSearchTermsAndPatterns(endpoint, searchTermLower) {
20821
- if (Array.isArray(endpoint.searchTerms)) {
20822
- const searchTermMatches = endpoint.searchTerms.filter(
20823
- (term) => term && typeof term === "string" && term.toLowerCase().includes(searchTermLower)
20824
- );
20825
- if (searchTermMatches.length > 0) {
20826
- return { score: 0.7, reason: `Search term match: ${searchTermMatches[0]}` };
20827
- }
20828
- }
20829
- if (Array.isArray(endpoint.commonPatterns)) {
20830
- const patternMatches = endpoint.commonPatterns.filter((pattern) => {
20831
- if (!pattern || typeof pattern !== "string") return false;
20832
- const patternLower = pattern.toLowerCase();
20833
- return patternLower.includes(searchTermLower);
20834
- });
20835
- if (patternMatches.length > 0) {
20836
- return { score: 0.5, reason: "Usage pattern match" };
20837
- }
20838
- }
20839
- return { score: 0, reason: "" };
20840
- }
20841
- /**
20842
- * Calculate partial word matches with lower scores
20843
- */
20844
- calculatePartialMatches(endpoint, searchTermLower) {
20845
- const allText = this.buildSearchableText(endpoint);
20846
- const wordMatches = this.countWordMatches(searchTermLower, allText);
20847
- return this.buildPartialMatchResult(wordMatches, searchTermLower);
20848
- }
20849
- /**
20850
- * Build searchable text from endpoint fields
20851
- */
20852
- buildSearchableText(endpoint) {
20853
- const searchTerms = Array.isArray(endpoint.searchTerms) ? endpoint.searchTerms : [];
20854
- const commonPatterns = Array.isArray(endpoint.commonPatterns) ? endpoint.commonPatterns : [];
20855
- return [
20856
- endpoint.fullPath || "",
20857
- endpoint.description || "",
20858
- endpoint.domain || "",
20859
- endpoint.service || "",
20860
- ...searchTerms,
20861
- ...commonPatterns
20862
- ].filter((text) => typeof text === "string").join(" ").toLowerCase();
20863
- }
20864
- /**
20865
- * Count matching words in text
20866
- */
20867
- countWordMatches(searchTermLower, allText) {
20868
- const searchWords = searchTermLower.split(/\s+/).filter((word) => word.length > 0);
20869
- let wordMatches = 0;
20870
- for (const word of searchWords) {
20871
- if (word.length > 2 && allText.includes(word)) {
20872
- wordMatches++;
20873
- }
20874
- }
20875
- return wordMatches;
20876
- }
20877
- /**
20878
- * Build partial match result with score and reason
20879
- */
20880
- buildPartialMatchResult(wordMatches, searchTermLower) {
20881
- if (wordMatches > 0) {
20882
- const searchWords = searchTermLower.split(/\s+/).filter((word) => word.length > 0);
20883
- const partialScore = wordMatches / searchWords.length * 0.2;
20884
- const reasonText = `Partial word match (${wordMatches}/${searchWords.length})`;
20885
- return {
20886
- score: partialScore,
20887
- reason: reasonText,
20888
- matchReason: reasonText
20889
- };
20890
- }
20891
- return { score: 0, reason: "", matchReason: "" };
20892
- }
20893
- /**
20894
- * Calculate multi-word matches by finding the best match for each word
20895
- */
20896
- calculateMultiWordMatches(endpoint, searchTermLower) {
20897
- const searchWords = searchTermLower.split(/\s+/).filter((word) => word.length > 0);
20898
- if (searchWords.length <= 1) {
20899
- return { score: 0, reason: "" };
20900
- }
20901
- let bestScore = 0;
20902
- let bestReason = "";
20903
- const matchedWords = [];
20904
- for (const word of searchWords) {
20905
- const wordMatch = this.calculateExactMatches(endpoint, word);
20906
- if (wordMatch.score > 0) {
20907
- if (wordMatch.score > bestScore) {
20908
- bestScore = wordMatch.score;
20909
- bestReason = wordMatch.reason;
20910
- }
20911
- matchedWords.push(word);
20912
- }
20913
- }
20914
- if (matchedWords.length > 1) {
20915
- const bonusScore = Math.min((matchedWords.length - 1) * 0.1, 0.3);
20916
- const finalScore = Math.min(bestScore + bonusScore, 1);
20917
- return {
20918
- score: finalScore,
20919
- reason: `Multi-word match (${matchedWords.length}/${searchWords.length} words): ${bestReason}`
20920
- };
20921
- }
20922
- if (bestScore > 0) {
20923
- return {
20924
- score: bestScore,
20925
- reason: bestReason
20926
- };
20927
- }
20928
- return { score: 0, reason: "" };
20929
- }
20930
20396
  };
20931
20397
  /** Endpoint registry contract version (see shared/REGISTRY.md). */
20932
20398
  _AugurAPI.registryVersion = REGISTRY_VERSION;
@@ -20986,7 +20452,7 @@ function createCrossSiteAuthenticator(augurInfoToken) {
20986
20452
  }
20987
20453
 
20988
20454
  // src/index.ts
20989
- var VERSION = "2026.10.11";
20455
+ var VERSION = "2026.10.13";
20990
20456
  // Annotate the CommonJS export names for ESM import in node:
20991
20457
  0 && (module.exports = {
20992
20458
  AgrInfoClient,