Frodo Library - v5.0.0-47
    Preparing search index...

    Type Alias Journey

    type Journey = {
        fileByIdTreeExportResolver: TreeExportResolverInterface;
        onlineTreeExportResolver: TreeExportResolverInterface;
        countJourneys(): Promise<number>;
        createFileParamTreeExportResolver(
            file: string,
        ): TreeExportResolverInterface;
        createJourney(
            journeyId: string,
            journeyData: TreeSkeleton,
        ): Promise<TreeSkeleton>;
        createMultiTreeExportTemplate(): MultiTreeExportInterface;
        createSingleTreeExportTemplate(): SingleTreeExportInterface;
        deleteJourney(
            journeyId: string,
            options: { deep: boolean; progress?: boolean; verbose: boolean },
        ): Promise<DeleteJourneyStatus>;
        deleteJourneys(
            options: { deep: boolean; verbose: boolean },
            resultCallback?: ResultCallback<DeleteJourneyStatus>,
        ): Promise<DeleteJourneysStatus>;
        disableJourney(journeyId: string): Promise<TreeSkeleton>;
        enableJourney(journeyId: string): Promise<TreeSkeleton>;
        exportJourney(
            treeId: string,
            options?: TreeExportOptions,
        ): Promise<MultiTreeExportInterface>;
        exportJourneys(
            options?: TreeExportOptions,
            resultCallback?: ResultCallback<SingleTreeExportInterface>,
        ): Promise<MultiTreeExportInterface>;
        findScriptReferences(scriptId: string): Promise<ScriptReference[]>;
        getNodeRef(
            nodeObj: NodeSkeleton,
            singleTreeExport: SingleTreeExportInterface,
        ): NodeRefSkeletonInterface | InnerNodeRefSkeletonInterface;
        getTreeDescendents(
            treeExport: SingleTreeExportInterface,
            resolveTreeExport: TreeExportResolverInterface,
            resolvedTreeIds?: string[],
        ): Promise<TreeDependencyMapInterface>;
        importJourney(
            treeObject: SingleTreeExportInterface,
            options: TreeImportOptions,
        ): Promise<TreeSkeleton>;
        importJourneys(
            importData: MultiTreeExportInterface,
            options: TreeImportOptions,
            resultCallback?: ResultCallback<TreeSkeleton>,
        ): Promise<TreeSkeleton[]>;
        readJourney(journeyId: string): Promise<TreeSkeleton>;
        readJourneys(): Promise<TreeSkeleton[]>;
        resolveDependencies(
            installedJorneys: any,
            journeyMap: any,
            unresolvedJourneys: any,
            resolvedJourneys: any,
            index?: number,
        ): Promise<void>;
        updateJourney(
            journeyId: string,
            journeyData: TreeSkeleton,
        ): Promise<TreeSkeleton>;
        validateJourneys(
            journeyIds?: string[],
            journeysExport?: MultiTreeExportInterface,
            resultCallback?: ResultCallback<JourneyValidationFinding[]>,
        ): Promise<JourneyValidationFinding[]>;
    }
    Index
    fileByIdTreeExportResolver: TreeExportResolverInterface

    Tree export resolver used to resolve a tree id/name to a full export of that tree from individual treename.journey.json export files.

    id/name of the tree to resolve

    tree export

    onlineTreeExportResolver: TreeExportResolverInterface

    Default tree export resolver used to resolve a tree id/name to a full export w/o dependencies of that tree from a platform instance.

    id/name of the tree to resolve

    tree export

    • Count all journeys in the active realm.

      Returns Promise<number>

      exact count when supported by the backing API

    • Delete a journey

      Parameters

      • journeyId: string

        journey id/name

      • options: { deep: boolean; progress?: boolean; verbose: boolean }

        deep=true also delete all the nodes and inner nodes, verbose=true print verbose info

      Returns Promise<DeleteJourneyStatus>

    • Find every journey/node that references a given script, by scanning all nodes in the active realm for a matching script id and cross-referencing against every journey's node map. Also resolves references nested inside a container node (e.g. a Page Node), reporting the top-level node a journey actually references alongside the inner node that uses the script.

      Parameters

      • scriptId: string

        script id to find references to

      Returns Promise<ScriptReference[]>

      a promise that resolves to every reference found

    • Get tree dependencies (all descendent inner trees). The whole tree is described, to any depth: a sub-journey referenced by several journeys is repeated and expanded in full under every parent. A sub-journey that is already an ancestor on the current path (a cycle), or whose id is in resolvedTreeIds, appears as a leaf and is not expanded again. A sub-journey that cannot be resolved appears as a leaf. Each sub-journey is resolved at most once per call.

      Parameters

      • treeExport: SingleTreeExportInterface

        single tree export

      • resolveTreeExport: TreeExportResolverInterface

        tree export resolver callback function

      • OptionalresolvedTreeIds: string[]

        list of tree ids that are listed as leaves and not expanded (the list is not modified)

      Returns Promise<TreeDependencyMapInterface>

      a promise that resolves to a tree dependency map

    • Import journeys

      Parameters

      • importData: MultiTreeExportInterface

        map of trees object

      • options: TreeImportOptions

        import options

      • OptionalresultCallback: ResultCallback<TreeSkeleton>

        Optional callback to process individual results. When given, the outcome of every journey is passed to it as it happens (the journey, or an error that names the journey) and a failed journey does not throw. Without it, a validation error or a missing dependency rejects the batch before anything is written, and a journey that cannot be written throws. Failing to list the installed journeys always throws.

      Returns Promise<TreeSkeleton[]>

      a promise that resolves to the journeys that were imported

      Without a result callback the complete batch is validated before reading installed journeys or writing any journey. If validation fails, the batch is rejected without partially importing valid journeys. With a result callback every journey is an item of its own: a journey that has validation errors, a journey that needs a journey that is neither installed nor in the import data, and a journey that needs a journey of the batch that failed are reported to the callback as failed and are not written; every other journey is imported.

    • Read journey without dependencies.

      Parameters

      • journeyId: string

        journey id/name

      Returns Promise<TreeSkeleton>

      a promise that resolves to a journey object

    • Resolve journey dependencies

      Parameters

      • installedJorneys: any

        Map of installed journeys

      • journeyMap: any

        Map of journeys to resolve dependencies for

      • unresolvedJourneys: any

        Map to hold the names of unresolved journeys and their dependencies

      • resolvedJourneys: any

        Array to hold the names of resolved journeys

      • Optionalindex: number

        Depth of recursion

      Returns Promise<void>

    • Validate journeys for referential integrity.

      journeyIds journeysExport Behavior
      omitted, null or [] omitted Read and validate all journeys in the realm.
      ['login'] omitted Read and validate journey login from the realm.
      omitted, null or [] supplied Validate all journeys in the export offline.
      ['login'] supplied Validate tree login in the export offline.

      Duplicate IDs are processed once. Live validation reads each journey once; findings are returned without printing. When verbose, live validation prints the export trace as exportJourney does (findings are never printed). Missing, blank, or unreadable journeys are reported together after all requested journeys are processed: without a result callback the function then throws one error that nests one error per failed journey and returns no findings; with one, each journey's outcome is passed to the callback as it happens (the findings of the journey, or an error that names the journey), the function does not throw for a failed journey and returns the findings of all journeys that could be validated. Dependency-completeness warnings are export-only: each non-empty dependency section is checked against that journey's node references. Empty sections are skipped. Live validation reads with deps: false, so it performs no dependency checks and does not check resource existence in the tenant.

      Parameters

      • OptionaljourneyIds: string[]

        journey names; omit or pass an empty array to validate all journeys

      • OptionaljourneysExport: MultiTreeExportInterface

        optional export; when supplied, validation is offline

      • OptionalresultCallback: ResultCallback<JourneyValidationFinding[]>

        Optional callback to process individual results: the findings of one journey (an empty array for a journey without findings) or an error that names the journey that could not be validated. Failing to list the journeys of the realm, and invalid arguments, always throw.

      Returns Promise<JourneyValidationFinding[]>

      validation findings