npm package: @spiffy-ai/commerce-api-client
Description: OpenAPI client for @spiffy-ai/commerce-api-client
Author: OpenAPI-Generator
Latest version: 1.1.0-SNAPSHOT.202603181358

# @spiffy-ai/commerce-api-client@1.1.0-SNAPSHOT.202603181358

A TypeScript SDK client for the localhost API.

## Usage

First, install the SDK from npm.

```bash
npm install @spiffy-ai/commerce-api-client --save
```

Next, try it out.


```ts
import {
  Configuration,
  CustomerServiceApi,
} from '@spiffy-ai/commerce-api-client';
import type { V1CustserviceAddNoteToLatestConversationPostRequest } from '@spiffy-ai/commerce-api-client';

async function example() {
  console.log("🚀 Testing @spiffy-ai/commerce-api-client SDK...");
  const config = new Configuration({ 
    // Configure HTTP bearer authorization: bearer
    accessToken: "YOUR BEARER TOKEN",
  });
  const api = new CustomerServiceApi(config);

  const body = {
    // AddNoteToLatestConversationRequest (optional)
    AddNoteToLatestConversationRequest: ...,
  } satisfies V1CustserviceAddNoteToLatestConversationPostRequest;

  try {
    const data = await api.v1CustserviceAddNoteToLatestConversationPost(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```


## Documentation

### API Endpoints

All URIs are relative to *http://localhost*

| Class | Method | HTTP request | Description
| ----- | ------ | ------------ | -------------
*CustomerServiceApi* | [**v1CustserviceAddNoteToLatestConversationPost**](docs/CustomerServiceApi.md#v1custserviceaddnotetolatestconversationpost) | **POST** /v1/custservice/add_note_to_latest_conversation | Add a note to the latest conversation for a customer
*CustomerServiceApi* | [**v1CustserviceCreateConversationPost**](docs/CustomerServiceApi.md#v1custservicecreateconversationpost) | **POST** /v1/custservice/create_conversation | Create a new conversation for a customer
*CustomerServiceApi* | [**v1CustserviceGetConversationMessagesPost**](docs/CustomerServiceApi.md#v1custservicegetconversationmessagespost) | **POST** /v1/custservice/get_conversation_messages | Get messages from a conversation
*CustomerServiceApi* | [**v1CustserviceIsBusinessHoursPost**](docs/CustomerServiceApi.md#v1custserviceisbusinesshourspost) | **POST** /v1/custservice/is_business_hours | Check if it is currently business hours
*CustomerServiceApi* | [**v1CustserviceSendMessagePost**](docs/CustomerServiceApi.md#v1custservicesendmessagepost) | **POST** /v1/custservice/send_message | Send a message in an existing conversation
*DefaultApi* | [**graphqlPlayground**](docs/DefaultApi.md#graphqlplayground) | **GET** /v1/graphql | Execute a GraphQL query
*DefaultApi* | [**graphqlServer**](docs/DefaultApi.md#graphqlserver) | **POST** /v1/graphql | Execute a GraphQL query
*DefaultApi* | [**healthExGet**](docs/DefaultApi.md#healthexget) | **GET** /healthex | Health check
*DefaultApi* | [**healthGet**](docs/DefaultApi.md#healthget) | **GET** /health | Health check
*DefaultApi* | [**v1AnalyticsIdentifyPost**](docs/DefaultApi.md#v1analyticsidentifypost) | **POST** /v1/analytics/identify | Get the organizations config
*DefaultApi* | [**v1AnalyticsTrackEventPost**](docs/DefaultApi.md#v1analyticstrackeventpost) | **POST** /v1/analytics/track_event | Get the organizations config
*DefaultApi* | [**v1ChatsReportSessionIdPost**](docs/DefaultApi.md#v1chatsreportsessionidpost) | **POST** /v1/chats/report | Report Session
*DefaultApi* | [**v1EventPost**](docs/DefaultApi.md#v1eventpost) | **POST** /v1/event | Post a user event 
*DefaultApi* | [**v1GetSessionMessages**](docs/DefaultApi.md#v1getsessionmessages) | **GET** /v1/session/messages | Get messages for an active chat session.
*DefaultApi* | [**v1OrgConfigGet**](docs/DefaultApi.md#v1orgconfigget) | **GET** /v1/org/config | Get the organizations config
*DefaultApi* | [**v1OrgGet**](docs/DefaultApi.md#v1orgget) | **GET** /v1/org | Get the organization and its settings given an API key
*DefaultApi* | [**v1RouterLbRedisStateGet**](docs/DefaultApi.md#v1routerlbredisstateget) | **GET** /v1/router-lb/redis-state | Check Redis keys and values for router load balancer runtime state
*DefaultApi* | [**v1SearchExplainGet**](docs/DefaultApi.md#v1searchexplainget) | **GET** /v1/search/explain | Explain why a product was recommended.
*InferenceApi* | [**v1NextResponsesPost**](docs/InferenceApi.md#v1nextresponsespost) | **POST** /v1/next_responses | Response for a user interaction
*InferenceApi* | [**v1NextSuggestionsPost**](docs/InferenceApi.md#v1nextsuggestionspost) | **POST** /v1/next_suggestions | Suggestions
*InferenceApi* | [**v1SupportedEventPost**](docs/InferenceApi.md#v1supportedeventpost) | **POST** /v1/supported_event | Check whether the event is supported
*InferenceApi* | [**v1UrlResolvingPost**](docs/InferenceApi.md#v1urlresolvingpost) | **POST** /v1/url_resolving | Resolve a URL to a page type and get configuration
*InferenceApi* | [**v1WidgetTextPost**](docs/InferenceApi.md#v1widgettextpost) | **POST** /v1/widget_text | Get widget text configuration based on tests
*ProductsApi* | [**v1ProductsRetrievePost**](docs/ProductsApi.md#v1productsretrievepost) | **POST** /v1/products/retrieve | Retrieve products
*SearchApi* | [**v1SearchQueryGet**](docs/SearchApi.md#v1searchqueryget) | **GET** /v1/search/query | 
*SearchApi* | [**v1SearchQueryPost**](docs/SearchApi.md#v1searchquerypost) | **POST** /v1/search/query | Product search with optional merchandising rule overrides
*SearchApi* | [**v1SearchSuggestionsGet**](docs/SearchApi.md#v1searchsuggestionsget) | **GET** /v1/search/suggestions | 
*SearchApi* | [**v2SearchQueryGet**](docs/SearchApi.md#v2searchqueryget) | **GET** /v2/search/query | 


### Models

- [AddNoteToLatestConversationRequest](docs/AddNoteToLatestConversationRequest.md)
- [AddNoteToLatestConversationResponse](docs/AddNoteToLatestConversationResponse.md)
- [AddToCartAttributes](docs/AddToCartAttributes.md)
- [AnalyticsIdentifyRequest](docs/AnalyticsIdentifyRequest.md)
- [AnalyticsTrackEventRequest](docs/AnalyticsTrackEventRequest.md)
- [AttachmentRequest](docs/AttachmentRequest.md)
- [AutoForm](docs/AutoForm.md)
- [Context](docs/Context.md)
- [ConversationStatus](docs/ConversationStatus.md)
- [CreateConversationRequest](docs/CreateConversationRequest.md)
- [CreateConversationResponse](docs/CreateConversationResponse.md)
- [CustServiceAttachment](docs/CustServiceAttachment.md)
- [CustServiceConversation](docs/CustServiceConversation.md)
- [CustServiceConversationMessages](docs/CustServiceConversationMessages.md)
- [CustServiceCustomer](docs/CustServiceCustomer.md)
- [CustServiceMessage](docs/CustServiceMessage.md)
- [CustomerServiceProvider](docs/CustomerServiceProvider.md)
- [FormResponseAttributes](docs/FormResponseAttributes.md)
- [FormResponseAttributesFormCategory](docs/FormResponseAttributesFormCategory.md)
- [FormSubmittedAttributes](docs/FormSubmittedAttributes.md)
- [FormType](docs/FormType.md)
- [FulfillmentDisplayStatus](docs/FulfillmentDisplayStatus.md)
- [GenerationParams](docs/GenerationParams.md)
- [GetConversationMessagesRequest](docs/GetConversationMessagesRequest.md)
- [IsBusinessHoursRequest](docs/IsBusinessHoursRequest.md)
- [IsBusinessHoursResponse](docs/IsBusinessHoursResponse.md)
- [LabelValue](docs/LabelValue.md)
- [ManualForm](docs/ManualForm.md)
- [MerchRule](docs/MerchRule.md)
- [MerchRuleAction](docs/MerchRuleAction.md)
- [MerchRuleActionAttribute](docs/MerchRuleActionAttribute.md)
- [MerchRuleActionType](docs/MerchRuleActionType.md)
- [MerchRuleCondition](docs/MerchRuleCondition.md)
- [MerchRuleOp](docs/MerchRuleOp.md)
- [MerchRuleStatus](docs/MerchRuleStatus.md)
- [NextMessageRequest](docs/NextMessageRequest.md)
- [OrderItemInfo](docs/OrderItemInfo.md)
- [OrderResponseAttributes](docs/OrderResponseAttributes.md)
- [Organization](docs/Organization.md)
- [OrganizationConfig](docs/OrganizationConfig.md)
- [OrganizationConfigResults](docs/OrganizationConfigResults.md)
- [OrganizationSettings](docs/OrganizationSettings.md)
- [PDPAttributes](docs/PDPAttributes.md)
- [PLPAttributeCategory](docs/PLPAttributeCategory.md)
- [PLPAttributes](docs/PLPAttributes.md)
- [PLPAttributesAttributes](docs/PLPAttributesAttributes.md)
- [PLPIdAttributes](docs/PLPIdAttributes.md)
- [PLPUrlAttributes](docs/PLPUrlAttributes.md)
- [PageVisitAttributes](docs/PageVisitAttributes.md)
- [PageVisitCategory](docs/PageVisitCategory.md)
- [ProductRetrievalRequest](docs/ProductRetrievalRequest.md)
- [ProductRetrievalResponse](docs/ProductRetrievalResponse.md)
- [ProductSearchFilterResponseAttributes](docs/ProductSearchFilterResponseAttributes.md)
- [ProductSearchRequest](docs/ProductSearchRequest.md)
- [ProductSearchResponse](docs/ProductSearchResponse.md)
- [ProductSearchResponseAttributes](docs/ProductSearchResponseAttributes.md)
- [ProductSearchResponseV2](docs/ProductSearchResponseV2.md)
- [QueryTypedAttributes](docs/QueryTypedAttributes.md)
- [ReportContent](docs/ReportContent.md)
- [ReportSessionRequest](docs/ReportSessionRequest.md)
- [Response](docs/Response.md)
- [ResponseCategory](docs/ResponseCategory.md)
- [ResponseProductAttributes](docs/ResponseProductAttributes.md)
- [SearchAttributes](docs/SearchAttributes.md)
- [SearchResponseProduct](docs/SearchResponseProduct.md)
- [SearchSuggestionsResponse](docs/SearchSuggestionsResponse.md)
- [SendMessageRequest](docs/SendMessageRequest.md)
- [SendMessageResponse](docs/SendMessageResponse.md)
- [StatsigExperiment](docs/StatsigExperiment.md)
- [StatsigFeatureGate](docs/StatsigFeatureGate.md)
- [Suggestion](docs/Suggestion.md)
- [SuggestionCategory](docs/SuggestionCategory.md)
- [SuggestionClickedAttributes](docs/SuggestionClickedAttributes.md)
- [SupportedEventProductCategory](docs/SupportedEventProductCategory.md)
- [SupportedEventRequest](docs/SupportedEventRequest.md)
- [SupportedEventResponse](docs/SupportedEventResponse.md)
- [TurnInfo](docs/TurnInfo.md)
- [TurnInfoPrevUserEvent](docs/TurnInfoPrevUserEvent.md)
- [UrlResolvingGenericConfig](docs/UrlResolvingGenericConfig.md)
- [UrlResolvingPDPConfig](docs/UrlResolvingPDPConfig.md)
- [UrlResolvingPLPConfig](docs/UrlResolvingPLPConfig.md)
- [UrlResolvingRequest](docs/UrlResolvingRequest.md)
- [UrlResolvingResponse](docs/UrlResolvingResponse.md)
- [UrlResolvingResponseSpecificDetails](docs/UrlResolvingResponseSpecificDetails.md)
- [UrlResolvingType](docs/UrlResolvingType.md)
- [UserEvent](docs/UserEvent.md)
- [UserEventAttributes](docs/UserEventAttributes.md)
- [UserEventCategory](docs/UserEventCategory.md)
- [V1GetSessionMessages200Response](docs/V1GetSessionMessages200Response.md)
- [V1SearchExplainGet200Response](docs/V1SearchExplainGet200Response.md)
- [WidgetString](docs/WidgetString.md)
- [WidgetTextRequest](docs/WidgetTextRequest.md)
- [WidgetTextResponse](docs/WidgetTextResponse.md)
- [WidgetType](docs/WidgetType.md)

### Authorization


Authentication schemes defined for the API:
<a id="bearer"></a>
#### bearer


- **Type**: HTTP Bearer Token authentication

## About

This TypeScript SDK client supports the [Fetch API](https://fetch.spec.whatwg.org/)
and is automatically generated by the
[OpenAPI Generator](https://openapi-generator.tech) project:

- API version: `1.1.0`
- Package version: `1.1.0-SNAPSHOT.202603181358`
- Generator version: `7.20.0`
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`

The generated npm module supports the following:

- Environments
  * Node.js
  * Webpack
  * Browserify
- Language levels
  * ES5 - you must have a Promises/A+ library installed
  * ES6
- Module systems
  * CommonJS
  * ES6 module system


## Development

### Building

To build the TypeScript source code, you need to have Node.js and npm installed.
After cloning the repository, navigate to the project directory and run:

```bash
npm install
npm run build
```

### Publishing

Once you've built the package, you can publish it to npm:

```bash
npm publish
```

## License

[]()