NDEx JavaScript Client API Reference - v0.6.0-alpha.5
    Preparing search index...

    Class NetworkServiceV3

    NetworkServiceV3 - NDEx API v3 network operations Handles modern v3 endpoints with native CX2 support

    Index

    Constructors

    Methods

    • Get raw network in CX2 format (native V3)

      Returns raw CX2 data which may contain fragmented aspects that need to be assembled into a complete CX2 network model for proper usage. The returned data follows the CX2 specification but may have aspects split across multiple fragments. For a fully assembled network object with utility methods, use getNetworkAsCX2Object() instead.

      Parameters

      • networkUUID: string

        The UUID of the network to retrieve

      • options: AccessParams = {}

        Access options including optional access key

      Returns Promise<CX2Network>

      Promise resolving to raw CX2 network data that may be fragmented

    • Get attributes of selected nodes

      Retrieves specific attributes for a set of nodes in a network. The server will return a 404 error if the network has no attributes on nodes.

      Parameters

      • networkUUID: string

        The UUID of the network

      • nodeSelection: { ids: number[]; attributeNames: string[] }

        Object containing node IDs and attribute names to retrieve

        • ids: number[]

          Array of node IDs (long numbers) to get attributes for

        • attributeNames: string[]

          Array of attribute names to retrieve

      • options: AccessParams = {}

        Access options including optional access key

      Returns Promise<Record<string, any>>

      Promise resolving to a JSON object where keys are stringified node IDs and values are the selected attributes for that node

      When the network has no attributes on nodes

    • Get network summaries by UUIDs using V3 API (migrated from original NDEx.js)

      Retrieves network summaries for multiple networks in a single batch request using V3 API. Uses the V3 API batch endpoint with format parameter support.

      Parameters

      • uuidList: string[]

        Array of network UUIDs to retrieve summaries for

      • OptionalaccessKey: string

        Optional access key for private networks

      • Optionalformat: string

        Summary format ("FULL" by default, can be "BASIC" or other supported formats)

      Returns Promise<NetworkSummaryV3[]>

      Promise resolving to array of V3 network summaries

    • Upload CX2 network via multipart/form-data

      Server endpoint: POST /v3/networks Consumes: multipart/form-data Form field: 'CXNetworkStream' (the CX2 content) Query params: visibility, folderId Returns: NdexObjectUpdateStatus

      Parameters

      • cx2: string | Buffer | File | Blob | ReadableStream
      • options: {
            visibility?: Visibility;
            folderId?: string;
            onProgress?: (progress: number) => void;
        } = {}

      Returns Promise<NDExObjectUpdateStatus>

    • Upload network file (Deprecated convenience wrapper)

      Delegates to uploadCX2Network(). Kept for backward compatibility.

      Parameters

      • file: string | Buffer | File | Blob | ReadableStream
      • options: {
            visibility?: Visibility;
            onProgress?: (progress: number) => void;
            folderId?: string;
        } = {}

      Returns Promise<NDExObjectUpdateStatus>

    • Get network metadata (V3 enhanced)

      Parameters

      • networkUUID: string

      Returns Promise<any>

    • Update network metadata

      Parameters

      • networkUUID: string
      • metadata: Record<string, any>

      Returns Promise<void>

    • Get network aspect (specific CX2 aspect)

      Parameters

      • networkUUID: string
      • aspectName: string
      • options: AccessParams = {}

      Returns Promise<any>

    • Delete network

      Parameters

      • networkUUID: string

        The UUID of the network to delete

      • permanent: boolean = false

        If true, permanently delete the network. If false (default), soft delete to trash for 30 days

      Returns Promise<void>