@ar.io/wayfinder-core 0.0.5-alpha.2 → 0.0.5-alpha.3

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 (48) hide show
  1. package/README.md +45 -2
  2. package/dist/classifiers/gql-classifier.d.ts +1 -2
  3. package/dist/classifiers/gql-classifier.d.ts.map +1 -1
  4. package/dist/classifiers/gql-classifier.js +16 -0
  5. package/dist/gateways/network.d.ts +2 -3
  6. package/dist/gateways/network.d.ts.map +1 -1
  7. package/dist/gateways/simple-cache.d.ts +1 -19
  8. package/dist/gateways/simple-cache.d.ts.map +1 -1
  9. package/dist/gateways/simple-cache.js +10 -11
  10. package/dist/gateways/static.d.ts +1 -1
  11. package/dist/gateways/static.d.ts.map +1 -1
  12. package/dist/index.d.ts +2 -0
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +3 -0
  15. package/dist/logger.d.ts +1 -10
  16. package/dist/logger.d.ts.map +1 -1
  17. package/dist/logger.js +16 -0
  18. package/dist/routing/ping.d.ts +1 -2
  19. package/dist/routing/ping.d.ts.map +1 -1
  20. package/dist/routing/preferred-with-fallback.d.ts +1 -2
  21. package/dist/routing/preferred-with-fallback.d.ts.map +1 -1
  22. package/dist/routing/preferred-with-fallback.js +16 -0
  23. package/dist/routing/random.d.ts +1 -1
  24. package/dist/routing/random.d.ts.map +1 -1
  25. package/dist/routing/round-robin.d.ts +1 -19
  26. package/dist/routing/round-robin.d.ts.map +1 -1
  27. package/dist/routing/round-robin.js +10 -11
  28. package/dist/routing/simple-cache.d.ts +37 -0
  29. package/dist/routing/simple-cache.d.ts.map +1 -0
  30. package/dist/routing/simple-cache.js +72 -0
  31. package/dist/routing/static.d.ts +1 -19
  32. package/dist/routing/static.d.ts.map +1 -1
  33. package/dist/routing/static.js +10 -11
  34. package/dist/types.d.ts +151 -0
  35. package/dist/types.d.ts.map +1 -0
  36. package/dist/types.js +17 -0
  37. package/dist/utils/hash.d.ts +1 -2
  38. package/dist/utils/hash.d.ts.map +1 -1
  39. package/dist/verification/data-root-verifier.d.ts +1 -2
  40. package/dist/verification/data-root-verifier.d.ts.map +1 -1
  41. package/dist/verification/hash-verifier.d.ts +1 -2
  42. package/dist/verification/hash-verifier.d.ts.map +1 -1
  43. package/dist/verification/signature-verifier.d.ts +1 -2
  44. package/dist/verification/signature-verifier.d.ts.map +1 -1
  45. package/dist/wayfinder.d.ts +17 -111
  46. package/dist/wayfinder.d.ts.map +1 -1
  47. package/dist/wayfinder.js +39 -43
  48. package/package.json +3 -13
package/README.md CHANGED
@@ -268,9 +268,12 @@ const wayfinder = new Wayfinder({
268
268
 
269
269
  ## Monitoring and Events
270
270
 
271
- Wayfinder emits events during the routing and verification process, allowing you to monitor its operation. You can provide these events to the Wayfinder constructor or use the event emitter directly.
271
+ Wayfinder emits events during the routing and verification process for all requests, allowing you to monitor its operation. All events are emitted on the `wayfinder.emitter` event emitter, and are updated for each request.
272
+
273
+ ### Global request events
272
274
 
273
275
  ```javascript
276
+ // Provide events to the Wayfinder constructor for tracking all requests
274
277
  const wayfinder = new Wayfinder({
275
278
  routingSettings: {
276
279
  events: {
@@ -306,7 +309,7 @@ const wayfinder = new Wayfinder({
306
309
  },
307
310
  });
308
311
 
309
- // Or use the event emitter directly
312
+ // listen to the global wayfinder event emitter for all requests
310
313
  wayfinder.emitter.on('routing-succeeded', (event) => {
311
314
  console.log(`Request routed to: ${event.targetGateway}`);
312
315
  });
@@ -328,6 +331,46 @@ wayfinder.emitter.on('verification-failed', (event) => {
328
331
  });
329
332
  ```
330
333
 
334
+ #### Request-specific events
335
+
336
+ You can also provide events to the `request` function to track a single request. These events are called for each request and are not updated for subsequent requests.
337
+
338
+ > Note: events are still emitted to the global event emitter for all requests. It is recommended to use the global event emitter for tracking all requests, and the request-specific events for tracking a single request.
339
+
340
+ ```javascript
341
+ // create a wayfinder instance with verification enabled
342
+ const wayfinder = new Wayfinder({
343
+ verificationSettings: {
344
+ enabled: true,
345
+ strategy: new HashVerificationStrategy({
346
+ trustedGateways: ['https://permagate.io'],
347
+ }),
348
+ events: {
349
+ onVerificationProgress: (event) => {
350
+ console.log(`Global callback handler called for: ${event.txId}`);
351
+ },
352
+ onVerificationSucceeded: (event) => {
353
+ console.log(`Global callback handler called for: ${event.txId}`);
354
+ },
355
+ },
356
+ },
357
+ });
358
+
359
+ const response = await wayfinder.request('ar://example-name', {
360
+ verificationSettings: {
361
+ // these callbacks will be triggered for this request only, the global callback handlers are still called
362
+ events: {
363
+ onVerificationProgress: (event) => {
364
+ console.log(`Request-specific callback handler called for: ${event.txId}`);
365
+ },
366
+ onVerificationSucceeded: (event) => {
367
+ console.log(`Request-specific callback handler called for: ${event.txId}`);
368
+ },
369
+ },
370
+ },
371
+ });
372
+ ```
373
+
331
374
  ## Advanced Usage
332
375
 
333
376
  ### Custom URL Resolution
@@ -14,8 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { DataClassifier } from '../../types/wayfinder.js';
18
- import { Logger } from '../logger.js';
17
+ import type { DataClassifier, Logger } from '../types.js';
19
18
  export declare class GqlClassifier implements DataClassifier {
20
19
  private readonly gqlEndpoint;
21
20
  private readonly logger;
@@ -1 +1 @@
1
- {"version":3,"file":"gql-classifier.d.ts","sourceRoot":"","sources":["../../src/classifiers/gql-classifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAiB,MAAM,cAAc,CAAC;AAErD,qBAAa,aAAc,YAAW,cAAc;IAClD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAM;IAClC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEpB,EACV,WAA0D,EAC1D,MAAsB,GACvB,GAAE;QACD,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC;KACZ;IAKA,QAAQ,CAAC,EACb,IAAI,GACL,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,QAAQ,GAAG,aAAa,CAAC;CAuCxD"}
1
+ {"version":3,"file":"gql-classifier.d.ts","sourceRoot":"","sources":["../../src/classifiers/gql-classifier.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1D,qBAAa,aAAc,YAAW,cAAc;IAClD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAM;IAClC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEpB,EACV,WAA0D,EAC1D,MAAsB,GACvB,GAAE;QACD,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC;KACZ;IAKA,QAAQ,CAAC,EACb,IAAI,GACL,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,QAAQ,GAAG,aAAa,CAAC;CAuCxD"}
@@ -1,3 +1,19 @@
1
+ /**
2
+ * WayFinder
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
1
17
  import { defaultLogger } from '../logger.js';
2
18
  export class GqlClassifier {
3
19
  gqlEndpoint;
@@ -14,9 +14,8 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { AoARIORead } from '@ar.io/sdk';
18
- import { GatewaysProvider } from '../../types/wayfinder.js';
19
- import { Logger } from '../logger.js';
17
+ import type { AoARIORead } from '@ar.io/sdk';
18
+ import type { GatewaysProvider, Logger } from '../types.js';
20
19
  export declare class NetworkGatewaysProvider implements GatewaysProvider {
21
20
  private ario;
22
21
  private sortBy;
@@ -1 +1 @@
1
- {"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src/gateways/network.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAiB,MAAM,cAAc,CAAC;AAErD,qBAAa,uBAAwB,YAAW,gBAAgB;IAC9D,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,MAAM,CAA6D;IAC3E,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,MAAM,CAAS;gBAEX,EACV,IAAI,EACJ,MAAwB,EACxB,SAAkB,EAClB,KAAY,EACZ,MAAqC,EACrC,MAAsB,GACvB,EAAE;QACD,IAAI,EAAE,UAAU,CAAC;QACjB,MAAM,CAAC,EAAE,qBAAqB,GAAG,eAAe,GAAG,gBAAgB,CAAC;QACpE,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;QAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC;QACnC,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IASK,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;CA0DpC"}
1
+ {"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src/gateways/network.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE5D,qBAAa,uBAAwB,YAAW,gBAAgB;IAC9D,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,MAAM,CAA6D;IAC3E,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,MAAM,CAAS;gBAEX,EACV,IAAI,EACJ,MAAwB,EACxB,SAAkB,EAClB,KAAY,EACZ,MAAqC,EACrC,MAAsB,GACvB,EAAE;QACD,IAAI,EAAE,UAAU,CAAC;QACjB,MAAM,CAAC,EAAE,qBAAqB,GAAG,eAAe,GAAG,gBAAgB,CAAC;QACpE,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;QAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC;QACnC,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IASK,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;CA0DpC"}
@@ -14,25 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { GatewaysProvider } from '../../types/wayfinder.js';
18
- /**
19
- * WayFinder
20
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
21
- *
22
- * This program is free software: you can redistribute it and/or modify
23
- * it under the terms of the GNU Affero General Public License as published by
24
- * the Free Software Foundation, either version 3 of the License, or
25
- * (at your option) any later version.
26
- *
27
- * This program is distributed in the hope that it will be useful,
28
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
29
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30
- * GNU Affero General Public License for more details.
31
- *
32
- * You should have received a copy of the GNU Affero General Public License
33
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
34
- */
35
- import { Logger } from '../logger.js';
17
+ import type { GatewaysProvider, Logger } from '../types.js';
36
18
  export declare class SimpleCacheGatewaysProvider implements GatewaysProvider {
37
19
  private gatewaysProvider;
38
20
  private ttlSeconds;
@@ -1 +1 @@
1
- {"version":3,"file":"simple-cache.d.ts","sourceRoot":"","sources":["../../src/gateways/simple-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,MAAM,EAAiB,MAAM,cAAc,CAAC;AAErD,qBAAa,2BAA4B,YAAW,gBAAgB;IAClE,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,aAAa,CAAQ;IAC7B,OAAO,CAAC,MAAM,CAAS;gBAEX,EACV,gBAAgB,EAChB,UAAoB,EAAE,SAAS;IAC/B,MAAsB,GACvB,EAAE;QACD,gBAAgB,EAAE,gBAAgB,CAAC;QACnC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAQK,WAAW,CAAC,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CACxE,GAAG,EAAE,CACN;CAmCF"}
1
+ {"version":3,"file":"simple-cache.d.ts","sourceRoot":"","sources":["../../src/gateways/simple-cache.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE5D,qBAAa,2BAA4B,YAAW,gBAAgB;IAClE,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,aAAa,CAAQ;IAC7B,OAAO,CAAC,MAAM,CAAS;gBAEX,EACV,gBAAgB,EAChB,UAAoB,EAAE,SAAS;IAC/B,MAAsB,GACvB,EAAE;QACD,gBAAgB,EAAE,gBAAgB,CAAC;QACnC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAQK,WAAW,CAAC,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CACxE,GAAG,EAAE,CACN;CAmCF"}
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  import { defaultLogger } from '../logger.js';
19
18
  export class SimpleCacheGatewaysProvider {
@@ -14,7 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { GatewaysProvider } from '../../types/wayfinder.js';
17
+ import type { GatewaysProvider } from '../types.js';
18
18
  export declare class StaticGatewaysProvider implements GatewaysProvider {
19
19
  private gateways;
20
20
  constructor({ gateways }: {
@@ -1 +1 @@
1
- {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../../src/gateways/static.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,qBAAa,sBAAuB,YAAW,gBAAgB;IAC7D,OAAO,CAAC,QAAQ,CAAQ;gBACZ,EAAE,QAAQ,EAAE,EAAE;QAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAE;IAI1C,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;CAGpC"}
1
+ {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../../src/gateways/static.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,qBAAa,sBAAuB,YAAW,gBAAgB;IAC7D,OAAO,CAAC,QAAQ,CAAQ;gBACZ,EAAE,QAAQ,EAAE,EAAE;QAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAE;IAI1C,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;CAGpC"}
package/dist/index.d.ts CHANGED
@@ -14,11 +14,13 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
+ export * from './types.js';
17
18
  export * from './routing/random.js';
18
19
  export * from './routing/static.js';
19
20
  export * from './routing/ping.js';
20
21
  export * from './routing/round-robin.js';
21
22
  export * from './routing/preferred-with-fallback.js';
23
+ export * from './routing/simple-cache.js';
22
24
  export * from './gateways/network.js';
23
25
  export * from './gateways/simple-cache.js';
24
26
  export * from './gateways/static.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sCAAsC,CAAC;AAGrD,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AAGrC,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AAIrD,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,cAAc,YAAY,CAAC;AAG3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAG1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AAGrC,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AAIrD,cAAc,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -14,12 +14,15 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
+ // types
18
+ export * from './types.js';
17
19
  // routing strategies
18
20
  export * from './routing/random.js';
19
21
  export * from './routing/static.js';
20
22
  export * from './routing/ping.js';
21
23
  export * from './routing/round-robin.js';
22
24
  export * from './routing/preferred-with-fallback.js';
25
+ export * from './routing/simple-cache.js';
23
26
  // gateways providers
24
27
  export * from './gateways/network.js';
25
28
  export * from './gateways/simple-cache.js';
package/dist/logger.d.ts CHANGED
@@ -14,16 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- /**
18
- * Simple logger interface that Wayfinder will use
19
- * This allows users to provide their own logger implementation
20
- */
21
- export interface Logger {
22
- debug: (message: string, ...args: any[]) => void;
23
- info: (message: string, ...args: any[]) => void;
24
- warn: (message: string, ...args: any[]) => void;
25
- error: (message: string, ...args: any[]) => void;
26
- }
17
+ import type { Logger } from './types.js';
27
18
  /**
28
19
  * Default console logger implementation
29
20
  */
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IACjD,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IAChD,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IAChD,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;CAClD;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAK3B,CAAC"}
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAK3B,CAAC"}
package/dist/logger.js CHANGED
@@ -1,3 +1,19 @@
1
+ /**
2
+ * WayFinder
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
1
17
  /**
2
18
  * Default console logger implementation
3
19
  */
@@ -1,5 +1,4 @@
1
- import { RoutingStrategy } from '../../types/wayfinder.js';
2
- import { Logger } from '../logger.js';
1
+ import type { Logger, RoutingStrategy } from '../types.js';
3
2
  export declare class FastestPingRoutingStrategy implements RoutingStrategy {
4
3
  private timeoutMs;
5
4
  private logger;
@@ -1 +1 @@
1
- {"version":3,"file":"ping.d.ts","sourceRoot":"","sources":["../../src/routing/ping.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAiB,MAAM,cAAc,CAAC;AAErD,qBAAa,0BAA2B,YAAW,eAAe;IAChE,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,cAAc,CAAS;gBAEnB,EACV,SAAe,EACf,cAAmB,EACnB,MAAsB,GACvB,GAAE;QACD,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,MAAM,CAAC,EAAE,MAAM,CAAC;KACZ;IAMA,aAAa,CAAC,EAClB,QAAQ,EACR,IAAS,EACT,SAAS,GACV,EAAE;QACD,QAAQ,EAAE,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,GAAG,CAAC;CA+DjB"}
1
+ {"version":3,"file":"ping.d.ts","sourceRoot":"","sources":["../../src/routing/ping.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE3D,qBAAa,0BAA2B,YAAW,eAAe;IAChE,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,cAAc,CAAS;gBAEnB,EACV,SAAe,EACf,cAAmB,EACnB,MAAsB,GACvB,GAAE;QACD,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,MAAM,CAAC,EAAE,MAAM,CAAC;KACZ;IAMA,aAAa,CAAC,EAClB,QAAQ,EACR,IAAS,EACT,SAAS,GACV,EAAE;QACD,QAAQ,EAAE,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,GAAG,CAAC;CA+DjB"}
@@ -14,8 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { RoutingStrategy } from '../../types/wayfinder.js';
18
- import { Logger } from '../logger.js';
17
+ import type { Logger, RoutingStrategy } from '../types.js';
19
18
  export declare class PreferredWithFallbackRoutingStrategy implements RoutingStrategy {
20
19
  readonly name = "preferred-with-fallback";
21
20
  private preferredGateway;
@@ -1 +1 @@
1
- {"version":3,"file":"preferred-with-fallback.d.ts","sourceRoot":"","sources":["../../src/routing/preferred-with-fallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAiB,MAAM,cAAc,CAAC;AAGrD,qBAAa,oCAAqC,YAAW,eAAe;IAC1E,SAAgB,IAAI,6BAA6B;IACjD,OAAO,CAAC,gBAAgB,CAAM;IAC9B,OAAO,CAAC,gBAAgB,CAAkB;IAC1C,OAAO,CAAC,MAAM,CAAS;gBAEX,EACV,gBAAgB,EAChB,gBAAmD,EACnD,MAAsB,GACvB,EAAE;QACD,gBAAgB,EAAE,MAAM,CAAC;QACzB,gBAAgB,CAAC,EAAE,eAAe,CAAC;QACnC,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAMK,aAAa,CAAC,EAClB,QAAa,EACb,IAAS,EACT,SAAS,GACV,EAAE;QACD,QAAQ,EAAE,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,GAAG,CAAC;CA6CjB"}
1
+ {"version":3,"file":"preferred-with-fallback.d.ts","sourceRoot":"","sources":["../../src/routing/preferred-with-fallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG3D,qBAAa,oCAAqC,YAAW,eAAe;IAC1E,SAAgB,IAAI,6BAA6B;IACjD,OAAO,CAAC,gBAAgB,CAAM;IAC9B,OAAO,CAAC,gBAAgB,CAAkB;IAC1C,OAAO,CAAC,MAAM,CAAS;gBAEX,EACV,gBAAgB,EAChB,gBAAmD,EACnD,MAAsB,GACvB,EAAE;QACD,gBAAgB,EAAE,MAAM,CAAC;QACzB,gBAAgB,CAAC,EAAE,eAAe,CAAC;QACnC,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAMK,aAAa,CAAC,EAClB,QAAa,EACb,IAAS,EACT,SAAS,GACV,EAAE;QACD,QAAQ,EAAE,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,GAAG,CAAC;CA6CjB"}
@@ -1,3 +1,19 @@
1
+ /**
2
+ * WayFinder
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
1
17
  import { defaultLogger } from '../logger.js';
2
18
  import { FastestPingRoutingStrategy } from './ping.js';
3
19
  export class PreferredWithFallbackRoutingStrategy {
@@ -14,7 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { RoutingStrategy } from '../../types/wayfinder.js';
17
+ import type { RoutingStrategy } from '../types.js';
18
18
  export declare class RandomRoutingStrategy implements RoutingStrategy {
19
19
  selectGateway({ gateways, }: {
20
20
  gateways: URL[];
@@ -1 +1 @@
1
- {"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src/routing/random.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,qBAAa,qBAAsB,YAAW,eAAe;IACrD,aAAa,CAAC,EAClB,QAAQ,GACT,EAAE;QACD,QAAQ,EAAE,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,GAAG,CAAC;CAMjB"}
1
+ {"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src/routing/random.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGnD,qBAAa,qBAAsB,YAAW,eAAe;IACrD,aAAa,CAAC,EAClB,QAAQ,GACT,EAAE;QACD,QAAQ,EAAE,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,GAAG,CAAC;CAMjB"}
@@ -14,25 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { RoutingStrategy } from '../../types/wayfinder.js';
18
- /**
19
- * WayFinder
20
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
21
- *
22
- * This program is free software: you can redistribute it and/or modify
23
- * it under the terms of the GNU Affero General Public License as published by
24
- * the Free Software Foundation, either version 3 of the License, or
25
- * (at your option) any later version.
26
- *
27
- * This program is distributed in the hope that it will be useful,
28
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
29
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30
- * GNU Affero General Public License for more details.
31
- *
32
- * You should have received a copy of the GNU Affero General Public License
33
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
34
- */
35
- import { Logger } from '../logger.js';
17
+ import type { Logger, RoutingStrategy } from '../types.js';
36
18
  export declare class RoundRobinRoutingStrategy implements RoutingStrategy {
37
19
  readonly name = "round-robin";
38
20
  private gateways;
@@ -1 +1 @@
1
- {"version":3,"file":"round-robin.d.ts","sourceRoot":"","sources":["../../src/routing/round-robin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,MAAM,EAAiB,MAAM,cAAc,CAAC;AAErD,qBAAa,yBAA0B,YAAW,eAAe;IAC/D,SAAgB,IAAI,iBAAiB;IACrC,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,MAAM,CAAS;gBAEX,EACV,QAAQ,EACR,MAAsB,GACvB,EAAE;QACD,QAAQ,EAAE,GAAG,EAAE,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAOK,aAAa,CAAC,EAClB,QAAa,GACd,GAAE;QACD,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,GAAG,CAAC;CActB"}
1
+ {"version":3,"file":"round-robin.d.ts","sourceRoot":"","sources":["../../src/routing/round-robin.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE3D,qBAAa,yBAA0B,YAAW,eAAe;IAC/D,SAAgB,IAAI,iBAAiB;IACrC,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,MAAM,CAAS;gBAEX,EACV,QAAQ,EACR,MAAsB,GACvB,EAAE;QACD,QAAQ,EAAE,GAAG,EAAE,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAOK,aAAa,CAAC,EAClB,QAAa,GACd,GAAE;QACD,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,GAAG,CAAC;CActB"}
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  import { defaultLogger } from '../logger.js';
19
18
  export class RoundRobinRoutingStrategy {
@@ -0,0 +1,37 @@
1
+ /**
2
+ * WayFinder
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type { Logger, RoutingStrategy } from '../types.js';
18
+ export declare class SimpleCacheRoutingStrategy implements RoutingStrategy {
19
+ readonly name = "simple-cache";
20
+ private routingStrategy;
21
+ private ttlSeconds;
22
+ private lastUpdated;
23
+ private cachedGateway;
24
+ private logger;
25
+ constructor({ routingStrategy, ttlSeconds, // 1 hour
26
+ logger, }: {
27
+ routingStrategy: RoutingStrategy;
28
+ ttlSeconds?: number;
29
+ logger?: Logger;
30
+ });
31
+ selectGateway(params: {
32
+ gateways: URL[];
33
+ path?: string;
34
+ subdomain?: string;
35
+ }): Promise<URL>;
36
+ }
37
+ //# sourceMappingURL=simple-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simple-cache.d.ts","sourceRoot":"","sources":["../../src/routing/simple-cache.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE3D,qBAAa,0BAA2B,YAAW,eAAe;IAChE,SAAgB,IAAI,kBAAkB;IACtC,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,aAAa,CAAa;IAClC,OAAO,CAAC,MAAM,CAAS;gBAEX,EACV,eAAe,EACf,UAAoB,EAAE,SAAS;IAC/B,MAAsB,GACvB,EAAE;QACD,eAAe,EAAE,eAAe,CAAC;QACjC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAQK,aAAa,CAAC,MAAM,EAAE;QAC1B,QAAQ,EAAE,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,GAAG,CAAC;CA4CjB"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * WayFinder
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { defaultLogger } from '../logger.js';
18
+ export class SimpleCacheRoutingStrategy {
19
+ name = 'simple-cache';
20
+ routingStrategy;
21
+ ttlSeconds;
22
+ lastUpdated;
23
+ cachedGateway;
24
+ logger;
25
+ constructor({ routingStrategy, ttlSeconds = 60 * 60, // 1 hour
26
+ logger = defaultLogger, }) {
27
+ this.routingStrategy = routingStrategy;
28
+ this.ttlSeconds = ttlSeconds;
29
+ this.lastUpdated = 0;
30
+ this.cachedGateway = null;
31
+ this.logger = logger;
32
+ }
33
+ async selectGateway(params) {
34
+ const now = Date.now();
35
+ if (this.cachedGateway === null ||
36
+ now - this.lastUpdated > this.ttlSeconds * 1000) {
37
+ try {
38
+ this.logger.debug('Cache expired, selecting new gateway', {
39
+ cacheAge: now - this.lastUpdated,
40
+ ttlSeconds: this.ttlSeconds,
41
+ });
42
+ // preserve the cache if the selection fails
43
+ const selectedGateway = await this.routingStrategy.selectGateway(params);
44
+ this.cachedGateway = selectedGateway;
45
+ this.lastUpdated = now;
46
+ this.logger.debug('Updated gateway cache', {
47
+ selectedGateway: selectedGateway.toString(),
48
+ });
49
+ }
50
+ catch (error) {
51
+ this.logger.error('Failed to select gateway', {
52
+ error: error.message,
53
+ stack: error.stack,
54
+ });
55
+ // If we have a cached gateway, return it even if expired
56
+ if (this.cachedGateway !== null) {
57
+ this.logger.warn('Returning expired cached gateway due to selection failure');
58
+ return this.cachedGateway;
59
+ }
60
+ throw error;
61
+ }
62
+ }
63
+ else {
64
+ this.logger.debug('Using cached gateway', {
65
+ cacheAge: now - this.lastUpdated,
66
+ ttlSeconds: this.ttlSeconds,
67
+ cachedGateway: this.cachedGateway.toString(),
68
+ });
69
+ }
70
+ return this.cachedGateway;
71
+ }
72
+ }
@@ -14,25 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { RoutingStrategy } from '../../types/wayfinder.js';
18
- /**
19
- * WayFinder
20
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
21
- *
22
- * This program is free software: you can redistribute it and/or modify
23
- * it under the terms of the GNU Affero General Public License as published by
24
- * the Free Software Foundation, either version 3 of the License, or
25
- * (at your option) any later version.
26
- *
27
- * This program is distributed in the hope that it will be useful,
28
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
29
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30
- * GNU Affero General Public License for more details.
31
- *
32
- * You should have received a copy of the GNU Affero General Public License
33
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
34
- */
35
- import { Logger } from '../logger.js';
17
+ import type { Logger, RoutingStrategy } from '../types.js';
36
18
  export declare class StaticRoutingStrategy implements RoutingStrategy {
37
19
  readonly name = "static";
38
20
  private gateway;
@@ -1 +1 @@
1
- {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../../src/routing/static.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,MAAM,EAAiB,MAAM,cAAc,CAAC;AAErD,qBAAa,qBAAsB,YAAW,eAAe;IAC3D,SAAgB,IAAI,YAAY;IAChC,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,MAAM,CAAS;gBAEX,EACV,OAAO,EACP,MAAsB,GACvB,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAOK,aAAa,CAAC,EAClB,QAAa,GACd,GAAE;QACD,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,GAAG,CAAC;CAYtB"}
1
+ {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../../src/routing/static.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE3D,qBAAa,qBAAsB,YAAW,eAAe;IAC3D,SAAgB,IAAI,YAAY;IAChC,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,MAAM,CAAS;gBAEX,EACV,OAAO,EACP,MAAsB,GACvB,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAOK,aAAa,CAAC,EAClB,QAAa,GACd,GAAE;QACD,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,GAAG,CAAC;CAYtB"}
@@ -1,19 +1,18 @@
1
1
  /**
2
2
  * WayFinder
3
- * Copyright (C) 2022-2025 Permanent Data Solutions, Inc. All Rights Reserved.
3
+ * Copyright (C) 2022-2025 Permanent Data Solutions, Inc.
4
4
  *
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU Affero General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
9
8
  *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
9
+ * http://www.apache.org/licenses/LICENSE-2.0
14
10
  *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
17
16
  */
18
17
  import { defaultLogger } from '../logger.js';
19
18
  export class StaticRoutingStrategy {