Skip to content

TransmitSecurity/stringlist-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

String List TypeScript Generator

This project reads a JSON input file containing string lists and generates TypeScript modules that expose functions for each string entry using the FlexID API.

📦 Project Setup

yarn install

🛠 Project Structure

  • src/generate.ts: Main generator script.

  • run.sh: Convenience script to run the generator.

  • output/: Folder where the generated .ts files are saved.

📥 Getting the Input JSON from Transmit Security Mosaic

To generate TypeScript files, you’ll need to export the string lists from your Mosaic admin console:

  1. Go to the Admin Console of your Transmit Security environment.
  2. From the left-hand menu, select Journey Tools.
  3. Under Journey Tools, choose Import/Export.
  4. In the Export tab, click Add.
  5. Choose String List from the export types.
  6. Select Export all String Lists.
  7. Press Save and download the generated .json file.

Exporting string list from Transmit Security

Once downloaded, this JSON file becomes the input for the generator script.

🚀 Usage

Input JSON Format

The input JSON must contain an exports array, where each entry has:

  • an id (string list name)

  • a values array with key=value strings

Example:

{
  "exports": [
    {
      "data": {
        "id": "ui_strings",
        "values": [
          "session_expired=Session ended.",
          "logout_not_found=Session to logout not found."
        ]
      }
    }
  ]
}

Run the Generator

./run.sh path/to/input.json

This will:

  • Parse the input file

  • Create a .ts file under output/ per string list

  • Add an exported function for each key and a generic lookup() function

Example Output (output/ui_strings.ts)

export async function lookup(key: string): Promise<string> {
  return await FlexID.authScript().customFunctions.typed_list_value("ui_strings", key);
}

export async function session_expired(): Promise<string> {
  return await FlexID.authScript().customFunctions.typed_list_value("ui_strings", "session_expired");
}

🧩 FlexID Note

The generator uses FlexID.authScript().customFunctions.typed_list_value(...), but the FlexID library is not included in this project. The generated files are intended to be used in an environment where FlexID is available.

🧹 .gitignore

Typical ignores include:

node_modules/
dist/
output/
.vscode/

See .gitignore for full list.

📄 License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published