├── bin └── build.js ├── tsconfig.json ├── .github └── workflows │ └── npm-publish.yaml ├── .gitignore ├── package.json ├── README.md ├── index.html ├── src ├── index.ts └── cli.ts └── events.json /bin/build.js: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env node 2 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "module": "ESNext", 5 | "moduleResolution": "node", 6 | "strict": true, 7 | "esModuleInterop": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "outDir": "./dist", 10 | "declaration": true 11 | }, 12 | "include": ["src/**/*"], 13 | "exclude": ["node_modules", "**/*.spec.ts"] 14 | } 15 | -------------------------------------------------------------------------------- /.github/workflows/npm-publish.yaml: -------------------------------------------------------------------------------- 1 | name: Publish Package to npm 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'v*' 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v2 14 | 15 | - name: Use Node.js 16 | uses: actions/setup-node@v2 17 | with: 18 | node-version: '14' 19 | registry-url: 'https://registry.npmjs.org/' 20 | 21 | - name: Install dependencies 22 | run: npm ci 23 | 24 | - name: Build 25 | run: npm run build 26 | 27 | - name: Publish to npm 28 | run: npm publish 29 | env: 30 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | #/model* 7 | 8 | # dependencies 9 | node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | *.code-workspace 20 | 21 | # IDE - VSCode 22 | .vscode/* 23 | !.vscode/settings.json 24 | !.vscode/tasks.json 25 | !.vscode/launch.json 26 | !.vscode/extensions.json 27 | 28 | # misc 29 | /.sass-cache 30 | /connect.lock 31 | /coverage 32 | /libpeerconnection.log 33 | npm-debug.log 34 | testem.log 35 | /typings 36 | _timestamp.json 37 | .history/ 38 | 39 | # e2e 40 | /e2e/*.js 41 | /e2e/*.map 42 | 43 | # System Files 44 | .DS_Store 45 | Thumbs.db 46 | .env* 47 | models 48 | inference_graph 49 | *.zip 50 | *.gz 51 | oh-* 52 | *.pem 53 | dist/ 54 | dist-old 55 | history*.txt 56 | notes/ 57 | temp/ 58 | 59 | # unit test 60 | #src/**/*.js 61 | #src/**/*.map 62 | #coverage 63 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ibm-segment", 3 | "version": "1.1.5", 4 | "type": "module", 5 | "description": "", 6 | "main": "dist/index.js", 7 | "scripts": { 8 | "build": "tsc", 9 | "start": "node dist/index.js", 10 | "test": "echo \"Error: no test specified\" && exit 1", 11 | "dev": "ts-node src/index.ts" 12 | }, 13 | "bin": { 14 | "ibm-segment": "./dist/cli.js" 15 | }, 16 | "author": "ljeff@us.ibm.com", 17 | "license": "ISC", 18 | "dependencies": { 19 | "@tsconfig/node14": "^14.1.0", 20 | "analytics-node": "^6.2.0", 21 | "ibm-segment": "^1.1.5", 22 | "inquirer": "^9.2.15", 23 | "rxjs": "^7.8.1", 24 | "yargs": "^17.7.2" 25 | }, 26 | "devDependencies": { 27 | "@types/analytics-node": "^3.1.14", 28 | "@types/inquirer": "^9.0.7", 29 | "@types/node": "^20.11.19", 30 | "@types/yargs": "^17.0.32", 31 | "http-server": "^14.1.1", 32 | "ts-node": "^10.9.2", 33 | "typescript": "^5.3.3", 34 | "undici-types": "^6.6.2" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ibm-segment 2 | 3 | A command-line interface (CLI) tool designed for seamless integration with Segment, enabling the tracking of events directly from your terminal. This tool simplifies the process of sending event data to Segment by allowing users to load events from a JSON file or input them manually. 4 | 5 | image 6 | 7 | ## Features: 8 | - ***API Key Configuration:*** Configure your Segment Write Key directly through the CLI. 9 | - ***Event File Loading:*** Load and track events in bulk from a JSON file.Update the events variable in index.js with your events. 10 | - ***Manual Event Tracking:*** Track additional events manually through interactive prompts. 11 | - ***User-Friendly Prompts:*** Easy-to-use prompts powered by Inquirer.js for manual event entry. 12 | 13 | ## Installation 14 | ``` npm install -g ibm-segment``` 15 | 16 | ## Usage 17 | ### Configuration Options 18 | The CLI supports the following options: 19 | - `--apikey`: Your Segment Write Key (optional if provided during runtime). 20 | - `--file`: Path to the JSON file containing events (optional if provided during runtime). 21 | - 22 | If you've installed the CLI globally, you can run it from anywhere: 23 | ``` ibm-segment --apikey YOUR_SEGMENT_WRITE_KEY --file PATH_TO_YOUR_EVENTS_FILE.json``` 24 | 25 | From here you can select which events to fire from the JSON file. If no events are selected, all will be added. 26 | 27 | image 28 | After processing the events from the file, you will be asked if you want to track more events manually: 29 | 30 | ``` > Would you like to track another event? (Y/n) ``` 31 | 32 | ## Manual Event Tracking 33 | To manually track an event, provide the event name, properties (as a JSON string), and user ID when prompted. 34 | 35 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 13 | 14 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |

Event list

42 |
43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import Analytics from "analytics-node"; 2 | import fs from "fs"; 3 | 4 | const productCode = "WW1314"; 5 | const productCodeType = "WWPC"; 6 | 7 | interface EventProps { 8 | [key: string]: any; 9 | } 10 | 11 | interface TrackedEvent { 12 | event: string; 13 | props: EventProps; 14 | } 15 | 16 | class SegmentTracker { 17 | private segmentAnalytics: Analytics | null = null; 18 | 19 | 20 | constructor(apiKey?: string) { 21 | if (apiKey) { 22 | this.segmentAnalytics = new Analytics(apiKey); 23 | } else { 24 | console.error("Segment API Key is required to initialize analytics tracking."); 25 | } 26 | } 27 | 28 | public async initialize(apiKey: string): Promise { 29 | if (!apiKey) { 30 | throw new Error("Segment API Key is required."); 31 | } 32 | this.segmentAnalytics = new Analytics(apiKey); 33 | } 34 | 35 | public track( 36 | event: string, 37 | props: EventProps, 38 | userId: string = "defaultUserId" 39 | ) { 40 | if (!this.segmentAnalytics) { 41 | console.error("Analytics not initialized"); 42 | return; 43 | } 44 | this.segmentAnalytics.track({ 45 | event, 46 | properties: props, 47 | userId, 48 | }); 49 | console.log(`Tracking event: ${event}`, props); 50 | } 51 | 52 | public loadAndTrackEventsFromFile(filePath: string) { 53 | try { 54 | const fileContent = fs.readFileSync(filePath, "utf8"); 55 | const eventsData = JSON.parse(fileContent); 56 | 57 | Object.keys(eventsData).forEach((key) => { 58 | const { path, events: eventList } = eventsData[key]; 59 | eventList.forEach((event: TrackedEvent) => { 60 | this.track(event.event, { ...event.props, path }, "userId"); 61 | }); 62 | }); 63 | } catch (error) { 64 | console.error("Failed to load or process events file", error); 65 | } 66 | } 67 | 68 | public async loadAndTrackEventsFromGroup( 69 | filePath: string, 70 | groupName: string 71 | ): Promise { 72 | try { 73 | const fileContent = fs.readFileSync(filePath, "utf8"); 74 | const eventsData = JSON.parse(fileContent); 75 | 76 | const groupData = eventsData[groupName]; 77 | if (!groupData || !Array.isArray(groupData.events)) { 78 | console.error( 79 | `No events found for group ${groupName} or 'events' is not an array` 80 | ); 81 | return; 82 | } 83 | 84 | 85 | 86 | groupData.events.forEach((event: TrackedEvent) => { 87 | if (event.event) { 88 | const enhancedProps = { 89 | ...event.props, 90 | productCode: productCode, 91 | productCodeType: productCodeType, 92 | }; 93 | this.track(event.event, enhancedProps, "userId"); 94 | } else { 95 | console.error( 96 | "Invalid event object, missing 'event' property:", 97 | event 98 | ); 99 | } 100 | }); 101 | } catch (error) { 102 | console.error("Failed to load or process events file", error); 103 | } 104 | } 105 | } 106 | 107 | export default SegmentTracker; 108 | -------------------------------------------------------------------------------- /src/cli.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import fs from "fs"; 3 | import inquirer from "inquirer"; 4 | import yargs from "yargs"; 5 | import { hideBin } from "yargs/helpers"; 6 | import SegmentTracker from "./index.js"; 7 | 8 | const productCode = "WW1314"; 9 | const productCodeType = "WWPC"; 10 | 11 | interface CommandLineOptions { 12 | apikey: string; 13 | file?: string; 14 | } 15 | 16 | const argv = yargs(hideBin(process.argv)) 17 | .usage("Usage: $0 --apikey [string] --file [string]") 18 | .option("apikey", { 19 | describe: "Your Segment Write Key", 20 | type: "string", 21 | demandOption: true, // Making API key mandatory 22 | }) 23 | .option("file", { 24 | describe: "Path to the JSON file containing events", 25 | type: "string", 26 | }) 27 | .help("h") 28 | .alias("h", "help").argv as unknown as CommandLineOptions; 29 | 30 | async function listEventGroups(filePath: string): Promise { 31 | if (fs.lstatSync(filePath).isDirectory()) { 32 | throw new Error("The provided path is a directory, expected a file path."); 33 | } 34 | const fileContent = fs.readFileSync(filePath, "utf8"); 35 | const eventsData = JSON.parse(fileContent); 36 | return Object.keys(eventsData); 37 | } 38 | 39 | const initCLI = async () => { 40 | let { apikey, file } = argv; 41 | 42 | if (file) { 43 | try { 44 | if (!fs.existsSync(file)) { 45 | console.error("File does not exist at the provided path."); 46 | // Ask if the user wants to proceed without a file 47 | const { proceedWithoutFile } = await inquirer.prompt([ 48 | { 49 | type: "confirm", 50 | name: "proceedWithoutFile", 51 | message: 52 | "File not found. Would you like to proceed with manual event tracking?", 53 | }, 54 | ]); 55 | if (!proceedWithoutFile) return; 56 | file = undefined; 57 | } 58 | } catch (err) { 59 | console.error("An error occurred while checking the file path:", err); 60 | return; 61 | } 62 | } 63 | const segmentTracker = new SegmentTracker(apikey); 64 | await segmentTracker.initialize(apikey); 65 | 66 | if (file) { 67 | const eventGroups = await listEventGroups(file); 68 | const { selectedGroups } = await inquirer.prompt([ 69 | { 70 | type: "checkbox", 71 | name: "selectedGroups", 72 | message: "Select event groups to trigger (select none to trigger all):", 73 | choices: eventGroups, 74 | }, 75 | ]); 76 | 77 | let groupsToTrigger = 78 | selectedGroups.length > 0 ? selectedGroups : eventGroups; 79 | 80 | groupsToTrigger.forEach((group: string) => { 81 | segmentTracker 82 | .loadAndTrackEventsFromGroup(file!, group) 83 | .catch((error) => { 84 | console.error( 85 | `Failed to load or track events for group ${group}:`, 86 | error 87 | ); 88 | }); 89 | }); 90 | } 91 | 92 | let trackAnother = true; 93 | do { 94 | const response = await inquirer.prompt([ 95 | { 96 | type: "confirm", 97 | name: "trackAnother", 98 | message: "Would you like to track another event?", 99 | }, 100 | ]); 101 | 102 | trackAnother = response.trackAnother; 103 | 104 | if (!trackAnother) { 105 | return process.exit(1); 106 | } 107 | 108 | let event = ""; 109 | let props = ""; 110 | let userId = "defaultUserId"; 111 | 112 | do { 113 | const eventResponse = await inquirer.prompt([ 114 | { 115 | type: "input", 116 | name: "event", 117 | message: "Enter the event name:", 118 | validate: (input) => { 119 | if (input.trim() === "") { 120 | return "Event name cannot be empty. Please enter a valid event name."; 121 | } 122 | return true; 123 | }, 124 | }, 125 | ]); 126 | event = eventResponse.event.trim(); 127 | } while (!event); 128 | 129 | let validProps = false; 130 | do { 131 | const propsResponse = await inquirer.prompt([ 132 | { 133 | type: "input", 134 | name: "props", 135 | message: "Enter the event properties (as a JSON string):", 136 | validate: (input) => { 137 | try { 138 | JSON.parse(input); 139 | validProps = true; 140 | return true; 141 | } catch (e) { 142 | validProps = false; 143 | return "This is not a valid JSON string. Please enter valid JSON properties."; 144 | } 145 | }, 146 | }, 147 | ]); 148 | props = propsResponse.props.trim(); 149 | } while (!validProps); 150 | 151 | const userIdResponse = await inquirer.prompt([ 152 | { 153 | type: "input", 154 | name: "userId", 155 | message: 'Enter the user ID (default is "defaultUserId"):', 156 | default: "defaultUserId", 157 | }, 158 | ]); 159 | userId = userIdResponse.userId.trim(); 160 | 161 | let parsedProps = JSON.parse(props); 162 | 163 | // extract out everything in props and put it into parsed props 164 | parsedProps = { 165 | ...parsedProps.props, 166 | productCode: productCode, 167 | productCodeType: productCodeType, 168 | }; 169 | segmentTracker.track(event, parsedProps, userId); 170 | } while (trackAnother); 171 | }; 172 | 173 | initCLI(); 174 | -------------------------------------------------------------------------------- /events.json: -------------------------------------------------------------------------------- 1 | { 2 | "Home": { 3 | "path": "/", 4 | "events": [ 5 | {"event": "CTA Clicked", "props": {"CTA": "Get started link clicked", "action": "Get started link clicked from home page"}}, 6 | {"event": "UI Interaction", "props": {"CTA": "Canvas view link clicked", "action": "Canvas view link clicked from home page"}}, 7 | {"event": "Created Object", "props": {"action": "Register application link clicked", "objectType": "button"}}, 8 | {"event": "Created Object", "props": {"action": "Register environment link clicked", "objectType": "button"}}, 9 | {"event": "Created Object", "props": {"action": "Register cloud link clicked", "objectType": "button"}}, 10 | {"event": "Created Object", "props": {"action": "Register application link clicked", "objectType": "button"}}, 11 | {"event": "Created Object", "props": {"action": "Create policy link clicked", "objectType": "button"}}, 12 | {"event": "Created Object", "props": {"action": "Register location link clicked", "objectType": "button"}}, 13 | {"event": "UI Interaction", "props": {"CTA": "Map view link clicked", "action": "Map view link clicked from home page"}} 14 | ] 15 | }, 16 | "Admin Dropdown": { 17 | "path": "/admin", 18 | "events": [ 19 | {"event": "Read Object", "props": {"action": "Resource group open", "objectType": "button"}}, 20 | {"event": "Read Object", "props": {"action": "API key open", "objectType": "button"}}, 21 | {"event": "Read Object", "props": {"action": "Secrets open", "objectType": "button"}}, 22 | {"event": "Read Object", "props": {"action": "Identities open", "objectType": "button"}}, 23 | {"event": "Read Object", "props": {"action": "Roles open", "objectType": "button"}} 24 | ] 25 | }, 26 | "Admin Resource Groups": { 27 | "path": "/admin", 28 | "events": [ 29 | {"event": "Created Object", "props": {"action": "Create resource group modal", "objectType": "button"}}, 30 | {"event": "Created Object", "props": {"action": "Create resource group", "objectType": "button"}}, 31 | {"event": "Created Object", "props": {"action": "Edit resource group", "objectType": "button"}}, 32 | {"event": "Created Object", "props": {"action": "View resource group", "objectType": "button"}}, 33 | {"event": "Created Object", "props": {"action": "Delete resource group", "objectType": "button"}} 34 | ] 35 | }, 36 | "Admin API Keys": { 37 | "path": "/admin", 38 | "events": [ 39 | {"event": "Read Object", "props": {"action": "View API key", "objectType": "button"}}, 40 | {"event": "Read Object", "props": {"action": "Edit API key", "objectType": "button"}}, 41 | {"event": "Created Object", "props": {"action": "create API key", "objectType": "button"}}, 42 | {"event": "Created Object", "props": {"action": "Generate API key", "objectType": "button"}}, 43 | {"event": "Deleted Object", "props": {"action": "Delete API key", "objectType": "button"}} 44 | ] 45 | }, 46 | "Admin Secrets": { 47 | "path": "/admin", 48 | "events": [ 49 | {"event": "Read Object", "props": {"action": "View secret", "objectType": "button"}}, 50 | {"event": "Created Object", "props": {"action": "Register secret modal", "objectType": "button"}}, 51 | {"event": "Created Object", "props": {"action": "Register secret", "objectType": "button"}}, 52 | {"event": "Updated Object", "props": {"action": "Edit secret", "objectType": "button"}}, 53 | {"event": "Deleted Object", "props": {"action": "Delete secret", "objectType": "button"}} 54 | ] 55 | }, 56 | "Admin Identities": { 57 | "path": "/admin", 58 | "events": [ 59 | {"event": "Read Object", "props": {"action": "View identities", "objectType": "button"}}, 60 | {"event": "Created Object", "props": {"action": "Create identity modal", "objectType": "button"}}, 61 | {"event": "Created Object", "props": {"action": "Create identity", "objectType": "button"}}, 62 | {"event": "Updated Object", "props": {"action": "Edit identity", "objectType": "button"}}, 63 | {"event": "Deleted Object", "props": {"action": "Delete identity", "objectType": "button"}} 64 | ] 65 | }, 66 | "Admin Roles": { 67 | "path": "/admin", 68 | "events": [ 69 | {"event": "Read Object", "props": {"action": "View role", "objectType": "button"}}, 70 | {"event": "Created Object", "props": {"action": "Create role modal", "objectType": "button"}}, 71 | {"event": "Created Object", "props": {"action": "Create role", "objectType": "button"}}, 72 | {"event": "Updated Object", "props": {"action": "Edit role", "objectType": "button"}}, 73 | {"event": "Deleted Object", "props": {"action": "Delete role", "objectType": "button"}} 74 | ] 75 | }, 76 | "Side Navigation": { 77 | "path": "/admin", 78 | "events": [ 79 | {"event": "UI Interaction", "props": {"CTA": "Applications & Services nav clicked", "action": "Open applications and services"}}, 80 | {"event": "UI Interaction", "props": {"CTA": "Environments nav clicked", "action": "Open deployment environments"}}, 81 | {"event": "UI Interaction", "props": {"CTA": "Policies nav clicked", "action": "Open policies"}}, 82 | {"event": "UI Interaction", "props": {"CTA": "Topology nav clicked", "action": "Open topology"}}, 83 | {"event": "UI Interaction", "props": {"CTA": "Locations nav clicked", "action": "Open locations"}}, 84 | {"event": "UI Interaction", "props": {"CTA": "Clouds nav clicked", "action": "Open clouds"}}, 85 | {"event": "UI Interaction", "props": {"CTA": "Gateways nav clicked", "action": "Open gateways"}}, 86 | {"event": "UI Interaction", "props": {"CTA": "Events nav clicked", "action": "Open events"}} 87 | ] 88 | }, 89 | "Cloud": { 90 | "path": "/cloud", 91 | "events": [ 92 | {"event": "Created Object", "props": {"action": "Register cloud", "objectType": "button"}}, 93 | {"event": "Created Object", "props": {"action": "Register cloud clicked", "objectType": "button"}}, 94 | {"event": "UI Interaction", "props": {"CTA": "Next clicked", "action": "Next button clicked after cloud selected"}}, 95 | {"event": "UI Interaction", "props": {"CTA": "Autodiscover on", "action": "Autodiscover switch to on from register cloud"}} 96 | ] 97 | }, 98 | "Cloud Details": { 99 | "path": "/cloudDetails", 100 | "events": [ 101 | {"event": "Updated Object", "props": {"action": "Edit icon", "objectType": "button"}}, 102 | {"event": "Read Object", "props": {"action": "Location details", "objectType": "button"}}, 103 | {"event": "UI Interaction", "props": {"CTA": "Manage cloud location", "action": "Manage cloud location switched on from cloudDetails page"}}, 104 | {"event": "UI Interaction", "props": {"CTA": "Manage cloud environments vpc", "action": "Manage cloud environment vpc switched on from cloudDetails page"}}, 105 | {"event": "Created Object", "props": {"action": "Register deployment environment vpc", "objectType": "button"}}, 106 | {"event": "UI Interaction", "props": {"CTA": "Manage cloud environment cluster", "action": "Manage cloud environment cluster switched on from cloudDetails page"}}, 107 | {"event": "UI Interaction", "props": {"CTA": "Autodiscover namespace cluster", "action": "Autodicover namespace cluster switched on from cloudDetails page"}}, 108 | {"event": "Created Object", "props": {"action": "Register deployment environment cluster", "objectType": "button"}}, 109 | {"event": "Read Object", "props": {"action": "Deployment environment details", "objectType": "button"}}, 110 | {"event": "UI Interaction", "props": {"CTA": "Cloud location", "action": "Cloud location link clicked from cloudDetails page"}}, 111 | {"event": "UI Interaction", "props": {"CTA": "Manage autodiscover namespace cluster", "action": "Manage autodiscover namespace cluster switched on from deployment environment configuration modal"}}, 112 | {"event": "CommonMilestone", "props": {"commonMilestoneName": "Manage autodiscover namespace cluster", "action": "Manage autodiscover namespace cluster milestone"}}, 113 | {"event": "Created Object", "props": {"action": "Connect a gateway cluster", "objectType": "button"}}, 114 | {"event": "UI Interaction", "props": {"CTA": "Gateway installation method", "action": "Gateway installation method radio button selected from connect edge gateway modal"}}, 115 | {"event": "Created Object", "props": {"action": "Deploy edge gateway", "objectType": "button"}}, 116 | {"event": "Created Object", "props": {"action": "Register edge gateway", "objectType": "button"}}, 117 | {"event": "Deleted Object", "props": {"action": "Delete a cloud", "objectType": "button"}}, 118 | {"event": "UI Interaction", "props": {"CTA": "Namespace details click", "action": "Namespace details link clicked from cloudDetails page"}} 119 | ] 120 | }, 121 | "Locations": { 122 | "path": "/locations", 123 | "events": [ 124 | {"event": "Created Object", "props": {"action": "Register location", "objectType": "button"}}, 125 | {"event": "Created Object", "props": {"action": "Register location modal", "objectType": "button"}}, 126 | {"event": "UI Interaction", "props": {"CTA": "Location type selected", "action": "Type selected from register location modal"}} 127 | ] 128 | }, 129 | "Locations Details": { 130 | "path": "/cloud/locationDetails", 131 | "events": [ 132 | {"event": "UI Interaction", "props": {"CTA": "Managed deployment environment", "action": "Managed deployment environment link clicked from locationDetails page"}}, 133 | {"event": "Created Object", "props": {"action": "Register deployment environment from location", "objectType": "button"}}, 134 | {"event": "Created Object", "props": {"action": "Register deployment environment from cloud", "objectType": "button"}}, 135 | {"event": "Deleted Object", "props": {"action": "Deleting location", "objectType": "button"}} 136 | ] 137 | }, 138 | "Deployment Environment": { 139 | "path": "/deploymentenvironments", 140 | "events": [ 141 | {"event": "UI Interaction", "props": {"CTA": "Register deployment environment", "action": "Register environment button clicked from deployment environments"}}, 142 | {"event": "Created Object", "props": {"action": "Register deployment environment model", "objectType": "button"}}, 143 | {"event": "UI Interaction", "props": {"CTA": "Autodiscover namespace on", "action": "Autodiscover namespace switch on from register deployment environment"}} 144 | ] 145 | }, 146 | "Deployment Environment Details": { 147 | "path": "/deploymentEnvironmentDetails", 148 | "events": [ 149 | {"event": "Updated Object", "props": {"action": "Edit deployment environment details", "objectType": "button"}}, 150 | {"event": "Created Object", "props": {"action": "Register namespace", "objectType": "button"}}, 151 | {"event": "CommonMilestone", "props": {"commonMilestoneName": "Register namespace", "action": "Register namespace milestone"}}, 152 | {"event": "UI Interaction", "props": {"CTA": "Autodiscover namespace applications", "action": "Autodiscover applications in the namespace"}}, 153 | {"event": "Updated Object", "props": {"action": "Save changes to the namespace", "objectType": "button"}}, 154 | {"event": "Deleted Object", "props": {"action": "Delete deployment environment", "objectType": "button"}} 155 | ] 156 | }, 157 | "Applications": { 158 | "path": "/applications", 159 | "events": [ 160 | {"event": "Created Object", "props": {"action": "Register application", "objectType": "button"}}, 161 | {"event": "Created Object", "props": {"action": "Register application modal", "objectType": "button"}} 162 | ] 163 | }, 164 | "Application Details": { 165 | "path": "/applicationDetails", 166 | "events": [ 167 | {"event": "Updated Object", "props": {"action": "Edit application details", "objectType": "button"}}, 168 | {"event": "Created Object", "props": {"action": "Register service", "objectType": "button"}}, 169 | {"event": "Created Object", "props": {"action": "Register service modal", "objectType": "button"}}, 170 | {"event": "Created Object", "props": {"action": "Register deployment", "objectType": "button"}}, 171 | {"event": "Created Object", "props": {"action": "Register application deployment modal", "objectType": "button"}}, 172 | {"event": "UI Interaction", "props": {"CTA": "Deployment instance selected", "action": "Deployment instance link clicked from applicationDetails page"}}, 173 | {"event": "Deleted Object", "props": {"action": "Deleting service", "objectType": "button"}}, 174 | {"event": "Deleted Object", "props": {"action": "Deleting application", "objectType": "button"}} 175 | ] 176 | }, 177 | "Application Deployment Details": { 178 | "path": "/applicationDeploymentDetails", 179 | "events": [ 180 | {"event": "Created Object", "props": {"action": "Register instance", "objectType": "button"}}, 181 | {"event": "Created Object", "props": {"action": "Register service", "objectType": "button"}}, 182 | {"event": "Created Object", "props": {"action": "Register service endpoint", "objectType": "button"}}, 183 | {"event": "Deleted Object", "props": {"action": "Deleting application instance", "objectType": "button"}}, 184 | {"event": "Deleted Object", "props": {"action": "Deleting service endpoint", "objectType": "button"}} 185 | ] 186 | }, 187 | "Policies": { 188 | "path": "/connectionAccessPolicies", 189 | "events": [ 190 | {"event": "Created Object", "props": {"action": "Create policy", "objectType": "button"}}, 191 | {"event": "Created Object", "props": {"action": "Create Policy modal", "objectType": "button"}}, 192 | {"event": "CommonMilestone", "props": {"commonMilestoneName": "Create Policy modal", "action": "Create Policy model milestone"}}, 193 | {"event": "Read Object", "props": {"action": "Open policy", "objectType": "button"}} 194 | ] 195 | }, 196 | "Policy Details": { 197 | "path": "/connectionaccesspolicydetails", 198 | "events": [ 199 | {"event": "Updated Object", "props": {"action": "Edit policy details", "objectType": "button"}}, 200 | {"event": "Updated Object", "props": {"action": "Edit Policy connection", "objectType": "button"}}, 201 | {"event": "Deleted Object", "props": {"action": "Delete policy", "objectType": "button"}} 202 | ] 203 | }, 204 | "Topology": { 205 | "path": "/topologies", 206 | "events": [ 207 | {"event": "Updated Object", "props": {"action": "Search", "objectType": "button"}}, 208 | {"event": "UI Interaction", "props": {"CTA": "Canvas view", "action": "Clicked on the canvas view in topology"}}, 209 | {"event": "UI Interaction", "props": {"CTA": "Map view", "action": "Clicked on the map view in topology"}}, 210 | {"event": "UI Interaction", "props": {"CTA": "View filter", "action": "Clicked on the view filter in topology"}}, 211 | {"event": "UI Interaction", "props": {"CTA": "Expand to", "action": "Clicked on the expand to in topology"}}, 212 | {"event": "UI Interaction", "props": {"CTA": "Open Metrics", "action": "Open the metrics panel"}} 213 | ] 214 | }, 215 | "Events": { 216 | "path": "/event", 217 | "events": [ 218 | {"event": "Read Object", "props": {"action": "Open event", "objectType": "button"}}, 219 | {"event": "Created Object", "props": {"action": "Assign event", "objectType": "button"}} 220 | ] 221 | }, 222 | "Event Details": { 223 | "path": "/eventDetails", 224 | "events": [ 225 | {"event": "Created Object", "props": {"action": "Comment on event", "objectType": "button"}}, 226 | {"event": "Deleted Object", "props": {"action": "Deleting event", "objectType": "button"}} 227 | ] 228 | }, 229 | "Gateways": { 230 | "path": "/gateways", 231 | "events": [ 232 | {"event": "Created Object", "props": {"action": "Create gateway modal", "objectType": "button"}}, 233 | {"event": "Read Object", "props": {"action": "Open gateway details", "objectType": "button"}}, 234 | {"event": "Created Object", "props": {"action": "Create gateway", "objectType": "button"}} 235 | ] 236 | }, 237 | "Gateway Details": { 238 | "path": "/gatewayDetails", 239 | "events": [ 240 | {"event": "Updated Object", "props": {"action": "Edit gateway", "objectType": "button"}}, 241 | {"event": "Deleted Object", "props": {"action": "Delete gateway", "objectType": "button"}} 242 | ] 243 | }, 244 | "Login & Logout": { 245 | "path": "", 246 | "events": [ 247 | {"event": "Service Login", "props": {"action": "User login", "objectType": "button"}}, 248 | {"event": "Service Logout", "props": {"action": "User logout", "objectType": "button"}} 249 | ] 250 | } 251 | } --------------------------------------------------------------------------------