hexmostech / lama2 Goto Github PK
View Code? Open in Web Editor NEWFree, Lightweight & Collaborative API Client
Home Page: https://hexmos.com/lama2/index.html
License: GNU Affero General Public License v3.0
Free, Lightweight & Collaborative API Client
Home Page: https://hexmos.com/lama2/index.html
License: GNU Affero General Public License v3.0
With the changes related to l2config.env
, I think MULTIPART attachments have gone broken. The MULTIPART attachment path must always be calculated relative the relevant .l2
file.
Moreover, in the environment loading logic, we seem to be making an error, that is chdir, load up env, chdir, go on parsing, making request, etc. The second chdir probably should happen as the last action.
Lama2 support in pure Windows and WSL contexts requires an end to end testing and calibration:
install.sh
script to support Windows & WSL-u
choco -v
2.2.2
PS C:\WINDOWS\system32> choco install lama2 --version=1.0.0 --force -y
Chocolatey v2.2.2
3 validations performed. 2 success(es), 1 warning(s), and 0 error(s).
Validation Warnings:
Installing the following packages:
lama2
By installing, you accept licenses for the packages.
lama2 not installed. The package was not found with the source(s) listed.
Source(s): 'https://community.chocolatey.org/api/v2/'
NOTE: When you specify explicit sources, it overrides default sources.
If the package version is a prerelease and you didn't specify --pre
,
the package may not be found.
Version was specified as '1.0.0'. It is possible that version
does not exist for 'lama2' at the source specified.
Please see https://docs.chocolatey.org/en-us/troubleshooting for more
assistance.
Chocolatey installed 0/1 packages. 1 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Failures
--pre
,Enjoy using Chocolatey? Explore more amazing features to take your
experience to the next level at
https://chocolatey.org/compare
The prototype version of l2
had an option to prettify/standardize .l2
files. The previous version depended entirely on regular expressions for identifying the various pieces of input (verb, url, headers, json/varjson). It is not entirely clear, what is the correct approach to implementing a prettification algorithm. Hence, the task involves two phases:
Note that, in the present version, it is almost trivial to implement JSON prettification. The difficulty is in dealing with arbitrary input order (say URL comes before Verb).
Example file:
GET
${LOCAL_COORD}/api/request-pwd/[email protected]
In this case +
is a special character which is part of the email value. It is not being interpreted correctly at backend.
However, if I URL encode the +
character as follows, it works as expected:
${LOCAL_COORD}/api/request-pwd/?email=qp0co2%2Bc5yyclrbbhrt3e%40sharklasers.com
I'm using the command:
curl -s https://hexmos.com/lama2/install.sh | bash -s
and getting the following error message in the end:
tar: Option --overwrite is not supported
Usage:
List: tar -tf <archive-filename>
Extract: tar -xf <archive-filename>
Create: tar -cf <archive-filename> [filenames...]
Help: tar --help
mv: rename /tmp/l2 to /usr/local/bin/l2: No such file or directory
The os version: macos Ventura version 13.1
According to the Stackoverflow survey, the following seem like some important platforms that may benefit Lama2 integration:
Any help with supporting these platforms is appreciated. The documentation contains points on how to build Editor/IDE extensions.For discussions/support, post in the thread, and join our Discord server.
Postman data can be exported to various formats in static form. Insomnia too, has similar features.
It'll be useful to have automated conversion from collections -> a directory of .l2
files ready to be committed.
Presently only the Response headers seem to appear
We need syntax highlighters for .l2
syntax. If you have experience in the area, please contact us.
From my limited research, iro4cli seems like a tool capable of generating multiple editor syntax format targets.
�[90m9:19PM�[0m �[32mINF�[0m Didn't find l2.env in the API directory �[36mType=�[0mPreprocess
const url = 'http://localhost:8000/polls/alldata';
const options = {method: 'get'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
Sometimes it is easier to launch a request through a button, rather than the command shell.
It'll be super handy to have an option to generate Python/JS/Other code from .l2
specifications.
curlconverter seems like a nice JS project which can generate code in multiple languages, given a curl input. So, then, the subproblems become:
.l2
goja
VM to load curlconverter
For application using JWT token this is the typical use case, like this in my current curl script:
TOKEN=$(curl -d '{"email": "[email protected]", "pass": "hello"}' -H 'Content-Type: application/json' http://localhost:3210/rpc/login | jq -r '.token')
curl -H 'Accept: application/json' -H "Authorization: Bearer ${TOKEN}" http://localhost:3210/user_articles?select=title
The first line gets the token from the response and then use the token to GET the result from the second line request.
We tend to have variables for remote/local hostname, and presently it is cumbersome to switch between the various values. Build an autocomplete for variables; fetch values from l2.env
and if possible from JS blocks.
The following request cannot be made presently using Lama2:
curl --request POST \
--url http://localhost:3000/oauth/token \
--header 'Authorization: Basic YXBwbGljYXRpb246c2VjcmV0' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data grant_type=password \
--data username=pedroetb \
--data password=password
We have the MULTIPART
keyword, but that is not exactly x-www-form-urlencoded
. The difference between these two options can be found at SO
Maybe we could have something as simple as:
POST
FORM
http://xyz
a=b
c=d
I love HTTPie , but since Python is a big dependency and since Lama2 is developed in GO , are there any plan to to use Go-Based httpclient or lib?eg:
https://github.com/nojima/httpie-go
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.