Function extractProductId

  • Extracts product IDs and versioned product IDs from a given source.

    This function handles three types of input:

    • If the source is a string, it parses the serial number to extract both productId and versionedProductId.
    • If the source is a HardwareDescription, it extracts the productId, versionedProductId, deviceProductId, and versionedDeviceProductId from either the device or assembly information.
    • If the source is a StackInfo, it parses the stack_serial_number to extract the productId and versionedProductId.

    Returns

    An object containing the following properties:

    • deviceProductId: The ID of the device.
    • productId: The general product ID.
    • versionedDeviceProductId: The device ID with version.
    • versionedProductId: The general product ID with version.

    Throws

    Throws an error if the source is of an invalid type.

    Parameters

    • source: string | StackInfo | HardwareDescription

      The source from which to extract the product information. It can be a string, StackInfo, or HardwareDescription.

    Returns {
        deviceProductId: string;
        productId: string;
        versionedDeviceProductId: string;
        versionedProductId: string;
    }

    • deviceProductId: string
    • productId: string
    • versionedDeviceProductId: string
    • versionedProductId: string

Generated using TypeDoc