# wbb-abavus

> With this integration you can check waste schedule and create service requests in Abavus with highly customisable fields.

Latest version **0.2.1** (published 2024-05-13) · 0 weekly downloads

## Install

```sh
npm install wbb-abavus
pnpm add wbb-abavus
yarn add wbb-abavus
bun add wbb-abavus
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2024-05-13 |
| First published | 2023-05-04 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 12 |
| Unpacked size | 59.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | WBB Developers |
| Maintainers | webuildbots |
| Keywords | wbb-logicdialog |

## Links

- npm: https://www.npmjs.com/package/wbb-abavus
- npm.io page: https://npm.io/package/wbb-abavus

## Dependencies (12)

- [axios](https://npm.io/package/axios.md) ^1.6.5
- [dotenv](https://npm.io/package/dotenv.md) ^16.3.1
- [moment](https://npm.io/package/moment.md) ^2.30.1
- [postwoman](https://npm.io/package/postwoman.md) ^1.1.0
- [wbb-logger](https://npm.io/package/wbb-logger.md) ^1.1.0
- [webpack-cli](https://npm.io/package/webpack-cli.md) ^5.1.4
- [@sentry/node](https://npm.io/package/@sentry/node.md) 7.93.0
- [json-stringify-safe](https://npm.io/package/json-stringify-safe.md) ^5.0.1
- [@sentry/webpack-plugin](https://npm.io/package/@sentry/webpack-plugin.md) ^2.10.2
- [@types/source-map-support](https://npm.io/package/@types/source-map-support.md) ^0.5.3
- [@webuildbots/webuildbots-sdk](https://npm.io/package/@webuildbots/webuildbots-sdk.md) ^11.3.1
- [@google-cloud/functions-framework](https://npm.io/package/@google-cloud/functions-framework.md) ^3.3.0

## Alternatives

- [react-native-root-siblings](https://npm.io/package/react-native-root-siblings.md) — 102.9K weekly downloads
- [post-robot](https://npm.io/package/post-robot.md) — 93.7K weekly downloads
- [@praxisui/dialog](https://npm.io/package/@praxisui/dialog.md) — 2.0K weekly downloads
- [easy-toggle-state](https://npm.io/package/easy-toggle-state.md) — 350 weekly downloads
- [ngx-lightbox-evp](https://npm.io/package/ngx-lightbox-evp.md) — 19 weekly downloads

## Recent versions

- 0.2.1 (latest) — 2024-05-13
- 0.2.0 — 2024-01-26
- 0.1.1 — 2023-12-04
- 0.1.0 — 2023-12-04
- 0.0.3 — 2023-05-04
- 0.0.2 — 2023-05-04
- 0.0.1 — 2023-05-04

## README

# WBB Abavus

With this integration you can check waste schedule and create service requests in Abavus.

## Blocks Provided

Provide a list of the blocks provided as part of this integration. This should be a list of block name, and its description.

| Block Name                         | Purpose                                                                                                                        |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| waste-collection-schedule-function | This will lookup waste schedule services based on provided postcode                                                            |
| missed-bins                        | This will lookup if there are any missed bins for the address requested                                                        |
| create-service-request-function    | This will create a service request with questions provided                                                                     |
| user-authentication-function       | This will authenticate user based on email address and one more field configured in args and set person number in user session |
| missing-person-number              | This will inform user if there is no person number in sessions                                                                 |
| missing-required-args              | This will inform user that required args from function are missing                                                             |
| no-uprn-found                      | This will inform user if no UPRN was found for the address                                                                     |
| no-missed-bins                     | This will inform user it there aren't any missed bins                                                                          |

## Handler Names

The following handler names and their functions are available :

| Handler Name              | Purpose                                                                                      |
| ------------------------- | -------------------------------------------------------------------------------------------- |
| waste-collection-schedule | Searches for waste collections based on the user input postcode                              |
| user-authentication       | It will authenticate user based on email address and configured and field configured in args |
| create-service-request    | It will create service request based on set args                                             |
| missed-bins               | Search missed collections based on user input address                                        |

## Configuration Options

( Provide a list of the configuration options for each of the handlers mentioned above )

Within the function there are a number of options that can be set to configure the behaviour of the integration. The tables below show the settings that are available for each handler.

### waste-collection-schedule

| Property                    | Required | Description                                                                                                                                  |
| --------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| apiKey                      | true     | A secure API key, provided by Abavus which will be used to authenticate all API calls                                                        |
| postcode_field              | false    | if set it will user another form, default is Abavus locality form                                                                            |
| address1_field              | false    | if set it will be used as first line of address                                                                                              |
| address2_field              | false    | if set it will be used as second line of address                                                                                             |
| noWasteScheduleBlock        | false    | Overrides default no waste schedule block                                                                                                    |
| startDateOfCollectionFormat | false    | Overrides default date format MMMM D, YYYY. Should use date formats from moment.js library                                                   |
| nextCollectionString        | false    | Overrides default string for next collections: `Your next collection will be on %%startDateOfCollection%%. To be %%subject%%`                |
| dateTemplate                | false    | Overrides default date format `DD-MMM-YYYY HH:mm:ss` to comply with the date format from API. Should use date formats from moment.js library |
| tryAgain                    | false    | If set it will show the choice to try again when the block for arguments is missing will be thrown                                           |
| resetForm                   | false    | If set it will reset the form after tryAgain was clicked                                                                                     |

### user-authentication

| Property        | Required | Description                                                                           |
| --------------- | -------- | ------------------------------------------------------------------------------------- |
| apiKey          | true     | A secure API key, provided by Abavus which will be used to authenticate all API calls |
| email           | true     | name of the form value which will set email                                           |
| matchFieldValue | true     | form value of the field which will be matched against abavus user                     |
| matchFieldKey   | true     | abavus user property which matchFieldValue will be compared                           |
| nextResponse   | false     | ID of response to be triggered after this response, by default will jump to create-service-request                           |

### create-service-request

| Property      | Required | Description                                                                           |
| ------------- | -------- | ------------------------------------------------------------------------------------- |
| apiKey        | true     | A secure API key, provided by Abavus which will be used to authenticate all API calls |
| abavus-person-number      | true     | Abavus user which going to raise the ticket                                                                      |
| formCode      | true     | Abavus form code                                                                      |
| catalogueCode | true     | Abavus catalogue code                                                                 |
| status        | true     | Abavus service request status                                                         |
| questionCodes | true     | Valid question codes used to create service request                                   |
| QUESTION_CODE | true     | Valid Abavus question code will be the key and value should be form value field name  |
| answerCodes | false     | Valid answer codes used to create service request                                   |
| ANSWER_CODE | false     | Valid Abavus answer code will be the key and value should be form value field name  |

### missed-bins

| Property                    | Required | Description                                                                                                                                  |
| --------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| apiKey                      | true     | A secure API key, provided by Abavus which will be used to authenticate all API calls                                                        |
| postcode_field              | false    | if set it will user another form, default is Abavus locality form                                                                            |
| address1_field              | false    | if set it will be used as first line of address                                                                                              |
| address2_field              | false    | if set it will be used as second line of address                                                                                             |
| noMissedBinBlock            | false    | Overrides default no missed bins block                                                                                                       |
| startDateOfCollectionFormat | false    | Overrides default date format MMMM D, YYYY. Should use date formats from moment.js library                                                   |
| missedCollectionString      | false    | Overrides default string for missed collections: `Your missed collection was to %%subject%% on %%startDateOfCollection%%.`                   |
| dateTemplate                | false    | Overrides default date format `DD-MMM-YYYY HH:mm:ss` to comply with the date format from API. Should use date formats from moment.js library |
| tryAgain                    | false    | If set it will show the choice to try again when the block for arguments is missing will be thrown                                           |
| resetForm                   | false    | If set it will reset the form after tryAgain was clicked                                                                                     |

---
_Source: https://npm.io/package/wbb-abavus · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
