Skip to content

Latest commit

 

History

History
387 lines (247 loc) · 21.3 KB

File metadata and controls

387 lines (247 loc) · 21.3 KB

@dgac/nmb2b-client

3.0.0

Major Changes

Patch Changes

2.2.7

Patch Changes

2.2.6

Patch Changes

2.2.5

Patch Changes

2.2.4

Patch Changes

2.2.3

Patch Changes

  • #251 0ab9490 Thanks @kouak! - chore: update dependencies
    • axios: 1.13.2 -> 1.13.4
    • remeda: 2.32.0 -> 2.33.4
    • soap: 1.6.1 -> 1.6.4
    • tar: 7.5.6 -> 7.5.7
    • type-fest: 5.3.1 -> 5.4.2

2.2.2

Patch Changes

2.2.1

Patch Changes

2.2.0

Minor Changes

  • #231 a0d26bd Thanks @kouak! - Corrected typos and type errors across multiple domain definitions to strictly align with Eurocontrol NM B2B v27.0.0 Business Documentation and XSD schemas.

    Modified types:

    • AlternativeRouteInfo
    • AUPSummary
    • CapacityPlanRetrievalRequest
    • CapacityPlans
    • CompleteAIXMDatasetRequest
    • Flight
    • FlightField
    • FlightListByAirspaceRequest
    • FlightRetrievalReplyData
    • HotspotPlans
    • IRegulationOrMCDMOnly
    • OTMVPlanRetrievalRequest
    • OTMVPlans
    • Regulation
    • ReroutingOpportunities
    • SignedDistanceNM
    • SignedDurationHourMinute
  • #235 340091b Thanks @kouak! - - Refactor configuration validation using assertion functions.

    • Rename getEndpoint to getSoapEndpoint.
    • Deprecate isConfigValid, isValidSecurity, and getEndpoint.
    • Enforce strict xsdEndpoint requirement when using custom endpoints.
    • Add TSDoc to public API.

Patch Changes

  • #240 2109151 Thanks @kouak! - Added internal testing utilities for fixture-based SOAP testing.

    Fixtures capture real SOAP interactions and store them as reproducible test artifacts (XML requests/responses with context variables). These artifacts enable deterministic unit testing without requiring a live B2B connection.

  • #229 72bc9e2 Thanks @kouak! - Implement isolated WSDL caching for custom xsdEndpoint configurations.

    • Feature: When xsdEndpoint is configured, WSDL files are now stored in a unique cache directory derived from the endpoint URL. This prevents cache corruption when switching between different sources (e.g. official NM B2B vs internal proxy).
    • Migration: The default cache directory (used when no xsdEndpoint is provided) has been renamed from {version} to {version}-network-manager to ensure isolation from legacy caches. This will trigger a one-time automatic re-download of WSDL files.
  • #228 d4ebb33 Thanks @kouak! - Ensure valid http response headers for WSDL download

  • #226 5b18de0 Thanks @kouak! - Improved error handling for SOAP queries: unexpected errors thrown during SOAP query execution are now wrapped in a standard Error object. This new error includes a descriptive message identifying the failing service and query (e.g., [Query service.query] Error thrown during query execution...) and preserves the original error as the cause.

2.1.3

Patch Changes

  • #222 10b5b56 Thanks @kouak! - Fix typescript types to allow passing node-soap options to NM B2B query functions

2.1.2

Patch Changes

2.1.1

Patch Changes

  • #214 0305896 Thanks @kouak! - Update dependencies :
    • axios v1.13.2
    • soap v1.6.0
    • type-fest v5.2.0

2.1.0

Minor Changes

  • #210 4f898e5 Thanks @kouak! - Rework B2B input types to accept Request parameters (endUserId, onBehalfOfUnit)

  • #207 39d7fe5 Thanks @kouak! - Implement query hooks.

    Hooks are user provided callbacks which will be executed during the SOAP query process.

    Basic example :

    const client = await createB2BClient({
      // ... other options,
      hooks: [
        function onRequestStart({ service, query, input }) {
          console.log(
            `Query ${query} of service ${service} was invoked with input`,
            input,
          );
        },
      ],
    });

    A hook can return an optional object containing success / error hooks :

    const client = await createB2BClient({
      // ... other options,
      hooks: [
        function onRequestStart({ service, query, input }) {
          const startTime = new Date();
    
          console.log(
            `Query ${query} of service ${service} was invoked with input:`,
            input,
          );
    
          return {
            onRequestSuccess: ({ response }) => {
              const durationMs = new Date().valueOf() - startTime;
              console.log(`Query took ${durationMs}ms`);
              console.log(`Query responded with`, response);
            },
            onRequestError: ({ error }) => {
              const durationMs = new Date().valueOf() - startTime;
              console.log(`Query took ${durationMs}ms`);
              console.log(`Query failed with error ${error.message}`);
            },
          };
        },
      ],
    });

    Hooks can also be async :

    const client = await createB2BClient({
      // ... other options,
      hooks: [
        async function onRequestStart({ service, query, input }) {
          await sendLog(`Query ${query} of service ${service} was invoked`);
        },
      ],
    });

    To get proper typescript support when creating custom hooks, a createHook() function helper is now exported :

    import { createHook } from '@dgac/nmb2b-client';
    
    const withPrometheusMetrics = createHook(({ service, query }) => {
      prometheusCounter.inc({ service, query, status: 'started' });
    
      return {
        onRequestSuccess: () =>
          prometheusCounter.inc({ service, query, status: 'completed' }),
        onRequestError: () =>
          prometheusCounter.inc({ service, query, status: 'completed' }),
      };
    });
    
    // ... in another file
    
    const b2bClient = await createB2BClient({
      // ... other options
      hooks: [withPrometheusMetrics],
    });

Patch Changes

  • #212 39f162f Thanks @kouak! - Document createClient() options and Config properties.

  • #211 f3ead5a Thanks @kouak! - Refactor internals with a declarative API which makes it easier to implement new Request/Reply queries

  • #208 6b8cd4c Thanks @kouak! - Fix incorrect optionnal arguments on some B2B queries

  • #205 6f53edb Thanks @kouak! - Update dependencies

2.0.0

Major Changes

  • #194 98b4031 Thanks @kouak! - - Rename make*Client to create*Client
    • Change export paths:
      • @dgac/nmb2b-client exports B2B client builders
      • @dgac/nmb2b-client/config exports utilities to check the B2B client builder configuration
      • @dgac/nmb2b-client/security exports utilities to create the security object required by a B2B client builder @dgac/nmb2b-client/types exports typescript types representing the XSD types defined in the B2B XSD
    • Drop node v18 support, test against node 24
    • Publish as ESM only package (with correct module-sync resolution for usage in commonjs context)
    • Migrate build to tsdown

1.5.1

Patch Changes

1.5.0

Minor Changes

  • #195 98c6e30 Thanks @kouak! - Implement compatibility with typescript moduleResolution: nodenext

Patch Changes

1.4.0

Minor Changes

  • #163 28b3764 Thanks @kouak! - Removed extraneous exports for old PublishSubscribe API from package.json. Fix invalid export for utils in CommonJS environment. Fix package.json#repository property.

Patch Changes

1.3.1

Patch Changes

  • #160 f872768 Thanks @kouak! - Remove unused dotenv/config import from config.ts

  • #161 fb8297d Thanks @kouak! - Fix tests failing when a flight returned by queryFlightsBy* has a non ICAO aerodrome of departure or destination

1.3.0

Minor Changes

1.2.1

Patch Changes

  • #156 222fb69 Thanks @kouak! - All B2B types are now exported.

    Fix AUPSummary.notes typing.

1.2.0

Minor Changes

  • #152 efc9f0a Thanks @kouak! - Safer B2B response types.

    Typings will now contain null | undefined when there's a risk a partial deserialization.

    A type helper SafeB2BDeserializedResponse is now exported, and will apply a safe type transformation to any typed exported from @dgac/nmb2b-client/*/types.

    See DGAC#149 for more information.

1.1.0

Minor Changes

1.0.2

Patch Changes

1.0.1

Patch Changes

1.0.0

Minor Changes