{"version":3,"file":"c8y-ngx-components-widgets-import-export-config.mjs","sources":["../../widgets/import-export-config/shared-helpers.ts","../../widgets/import-export-config/device-import-export.ts","../../widgets/import-export-config/target-import-export-types.ts","../../widgets/import-export-config/target-transformers.ts","../../widgets/import-export-config/config-target-export.ts","../../widgets/import-export-config/config-target-import.ts","../../widgets/import-export-config/c8y-ngx-components-widgets-import-export-config.ts"],"sourcesContent":["import { inject, Injector } from '@angular/core';\nimport { IdentityService, IExternalIdentity, IManagedObject, InventoryService } from '@c8y/client';\n\nexport type ExportedAsset = IManagedObject & {\n  externalIdentity: IExternalIdentity;\n};\n\nexport type ImportedAsset = IManagedObject & {\n  suggestedDevice: IManagedObject | null;\n};\n\nexport async function getExternalIdentityByTargetId(\n  targetId: string | number,\n  identityService: IdentityService\n): Promise<IExternalIdentity> {\n  const targetExternalIds = await identityService.list(`${targetId}`);\n  return targetExternalIds.data[0] as IExternalIdentity;\n}\n\nexport async function targetDetails(\n  targetId: string | number,\n  inventoryService: InventoryService\n): Promise<IManagedObject> {\n  const targetDetails = await inventoryService.detail(targetId);\n  return targetDetails.data;\n}\n\nexport async function resolveSuggestedAsset(\n  exportedDevice: ExportedAsset,\n  contextDevice: IManagedObject\n): Promise<IManagedObject | null> {\n  // 1. check if the exported device is of the same type as the context device\n  if (exportedDevice.type === contextDevice.type) {\n    return contextDevice;\n  }\n\n  const injector = inject(Injector);\n  const identityService = injector.get(IdentityService);\n  const contextAssetExternalIdentity = await getExternalIdentityByTargetId(\n    contextDevice.id,\n    identityService\n  );\n  // 2. check if the exported device has the same externalId as the context device\n  if (contextAssetExternalIdentity?.externalId === exportedDevice.externalIdentity?.externalId) {\n    return contextDevice;\n  }\n  // 3. If context device is a group, check if the exported device is a child of the context asset\n  if (contextDevice.c8y_IsDeviceGroup) {\n    const inventoryService = injector.get(InventoryService);\n    const children = (await inventoryService.childAssetsList(contextDevice.id, { pageSize: 100 }))\n      .data;\n    const matchingChild: IManagedObject = children.find((child: IManagedObject) => {\n      return child.id === exportedDevice.id && child.type === exportedDevice.type;\n    });\n    return matchingChild || null;\n  }\n\n  return null;\n}\n","import { inject, Injector } from '@angular/core';\nimport { IdentityService, IManagedObject, InventoryService } from '@c8y/client';\nimport {\n  ExportedAsset,\n  getExternalIdentityByTargetId,\n  ImportedAsset,\n  resolveSuggestedAsset,\n  targetDetails\n} from './shared-helpers';\nimport type { DashboardMetadata } from '@c8y/ngx-components/context-dashboard';\nimport type { WidgetImportExportInjectorOptions } from '@c8y/ngx-components';\n\n/**\n * Interface for any configuration that has a device property\n */\nexport interface ConfigWithAsset {\n  device?: IManagedObject | null;\n  [key: string]: any;\n}\n\n/**\n * Configuration with exported asset information\n */\nexport type ExportedConfigWithAsset<T extends ConfigWithAsset = ConfigWithAsset> = Omit<\n  T,\n  'device'\n> & {\n  device?: ExportedAsset | null;\n};\n\n/**\n * Configuration with imported asset information\n */\nexport type ImportedConfigWithAsset<T extends ConfigWithAsset = ConfigWithAsset> = Omit<\n  T,\n  'device'\n> & {\n  device?: ImportedAsset | null;\n};\n\n/**\n * Check if a configuration has a valid device property\n */\nexport function hasAssetProperty(config: any): config is ConfigWithAsset {\n  return config && 'device' in config && config.device !== null && config.device !== undefined;\n}\n\n/**\n * Creates a device with external identity information\n */\nasync function createExportedAsset(\n  device: IManagedObject,\n  identityService: IdentityService,\n  inventoryService: InventoryService\n): Promise<ExportedAsset> {\n  const deviceDetails = await targetDetails(device.id, inventoryService);\n  const externalIdentity = await getExternalIdentityByTargetId(device.id, identityService);\n  return { ...deviceDetails, externalIdentity };\n}\n\n/**\n * Exports a configuration with asset information enriched for export\n */\nexport async function exportConfigWithDevice<T extends ConfigWithAsset>(\n  config: T,\n  _dashboardData: DashboardMetadata,\n  _options: WidgetImportExportInjectorOptions\n): Promise<ExportedConfigWithAsset<T>> {\n  const injector = inject(Injector);\n  const identityService = injector.get(IdentityService);\n  const inventoryService = injector.get(InventoryService);\n\n  // Create a new config object with all properties\n  const exportedConfig = { ...config } as any;\n\n  if (hasAssetProperty(config) && config.device?.id) {\n    exportedConfig.device = await createExportedAsset(\n      config.device,\n      identityService,\n      inventoryService\n    );\n  } else {\n    // If there's no device or no device.id, maintain the null/undefined\n    exportedConfig.device = config.device;\n  }\n\n  return exportedConfig as ExportedConfigWithAsset<T>;\n}\n\n/**\n * Imports a configuration with asset information adapted to the current context\n */\nexport async function importConfigWithDevice<T extends ConfigWithAsset>(\n  config: ExportedConfigWithAsset<T>,\n  dashboardData: DashboardMetadata,\n  _options: WidgetImportExportInjectorOptions\n): Promise<ImportedConfigWithAsset<T>> {\n  // Create a new config object with all properties\n  const importedConfig = { ...config } as any;\n\n  if (config.device && 'externalIdentity' in config.device) {\n    const suggestedDevice = await resolveSuggestedAsset(config.device, dashboardData.context);\n\n    // Remove externalIdentity and add suggestedDevice\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    const { externalIdentity, ...deviceWithoutExternalId } = config.device;\n    importedConfig.device = { ...deviceWithoutExternalId, suggestedDevice };\n  } else {\n    // If the device doesn't have externalIdentity, maintain it as is\n    importedConfig.device = config.device;\n  }\n\n  return importedConfig as ImportedConfigWithAsset<T>;\n}\n","import { IIdentified } from '@c8y/client';\nimport { ExportedAsset, ImportedAsset } from './shared-helpers';\n\n/**\n * Type for any object that has a __target property\n */\nexport interface WithTarget {\n  __target: IIdentified | null;\n  [key: string]: any;\n}\n\n/**\n * Represents a target-based object with export information\n */\nexport type ExportedTargetObject<T extends WithTarget = WithTarget> = Omit<T, '__target'> & {\n  __target: ExportedAsset;\n};\n\n/**\n * Represents a target-based object with import information\n */\nexport type ImportedTargetObject<T extends WithTarget = WithTarget> = Omit<T, '__target'> & {\n  __target: ImportedAsset;\n};\n\n/**\n * Helper type to identify arrays of objects with __target property\n */\nexport type TargetObjectArray = WithTarget[];\n\n/**\n * Transforms a type to replace arrays of objects with __target property to ExportedTargetObject[]\n */\nexport type WithExportedTargets<T> = {\n  [K in keyof T]: T[K] extends TargetObjectArray ? ExportedTargetObject<T[K][number]>[] : T[K];\n};\n\n/**\n * Transforms a type to replace arrays of objects with __target property to ImportedTargetObject[]\n */\nexport type WithImportedTargets<T> = {\n  [K in keyof T]: T[K] extends TargetObjectArray ? ImportedTargetObject<T[K][number]>[] : T[K];\n};\n\n/**\n * Generic config type that can have any properties with target objects\n */\nexport interface ConfigWithTargets {\n  [key: string]: any;\n}\n\n/**\n * Configuration type with target objects prepared for export\n */\nexport type ExportedConfigWithTargets<T extends ConfigWithTargets = ConfigWithTargets> =\n  WithExportedTargets<T>;\n\n/**\n * Configuration type with target objects prepared for import\n */\nexport type ImportedConfigWithTargets<T extends ConfigWithTargets = ConfigWithTargets> =\n  WithImportedTargets<T>;\n\n/**\n * Helper function to check if a value is an array of objects with __target property\n */\nexport function isTargetObjectArray(value: any): value is TargetObjectArray {\n  return (\n    Array.isArray(value) &&\n    value.length > 0 &&\n    typeof value[0] === 'object' &&\n    value[0] !== null &&\n    '__target' in value[0]\n  );\n}\n\n/**\n * Find all property names in an object that contain arrays of objects with __target property\n */\nexport function findTargetArrayProperties(config: ConfigWithTargets): string[] {\n  return Object.entries(config)\n    .filter(([_, value]) => isTargetObjectArray(value))\n    .map(([key]) => key);\n}\n","import { IdentityService, IManagedObject, InventoryService } from '@c8y/client';\nimport {\n  getExternalIdentityByTargetId,\n  resolveSuggestedAsset,\n  targetDetails\n} from './shared-helpers';\nimport {\n  WithTarget,\n  ExportedTargetObject,\n  ImportedTargetObject\n} from './target-import-export-types';\n\n/**\n * Transforms a single target object for export\n */\nexport async function createExportedTargetObject<T extends WithTarget>(\n  targetObject: T,\n  identityService: IdentityService,\n  inventoryService: InventoryService\n): Promise<ExportedTargetObject<T>> {\n  if (!targetObject.__target?.id) {\n    return {\n      ...targetObject,\n      __target: null as any // Handle null case\n    } as ExportedTargetObject<T>;\n  }\n\n  const externalIdentity = await getExternalIdentityByTargetId(\n    targetObject.__target.id,\n    identityService\n  );\n  const details = await targetDetails(targetObject.__target.id, inventoryService);\n\n  return {\n    ...targetObject,\n    __target: {\n      ...details,\n      externalIdentity\n    }\n  } as ExportedTargetObject<T>;\n}\n\n/**\n * Transforms a single exported target object for import\n */\nexport async function createImportedTargetObject<T extends WithTarget>(\n  exportedTargetObject: ExportedTargetObject<T>,\n  context: IManagedObject\n): Promise<ImportedTargetObject<T>> {\n  if (!exportedTargetObject.__target) {\n    return {\n      ...exportedTargetObject,\n      __target: {\n        suggestedDevice: null\n      } as any\n    } as ImportedTargetObject<T>;\n  }\n\n  const suggestedDevice = await resolveSuggestedAsset(exportedTargetObject.__target, context);\n\n  // Create a new object without externalIdentity\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  const { externalIdentity, ...targetWithoutExternalId } = exportedTargetObject.__target;\n\n  return {\n    ...exportedTargetObject,\n    __target: {\n      ...targetWithoutExternalId,\n      suggestedDevice\n    }\n  } as ImportedTargetObject<T>;\n}\n\n/**\n * Transforms an array of target objects for export\n */\nexport async function processTargetArrayToExport<T extends WithTarget>(\n  targetObjects: T[] | undefined = [],\n  identityService: IdentityService,\n  inventoryService: InventoryService\n): Promise<ExportedTargetObject<T>[]> {\n  if (!targetObjects || !Array.isArray(targetObjects)) {\n    return [];\n  }\n\n  return Promise.all(\n    targetObjects.map(obj => createExportedTargetObject(obj, identityService, inventoryService))\n  );\n}\n\n/**\n * Transforms an array of exported target objects for import\n */\nexport async function processExportedTargetArray<T extends WithTarget>(\n  targetObjects: ExportedTargetObject<T>[] | undefined = [],\n  context: IManagedObject\n): Promise<ImportedTargetObject<T>[]> {\n  if (!targetObjects || !Array.isArray(targetObjects)) {\n    return [];\n  }\n\n  return Promise.all(targetObjects.map(obj => createImportedTargetObject(obj, context)));\n}\n","import { inject, Injector } from '@angular/core';\nimport { IdentityService, InventoryService } from '@c8y/client';\nimport {\n  ConfigWithTargets,\n  ExportedConfigWithTargets,\n  findTargetArrayProperties\n} from './target-import-export-types';\nimport { processTargetArrayToExport } from './target-transformers';\nimport type { WidgetImportExportInjectorOptions } from '@c8y/ngx-components';\nimport type { DashboardMetadata } from '@c8y/ngx-components/context-dashboard';\n\n/**\n * Exports widget configuration with all target objects transformed for export\n */\nexport async function exportConfigWithTargets<T extends ConfigWithTargets>(\n  config: T,\n  _dashboardData: DashboardMetadata,\n  _options: WidgetImportExportInjectorOptions\n): Promise<ExportedConfigWithTargets<T>> {\n  const injector = inject(Injector);\n  const identityService = injector.get(IdentityService);\n  const inventoryService = injector.get(InventoryService);\n\n  // Find all properties with target arrays\n  const targetArrayProperties = findTargetArrayProperties(config);\n\n  if (targetArrayProperties.length === 0) {\n    return config as ExportedConfigWithTargets<T>;\n  }\n\n  // Create a new object with all properties from the original config\n  const exportedConfig = { ...config } as Record<string, any>;\n\n  // Process each target array property\n  await Promise.all(\n    targetArrayProperties.map(async prop => {\n      exportedConfig[prop] = await processTargetArrayToExport(\n        config[prop],\n        identityService,\n        inventoryService\n      );\n    })\n  );\n\n  return exportedConfig as ExportedConfigWithTargets<T>;\n}\n","import type { DashboardMetadata } from '@c8y/ngx-components/context-dashboard';\nimport {\n  ConfigWithTargets,\n  ExportedConfigWithTargets,\n  findTargetArrayProperties,\n  ImportedConfigWithTargets\n} from './target-import-export-types';\nimport { processExportedTargetArray } from './target-transformers';\nimport type { WidgetImportExportInjectorOptions } from '@c8y/ngx-components';\n\n/**\n * Imports widget configuration with all target objects transformed for the current context\n */\nexport async function importConfigWithTargets<T extends ConfigWithTargets>(\n  config: ExportedConfigWithTargets<T>,\n  dashboardData: DashboardMetadata,\n  _options: WidgetImportExportInjectorOptions\n): Promise<ImportedConfigWithTargets<T>> {\n  // Find all properties with target arrays\n  const targetArrayProperties = findTargetArrayProperties(config);\n\n  if (targetArrayProperties.length === 0) {\n    return config as ImportedConfigWithTargets<T>;\n  }\n\n  // Create a new object with all properties from the original config\n  const importedConfig = { ...config } as Record<string, any>;\n\n  // Process each target array property\n  await Promise.all(\n    targetArrayProperties.map(async prop => {\n      importedConfig[prop] = await processExportedTargetArray(config[prop], dashboardData.context);\n    })\n  );\n\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