@thirstie/thirstieservices 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/README.md +41 -0
- package/dist/bundle.cjs +2851 -0
- package/dist/bundle.iife.js +1 -0
- package/dist/bundle.mjs +2848 -0
- package/package.json +37 -0
- package/rollup.config.mjs +28 -0
- package/src/geoservice/index.js +232 -0
- package/src/index.js +7 -0
- package/src/thirstieapi/index.js +331 -0
- package/src/thirstieapi/utils/apirequest.js +34 -0
- package/tests/env.json.tpl +5 -0
- package/tests/fixtures/catalog.json +757 -0
- package/tests/fixtures/catalog_productline_offerings.json +689 -0
- package/tests/fixtures/google_autocomplete_response.json +281 -0
- package/tests/fixtures/google_autocomplete_response_withzip.json +75 -0
- package/tests/fixtures/google_placeid_details.json +104 -0
- package/tests/fixtures/guest_user.json +20 -0
- package/tests/fixtures/session_anonymous.json +8 -0
- package/tests/fixtures/user_addressbook.json +22 -0
- package/tests/fixtures/user_guest.json +20 -0
- package/tests/fixtures/user_loggedin.json +23 -0
- package/tests/fixtures/user_wallet.json +194 -0
- package/tests/functional/apirequest.func.test.js +46 -0
- package/tests/functional/geoservice.func.test.js +53 -0
- package/tests/integration/thirstieapi.int.test.js +89 -0
- package/tests/unit/geoservice.unit.test.js +367 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
# 0.1.0 (2024-10-07)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* allow restoring age gate settings ([2030773](https://github.com/ThirstieAdmin/thirstiejs-monorepo/commit/2030773073df53b56a08a3dd5937afac63c87217))
|
|
12
|
+
* simplify saving session state ([fa0ba48](https://github.com/ThirstieAdmin/thirstiejs-monorepo/commit/fa0ba48d29140961e7c035605a0bee82ac7f0b17))
|
|
13
|
+
* update user actions ([2f8cf07](https://github.com/ThirstieAdmin/thirstiejs-monorepo/commit/2f8cf07f9bafbca4fd5d57435a37189541449ded))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# Changelog
|
|
20
|
+
|
|
21
|
+
All notable changes to this project will be documented in this file.
|
|
22
|
+
|
|
23
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
24
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
25
|
+
|
|
26
|
+
## [Unreleased]
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- n/a
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
|
|
34
|
+
- n/a
|
|
35
|
+
|
|
36
|
+
### Removed
|
|
37
|
+
|
|
38
|
+
- n/a
|
package/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# ThirstieClient
|
|
2
|
+
|
|
3
|
+
ThirstieClient provides a service layer for using the Thirstie ECommerce API which
|
|
4
|
+
can be imported as a CommonJS or ES module.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
- `npm install @thirstie/thirstieclient`
|
|
9
|
+
|
|
10
|
+
## Minimum Requirements
|
|
11
|
+
|
|
12
|
+
- Node.js: v18+
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
You must have an Thirstie API Client Key (provided by your Thirstie representative)
|
|
17
|
+
to initialize `ThirstieClient`. Optionally, you can also provide a Google API key to
|
|
18
|
+
enable location services using Google's Maps / Places API.
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
async function main (apiKey, mapsKey) {
|
|
22
|
+
const thirstieapp = new ThirstieClient({ apiKey, mapsKey });
|
|
23
|
+
const res = await thirstieapp.initSession();
|
|
24
|
+
console.log(res);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
main();
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Expected output:
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
{
|
|
34
|
+
application_name: '<your thirstie application name>',
|
|
35
|
+
session_uuid: '<session uuid>',
|
|
36
|
+
token: '<access jwt>',
|
|
37
|
+
token_type: 'Bearer',
|
|
38
|
+
user: null,
|
|
39
|
+
uuid: '<thirstie application uuid>'
|
|
40
|
+
}
|
|
41
|
+
```
|