Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
"space-before-function-paren": 0,
"comma-dangle": 0
}
}
}
12 changes: 6 additions & 6 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ daysUntilStale: 20
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
closeComment: false
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# compiled output
/dist/
/tmp/

# dependencies
/node_modules/
LICENSE.md
README.md
9 changes: 9 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

module.exports = {
trailingComma: 'es5',
tabWidth: 4,
semi: true,
singleQuote: true,
printWidth: 190,
};
8 changes: 4 additions & 4 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Copyright (c) 2021 Fleetbase Pte Ltd, All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3) Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ const fleetbase = new Fleetbase('Your Public Key');

// create a place
const speceNeedle = await fleetbase.places.create({
name: 'Space Needle',
street1: '400 Broad Street',
city: 'Seattle',
state: 'WA',
country: 'US'
name: 'Space Needle',
street1: '400 Broad Street',
city: 'Seattle',
state: 'WA',
country: 'US',
});
```

Expand All @@ -65,32 +65,32 @@ const fleetbase = new Fleetbase('Your Secret Key');

// create a place
const speceNeedle = await fleetbase.places.create({
name: 'Space Needle',
street1: '400 Broad Street',
city: 'Seattle',
state: 'WA',
country: 'US'
name: 'Space Needle',
street1: '400 Broad Street',
city: 'Seattle',
state: 'WA',
country: 'US',
});
```

## Create a custom adapter

You're able to create a custom adapter to handle network request in the Fleetbase SDK.
You're able to create a custom adapter to handle network request in the Fleetbase SDK.
The Fleetbase SDK ships with two standard adapters. The BrowserAdapter which is based on `fetch()` and
the NodeAdapter based on axios.

```js
import { Adapter } from '@fleetbase/sdk';

class CustomAdapter extends Adapter {
constructor(config) {
super(config);
}

get() {}
post() {}
put() {}
patch() {}
delete() {}
constructor(config) {
super(config);
}

get() {}
post() {}
put() {}
patch() {}
delete() {}
}
```
2 changes: 1 addition & 1 deletion dist/@fleetbase/sdk.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/@fleetbase/sdk.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cjs/fleetbase.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cjs/fleetbase.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/esm/fleetbase.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/esm/fleetbase.js.map

Large diffs are not rendered by default.

157 changes: 84 additions & 73 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,86 @@
{
"name": "@fleetbase/sdk",
"version": "1.2.5",
"description": "Fleetbase JS & Node SDK",
"main": "dist/cjs/fleetbase.js",
"module": "dist/esm/fleetbase.js",
"files": [
"dist",
"src"
],
"scripts": {
"prebuild": "npm run lint",
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"lint:tests": "eslint tests",
"bundle": "rollup -c",
"dev": "rollup -c -w",
"test": "mocha --require @babel/polyfill --require @babel/register --require source-map-support/register tests/*.test.js"
},
"author": "Ronald A. Richardson <ron@fleetbase.io> (https://ron.dev)",
"license": "BSD-3-Clause",
"devDependencies": {
"@babel/core": "^7.14.0",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-proposal-decorators": "^7.13.15",
"@babel/plugin-transform-spread": "^7.13.0",
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.14.1",
"@babel/register": "^7.13.16",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-node-resolve": "^13.0.5",
"chai": "^4.3.4",
"eslint": "^7.26.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.16.0",
"mocha": "^8.4.0",
"rollup-plugin-eslint": "^5.1.0",
"rollup-plugin-terser": "^7.0.2",
"source-map-support": "^0.5.19"
},
"dependencies": {
"@babel/runtime": "^7.15.4",
"axios": "^0.21.1",
"cross-fetch": "^3.1.4",
"global": "^4.4.0",
"rollup": "^2.50.5"
},
"directories": {
"lib": "src",
"test": "tests"
},
"repository": {
"type": "git",
"url": "git+https://github.com/fleetbase/fleetbase-js.git"
},
"publishConfig": {
"access": "public"
},
"keywords": [
"logistics",
"ondemand",
"delivery",
"operations",
"logistics",
"api",
"fleet",
"management",
"fleet",
"api"
],
"bugs": {
"url": "https://github.com/fleetbase/fleetbase-js/issues"
},
"homepage": "https://github.com/fleetbase/fleetbase-js#readme"
"name": "@fleetbase/sdk",
"version": "1.2.8",
"description": "Fleetbase JS & Node SDK",
"main": "dist/cjs/fleetbase.js",
"module": "dist/esm/fleetbase.js",
"types": "types/fleetbase.d.ts",
"files": [
"dist",
"src",
"types"
],
"scripts": {
"prebuild": "npm run lint",
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"lint:tests": "eslint tests",
"bundle": "rollup -c",
"dev": "rollup -c -w",
"test": "mocha --require @babel/polyfill --require @babel/register --require source-map-support/register tests/*.test.js",
"prepare": "husky install",
"format": "prettier . --write"
},
"author": "Ronald A. Richardson <ron@fleetbase.io> (https://ron.dev)",
"license": "BSD-3-Clause",
"lint-staged": {
"**/*": "prettier --write --ignore-unknown"
},
"dependencies": {
"@babel/runtime": "^7.23.6",
"axios": "^1.6.2",
"cross-fetch": "^4.0.0",
"global": "^4.4.0",
"rollup": "^4.9.0"
},
"devDependencies": {
"@babel/core": "^7.23.6",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.23.6",
"@babel/plugin-transform-spread": "^7.23.3",
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.23.6",
"@babel/register": "^7.22.15",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-node-resolve": "^15.2.3",
"chai": "^4.3.10",
"eslint": "^8.55.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.29.0",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"mocha": "^10.2.0",
"prettier": "3.1.1",
"rollup-plugin-eslint": "^7.0.0",
"rollup-plugin-terser": "^7.0.2",
"source-map-support": "^0.5.21",
"typescript": "^5.3.3"
},
"directories": {
"lib": "src",
"test": "tests"
},
"repository": {
"type": "git",
"url": "git+https://github.com/fleetbase/fleetbase-js.git"
},
"publishConfig": {
"access": "public"
},
"keywords": [
"logistics",
"ondemand",
"delivery",
"operations",
"logistics",
"api",
"fleet",
"management",
"fleet",
"api"
],
"bugs": {
"url": "https://github.com/fleetbase/fleetbase-js/issues"
},
"homepage": "https://github.com/fleetbase/fleetbase-js#readme"
}
Loading