Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent browser issue without an input containing the api key #144

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
0c3cc6a
prevent browser issue without input apikey
tsamaya Jun 3, 2023
19b6378
updates browser example
tsamaya Jun 3, 2023
87c2ba9
Update dependency dotenv to v16.1.4
renovate[bot] Jun 10, 2023
4cecb1b
Update dependency webpack-cli to v5.1.4
renovate[bot] Jun 10, 2023
f35c409
Update dependency webpack to v5.86.0
renovate[bot] Jun 10, 2023
4341d72
Update dependency dotenv to v16.3.0
renovate[bot] Jun 17, 2023
29cb20e
Update dependency eslint to v8.43.0
renovate[bot] Jun 17, 2023
3148cb9
Update dependency webpack to v5.87.0
renovate[bot] Jun 17, 2023
3015384
Update dependency dotenv to v16.3.1
renovate[bot] Jun 17, 2023
0e919fd
Update dependency eslint-plugin-jest to v27.2.2
renovate[bot] Jun 24, 2023
8bae33a
build
tsamaya Jun 24, 2023
f9d2eb0
output error on ci
tsamaya Jun 24, 2023
90dcf09
httpbin
tsamaya Jun 24, 2023
34f25b3
Update Node.js to v20.3.1
renovate[bot] Jun 24, 2023
b42fa84
Update dependency webpack to v5.88.0
renovate[bot] Jun 24, 2023
836c17f
prevent prepublish
tsamaya Jun 24, 2023
d8b4513
rollback cimg
tsamaya Jun 24, 2023
bed6d59
Update dependency lint-staged to v13.2.3
renovate[bot] Jul 1, 2023
ae6f671
Update dependency webpack to v5.88.1
renovate[bot] Jul 1, 2023
2e0af2c
Update dependency eslint to v8.44.0
renovate[bot] Jul 1, 2023
ae21f68
Update Node.js to v20.4.0
renovate[bot] Jul 8, 2023
5dda726
Update dependency jest to v29.6.1
renovate[bot] Jul 8, 2023
b5d4ae1
use jsonplaceholder instead of httpbin
tsamaya Jul 8, 2023
6b5b59a
Update dependency cross-fetch to v4
renovate[bot] Jul 8, 2023
9b54a07
Update dependency eslint-plugin-jest to v27.2.3
renovate[bot] Jul 15, 2023
48054aa
Update dependency eslint to v8.45.0
renovate[bot] Jul 15, 2023
f043468
Update dependency prettier to v3
renovate[bot] Jul 8, 2023
1cbd0a6
updates config for prettier 3
tsamaya Jul 9, 2023
2cc13a5
updates hound config
tsamaya Jul 9, 2023
7f67bae
Update dependency eslint-plugin-prettier to v5
renovate[bot] Jul 15, 2023
b3d00b8
updates lock file
tsamaya Jul 15, 2023
4a77e0b
updates lock file
tsamaya Jul 15, 2023
085c945
linter fix->prettier v3
tsamaya Jul 15, 2023
cb48dce
updates README
tsamaya Jul 15, 2023
7452863
docs 1.0.2
tsamaya Jul 16, 2023
7cd9148
Changelog
tsamaya Jul 16, 2023
51df727
1.0.2
tsamaya Jul 16, 2023
c89c0b6
Update dependency webpack to v5.88.2
renovate[bot] Jul 22, 2023
3508f9f
Update Node.js to v20.5.0
renovate[bot] Jul 22, 2023
7d27414
Update dependency jest to v29.6.2
renovate[bot] Jul 29, 2023
bb366f4
Update dependency eslint to v8.46.0
renovate[bot] Jul 29, 2023
a33e598
Update dependency eslint-config-prettier to v8.9.0
renovate[bot] Jul 29, 2023
5776f23
Update dependency eslint-plugin-import to v2.28.0
renovate[bot] Jul 29, 2023
44a964e
Update dependency prettier to v3.0.1
renovate[bot] Aug 5, 2023
f749fd5
Update dependency eslint-config-prettier to v8.10.0
renovate[bot] Aug 5, 2023
9346787
Update dependency eslint-config-prettier to v9
renovate[bot] Aug 5, 2023
b95e2c2
Update dependency eslint to v8.47.0
renovate[bot] Aug 12, 2023
6bca5e3
Update Node.js to v20.5.1
renovate[bot] Aug 12, 2023
37e830e
adds meterian scanner
tsamaya Aug 13, 2023
d31b4d0
use my token
tsamaya Aug 13, 2023
ed65c60
audit fix semver
tsamaya Aug 13, 2023
9dd4eea
updates package json, deps with fixed version
tsamaya Aug 13, 2023
50baad1
removes codecov deps in favor of the orb
tsamaya Aug 13, 2023
0109e5e
Update dependency eslint-plugin-import to v2.28.1
renovate[bot] Aug 19, 2023
061b6a2
Update dependency prettier to v3.0.2
renovate[bot] Aug 19, 2023
25d070a
Update dependency lint-staged to v13.3.0
renovate[bot] Aug 19, 2023
b82332f
Update dependency lint-staged to v14
renovate[bot] Aug 19, 2023
6155938
Update dependency jest to v29.6.4
renovate[bot] Aug 26, 2023
6b37615
Update dependency lint-staged to v14.0.1
renovate[bot] Aug 26, 2023
61e3cfd
Update dependency eslint to v8.48.0
renovate[bot] Aug 26, 2023
1f69f9d
Update dependency prettier to v3.0.3
renovate[bot] Sep 2, 2023
1e36d05
Update Node.js to v20.6.0
renovate[bot] Sep 9, 2023
26e0b2a
Update dependency eslint to v8.49.0
renovate[bot] Sep 9, 2023
0e4b9a2
Update actions/checkout action to v4
renovate[bot] Sep 9, 2023
d5b8413
Update Node.js to v20.6.1
renovate[bot] Sep 16, 2023
8f47044
Update dependency eslint-plugin-jest to v27.4.0
renovate[bot] Sep 16, 2023
c8f2abe
Update dependency jest to v29.7.0
renovate[bot] Sep 16, 2023
a479a0e
Update Node.js to v20.7.0
renovate[bot] Sep 23, 2023
e2d3f38
Update dependency eslint to v8.50.0
renovate[bot] Sep 23, 2023
79d707e
Update MeterianHQ/meterian-github-action action to v1.0.16
renovate[bot] Sep 30, 2023
1f6b38e
Update dependency eslint-plugin-jest to v27.4.2
renovate[bot] Sep 30, 2023
b4f1bc8
Update codecov orb to v3.3.0
renovate[bot] Sep 30, 2023
9b5580f
Update Node.js to v20.8.0
renovate[bot] Oct 7, 2023
ac0bb05
Update dependency eslint to v8.51.0
renovate[bot] Oct 7, 2023
8b56cbf
Bump postcss from 8.4.19 to 8.4.31
dependabot[bot] Oct 7, 2023
c1e9769
Update dependency eslint-plugin-prettier to v5.0.1
renovate[bot] Oct 14, 2023
0c73cd3
Update dependency webpack to v5.89.0
renovate[bot] Oct 14, 2023
857788a
Update dependency lint-staged to v15
renovate[bot] Oct 14, 2023
ca4925f
Bump @babel/traverse from 7.20.1 to 7.23.2
dependabot[bot] Oct 18, 2023
d8682c7
Update Node.js to v20.8.1
renovate[bot] Oct 21, 2023
0956c4a
Update dependency eslint-plugin-jest to v27.4.3
renovate[bot] Oct 21, 2023
f485fd5
Update dependency lint-staged to v15.0.2
renovate[bot] Oct 21, 2023
9813f46
Update dependency eslint to v8.52.0
renovate[bot] Oct 21, 2023
dbbc4d0
Update Node.js to v20.9.0
renovate[bot] Oct 28, 2023
457278b
Update dependency eslint-plugin-import to v2.29.0
renovate[bot] Oct 28, 2023
5db65b3
Update dependency eslint-plugin-jest to v27.6.0
renovate[bot] Oct 28, 2023
dbc2559
Update dependency eslint to v8.53.0
renovate[bot] Nov 4, 2023
3dc630c
Update Node.js to v21
renovate[bot] Nov 10, 2023
e671b96
feat: 🎸 Adds input paramater address_only
tsamaya Nov 10, 2023
424b48d
prepare 1.0.3
tsamaya Nov 10, 2023
528b49a
1.0.3
tsamaya Nov 10, 2023
a0b008b
updates deps
tsamaya Nov 10, 2023
a9e5f38
runs meterian scan on PR only
tsamaya Nov 10, 2023
817683f
chore(deps): update dependency lint-staged to v15.1.0
renovate[bot] Nov 11, 2023
d9cf445
chore(deps): update dependency eslint to v8.54.0
renovate[bot] Nov 18, 2023
12e4f73
chore(deps): update dependency prettier to v3.1.0
renovate[bot] Nov 18, 2023
f7ec7c0
chore(deps): update node.js to v21.2.0
renovate[bot] Nov 18, 2023
ab6b11f
chore(deps): update meterianhq/meterian-github-action action to v1.0.17
renovate[bot] Nov 25, 2023
d49f91e
chore(deps): update dependency eslint-config-prettier to v9.1.0
renovate[bot] Dec 2, 2023
47994e2
chore(deps): update dependency eslint to v8.55.0
renovate[bot] Dec 2, 2023
11199e8
chore(deps): update dependency lint-staged to v15.2.0
renovate[bot] Dec 9, 2023
0102783
chore(deps): update node.js to v21.4.0
renovate[bot] Dec 9, 2023
2f6aacf
chore(deps): update dependency eslint-plugin-import to v2.29.1
renovate[bot] Dec 16, 2023
543ff67
chore(deps): update dependency prettier to v3.1.1
renovate[bot] Dec 16, 2023
2f2212a
chore(deps): update node orb to v5.1.1
renovate[bot] Dec 16, 2023
a2afa21
chore(deps): update dependency eslint to v8.56.0
renovate[bot] Dec 16, 2023
3c6909f
chore(deps): update dependency eslint-plugin-prettier to v5.1.1
renovate[bot] Dec 23, 2023
87f961b
chore(deps): update dependency eslint-plugin-prettier to v5.1.2
renovate[bot] Dec 30, 2023
20a8ed4
chore(deps): update node orb to v5.2.0
renovate[bot] Jan 6, 2024
22c688d
chore(deps): update dependency eslint-plugin-jest to v27.6.1
renovate[bot] Jan 6, 2024
cf2932b
chore(deps): update node.js to v21.5.0
renovate[bot] Jan 6, 2024
cbf0abe
chore(deps): update dependency eslint-plugin-prettier to v5.1.3
renovate[bot] Jan 13, 2024
2f6a736
chore(deps): update dependency eslint-plugin-jest to v27.6.3
renovate[bot] Jan 13, 2024
e705262
chore(deps): update dependency prettier to v3.2.1
renovate[bot] Jan 13, 2024
746dab6
chore(deps): update dependency prettier to v3.2.4
renovate[bot] Jan 20, 2024
d3e43a1
fix(deps): update dependency dotenv to v16.3.2
renovate[bot] Jan 20, 2024
63ae934
chore(deps): update node.js to v21.6.0
renovate[bot] Jan 20, 2024
3774cae
chore(deps): update dependency webpack to v5.90.0
renovate[bot] Jan 27, 2024
c975f15
chore(deps): update node.js to v21.6.1
renovate[bot] Jan 27, 2024
aff608b
chore(deps): update codecov orb to v4
renovate[bot] Jan 27, 2024
d7294bc
fix(deps): update dependency dotenv to v16.4.1
renovate[bot] Jan 27, 2024
c936f9e
chore(deps): update dependency husky to v9
renovate[bot] Jan 27, 2024
29cf3e0
chore(deps): update codecov orb to v4.0.1
renovate[bot] Feb 3, 2024
ad8a63d
chore(deps): update dependency documentation to v14.0.3
renovate[bot] Feb 3, 2024
eff099c
chore(deps): update dependency husky to v9.0.10
renovate[bot] Feb 3, 2024
dffeae2
chore(deps): update dependency lint-staged to v15.2.1
renovate[bot] Feb 3, 2024
78f640d
chore(deps): update dependency webpack to v5.90.1
renovate[bot] Feb 3, 2024
2f1283d
Changelog's links
tsamaya Feb 3, 2024
8092fcd
Release v1.0.4
tsamaya Feb 3, 2024
a39d1a1
updates changelog
tsamaya Feb 3, 2024
0e6dc58
maintenance 2024
tsamaya Feb 3, 2024
fe91a58
updates meterian scanner
tsamaya Feb 3, 2024
198c8ed
updates Meterian's badges
tsamaya Feb 3, 2024
d708875
chore(deps): update dependency lint-staged to v15.2.2
renovate[bot] Feb 10, 2024
9eb2b6d
chore(deps): update dependency prettier to v3.2.5
renovate[bot] Feb 10, 2024
60767cc
fix(deps): update dependency dotenv to v16.4.2
renovate[bot] Feb 10, 2024
b0d816e
chore(deps): update dependency husky to v9.0.11
renovate[bot] Feb 17, 2024
a529a30
chore(deps): update dependency webpack to v5.90.2
renovate[bot] Feb 17, 2024
3a6c17d
fix(deps): update dependency dotenv to v16.4.4
renovate[bot] Feb 17, 2024
eada685
chore(deps): update dependency eslint-plugin-jest to v27.9.0
renovate[bot] Feb 17, 2024
c6f60e9
fix(deps): update dependency dotenv to v16.4.5
renovate[bot] Feb 24, 2024
128723d
chore(deps): update dependency eslint to v8.57.0
renovate[bot] Feb 24, 2024
9e2d3ae
chore(deps): update node.js to v21.6.2
renovate[bot] Mar 2, 2024
992bcac
chore(deps): update dependency webpack to v5.91.0
renovate[bot] Mar 20, 2024
2535104
chore(deps): update node.js to v21.7.1
renovate[bot] Mar 30, 2024
4a3113a
chore(deps): update node.js to v21.7.2
renovate[bot] Apr 6, 2024
98c5c08
chore(deps): update dependency eslint-plugin-jest to v28
renovate[bot] Apr 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
version: 2.1

orbs:
node: circleci/[email protected]
node: circleci/[email protected]
codecov: codecov/[email protected]

jobs:
build:
docker:
- image: cimg/node:20.2.0
- image: cimg/node:21.7.2

steps:
- checkout
Expand All @@ -25,5 +26,8 @@ jobs:
name: Run tests
command: |
./cc-test-reporter before-build
npm run coverage
npm run test
./cc-test-reporter after-build --coverage-input-type lcov --exit-code $?

# Upload coverage reports to Codecov
- codecov/upload
7 changes: 7 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
module.exports = {
env: {
node: true,
browser: true,
},
parserOptions: {
ecmaVersion: 'latest',
},
extends: [
'airbnb-base',
'plugin:prettier/recommended',
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/meterian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# .github/workflows/meterian.yml

name: Meterian Scanner workflow

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
meterian_scan:
name: Meterian client scan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Meterian Scanner
uses: MeterianHQ/[email protected]
env:
METERIAN_API_TOKEN: ${{ secrets.METERIAN_API_TOKEN }}
3 changes: 2 additions & 1 deletion .hound.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
eslint:
version: 8.33.0
version: 8.44.0
esversion: 6
ignore_file: .eslintignore
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## [Unreleased]

## [1.0.4] - 2024-02-03

### Changed

- upgrade dependencies

## [1.0.3] - 2023-11-10

### Changed

- adds input parameter `address_only` into the typescript definition

## [1.0.2] - 2023-07-16

### Changed

- upgrade dependencies
Expand Down Expand Up @@ -94,7 +108,11 @@ Open Cage website URL has changed

First release

[unreleased]: https://github.com/tsamaya/opencage-api-client/compare/v1.0.0...HEAD
[unreleased]: https://github.com/tsamaya/opencage-api-client/compare/v1.0.4...HEAD
[1.0.4]: https://github.com/tsamaya/opencage-api-client/compare/v0.10.3...v1.0.4
[1.0.3]: https://github.com/tsamaya/opencage-api-client/compare/v0.10.2...v1.0.3
[1.0.2]: https://github.com/tsamaya/opencage-api-client/compare/v0.10.2...v1.0.2
[1.0.1]: https://github.com/tsamaya/opencage-api-client/compare/v0.10.0...v1.0.1
[1.0.0]: https://github.com/tsamaya/opencage-api-client/compare/v0.10.0...v1.0.0
[0.10.0]: https://github.com/tsamaya/opencage-api-client/compare/v0.9.0...v0.10.0
[0.9.0]: https://github.com/tsamaya/opencage-api-client/compare/v0.8.1...v0.9.0
Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Version](https://img.shields.io/npm/v/opencage-api-client.svg)](https://www.npmjs.com/package/opencage-api-client)
![Downloads](https://img.shields.io/npm/dw/opencage-api-client)
[![GitHub license](https://img.shields.io/github/license/tsamaya/opencage-api-client)](https://github.com/tsamaya/opencage-api-client/blob/master/LICENSE.md)
![Maintained](https://img.shields.io/maintenance/yes/2023.svg)
![Maintained](https://img.shields.io/maintenance/yes/2024.svg)

This repository is an [OpenCage Geocoding API](https://opencagedata.com/api) client for JavaScript and node.

Expand All @@ -16,11 +16,11 @@ This repository is an [OpenCage Geocoding API](https://opencagedata.com/api) cli

### Security

| Source | Scores |
| ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Meterian](https://www.meterian.io/) | [![stability status](https://www.meterian.io/badge/gh/tsamaya/opencage-api-client/stability)](https://www.meterian.io/report/gh/tsamaya/opencage-api-client) [![security status](https://www.meterian.io/badge/gh/tsamaya/opencage-api-client/security)](https://www.meterian.io/report/gh/tsamaya/opencage-api-client) |
| [FOSSA](https://fossa.com/) | [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftsamaya%2Fopencage-api-client.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftsamaya%2Fopencage-api-client?ref=badge_shield) |
| [Snyk](https://snyk.io/) | ![Snyk Vulnerabilities for GitHub Repo](https://img.shields.io/snyk/vulnerabilities/github/tsamaya/opencage-api-client?label=GH%20Vulnerabilities) ![Snyk Vulnerabilities for npm package](https://img.shields.io/snyk/vulnerabilities/npm/opencage-api-client?label=npm%20Vulnerabilities) |
| Source | Scores |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Meterian](https://www.meterian.io/) | [![security status](https://www.meterian.com/badge/gh/tsamaya/opencage-api-client/security?branch=master)](https://www.meterian.com/report/gh/tsamaya/opencage-api-client) [![stability status](https://www.meterian.com/badge/gh/tsamaya/opencage-api-client/stability?branch=master)](https://www.meterian.com/report/gh/tsamaya/opencage-api-client) |
| [FOSSA](https://fossa.com/) | [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftsamaya%2Fopencage-api-client.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftsamaya%2Fopencage-api-client?ref=badge_shield) |
| [Snyk](https://snyk.io/) | ![Known Vulnerabilities](https://snyk.io/test/github/tsamaya/opencage-api-client/badge.svg) |

## Tutorial

Expand Down Expand Up @@ -152,8 +152,7 @@ Check the examples using the Test API key from OpenCage [error handling examples
1. Fork or clone this repository
1. `$ cd` into the `repository` folder
1. `$ npm install` to install all the required dependencies from [npm](https://www.npmjs.com/)
1. lint and test using `$ npm test`
1. coverage `$ npm run coverage`
1. lint and test coverage using `$ npm test`
1. Build : `$ npm run build`

## 🛣 Revision History
Expand Down
2 changes: 1 addition & 1 deletion dist/opencage-api.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/opencage-api.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset='utf-8'>
<title>opencage-api-client 1.0.1 | Documentation</title>
<title>opencage-api-client 1.0.3 | Documentation</title>
<meta name='description' content='An OpenCageData Geocoder API client library for node and browsers (UMD)'>
<meta name='viewport' content='width=device-width,initial-scale=1'>
<link href='assets/bass.css' rel='stylesheet'>
Expand All @@ -15,7 +15,7 @@
<div id='split-left' class='overflow-auto fs0 height-viewport-100'>
<div class='py1 px2'>
<h3 class='mb0 no-anchor'>opencage-api-client</h3>
<div class='mb1'><code>1.0.1</code></div>
<div class='mb1'><code>1.0.3</code></div>
<input
placeholder='Filter'
id='filter-input'
Expand Down
3 changes: 2 additions & 1 deletion examples/browser.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ <h2 class="title">Result</h2>
}

$('.button.is-text').click(function () {
console.log('submit button clicked');
console.log('cancel button clicked');
clear();
raz();
});
Expand All @@ -84,6 +84,7 @@ <h2 class="title">Result</h2>
console.log('submit button clicked');
clear();
if (!check()) {
console.log('invalid input');
return;
}

Expand Down
8 changes: 8 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ declare module 'opencage-api-client' {
* When set to 1 the behaviour of the geocoder is changed to attempt to match the nearest road (as opposed to address). If possible we also fill additional information in the roadinfo annotation. Please see details API Documentation.
*/
roadinfo?: number;
/**
* When set to 1 we include only the address (exluding POI names) in the formatted string we return.
*
* Example usage: address_only=1
*
* As an example, by default a reverse geocoding request for the coordinates 50.976004, 11.336753 returns a formatted value of Goethes Gartenhaus, Corona-Schröter-Weg 1, 99425 Weimar, Germany, but if address_only=1 is specified the value would be simply Corona-Schröter-Weg 1, 99425 Weimar, Germany. This can be particularly useful when there are many stores/restaurants/whatever at a single location (for example a multi-story building).
*/
address_only?: number;
}

export function geocode(input: GeocodeRequest): Promise<any>;
Expand Down
Loading