Commit 87ac58f4 authored by Ben Galloway's avatar Ben Galloway

Tweaks to README and removal of old PDF docs

parent 7fcee1a9
......@@ -4,30 +4,20 @@ A library of async JavaScript functions that make the corresponding calls to the
## Installation
Via the command line:
```bash
yarn add git+ssh://git@gscgit:utils/gamma-in-js.git
```
or directly in `package.json`:
```json
"dependencies": {
"gamma-in-js": "git+ssh://git@gscgit:utils/gamma-in-js.git"
}
```
## Config
Set an environment variable `GAMMA_ENV=live` to use the LIVE Gamma database. Anything else will send requests to TEST Gamma.
Set an environment variable `GAMMA_ENV=live` to use the _live_ Gamma database. Anything else will send requests to _test_ Gamma.
This library uses the `debug` module to provide debug logs. To turn this on, set an environment variable `DEBUG=gammajs`.
## Usage
```javascript
// Simple example
// Simple example, with no error handling
import { gammaResourceViewListLoad } from "gamma-in-js";
(async () => {
const resourceViews = await gammaResourceViewListLoad();
......@@ -35,6 +25,8 @@ import { gammaResourceViewListLoad } from "gamma-in-js";
})();
```
(Note that, depending on the version of Node which is used to run it, this example may require transpilation by Babel or similar, as it uses the ES6 module syntax.)
### Example input format
All methods accept an object of parameters, e.g. for the call above,
......@@ -287,19 +279,53 @@ Note the use of array fields with a key of `anyType` to produce the correspondin
No input validation is performed because the documentation and calls are just not consistent enough - for example, some calls will return 'Unsupported' if a tag (marked Optional in the docs) is not included as an empty tag; other calls will return a value just fine if the tag is omitted entirely.
If the Gamma API throws an error, an error will also be thrown from the JavaScript method, giving the details.
If the Gamma API throws an error, an error will also be thrown from the JavaScript method, giving any details received.
## TODO
* **Endpoints** - a small refactor of `config.js` will be required when the multi-endpoint API architecture is introduced. It is already partly set up to handle this.
* **Endpoints** - a small refactor of `config.js` will be required when the multi-endpoint API architecture is introduced. The file is already partly set up to handle this.
## Methods List
See the full Gamma documentation in the `docs/` directory for complete details of each call and its expected input parameters.
### Bookings methods
All of these methods are destructive - i.e. if called correctly they push new data into Gamma or remove existing data from Gamma. They therefore require correspondingly more care in their use.
* `gammaAmendBooking`
* `gammaBookingAllSave`
* `gammaCancelBookingRequest`
* `gammaRemoveContactInterests`
* `gammaSaveCustomerDetails`
* `gammaUpdateBooking`
* `gammaUpdateBookingStatus`
### Reservation methods
These methods are not destructive but do cause some side-effects. They have a separate endpoint as they can be called live/in real time by the website.
* `gammaBookAvailableSpacesRequest`
* `gammaCancelBookAvailableSpaces`
* `gammaReserveXTSeats`
* `gammaCancelSeats`
### Membership methods
These are methods which relate purely to memberships. There are some which are destructive:
* `gammaChangeMemberDetails`
* `gammaMembershipPurchase`
* `gammaMembershipCancellation`
and some which are not:
* `gammaMembershipSubscriptionsLoad`
* `gammaModifiedMembers`
### Availability methods
All of these methods are non-destructive, i.e. they do not push any data into Gamma.
All of these methods are non-destructive, i.e. they do not push any data into Gamma, only pull data from it.
* `gammaAllContactInterests`
* `gammaBookingETicketExportRequest`
......@@ -326,41 +352,11 @@ All of these methods are non-destructive, i.e. they do not push any data into Ga
#### Methods from the docs that are unavailable in this library
The following availability methods seem to be unsupported by the Gamma API. They are not made available on the export:
The following availability methods seem to be unsupported by the Gamma API. They are defined within the library but not made available on the export:
* `ResourceDatesNotAvailable`
* `ResourceListByViewByDateLoadLight`
### Bookings methods
All of these methods **are** destructive - i.e. if called correctly they push new data into Gamma or remove existing data from Gamma. They therefore require correspondingly more care in their use.
* `gammaAmendBooking`
* `gammaBookingAllSave`
* `gammaCancelBookingRequest`
* `gammaRemoveContactInterests`
* `gammaSaveCustomerDetails`
* `gammaUpdateBooking`
* `gammaUpdateBookingStatus`
### Reservation methods
These methods are not destructive but do cause some side-effects. They have a separate endpoint as they can be called live/in real time by the website.
* `gammaBookAvailableSpacesRequest`
* `gammaCancelBookAvailableSpaces`
* `gammaReserveXTSeats`
* `gammaCancelSeats`
### Membership methods
These are methods which relate purely to memberships. There are some which are destructive:
## Contributing
* `gammaChangeMemberDetails`
* `gammaMembershipPurchase`
* `gammaMembershipCancellation`
and some which are not:
* `gammaMembershipSubscriptionsLoad`
* `gammaModifiedMembers`
The distributed version of this library is simply built by Babel, assuming that any applications which use it will be running a relatively modern version of Node.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment