UNPKG

@dgac/nmb2b-client

Version:

EUROCONTROL Network Manager B2B SOAP client

1 lines 1.69 kB
{"version":3,"file":"retrieveSectorConfigurationPlan.mjs","names":[],"sources":["../../src/Flow/retrieveSectorConfigurationPlan.ts"],"sourcesContent":["import type { AirspaceId } from '../Airspace/types.js';\nimport type { SafeB2BDeserializedResponse } from '../types.js';\nimport { createSoapQueryDefinition } from '../utils/soap-query-definition.js';\nimport type {\n KnownConfigurations,\n SectorConfigurationId,\n SectorConfigurationPlanRetrievalReply,\n SectorConfigurationPlanRetrievalRequest,\n} from './types.js';\n\nexport const retrieveSectorConfigurationPlan = createSoapQueryDefinition<\n SectorConfigurationPlanRetrievalRequest,\n SectorConfigurationPlanRetrievalReply\n>({\n service: 'Flow',\n query: 'retrieveSectorConfigurationPlan',\n getSchema: (client) =>\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access\n client.describe().TacticalUpdatesService.TacticalUpdatesPort\n .retrieveSectorConfigurationPlan.input,\n});\n\nexport function knownConfigurationsToMap(\n knownConfigurations:\n | undefined\n | null\n | SafeB2BDeserializedResponse<KnownConfigurations>\n | KnownConfigurations,\n): Map<SectorConfigurationId, AirspaceId[]> {\n if (!knownConfigurations?.item) {\n return new Map();\n }\n\n const { item } = knownConfigurations;\n\n const map: Map<SectorConfigurationId, AirspaceId[]> = new Map();\n item.forEach(({ key, value }) => {\n if (!value?.item) {\n return;\n }\n\n map.set(key, value.item);\n });\n\n return map;\n}\n"],"mappings":";;;AAUA,MAAa,kCAAkC,0BAG7C;CACA,SAAS;CACT,OAAO;CACP,YAAY,WAEV,OAAO,UAAU,CAAC,uBAAuB,oBACtC,gCAAgC;CACtC,CAAC"}