Skip to content

Commit

Permalink
[Epic] New HTTP Adaptor & Utils (#457)
Browse files Browse the repository at this point in the history
* wip add request util

* wip: using undici client

add tests

* wip: add mock agent

* wip: more tests

* wip: test options

* update undici

* add changeset

* fix typo

* improve errorMap

* fix undici

* remove method in assertOK

* improve signature

* improve assertOK

add tests for baseUrl option and errorMap

* throw an error if response code match errorMap

* remove duplicate property value

* test if body is string and add default body timeout

* wip: improvements in util

* remove util.js

* restructure util files

* add recursive option

* common: restructure build output

* remove comments

* update isValidHttpUrl

minor improvements

* rename a test

* wip: parseAs

* wip: update mockClient func

* wip: refactor test

* improve tests

* better url parsing

* remove comment

* update response body

* update content type check

* remove comments

* remove headers

* common: adjust import

* common: tweak request docs

* wip: refactor

* wip: refactor test

* wip: post tests

* wip: skip failed tests

* wip: tests

* common: updated unit tests

* common: fix test

* add request helper function

* wip: clean up tests

* add support for successcode in errorMap

* fix broken test

* remove undici skip test

* remove cookies handling

* remove unused packages

* improve aut parsing

* wip: followRedirect

* wip: follow redirect

* wip: form-data

* http: update formdata tests

* http: remove rediect test

* improve logging

* clean up unused packages and add http-status-codes

* clean up deadcode

* improve form-data test

* add changeset

* remove common changeset

* improvements

* add duration

* add method and url to response body

* add support for tls

* improve jsdoc

* update changelog

* add requestBodyType function

This function assert that body type and convert a plan json to a string

* remove JSON.stringify

* add unit test for requestBodyType

* add helpers for http server

* update dependencies

* remove http helpers

* add intergration test

* add responseUrl function

This function will return history url if found or request url

* fix test

* add koa and koa-sslify

* add certificates for testing

* update tests

* move server into integration file

* add server logic

* update https port

it turns out in ubuntu any port < 1024 needs root permission

* use nodes https module

remove koa implementation

* http: move request helper into utils

* common: typo in docs

* http: fix headers and start updating tests

* package lock

* test updates

* common: rename http helper response touse statusCode and statusMessage. Also remove the response url.

* http: update tests

* http: update tests

* common: restore url to the response object

A version of it anyway

* http: refactor response log

* common: update http error message

* http: update to use new  error handling

* http: tidy ups

* http: docs

* http,common:docs

* http: undocument maxRedirects

Not willing to commit to it tbh

* http: light refactor

* common: another light refactor

* lock node version in ci

* common: restore default error map

* http: fix form processing

* http: remove file extension from import

* common: deprecate old http functions

Shoud print a warning in dev mode, but not in prod (platform or lightning)

* http: expose a general request operation

* common: update release notes

* bump versions

* lockfile

* Update auto-generated documentation.

* docs: improve markdown templates

* tools: update docs

* Update http docs

* http: update request example

* remove build artefacts

* http,common: move some http stuff into common utils

* Update template

* template: update to use new helpers

* template: remove unused code

* readme

* Update template

Template should be locked at 1.0.0 and never published

* common: don't print output if you're given a bad response

* common: better url building

* http: remove custom tags from docs

* common: tweak URL parsing rules

* common: better url reporting in errors

* common: fix url parsing

whoops

* common: don't use URL.parse

* add linting for undeclared variables

Fixes issues in azure-storage, common, http, magpi, mailchimp, mongodb, resourcemap and twilio

* bump versions

* common: better handling of error responses in http

* http: update changelog

* http: changelog fixes

---------

Co-authored-by: Emmanuel Evance <[email protected]>
  • Loading branch information
mtuchi committed Mar 19, 2024
1 parent 2b72294 commit fa6afac
Show file tree
Hide file tree
Showing 6 changed files with 770 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/template/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# @openfn/language-template

## 1.0.0

Initial release.
Loading

0 comments on commit fa6afac

Please sign in to comment.