Member Junction
    Preparing search index...

    Engine that manages tag lifecycle operations (merge, split, move, rename, deprecate, reactivate, delete) with full audit logging to the MJ: Tag Audit Logs entity.

    All operations are server-side and require a contextUser for proper security context. Every mutation creates an audit log entry for traceability.

    const gov = TagGovernanceEngine.Instance;
    // Merge two tags into one
    const result = await gov.MergeTags(['tag-a-id', 'tag-b-id'], 'surviving-id', contextUser);
    console.log(`Moved ${result.ItemsMoved} content item tags`);

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get GlobalKey(): string

      Returns string

    Methods

    • Soft-delete a tag by setting its Status to 'Deleted'. The tag record is preserved in the database for audit history.

      Parameters

      • tagID: string

        The tag to soft-delete

      • contextUser: UserInfo

        The user performing the operation

      Returns Promise<void>

      Error if the tag cannot be loaded or saved

    • Deprecate a tag by setting its Status to 'Deprecated'. Deprecated tags are preserved in the system but excluded from active tag resolution.

      Parameters

      • tagID: string

        The tag to deprecate

      • contextUser: UserInfo

        The user performing the operation

      Returns Promise<void>

      Error if the tag cannot be loaded or saved

    • The Global Object Store is a place to store global objects that need to be shared across the application. Depending on the execution environment, this could be the window object in a browser, or the global object in a node environment, or something else in other contexts. The key here is that in some cases static variables are not truly shared because it is possible that a given class might have copies of its code in multiple paths in a deployed application. This approach ensures that no matter how many code copies might exist, there is only one instance of the object in question by using the Global Object Store.

      Returns GlobalObjectStore

    • Merge one or more source tags into a single surviving tag.

      This operation:

      1. Re-points all ContentItemTag.TagID references from each source tag to the surviving tag
      2. Re-points all TaggedItem records from each source tag to the surviving tag
      3. Sets each source tag's Status to 'Merged' and MergedIntoTagID to the surviving tag
      4. Creates an audit log entry for each source tag with action 'Merged'

      Parameters

      • sourceTagIDs: string[]

        Array of tag IDs to merge away (these become inactive)

      • survivingTagID: string

        The tag ID that absorbs all references

      • contextUser: UserInfo

        The user performing the operation

      Returns Promise<MergeResult>

      Summary of items moved during the merge

      Error if the surviving tag cannot be loaded or if any save operation fails

    • Move a tag to a new parent in the taxonomy hierarchy.

      Parameters

      • tagID: string

        The tag to move

      • newParentID: string

        The new parent tag ID, or null for root-level

      • contextUser: UserInfo

        The user performing the operation

      Returns Promise<void>

      Error if the tag cannot be loaded or saved

    • Approve a pending suggestion. When the reviewer chose merge-into-existing, re-points any existing free-text ContentItemTag rows whose Tag text matches ProposedName to the merge target. When create-new, creates a fresh MJ:Tag (inheriting parent scope when applicable) and re-points the same set of free-text rows to the new tag.

      Returns the resolved tag (merge target or newly-created tag).

      Parameters

      Returns Promise<MJTagEntity>

    • Reactivate a previously deprecated or deleted tag by setting its Status back to 'Active'.

      Parameters

      • tagID: string

        The tag to reactivate

      • contextUser: UserInfo

        The user performing the operation

      Returns Promise<void>

      Error if the tag cannot be loaded or saved

    • Rename a tag, updating both Name and DisplayName.

      Parameters

      • tagID: string

        The tag to rename

      • newName: string

        The new name (applied to both Name and DisplayName)

      • contextUser: UserInfo

        The user performing the operation

      Returns Promise<void>

      Error if the tag cannot be loaded or saved

    • Split a tag by creating new child tags under the original tag's parent.

      This operation creates new sibling tags alongside the original tag. It does NOT automatically reassign items from the original tag to the new children; that must be done separately (e.g., via MergeTags or manual reassignment).

      Parameters

      • tagID: string

        The tag being split

      • newChildNames: string[]

        Array of names for the new child tags to create

      • contextUser: UserInfo

        The user performing the operation

      Returns Promise<MJTagEntity[]>

      Array of newly created tag entities

      Error if the original tag cannot be loaded or if any tag creation fails

    • Walk the proposed parent's ancestor chain and decide whether the autotagger may auto-create a new child under it. Returns the first blocking reason found (so reviewer messages can be precise) or ok:true.

      Caller responsibilities:

      • weight is the classifier confidence; BelowMinWeight is checked against the proposed parent's MinWeight.
      • proposedParentID == null means "create a root" — only the global IsFrozen / IsLeaf governance applies.
      • The caller must have ensured TagEngine.Config() ran so GetTagByID returns the up-to-date entity instances.

      Parameters

      • proposedParentID: string
      • weight: number
      • contextUser: UserInfo

      Returns Promise<AutoGrowValidationResult>

    • Returns the singleton instance of the class. If the instance does not exist, it is created and stored in the Global Object Store. If className is provided it will be used as part of the key in the Global Object Store, otherwise the actual class name will be used. NOTE: the class name used by default is the lowest level of the object hierarchy, so if you have a class that extends another class, the lowest level class name will be used.

      Type Parameters

      Parameters

      • this: new () => T
      • OptionalclassName: string

      Returns T