Skip to content

Commit

Permalink
Merge pull request #47 from srveit/fix-params
Browse files Browse the repository at this point in the history
## [1.5.0] - 2024-06-07

### Changed

- changed options to agent.get
- use previous retrieved URL as base for partial URLs in fetchPage
- updated "Mac Safari" agent string
- removed field.rawValue property
- change fiel.value from property to function
- updated to use Node.JS v22

### Added

- handle binary mime types
- handle redirects in fetchPage
- debug option to fetchPage and submit
- agent.getCookies function
  • Loading branch information
srveit authored Jun 7, 2024
2 parents 22f0413 + 5f643f1 commit c84ef91
Show file tree
Hide file tree
Showing 35 changed files with 1,391 additions and 953 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
env:
OS: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"default": true,
"no-duplicate-header": {
"no-duplicate-heading": {
"siblings_only": true
}
}
25 changes: 23 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,29 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.5.0] - 2024-06-07

### Changed

- changed options to agent.get
- use previous retrieved URL as base for partial URLs in fetchPage
- updated "Mac Safari" agent string
- removed field.rawValue property
- change fiel.value from property to function
- updated to use Node.JS v22

### Added

- handle binary mime types
- handle redirects in fetchPage
- debug option to fetchPage and submit
- agent.getCookies function

## [1.4.1] - 2024-04-25

### Changed

- change package main to lib/mechanize.js
- changed package main to lib/mechanize.js

## [1.4.0] - 2024-04-25

Expand Down Expand Up @@ -220,7 +238,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial code

[Unreleased]: https://github.com/srveit/mechanize-js/compare/v1.2.1...HEAD
[1.5.0]: https://github.com/srveit/mechanize-js/compare/v1.4.1...v1.5.0
[1.4.1]: https://github.com/srveit/mechanize-js/compare/v1.4.0...v1.4.1
[1.4.0]: https://github.com/srveit/mechanize-js/compare/v1.3.0...v1.4.0
[1.3.0]: https://github.com/srveit/mechanize-js/compare/v1.2.1...v1.3.0
[1.2.1]: https://github.com/srveit/mechanize-js/compare/v1.2.0...v1.2.1
[1.2.0]: https://github.com/srveit/mechanize-js/compare/v1.1.0...v1.2.0
[1.1.0]: https://github.com/srveit/mechanize-js/compare/v1.0.3...v1.1.0
Expand Down
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,14 @@ This borrows heavily from Aaron Patterson's
[node-version-url]: https://nodejs.org/en/download/
[github-build-badge]: https://img.shields.io/github/workflow/status/srveit/mechanize-js/build-actions
[github-build-url]: https://github.com/srveit/mechanize-js/actions/workflows/test-actions.yml
[coveralls-badge]: https://coveralls.io/repos/github/srveit/mechanize-js/badge.svg?branch=master
[coveralls-url]: https://coveralls.io/github/srveit/mechanize-js?branch=master
[code-climate-badge]: https://img.shields.io/codeclimate/maintainability/srveit/mechanize-js.svg
[code-climate-url]: https://codeclimate.com/github/srveit/mechanize-js
[gitter-badge]: https://img.shields.io/gitter/room/mechanize-js/Lobby.svg
[gitter-url]: https://gitter.im/mechanize-js/Lobby
[bithound-badge]: https://www.bithound.io/github/srveit/mechanize-js/badges/score.svg
[bithound-url]: https://www.bithound.io/github/srveit/mechanize-js
[codecov-badge]: https://img.shields.io/codecov/c/github/srveit/mechanize-js/master.svg?style=flat
[codecov-url]: https://codecov.io/github/srveit/mechanize-js
[license-badge]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat
[license-url]: http://choosealicense.com/licenses/mit/
[canonical-badge]: https://img.shields.io/badge/code%20style-canonical-brightgreen.svg?style=flat
[canonical-url]: https://github.com/gajus/eslint-config-canonical
[snyk-badge]: https://snyk.io/test/github/srveit/mechanize-js/badge.svg
[snyk-url]: https://snyk.io/test/github/srveit/mechanize-js

Expand All @@ -114,7 +108,8 @@ https://sonarcloud.io/dashboard/index/srveit:mechanize
[![Readme](https://img.shields.io/badge/readme-tested-brightgreen.svg?style=flat)](https://www.npmjs.com/package/reamde)
[![Doug's Gratipay][gratipay-image-dougwilson]][gratipay-url-dougwilson]
[![API documented](https://img.shields.io/badge/API-documented-brightgreen.svg)](https://raszi.github.io/node-tmp/)
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/thlorenz/convert-source-map/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/thlorenz/convert-source-map/trend.png)]
(https://bitdeli.com/free "Bitdeli Badge")
[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=282608)](https://www.bountysource.com/trackers/282608-eslint?utm_source=282608&utm_medium=shield&utm_campaign=TRACKER_BADGE)
[![Bower version](https://img.shields.io/bower/v/spdx-license-ids.svg)](https://github.com/shinnn/spdx-license-ids/releases)
[![Codeship Status for ashtuchkin/iconv-lite](https://www.codeship.com/projects/81670840-fa72-0131-4520-4a01a6c01acc/status)](https://www.codeship.com/projects/29053)
Expand Down
10 changes: 10 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
coverage:
status:
project:
default:
target: 50%
threshold: 1%
patch:
default:
target: 50%
threshold: 1%
2 changes: 1 addition & 1 deletion docs/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.htm
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Apr 25 2024 16:35:43 GMT-0500 (Central Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a> on Fri Jun 07 2024 12:39:51 GMT-0500 (Central Daylight Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/history.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.htm
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Apr 25 2024 16:35:43 GMT-0500 (Central Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a> on Fri Jun 07 2024 13:08:03 GMT-0500 (Central Daylight Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.htm
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Apr 25 2024 16:35:43 GMT-0500 (Central Daylight Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.3</a> on Fri Jun 07 2024 13:08:03 GMT-0500 (Central Daylight Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
4 changes: 1 addition & 3 deletions examples/get_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ const args = process.argv.slice(2)

const showPageLinks = async (uri) => {
const agent = newAgent()
const page = await agent.get({
uri,
})
const page = await agent.get(uri)
const links = page.links()

for (const link of links) {
Expand Down
2 changes: 1 addition & 1 deletion examples/submit_form_chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const args = process.argv.slice(2)

const submitFormChain = async (url) => {
const agent = newAgent()
const page = await agent.get({ uri: url })
const page = await agent.get(url)
// get the first form from the page (index #0)
const form = page.form(0)

Expand Down
2 changes: 1 addition & 1 deletion spec/mechanize.test.js → lib/mechanize.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { newAgent, newPage } from '../lib/mechanize'
import { newAgent, newPage } from './mechanize'
import { beforeEach, describe, expect, it } from 'vitest'

describe('Mechanize', () => {
Expand Down
Loading

0 comments on commit c84ef91

Please sign in to comment.