This project provides a JSSP broker for integration with Google Sheets.
This template requires Node.js v12.14.1+ to run.
Install the dependencies and devDependencies:
npm install
See the documentation for @k2oss/k2-broker-core for more information about how to use the broker SDK package.
When you're ready to build your broker, run the following command
npm run build
You will find the results in the dist/index.js.
For notes on testing, please see the Testing section below.
Once you have a bundled .js file, upload it to your repository (anonymously accessible) and register the service type using the system SmartObject located at System > Management > SmartObjects > SmartObjects > JavaScript Service Provider and run the Create From URL method.
Thank you for you interest to contribute to this JSSP Broker. This section explains some of the things you need to keep in mind when contributing. This will both help you be successful in submitting your contribution, as well as make our lives a bit easier.
Please check if your issue hasn't been reported before by checking the current issues. If your issue already exists then please add extra information or show that you have the same issue/want this feature by adding a :+1:
.
If your issue is not there, feel free to open a new issue.
If you have a feature request that doesn't already exist, then please add one to the list. Please be as detailed as possible. Please remember that we're creating Service Objects with Methods and Properties and that we really can't read your mind. So, state the obvious and also don't be afraid to explain /why/ you need the functionality.
If you do have a problem with the broker and want help, then please provide the following information in the issue:
- Version of the broker that you're using
- How you got the JSSP broker
- Reproduction steps - Please explain which service object method you're executing and what the input properties are.
- Expected behavior - explain what you expect to happen.
- Any error messages that you're getting. Really, don't try to skimp on the screenshot or so. Provide as much detail as you can.
If you're lucky enough to be able to add functionality yourself, or fix an issue yourself, then please keep in mind:
- Make a pull request with a clear title. "Fix #1233" is not clear.
- Describe what the fix/feature does.
- Make sure any documentation is updated.
- Make sure there is a test for new functionality. We will reject new service object methods that do not have a test. Also, see Testing below.
- Create the pull request against the master branch.
- If you fix an issue, then please include "Closed #XXX" in the message.
We tend to use VS code. The .vscode
folder already indicated that. Furthermore we use prettier for code formatting. VS code should be configured to format your code when you save your file. Please stick to the default code formatting of prettier.
MIT, found in the LICENSE file.
The source code has a set of tests that need to be 100% successful before we allow code to enter the master
branch.
To run the unit tests, run:
npm test
You can also use a development build, for debugging and coverage gutters:
npm run test:dev
You will find the code coverage results in coverage/index.html.
The above commands will likely cause issues the first time you run them, that has two reasons
- Google Sheet uses Oauth, and at this time the OAuth token needs to be entered in a variable in the
test.ts
file. You can get this OAuth token easily from PostMan.