Import dynamic variables from Postman into PAW - paw-app

I've set up a pretty extensive set of calls in collections using postman. I use dynamic variables (e.g. {{USERNAME}}) in the URL, headers, and body of these calls that are dynamically replaced by variables from my selected postman environment. I'd like to import this collection (along with environments) to PAW and have the dynamic postman variables be switched to dynamic PAW variables.
I've looked at How do I import from Postman and ensure all of my environment variables will get resolved? which is this exact same question, but the answer (to use the Postman Importer - https://luckymarmot.com/paw/extensions/PostmanImporter) doesn't seem to work completely.
I've tried the latest version of the importer (v2.0.0) and while it appears to convert the dynamic variables I define in the headers of my postman calls, it does not replace those in the URL or request body. After importing to PAW I still have, for example, {{USERNAME}} in my request body.
Any tips would be appreciated.

We're currently working on a large project that will enable Paw to import many API formats in a lot nicer way (including Postman), we should have something ready by next week, and it will solve the problem you're having for environment variable {{EXAMPLE}} in the URL and the body.
Though, I've checked and it appears that the previous version of the Postman Importer had this environment variable import right. So maybe it's worth giving it a try if you need that today: https://github.com/luckymarmot/Paw-PostmanImporter/releases/tag/v1.2.0
All you have to do, is checkout the repo, checkout the tag v1.2.0 and run npm install and cake install. It should install itself in the Paw extension directory and replace the existing version of the importer.

Related

Next.js - import server-side package in a file contains both server-side and client-side functionality?

Let's say I have a file named utils.js, containing two functions s and c.
s is a server-side function (Being called on an /api endpoint handler), and uses mongodb package.
c is a client-side function (will be bundled and sent to the browser).
When compiling the app using next build, will it cause any issues?
Does webpack know to bundle only part of a file/module? (considering server-side functions and imports as a "dead code" since they only being called from a server-side code)
Thanks
If you need to know which functions get bundled to the client & which ones to the server, there's an easy way to know this → https://next-code-elimination.now.sh/
Just copy & paste the contents of your file into it & you'll see which code gets bundled to the client & which code is bundled to the server. If you have imports then make sure to put all the imports in one file so you can see how it works.
The thumb rule is:
Anything like getServerSideProps, getStaticProps & getStaticPaths will be removed from the bundled code. If you import anything from a file that uses server-side code like fs but doesn't use it in any of the above 3 functions, then it won't be removed (check at Next Code Elimination Tool) & will give you an error.
The tool is the answer. I copy-pasted my file in it & found the answer in an instant.
I think there will be errors but not in the build time. It is likely issues will happen in the run time. You won't be able to access file systems on the client side just like how you can't access the window object on the server-side.
In my current project, we have utility functions for both the server-side, client-side, or universal. All server-side functions are called in getServerSideProps to make sure they work as expected. All your server-side code in getServerSideProps will not be imported as part of the client-side bundle if that's what you mean by "dead code". According to the Next.js
Note: You can import modules in top-level scope for use in
getServerSideProps. Imports used in getServerSideProps will not be
bundled for the client-side.
This means you can write server-side code directly in
getServerSideProps. This includes reading from the filesystem or a
database.
I'm not aware of a way you can ask webpack to bundle part of the file or execute a subset of import statements.
I hope that provides some help.
Reference:
Docs - getServerSideProps
Custom Webpack Config

Can Meteor 1.5 dynamic importing be done on multiple scripts simultaneously?

Meteor 1.5 was recently released, and it has... dynamic imports!
All the examples I see are for dynamically importing one file, and then running code for it. I'm curious if there is a way to dynamically import multiple files with one declaration?
Thanks. :)
Depends on what you mean by "import multiple files"…
Whenever you request a dynamic import, Meteor will fetch the required module and all its dependencies which are not already available in the browser cache.
On the contrary of classic HTTP request, the downloading is not parallelized, but goes through the already available Websocket. So all modules go through a pipe / queue.
If your code depends on multiple modules, you could simply write a "parent" module.
Or you could also aggregate your dynamic imports with Promise.all, since they return Promises.

h5ai use on a CDN?

Is it possible to use the h5ai "pretty" index UI on a CDN? I'm using Dreamhosts' DreamObjects and have it installed correctly (I've used it before on standard hosting sites). Am only getting an XML parse of the data back.
See it here: https://randassets.objects.cdn.dream.io/
Any thoughts? Thanks!
I guess what you would like to see is a pretty-looking list of files and directories on a web page, like a file browser to explore the content of your DreamObjects bucket. If that's the case, hi5ai would not work because from what I understand, hi5ai doesn't natively speak neither the S3 API nor the OpenStack Swift ones. hi5ai relies on a web server and a php interpreter, which are not provided by DreamObjects.
Maybe if you expand on your use case I can suggest you other tools you could use to browse your collection of files, something like ownCloud (and more specifically how to configure DreamObjects with ownCloud) or others.

How do I import from Postman and ensure all of my environment variables will get resolved?

I have a pretty large suite of Postman definitions, and every request contains one or more Postman-style variables, e.g. {{HOST}}. The values for those are obviously different for each of my Postman environments. I have successfully imported all of my environments into Paw, and then I imported one of my collections, but none of the variables were converted into Paw-style variables, it seems, because I am having to go to each one and delete the likes of {{HOST}} in favor of re-typing from scratch {HOST} so that it will resolve to the proper environment variable placeholder. I tried hacking the imported file as well as the importer extension to beat it into submission but to no avail. Is there really no way to get these variables to import as placeholders?
Update: Paw has a new documentation article on How to migrate from Postman to Paw
Probably late for an answer, but we've recently improved the Postman Importer so all variable tags (like {{variable}}) are now resolved into environment variables: https://luckymarmot.com/paw/extensions/PostmanImporter

Installanywhere silent install is not respecting several properties in the response file?

I am trying to run a silent installation of an application using Installanywhere's silent install and response file functions. I have recorded a response file multiple times, and then run a silent install using that response file, yet certain properties are not used. The target directory always ends up being correct, but things like a passphrase or a server port are completely ignored. I have researched the vendor's boards and found nothing helpful on the topic. Can anyone with Installanywhere experience be of assistance?
If those panels are custom, it is a vendor bug: storing variable to response file is an additional action that should be added to custom panel code
it is possible though to investigate the installer and find out what variable to add to response file
The problem might be that the installer you are using relies on "merge modules". It seems that variable values are not passed to-and-from merge modules when running in silent mode.
I have unfortunately encountered this issue with the installers I'm working on, but the Flexera forums don't provide much help either:
silent installation with merge modules
merge module variable are accessible in silent install
The vendor may not even be aware of this either.
Just put to blank your default value in your "Set installanywhere variable"'s action, Otherwise values from your properties file (for silent install) will be overwrite by values define in action 'Set installAnywhere variable".
As stated in Flexera's documentation, you will need to set the variable both in your proxy's 'setVariable' method, and ReplayService 'register' method.
The 'register' method is responsible on writing the variable to the response file:
customCodePanelProxy.setVariable("MY_VAR", "MY_VALUE");
ReplayVariableService replayService = (ReplayVariableService)customCodePanelProxy.getService(ReplayVariableService.class);
// This will do the trick:
replayService.register("MY_VAR", "MY_VALUE");
For further details refer to this IA guide:
http://helpnet.flexerasoftware.com/InstallAnywhereAPI/IA2010/javadoc/com/zerog/ia/api/pub/ReplayVariableService.html

Resources