Proxyman icon indicating copy to clipboard operation
Proxyman copied to clipboard

Request: Add support for organizing scripts, and other rules, using expandable nested sections.

Open mprice-banno opened this issue 4 years ago • 28 comments

Proxyman version? (Ex. Proxyman 1.4.3)

2.15.0 (21500)

macOS Version? (Ex. mac 10.14)

macOS 10.15.6

Feature request to add the ability to organize scripts in the Scripting window. I already have 40-50 scripts and it's beginning to get difficult to manage them. I would like to be able to:

  • Create folders of scripts that I can expand or contract.
  • Enable scripts either individually, or a folder of them all at once (and then be able to disable some).
  • Drag and drop scripts from folder to folder to re-organize them.
  • Nested folders would be fantastic, would make it easy to organize by project and then function. But non-nested would be great start.

Sorry for the poor quality mock-up , but something along the lines of:

Screen Shot 2020-12-22 at 8 47 18 AM

Thanks!

mprice-banno avatar Dec 22 '20 19:12 mprice-banno

Thanks for the feature request. It's quite popular recently (#713) and I suppose that it should be supported in the next major release 👍

NghiaTranUIT avatar Dec 23 '20 02:12 NghiaTranUIT

I should have checked to see if it was already filed 🙂 Thanks for the update!

mprice-banno avatar Dec 23 '20 06:12 mprice-banno

Good new that I'm working on this feature because I've recently received a lot of requests 😄

NghiaTranUIT avatar Jan 08 '21 04:01 NghiaTranUIT

Great! Perfect timing I just requested 32 new licenses, hopefully our purchasing department will get those ordered soon :-) Thanks!

mprice-banno avatar Jan 08 '21 15:01 mprice-banno

@mprice-banno wow, it's awesome. Thank you so much for supporting the Proxyman team 🎉

NghiaTranUIT avatar Jan 09 '21 01:01 NghiaTranUIT

Out of interest because I'm curious what are common use-cases for scripting?

cameroncooke avatar Jan 15 '21 13:01 cameroncooke

@cameroncooke Basically, you can do Map Local, Map Remote, and Breakpoint and more complicated tasks by writing JS Code instead of using GUI.

You can take a look at the Snippet Code that how Scripting can do: https://docs.proxyman.io/scripting/snippet-code 👍

NghiaTranUIT avatar Jan 15 '21 13:01 NghiaTranUIT

@cameroncooke Basically, you can do Map Local, Map Remote, and Breakpoint and more complicated tasks by writing JS Code instead of using GUI.

You can take a look at the Snippet Code that how Scripting can do: https://docs.proxyman.io/scripting/snippet-code 👍

Sorry don't want to take this thread too far off topic and sure I understand what it does I'm more interested in what the actual use-cases are as breakpoints and map local are pretty powerful and anything more dynamic just feels like an API builder to me which is probably better served with mocking using something like Postman.

cameroncooke avatar Jan 15 '21 13:01 cameroncooke

You can do a Mock API with the Scripting or Map Local too 😄 If you have time, let explore the Scripting, it's powerful and useful than other tools 🎉

NghiaTranUIT avatar Jan 15 '21 13:01 NghiaTranUIT

Good new that I'm working on this feature because I've recently received a lot of requests 😄

@NghiaTranUIT: Really looking forward to this feature! :tada:

michaelhogg avatar Mar 25 '21 01:03 michaelhogg

@NghiaTranUIT any update on this feature, I know it's a big one :-)

mprice-banno avatar May 06 '21 16:05 mprice-banno

Hey @mprice-banno, we're currently working on the GraphQL Matching for tools #840.

It's almost done. After that, we will focus on this feature 👍 Sorry for this inconvenience

NghiaTranUIT avatar May 07 '21 01:05 NghiaTranUIT

No worries. Good to hear it's still in the works though. :-)

mprice-banno avatar May 07 '21 16:05 mprice-banno

Just checking in again, my list of scripts is getting bigger ;-) Any updates on this one?

mprice-banno avatar Jul 26 '21 23:07 mprice-banno

@mprice-banno We're still working on it 🙇 . Sorry for the delay since we have to implement other features (Socks, http/2), which is in high priority.

NghiaTranUIT avatar Jul 27 '21 06:07 NghiaTranUIT

@NghiaTranUIT I've been running into limitations with the current scripting list, too. I realize the original request is a big lift, so I was wondering if there may be some other things that could be added while that's in progress? For example, I use pretty verbose names for my scripts, so having the ability to filter the list by strings would help.

I know this could introduce some other issues, such as indicating if non-visible scripts are enabled.

crankygeek avatar Sep 17 '21 16:09 crankygeek

@NghiaTranUIT Any news on this one? My script list is getting longer all the time.

mprice-banno avatar Feb 17 '22 19:02 mprice-banno

No idea how big of an ask this is, but could the data in ScriptService (which looks like standard JSON) be moved to a comment block in the script file itself, and the application adjusted to just use a user-defined file-system directory as the source for all scripts? This would open up the option to much more easily use external editors and git to manage scripts vs a gui in the app (I don't see why the gui would need to go away or change, but external editing would be a welcome addition).

jrobinson01 avatar Feb 17 '22 20:02 jrobinson01

@mprice-banno here is the sneak peek of what we're still working 👍

Folder Rule

Basically, you can create a folder, drag and drop, enable/disable a folder or single rules, nest folder with multiple levels...

It's done, but only for Map Local, Breakpoint, and Scripting. Our team is still working on refactoring the Block List, SSL Proxying, Map Remote, etc.

The difficult part is that we have to use a different structure, switch from NSTableView (1 layer) to NSOutlineView (multiple layers), so it takes more time.

NghiaTranUIT avatar Feb 18 '22 04:02 NghiaTranUIT

@jrobinson01 if we put the ScriptService as a comment block in the script, it's inconsistent with other tools (Breakpoint, Map Loca, ...).

To use git, you can easily add this folder ~/Library/Application Support/com.proxyman.NSProxy/user-data/. It's where all debugging tools's configs are stored.

If you change these data (JSON), the GUI is updated.


Regarding the script file, you can parse the ScriptService file and get the filePath.

For example:

[{"id":"676C54FE","isMockResponse":false,"regex":"useWildcard","url":"","graphQLQueryName":null,"isEnableRequest":true,"isEnabled":true,"filePath":"~\/Library\/Application Support\/com.proxyman.NSProxy\/scripts\/676C54FE.js","isIncludingPaths":false,"isEnableResponse":true,"name":"Untitled","method":{"any":{}}}]

Thus, you can use the external editor to modify the script.

NghiaTranUIT avatar Feb 18 '22 04:02 NghiaTranUIT

@NghiaTranUIT I'll have to play with the git setup. My goal with moving the json to the script files was to self-contain the script files for ease of sharing across teams. Understandable that that's not consistent with the rest of the app.

jrobinson01 avatar Feb 18 '22 14:02 jrobinson01

@NghiaTranUIT That looks great! Can't wait!

mprice-banno avatar Feb 18 '22 23:02 mprice-banno

Hey @crankygeek @jrobinson01 @mprice-banno @cameroncooke here is the good news 🎉

The folder for debugging tools is finally done 😄 If you don't mind, you guys can check out this beta build: Beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_3.5.2_Support_Folder.dmg

Changelog

  • Support Folder on Map Local, Breakpoint, and Scripting tool.
  • Only 1 level folder for now.
  • Enable an entire folder or particular rules.
  • Drag and drop
  • Filter on folders
  • Redesign the Scripting Editor to utilize the working space on small screens and be easier to use.
  • and minor changes.

Notes

As soon as you use this build, Proxyman will perform the data migration to the new format (treeview). Your data is safely backup. (You can access it in Help Menu -> Advanced -> Open Backup folder) 👍

GIF

CleanShot 2022-06-06 at 21 37 30

NghiaTranUIT avatar Jun 06 '22 14:06 NghiaTranUIT

@NghiaTranUIT Checking it now! Does this build also resolve the script data loss issue?

mprice-banno avatar Jun 06 '22 17:06 mprice-banno

Since I've redesigned the Scripting UI, the lost issues is fixed too 👍

NghiaTranUIT avatar Jun 07 '22 01:06 NghiaTranUIT

@NghiaTranUIT seeing a couple of issues. Haven't completely debugged them yet, but wanted to note here before I forget.

  • Creating a new script, it doesn't show any console output until I quit and restart the app.
  • The console doesn't seem to update when a script is executed, I have to close the script/console window and re-open to see the output.
  • The clear console 🗑️ icon doesn't seem to clear the console.

mprice-banno avatar Jun 10 '22 20:06 mprice-banno

Thanks for letting me know @mprice-banno 👍 it seems that all about the Scripting new UI. I'm going to fix it now 👍

NghiaTranUIT avatar Jun 11 '22 06:06 NghiaTranUIT

Here is the fix @mprice-banno : https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_3.5.2_Fix_Scripting_and_Console_Log.dmg

There was a mistake that I forget to link the Script to the Console Log Controller. Thus, it causes all problems, that you report 👍

NghiaTranUIT avatar Jun 14 '22 01:06 NghiaTranUIT