diff --git a/.travis.yml b/.travis.yml index fe97ea9..b00ccea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ node_js: - '6' - '6.1' before_install: -- openssl aes-256-cbc -K $encrypted_0dfb31adf922_key -iv $encrypted_0dfb31adf922_iv +- openssl aes-256-cbc -K $encrypted_17d5860a9a31_key -iv $encrypted_17d5860a9a31_iv -in ./travis-ci/accounts.enc -out ./travis-ci/accounts.json -d cache: directories: diff --git a/CHANGES.md b/CHANGES.md index 58e7f45..776a937 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,25 @@ # Change Log +## Version 2.9.0 (2018-06-28) + +We have added search functionality to the Connect v2 Customer API. + +### New features and Improvements: Customer API (Connect v2) + +* `SearchCustomers` endpoint — retrieves groups of customer profiles + based on a related characteristic. For example, retrieving all customers + created in the past 24 hours. +* `creation_source` field is now available on `Customer` entities. The creation + source exposes the process that created a customer profile. For example, if + a customer is created using the API, the creation source will be + `THIRD_PARTY`. +* **Instant Profiles** are now exposed in the following endpoints: + `RetrieveCustomer`, `SearchCustomers`, `UpdateCustomer`, `DeleteCustomer`. + +### Fixes: Inventory SDK (Connect v1) + +* Fix SDK request property `adjustment_type` in V1 Adjust Inventory. + ## Version 2.8.0 (2018-05-24) We have added sorting functionality to the Connect v2 Customer API, updated diff --git a/README.md b/README.md index 7090bcb..af12516 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ Class | Method | HTTP request | Description *SquareConnect.CustomersApi* | [**deleteCustomerCard**](docs/CustomersApi.md#deleteCustomerCard) | **DELETE** /v2/customers/{customer_id}/cards/{card_id} | DeleteCustomerCard *SquareConnect.CustomersApi* | [**listCustomers**](docs/CustomersApi.md#listCustomers) | **GET** /v2/customers | ListCustomers *SquareConnect.CustomersApi* | [**retrieveCustomer**](docs/CustomersApi.md#retrieveCustomer) | **GET** /v2/customers/{customer_id} | RetrieveCustomer +*SquareConnect.CustomersApi* | [**searchCustomers**](docs/CustomersApi.md#searchCustomers) | **POST** /v2/customers/search | SearchCustomers *SquareConnect.CustomersApi* | [**updateCustomer**](docs/CustomersApi.md#updateCustomer) | **PUT** /v2/customers/{customer_id} | UpdateCustomer *SquareConnect.LocationsApi* | [**listLocations**](docs/LocationsApi.md#listLocations) | **GET** /v2/locations | ListLocations *SquareConnect.OrdersApi* | [**batchRetrieveOrders**](docs/OrdersApi.md#batchRetrieveOrders) | **POST** /v2/locations/{location_id}/orders/batch-retrieve | BatchRetrieveOrders @@ -215,8 +216,14 @@ Class | Method | HTTP request | Description - [SquareConnect.CreateRefundResponse](docs/CreateRefundResponse.md) - [SquareConnect.Currency](docs/Currency.md) - [SquareConnect.Customer](docs/Customer.md) + - [SquareConnect.CustomerCreationSource](docs/CustomerCreationSource.md) + - [SquareConnect.CustomerCreationSourceFilter](docs/CustomerCreationSourceFilter.md) + - [SquareConnect.CustomerFilter](docs/CustomerFilter.md) - [SquareConnect.CustomerGroupInfo](docs/CustomerGroupInfo.md) + - [SquareConnect.CustomerInclusionExclusion](docs/CustomerInclusionExclusion.md) - [SquareConnect.CustomerPreferences](docs/CustomerPreferences.md) + - [SquareConnect.CustomerQuery](docs/CustomerQuery.md) + - [SquareConnect.CustomerSort](docs/CustomerSort.md) - [SquareConnect.CustomerSortField](docs/CustomerSortField.md) - [SquareConnect.DeleteCatalogObjectRequest](docs/DeleteCatalogObjectRequest.md) - [SquareConnect.DeleteCatalogObjectResponse](docs/DeleteCatalogObjectResponse.md) @@ -270,6 +277,8 @@ Class | Method | HTTP request | Description - [SquareConnect.RetrieveTransactionResponse](docs/RetrieveTransactionResponse.md) - [SquareConnect.SearchCatalogObjectsRequest](docs/SearchCatalogObjectsRequest.md) - [SquareConnect.SearchCatalogObjectsResponse](docs/SearchCatalogObjectsResponse.md) + - [SquareConnect.SearchCustomersRequest](docs/SearchCustomersRequest.md) + - [SquareConnect.SearchCustomersResponse](docs/SearchCustomersResponse.md) - [SquareConnect.SortOrder](docs/SortOrder.md) - [SquareConnect.TaxCalculationPhase](docs/TaxCalculationPhase.md) - [SquareConnect.TaxInclusionType](docs/TaxInclusionType.md) @@ -279,6 +288,7 @@ Class | Method | HTTP request | Description - [SquareConnect.TenderCardDetailsStatus](docs/TenderCardDetailsStatus.md) - [SquareConnect.TenderCashDetails](docs/TenderCashDetails.md) - [SquareConnect.TenderType](docs/TenderType.md) + - [SquareConnect.TimeRange](docs/TimeRange.md) - [SquareConnect.Transaction](docs/Transaction.md) - [SquareConnect.TransactionProduct](docs/TransactionProduct.md) - [SquareConnect.UpdateCustomerRequest](docs/UpdateCustomerRequest.md) diff --git a/docs/Customer.md b/docs/Customer.md index 60e070c..f53592f 100644 --- a/docs/Customer.md +++ b/docs/Customer.md @@ -18,5 +18,51 @@ Name | Type | Description | Notes **note** | **String** | A note to associate with the customer. | [optional] **preferences** | [**CustomerPreferences**](CustomerPreferences.md) | The customer's preferences. | [optional] **groups** | [**[CustomerGroupInfo]**](CustomerGroupInfo.md) | The groups the customer belongs to. | [optional] +**creationSource** | **String** | A creation source represents the method used to create the customer profile. | [optional] + + + +## Enum: CreationSourceEnum + + +* `OTHER` (value: `"OTHER"`) + +* `APPOINTMENTS` (value: `"APPOINTMENTS"`) + +* `COUPON` (value: `"COUPON"`) + +* `DELETION_RECOVERY` (value: `"DELETION_RECOVERY"`) + +* `DIRECTORY` (value: `"DIRECTORY"`) + +* `EGIFTING` (value: `"EGIFTING"`) + +* `EMAIL_COLLECTION` (value: `"EMAIL_COLLECTION"`) + +* `FEEDBACK` (value: `"FEEDBACK"`) + +* `IMPORT` (value: `"IMPORT"`) + +* `INVOICES` (value: `"INVOICES"`) + +* `LOYALTY` (value: `"LOYALTY"`) + +* `MARKETING` (value: `"MARKETING"`) + +* `MERGE` (value: `"MERGE"`) + +* `ONLINE_STORE` (value: `"ONLINE_STORE"`) + +* `INSTANT_PROFILE` (value: `"INSTANT_PROFILE"`) + +* `TERMINAL` (value: `"TERMINAL"`) + +* `THIRD_PARTY` (value: `"THIRD_PARTY"`) + +* `THIRD_PARTY_IMPORT` (value: `"THIRD_PARTY_IMPORT"`) + +* `UNMERGE_RECOVERY` (value: `"UNMERGE_RECOVERY"`) + + diff --git a/docs/CustomerCreationSource.md b/docs/CustomerCreationSource.md new file mode 100644 index 0000000..574efdd --- /dev/null +++ b/docs/CustomerCreationSource.md @@ -0,0 +1,44 @@ +# SquareConnect.CustomerCreationSource + +## Enum + + +* `OTHER` (value: `"OTHER"`) + +* `APPOINTMENTS` (value: `"APPOINTMENTS"`) + +* `COUPON` (value: `"COUPON"`) + +* `DELETION_RECOVERY` (value: `"DELETION_RECOVERY"`) + +* `DIRECTORY` (value: `"DIRECTORY"`) + +* `EGIFTING` (value: `"EGIFTING"`) + +* `EMAIL_COLLECTION` (value: `"EMAIL_COLLECTION"`) + +* `FEEDBACK` (value: `"FEEDBACK"`) + +* `IMPORT` (value: `"IMPORT"`) + +* `INVOICES` (value: `"INVOICES"`) + +* `LOYALTY` (value: `"LOYALTY"`) + +* `MARKETING` (value: `"MARKETING"`) + +* `MERGE` (value: `"MERGE"`) + +* `ONLINE_STORE` (value: `"ONLINE_STORE"`) + +* `INSTANT_PROFILE` (value: `"INSTANT_PROFILE"`) + +* `TERMINAL` (value: `"TERMINAL"`) + +* `THIRD_PARTY` (value: `"THIRD_PARTY"`) + +* `THIRD_PARTY_IMPORT` (value: `"THIRD_PARTY_IMPORT"`) + +* `UNMERGE_RECOVERY` (value: `"UNMERGE_RECOVERY"`) + + diff --git a/docs/CustomerCreationSourceFilter.md b/docs/CustomerCreationSourceFilter.md new file mode 100644 index 0000000..c840381 --- /dev/null +++ b/docs/CustomerCreationSourceFilter.md @@ -0,0 +1,65 @@ +# SquareConnect.CustomerCreationSourceFilter + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**values** | **[String]** | The list of creation sources used as filtering criteria. | [optional] +**rule** | **String** | Indicates whether a customer profile matching the filter criteria should be included in the result or excluded from the result. Default: `INCLUDE`. See [CustomerInclusionExclusion](#type-customerinclusionexclusion) for possible values. | [optional] + + + +## Enum: [ValuesEnum] + + +* `OTHER` (value: `"OTHER"`) + +* `APPOINTMENTS` (value: `"APPOINTMENTS"`) + +* `COUPON` (value: `"COUPON"`) + +* `DELETION_RECOVERY` (value: `"DELETION_RECOVERY"`) + +* `DIRECTORY` (value: `"DIRECTORY"`) + +* `EGIFTING` (value: `"EGIFTING"`) + +* `EMAIL_COLLECTION` (value: `"EMAIL_COLLECTION"`) + +* `FEEDBACK` (value: `"FEEDBACK"`) + +* `IMPORT` (value: `"IMPORT"`) + +* `INVOICES` (value: `"INVOICES"`) + +* `LOYALTY` (value: `"LOYALTY"`) + +* `MARKETING` (value: `"MARKETING"`) + +* `MERGE` (value: `"MERGE"`) + +* `ONLINE_STORE` (value: `"ONLINE_STORE"`) + +* `INSTANT_PROFILE` (value: `"INSTANT_PROFILE"`) + +* `TERMINAL` (value: `"TERMINAL"`) + +* `THIRD_PARTY` (value: `"THIRD_PARTY"`) + +* `THIRD_PARTY_IMPORT` (value: `"THIRD_PARTY_IMPORT"`) + +* `UNMERGE_RECOVERY` (value: `"UNMERGE_RECOVERY"`) + + + + + +## Enum: RuleEnum + + +* `INCLUDE` (value: `"INCLUDE"`) + +* `EXCLUDE` (value: `"EXCLUDE"`) + + + + diff --git a/docs/CustomerFilter.md b/docs/CustomerFilter.md new file mode 100644 index 0000000..ffb6ce7 --- /dev/null +++ b/docs/CustomerFilter.md @@ -0,0 +1,10 @@ +# SquareConnect.CustomerFilter + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**creationSource** | [**CustomerCreationSourceFilter**](CustomerCreationSourceFilter.md) | A filter to select customers based on their creation source. | [optional] +**createdAt** | [**TimeRange**](TimeRange.md) | A filter to select customers based on when they were created. | [optional] +**updatedAt** | [**TimeRange**](TimeRange.md) | A filter to select customers based on when they were updated. | [optional] + + diff --git a/docs/CustomerInclusionExclusion.md b/docs/CustomerInclusionExclusion.md new file mode 100644 index 0000000..51306df --- /dev/null +++ b/docs/CustomerInclusionExclusion.md @@ -0,0 +1,10 @@ +# SquareConnect.CustomerInclusionExclusion + +## Enum + + +* `INCLUDE` (value: `"INCLUDE"`) + +* `EXCLUDE` (value: `"EXCLUDE"`) + + diff --git a/docs/CustomerQuery.md b/docs/CustomerQuery.md new file mode 100644 index 0000000..9e33a93 --- /dev/null +++ b/docs/CustomerQuery.md @@ -0,0 +1,9 @@ +# SquareConnect.CustomerQuery + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filter** | [**CustomerFilter**](CustomerFilter.md) | A list of filter criteria. | [optional] +**sort** | [**CustomerSort**](CustomerSort.md) | Sort criteria for query results. The default sort behavior is to order customers alphabetically by `given_name` and `last_name`. | [optional] + + diff --git a/docs/CustomerSort.md b/docs/CustomerSort.md new file mode 100644 index 0000000..868084c --- /dev/null +++ b/docs/CustomerSort.md @@ -0,0 +1,31 @@ +# SquareConnect.CustomerSort + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field** | **String** | The field to sort the results on. It could be the total money spent at the merchant, the date of the first visit (etc). Default value: `DEFAULT`. | [optional] +**order** | **String** | Indicates the order in which results should be displayed based on the value of the sort field. String comparisons use standard alphabetic comparison to determine order. Strings representing numbers are sorted as strings. Default value: `ASC`. | [optional] + + + +## Enum: FieldEnum + + +* `DEFAULT` (value: `"DEFAULT"`) + +* `CREATED_AT` (value: `"CREATED_AT"`) + + + + + +## Enum: OrderEnum + + +* `DESC` (value: `"DESC"`) + +* `ASC` (value: `"ASC"`) + + + + diff --git a/docs/CustomersApi.md b/docs/CustomersApi.md index bed3527..dec7498 100644 --- a/docs/CustomersApi.md +++ b/docs/CustomersApi.md @@ -10,6 +10,7 @@ Method | HTTP request | Description [**deleteCustomerCard**](CustomersApi.md#deleteCustomerCard) | **DELETE** /v2/customers/{customer_id}/cards/{card_id} | DeleteCustomerCard [**listCustomers**](CustomersApi.md#listCustomers) | **GET** /v2/customers | ListCustomers [**retrieveCustomer**](CustomersApi.md#retrieveCustomer) | **GET** /v2/customers/{customer_id} | RetrieveCustomer +[**searchCustomers**](CustomersApi.md#searchCustomers) | **POST** /v2/customers/search | SearchCustomers [**updateCustomer**](CustomersApi.md#updateCustomer) | **PUT** /v2/customers/{customer_id} | UpdateCustomer @@ -232,8 +233,8 @@ var apiInstance = new SquareConnect.CustomersApi(); var opts = { 'cursor': "cursor_example", // String | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information. - 'sortField': "sortField_example", // String | Indicates how Customers should be sorted. Default: `DEFAULT`. - 'sortOrder': "sortOrder_example" // String | Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`. + 'sortField': "sortField_example", // String | Indicates how Customers should be sorted. Default: `DEFAULT`. See [CustomerSortField](#type-customersortfield) for possible values. + 'sortOrder': "sortOrder_example" // String | Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`. See [SortOrder](#type-sortorder) for possible values. }; apiInstance.listCustomers(opts).then(function(data) { console.log('API called successfully. Returned data: ' + data); @@ -248,8 +249,8 @@ apiInstance.listCustomers(opts).then(function(data) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **cursor** | **String**| A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information. | [optional] - **sortField** | **String**| Indicates how Customers should be sorted. Default: `DEFAULT`. | [optional] - **sortOrder** | **String**| Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`. | [optional] + **sortField** | **String**| Indicates how Customers should be sorted. Default: `DEFAULT`. See [CustomerSortField](#type-customersortfield) for possible values. | [optional] + **sortOrder** | **String**| Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`. See [SortOrder](#type-sortorder) for possible values. | [optional] ### Return type @@ -307,6 +308,54 @@ Name | Type | Description | Notes [oauth2](../README.md#oauth2) +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **searchCustomers** +> SearchCustomersResponse searchCustomers(body) + +SearchCustomers + +Searches a business's customers. + +### Example +```javascript +var SquareConnect = require('square-connect'); +var defaultClient = SquareConnect.ApiClient.instance; + +// Configure OAuth2 access token for authorization: oauth2 +var oauth2 = defaultClient.authentications['oauth2']; +oauth2.accessToken = 'YOUR ACCESS TOKEN'; + +var apiInstance = new SquareConnect.CustomersApi(); + +var body = new SquareConnect.SearchCustomersRequest(); // SearchCustomersRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. + +apiInstance.searchCustomers(body).then(function(data) { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**SearchCustomersRequest**](SearchCustomersRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. | + +### Return type + +[**SearchCustomersResponse**](SearchCustomersResponse.md) + +### Authorization + +[oauth2](../README.md#oauth2) + ### HTTP request headers - **Content-Type**: application/json diff --git a/docs/Error.md b/docs/Error.md index dab58d6..d28263e 100644 --- a/docs/Error.md +++ b/docs/Error.md @@ -118,6 +118,8 @@ Name | Type | Description | Notes * `NO_FIELDS_SET` (value: `"NO_FIELDS_SET"`) +* `DEPRECATED_FIELD_SET` (value: `"DEPRECATED_FIELD_SET"`) + * `CARD_EXPIRED` (value: `"CARD_EXPIRED"`) * `INVALID_EXPIRATION` (value: `"INVALID_EXPIRATION"`) @@ -180,6 +182,8 @@ Name | Type | Description | Notes * `NOT_FOUND` (value: `"NOT_FOUND"`) +* `METHOD_NOT_ALLOWED` (value: `"METHOD_NOT_ALLOWED"`) + * `REQUEST_TIMEOUT` (value: `"REQUEST_TIMEOUT"`) * `CONFLICT` (value: `"CONFLICT"`) diff --git a/docs/ErrorCode.md b/docs/ErrorCode.md index 21e81cd..f2f1192 100644 --- a/docs/ErrorCode.md +++ b/docs/ErrorCode.md @@ -89,6 +89,8 @@ * `NO_FIELDS_SET` (value: `"NO_FIELDS_SET"`) +* `DEPRECATED_FIELD_SET` (value: `"DEPRECATED_FIELD_SET"`) + * `CARD_EXPIRED` (value: `"CARD_EXPIRED"`) * `INVALID_EXPIRATION` (value: `"INVALID_EXPIRATION"`) @@ -151,6 +153,8 @@ * `NOT_FOUND` (value: `"NOT_FOUND"`) +* `METHOD_NOT_ALLOWED` (value: `"METHOD_NOT_ALLOWED"`) + * `REQUEST_TIMEOUT` (value: `"REQUEST_TIMEOUT"`) * `CONFLICT` (value: `"CONFLICT"`) diff --git a/docs/ListCustomersRequest.md b/docs/ListCustomersRequest.md index 34ff011..f859008 100644 --- a/docs/ListCustomersRequest.md +++ b/docs/ListCustomersRequest.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **cursor** | **String** | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information. | [optional] -**sortField** | **String** | Indicates how Customers should be sorted. Default: `DEFAULT`. | [optional] -**sortOrder** | **String** | Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`. | [optional] +**sortField** | **String** | Indicates how Customers should be sorted. Default: `DEFAULT`. See [CustomerSortField](#type-customersortfield) for possible values. | [optional] +**sortOrder** | **String** | Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`. See [SortOrder](#type-sortorder) for possible values. | [optional] diff --git a/docs/OrderLineItem.md b/docs/OrderLineItem.md index 4abecbf..d1f9807 100644 --- a/docs/OrderLineItem.md +++ b/docs/OrderLineItem.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **String** | The name of the line item. | [optional] -**quantity** | **String** | The quantity purchased, as a string representation of a number. | +**quantity** | **String** | The quantity purchased, as a string representation of a number. This string must have a positive integer value. | **note** | **String** | The note of the line item. | [optional] **catalogObjectId** | **String** | The [CatalogItemVariation](#type-catalogitemvariation) id applied to this line item. | [optional] **variationName** | **String** | The name of the variation applied to this line item. | [optional] diff --git a/docs/SearchCustomersRequest.md b/docs/SearchCustomersRequest.md new file mode 100644 index 0000000..f41ffaf --- /dev/null +++ b/docs/SearchCustomersRequest.md @@ -0,0 +1,10 @@ +# SquareConnect.SearchCustomersRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cursor** | **String** | Include the pagination cursor in subsequent calls to this endpoint to retrieve the next set of results associated with the original query. See [Paginating results](#paginatingresults) for more information. | [optional] +**limit** | **Number** | A limit on the number of results to be returned in a single page. The limit is advisory - the implementation may return more or fewer results. If the supplied limit is negative, zero, or is higher than the maximum limit of 1,000, it will be ignored. | [optional] +**query** | [**CustomerQuery**](CustomerQuery.md) | Query customers based on the given conditions and sort order. Calling SearchCustomers without an explicit query parameter will return all customers ordered alphabetically based on `given_name` and `family_name`. | [optional] + + diff --git a/docs/SearchCustomersResponse.md b/docs/SearchCustomersResponse.md new file mode 100644 index 0000000..515aba4 --- /dev/null +++ b/docs/SearchCustomersResponse.md @@ -0,0 +1,10 @@ +# SquareConnect.SearchCustomersResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errors** | [**[Error]**](Error.md) | Any errors that occurred during the request. | [optional] +**customers** | [**[Customer]**](Customer.md) | An array of `Customer` objects that match a query. | [optional] +**cursor** | **String** | A pagination cursor that can be used during subsequent calls to SearchCustomers to retrieve the next set of results associated with the original query. Pagination cursors are only present when a request succeeds and additional results are available. See [Paginating results](#paginatingresults) for more information. | [optional] + + diff --git a/docs/TimeRange.md b/docs/TimeRange.md new file mode 100644 index 0000000..ee3af7f --- /dev/null +++ b/docs/TimeRange.md @@ -0,0 +1,9 @@ +# SquareConnect.TimeRange + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**startAt** | **String** | A datetime value in RFC-3339 format indicating when the time range starts. | [optional] +**endAt** | **String** | A datetime value in RFC-3339 format indicating when the time range ends. | [optional] + + diff --git a/docs/V1AdjustInventoryRequest.md b/docs/V1AdjustInventoryRequest.md index b50529a..4d27ebf 100644 --- a/docs/V1AdjustInventoryRequest.md +++ b/docs/V1AdjustInventoryRequest.md @@ -4,7 +4,20 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **quantityDelta** | **Number** | The number to adjust the variation's quantity by. | [optional] -**adjustmentType** | **Number** | The reason for the inventory adjustment. | [optional] +**adjustmentType** | **String** | The reason for the inventory adjustment. | [optional] **memo** | **String** | A note about the inventory adjustment. | [optional] + +## Enum: AdjustmentTypeEnum + + +* `SALE` (value: `"SALE"`) + +* `RECEIVE_STOCK` (value: `"RECEIVE_STOCK"`) + +* `MANUAL_ADJUST` (value: `"MANUAL_ADJUST"`) + + + + diff --git a/docs/V1Payment.md b/docs/V1Payment.md index ab9632b..eafd602 100644 --- a/docs/V1Payment.md +++ b/docs/V1Payment.md @@ -28,6 +28,6 @@ Name | Type | Description | Notes **refunds** | [**[V1Refund]**](V1Refund.md) | All of the refunds applied to the payment. Note that the value of all refunds on a payment can exceed the value of all tenders if a merchant chooses to refund money to a tender after previously accepting returned goods as part of an exchange. | [optional] **itemizations** | [**[V1PaymentItemization]**](V1PaymentItemization.md) | The items purchased in the payment. | [optional] **surchargeMoney** | [**V1Money**](V1Money.md) | The total of all surcharges applied to the payment. | [optional] -**surcharges** | [**[V1PaymentSurcharge]**](V1PaymentSurcharge.md) | A list of all surcharges associated with the payment. | [optional] +**surcharges** | [**[V1PaymentSurcharge]**](V1PaymentSurcharge.md) | A list of all surcharges associated with the payment. | [optional] diff --git a/package.json b/package.json index 72038bd..0603b22 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "square-connect", - "version": "2.8.0", + "version": "2.9.0", "description": "JavaScript client library for the Square Connect v2 API", "keywords": [ "square", diff --git a/src/ApiClient.js b/src/ApiClient.js index 265b0d0..43f5419 100644 --- a/src/ApiClient.js +++ b/src/ApiClient.js @@ -16,7 +16,7 @@ var querystring = require('querystring'); /** * @module ApiClient - * @version 2.8.0 + * @version 2.9.0 */ /** @@ -48,7 +48,7 @@ var exports = function() { * @default {} */ this.defaultHeaders = { - 'User-Agent': 'Square-Connect-Javascript/2.8.0' + 'User-Agent': 'Square-Connect-Javascript/2.9.0' }; /** * The default HTTP timeout for all API calls. diff --git a/src/api/CustomersApi.js b/src/api/CustomersApi.js index 5129d9b..f087880 100644 --- a/src/api/CustomersApi.js +++ b/src/api/CustomersApi.js @@ -20,6 +20,8 @@ var DeleteCustomerCardResponse = require('../model/DeleteCustomerCardResponse'); var DeleteCustomerResponse = require('../model/DeleteCustomerResponse'); var ListCustomersResponse = require('../model/ListCustomersResponse'); var RetrieveCustomerResponse = require('../model/RetrieveCustomerResponse'); +var SearchCustomersRequest = require('../model/SearchCustomersRequest'); +var SearchCustomersResponse = require('../model/SearchCustomersResponse'); var UpdateCustomerRequest = require('../model/UpdateCustomerRequest'); var UpdateCustomerResponse = require('../model/UpdateCustomerResponse'); @@ -263,8 +265,8 @@ module.exports = function(apiClient) { * Lists a business's customers. * @param {Object} opts Optional parameters * @param {String} opts.cursor A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information. - * @param {module:model/String} opts.sortField Indicates how Customers should be sorted. Default: `DEFAULT`. - * @param {module:model/String} opts.sortOrder Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`. + * @param {module:model/String} opts.sortField Indicates how Customers should be sorted. Default: `DEFAULT`. See [CustomerSortField](#type-customersortfield) for possible values. + * @param {module:model/String} opts.sortOrder Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`. See [SortOrder](#type-sortorder) for possible values. * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListCustomersResponse} and HTTP response */ this.listCustomersWithHttpInfo = function(opts) { @@ -301,8 +303,8 @@ module.exports = function(apiClient) { * Lists a business's customers. * @param {Object} opts Optional parameters * @param {String} opts.cursor A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Paginating results](#paginatingresults) for more information. - * @param {module:model/String} opts.sortField Indicates how Customers should be sorted. Default: `DEFAULT`. - * @param {module:model/String} opts.sortOrder Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`. + * @param {module:model/String} opts.sortField Indicates how Customers should be sorted. Default: `DEFAULT`. See [CustomerSortField](#type-customersortfield) for possible values. + * @param {module:model/String} opts.sortOrder Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`. See [SortOrder](#type-sortorder) for possible values. * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListCustomersResponse} */ this.listCustomers = function(opts) { @@ -364,6 +366,56 @@ module.exports = function(apiClient) { } + /** + * SearchCustomers + * Searches a business's customers. + * @param {module:model/SearchCustomersRequest} body An object containing the fields to POST for the request. See the corresponding object definition for field details. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SearchCustomersResponse} and HTTP response + */ + this.searchCustomersWithHttpInfo = function(body) { + var postBody = body; + + // verify the required parameter 'body' is set + if (body === undefined || body === null) { + throw new Error("Missing the required parameter 'body' when calling searchCustomers"); + } + + + var pathParams = { + }; + var queryParams = { + }; + var headerParams = { + }; + var formParams = { + }; + + var authNames = ['oauth2']; + var contentTypes = ['application/json']; + var accepts = ['application/json']; + var returnType = SearchCustomersResponse; + + return this.apiClient.callApi( + '/v2/customers/search', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * SearchCustomers + * Searches a business's customers. + * @param {module:model/SearchCustomersRequest} body An object containing the fields to POST for the request. See the corresponding object definition for field details. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SearchCustomersResponse} + */ + this.searchCustomers = function(body) { + return this.searchCustomersWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + /** * UpdateCustomer * Updates the details of an existing customer. The ID of the customer may change if the customer has been merged into another customer. You cannot edit a customer's cards on file with this endpoint. To make changes to a card on file, you must delete the existing card on file with the [DeleteCustomerCard](#endpoint-deletecustomercard) endpoint, then create a new one with the [CreateCustomerCard](#endpoint-createcustomercard) endpoint. diff --git a/src/index.js b/src/index.js index 11a5491..54a984a 100644 --- a/src/index.js +++ b/src/index.js @@ -79,8 +79,14 @@ var CreateRefundRequest = require('./model/CreateRefundRequest'); var CreateRefundResponse = require('./model/CreateRefundResponse'); var Currency = require('./model/Currency'); var Customer = require('./model/Customer'); +var CustomerCreationSource = require('./model/CustomerCreationSource'); +var CustomerCreationSourceFilter = require('./model/CustomerCreationSourceFilter'); +var CustomerFilter = require('./model/CustomerFilter'); var CustomerGroupInfo = require('./model/CustomerGroupInfo'); +var CustomerInclusionExclusion = require('./model/CustomerInclusionExclusion'); var CustomerPreferences = require('./model/CustomerPreferences'); +var CustomerQuery = require('./model/CustomerQuery'); +var CustomerSort = require('./model/CustomerSort'); var CustomerSortField = require('./model/CustomerSortField'); var DeleteCatalogObjectRequest = require('./model/DeleteCatalogObjectRequest'); var DeleteCatalogObjectResponse = require('./model/DeleteCatalogObjectResponse'); @@ -134,6 +140,8 @@ var RetrieveTransactionRequest = require('./model/RetrieveTransactionRequest'); var RetrieveTransactionResponse = require('./model/RetrieveTransactionResponse'); var SearchCatalogObjectsRequest = require('./model/SearchCatalogObjectsRequest'); var SearchCatalogObjectsResponse = require('./model/SearchCatalogObjectsResponse'); +var SearchCustomersRequest = require('./model/SearchCustomersRequest'); +var SearchCustomersResponse = require('./model/SearchCustomersResponse'); var SortOrder = require('./model/SortOrder'); var TaxCalculationPhase = require('./model/TaxCalculationPhase'); var TaxInclusionType = require('./model/TaxInclusionType'); @@ -143,6 +151,7 @@ var TenderCardDetailsEntryMethod = require('./model/TenderCardDetailsEntryMethod var TenderCardDetailsStatus = require('./model/TenderCardDetailsStatus'); var TenderCashDetails = require('./model/TenderCashDetails'); var TenderType = require('./model/TenderType'); +var TimeRange = require('./model/TimeRange'); var Transaction = require('./model/Transaction'); var TransactionProduct = require('./model/TransactionProduct'); var UpdateCustomerRequest = require('./model/UpdateCustomerRequest'); @@ -238,7 +247,7 @@ var V1TransactionsApi = require('./api/V1TransactionsApi'); * *
* @module index - * @version 2.8.0 + * @version 2.9.0 */ module.exports = { /** @@ -576,16 +585,46 @@ var V1TransactionsApi = require('./api/V1TransactionsApi'); * @property {module:model/Customer} */ Customer: Customer, + /** + * The CustomerCreationSource model constructor. + * @property {module:model/CustomerCreationSource} + */ + CustomerCreationSource: CustomerCreationSource, + /** + * The CustomerCreationSourceFilter model constructor. + * @property {module:model/CustomerCreationSourceFilter} + */ + CustomerCreationSourceFilter: CustomerCreationSourceFilter, + /** + * The CustomerFilter model constructor. + * @property {module:model/CustomerFilter} + */ + CustomerFilter: CustomerFilter, /** * The CustomerGroupInfo model constructor. * @property {module:model/CustomerGroupInfo} */ CustomerGroupInfo: CustomerGroupInfo, + /** + * The CustomerInclusionExclusion model constructor. + * @property {module:model/CustomerInclusionExclusion} + */ + CustomerInclusionExclusion: CustomerInclusionExclusion, /** * The CustomerPreferences model constructor. * @property {module:model/CustomerPreferences} */ CustomerPreferences: CustomerPreferences, + /** + * The CustomerQuery model constructor. + * @property {module:model/CustomerQuery} + */ + CustomerQuery: CustomerQuery, + /** + * The CustomerSort model constructor. + * @property {module:model/CustomerSort} + */ + CustomerSort: CustomerSort, /** * The CustomerSortField model constructor. * @property {module:model/CustomerSortField} @@ -851,6 +890,16 @@ var V1TransactionsApi = require('./api/V1TransactionsApi'); * @property {module:model/SearchCatalogObjectsResponse} */ SearchCatalogObjectsResponse: SearchCatalogObjectsResponse, + /** + * The SearchCustomersRequest model constructor. + * @property {module:model/SearchCustomersRequest} + */ + SearchCustomersRequest: SearchCustomersRequest, + /** + * The SearchCustomersResponse model constructor. + * @property {module:model/SearchCustomersResponse} + */ + SearchCustomersResponse: SearchCustomersResponse, /** * The SortOrder model constructor. * @property {module:model/SortOrder} @@ -896,6 +945,11 @@ var V1TransactionsApi = require('./api/V1TransactionsApi'); * @property {module:model/TenderType} */ TenderType: TenderType, + /** + * The TimeRange model constructor. + * @property {module:model/TimeRange} + */ + TimeRange: TimeRange, /** * The Transaction model constructor. * @property {module:model/Transaction} diff --git a/src/model/Customer.js b/src/model/Customer.js index 0205c80..1554e49 100644 --- a/src/model/Customer.js +++ b/src/model/Customer.js @@ -52,6 +52,7 @@ var exports = function(id, createdAt, updatedAt) { + }; /** @@ -109,6 +110,9 @@ exports.constructFromObject = function(data, obj) { } if (data.hasOwnProperty('groups')) { obj['groups'] = ApiClient.convertToType(data['groups'], [CustomerGroupInfo]); + } + if (data.hasOwnProperty('creation_source')) { + obj['creation_source'] = ApiClient.convertToType(data['creation_source'], 'String'); } } return obj; @@ -189,7 +193,114 @@ exports.prototype['preferences'] = undefined; * @member {Array.creation_source
property.
+ * @enum {String}
+ * @readonly
+ */
+ exports.CreationSourceEnum = {
+ /**
+ * value: "OTHER"
+ * @const
+ */
+ "OTHER": "OTHER",
+ /**
+ * value: "APPOINTMENTS"
+ * @const
+ */
+ "APPOINTMENTS": "APPOINTMENTS",
+ /**
+ * value: "COUPON"
+ * @const
+ */
+ "COUPON": "COUPON",
+ /**
+ * value: "DELETION_RECOVERY"
+ * @const
+ */
+ "DELETION_RECOVERY": "DELETION_RECOVERY",
+ /**
+ * value: "DIRECTORY"
+ * @const
+ */
+ "DIRECTORY": "DIRECTORY",
+ /**
+ * value: "EGIFTING"
+ * @const
+ */
+ "EGIFTING": "EGIFTING",
+ /**
+ * value: "EMAIL_COLLECTION"
+ * @const
+ */
+ "EMAIL_COLLECTION": "EMAIL_COLLECTION",
+ /**
+ * value: "FEEDBACK"
+ * @const
+ */
+ "FEEDBACK": "FEEDBACK",
+ /**
+ * value: "IMPORT"
+ * @const
+ */
+ "IMPORT": "IMPORT",
+ /**
+ * value: "INVOICES"
+ * @const
+ */
+ "INVOICES": "INVOICES",
+ /**
+ * value: "LOYALTY"
+ * @const
+ */
+ "LOYALTY": "LOYALTY",
+ /**
+ * value: "MARKETING"
+ * @const
+ */
+ "MARKETING": "MARKETING",
+ /**
+ * value: "MERGE"
+ * @const
+ */
+ "MERGE": "MERGE",
+ /**
+ * value: "ONLINE_STORE"
+ * @const
+ */
+ "ONLINE_STORE": "ONLINE_STORE",
+ /**
+ * value: "INSTANT_PROFILE"
+ * @const
+ */
+ "INSTANT_PROFILE": "INSTANT_PROFILE",
+ /**
+ * value: "TERMINAL"
+ * @const
+ */
+ "TERMINAL": "TERMINAL",
+ /**
+ * value: "THIRD_PARTY"
+ * @const
+ */
+ "THIRD_PARTY": "THIRD_PARTY",
+ /**
+ * value: "THIRD_PARTY_IMPORT"
+ * @const
+ */
+ "THIRD_PARTY_IMPORT": "THIRD_PARTY_IMPORT",
+ /**
+ * value: "UNMERGE_RECOVERY"
+ * @const
+ */
+ "UNMERGE_RECOVERY": "UNMERGE_RECOVERY" };
module.exports = exports;
diff --git a/src/model/CustomerCreationSource.js b/src/model/CustomerCreationSource.js
new file mode 100644
index 0000000..f4f2b74
--- /dev/null
+++ b/src/model/CustomerCreationSource.js
@@ -0,0 +1,130 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+
+
+/**
+ * Enum class CustomerCreationSource.
+ * @enum {}
+ * @readonly
+ */
+var exports = {
+ /**
+ * value: "OTHER"
+ * @const
+ */
+ "OTHER": "OTHER",
+ /**
+ * value: "APPOINTMENTS"
+ * @const
+ */
+ "APPOINTMENTS": "APPOINTMENTS",
+ /**
+ * value: "COUPON"
+ * @const
+ */
+ "COUPON": "COUPON",
+ /**
+ * value: "DELETION_RECOVERY"
+ * @const
+ */
+ "DELETION_RECOVERY": "DELETION_RECOVERY",
+ /**
+ * value: "DIRECTORY"
+ * @const
+ */
+ "DIRECTORY": "DIRECTORY",
+ /**
+ * value: "EGIFTING"
+ * @const
+ */
+ "EGIFTING": "EGIFTING",
+ /**
+ * value: "EMAIL_COLLECTION"
+ * @const
+ */
+ "EMAIL_COLLECTION": "EMAIL_COLLECTION",
+ /**
+ * value: "FEEDBACK"
+ * @const
+ */
+ "FEEDBACK": "FEEDBACK",
+ /**
+ * value: "IMPORT"
+ * @const
+ */
+ "IMPORT": "IMPORT",
+ /**
+ * value: "INVOICES"
+ * @const
+ */
+ "INVOICES": "INVOICES",
+ /**
+ * value: "LOYALTY"
+ * @const
+ */
+ "LOYALTY": "LOYALTY",
+ /**
+ * value: "MARKETING"
+ * @const
+ */
+ "MARKETING": "MARKETING",
+ /**
+ * value: "MERGE"
+ * @const
+ */
+ "MERGE": "MERGE",
+ /**
+ * value: "ONLINE_STORE"
+ * @const
+ */
+ "ONLINE_STORE": "ONLINE_STORE",
+ /**
+ * value: "INSTANT_PROFILE"
+ * @const
+ */
+ "INSTANT_PROFILE": "INSTANT_PROFILE",
+ /**
+ * value: "TERMINAL"
+ * @const
+ */
+ "TERMINAL": "TERMINAL",
+ /**
+ * value: "THIRD_PARTY"
+ * @const
+ */
+ "THIRD_PARTY": "THIRD_PARTY",
+ /**
+ * value: "THIRD_PARTY_IMPORT"
+ * @const
+ */
+ "THIRD_PARTY_IMPORT": "THIRD_PARTY_IMPORT",
+ /**
+ * value: "UNMERGE_RECOVERY"
+ * @const
+ */
+ "UNMERGE_RECOVERY": "UNMERGE_RECOVERY"};
+
+/**
+ * Returns a CustomerCreationSource
enum value from a Javascript object name.
+ * @param {Object} data The plain JavaScript object containing the name of the enum value.
+ * @return {module:model/CustomerCreationSource} The enum CustomerCreationSource
value.
+ */
+exports.constructFromObject = function(object) {
+ return object;
+}
+
+module.exports = exports;
+
+
diff --git a/src/model/CustomerCreationSourceFilter.js b/src/model/CustomerCreationSourceFilter.js
new file mode 100644
index 0000000..c746120
--- /dev/null
+++ b/src/model/CustomerCreationSourceFilter.js
@@ -0,0 +1,193 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+
+
+
+
+/**
+ * The CustomerCreationSourceFilter model module.
+ * @module model/CustomerCreationSourceFilter
+ */
+
+/**
+ * Constructs a new CustomerCreationSourceFilter
.
+ * Creation source filter. If one or more creation sources are set, customer profiles are included in, or excluded from, the result if they match at least one of the filter criteria.
+ * @alias module:model/CustomerCreationSourceFilter
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+
+
+};
+
+/**
+ * Constructs a CustomerCreationSourceFilter
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/CustomerCreationSourceFilter} obj Optional instance to populate.
+ * @return {module:model/CustomerCreationSourceFilter} The populated CustomerCreationSourceFilter
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('values')) {
+ obj['values'] = ApiClient.convertToType(data['values'], ['String']);
+ }
+ if (data.hasOwnProperty('rule')) {
+ obj['rule'] = ApiClient.convertToType(data['rule'], 'String');
+ }
+ }
+ return obj;
+}
+
+/**
+ * The list of creation sources used as filtering criteria.
+ * @member {Array.values
property.
+ * @enum {String}
+ * @readonly
+ */
+ exports.ValuesEnum = {
+ /**
+ * value: "OTHER"
+ * @const
+ */
+ "OTHER": "OTHER",
+ /**
+ * value: "APPOINTMENTS"
+ * @const
+ */
+ "APPOINTMENTS": "APPOINTMENTS",
+ /**
+ * value: "COUPON"
+ * @const
+ */
+ "COUPON": "COUPON",
+ /**
+ * value: "DELETION_RECOVERY"
+ * @const
+ */
+ "DELETION_RECOVERY": "DELETION_RECOVERY",
+ /**
+ * value: "DIRECTORY"
+ * @const
+ */
+ "DIRECTORY": "DIRECTORY",
+ /**
+ * value: "EGIFTING"
+ * @const
+ */
+ "EGIFTING": "EGIFTING",
+ /**
+ * value: "EMAIL_COLLECTION"
+ * @const
+ */
+ "EMAIL_COLLECTION": "EMAIL_COLLECTION",
+ /**
+ * value: "FEEDBACK"
+ * @const
+ */
+ "FEEDBACK": "FEEDBACK",
+ /**
+ * value: "IMPORT"
+ * @const
+ */
+ "IMPORT": "IMPORT",
+ /**
+ * value: "INVOICES"
+ * @const
+ */
+ "INVOICES": "INVOICES",
+ /**
+ * value: "LOYALTY"
+ * @const
+ */
+ "LOYALTY": "LOYALTY",
+ /**
+ * value: "MARKETING"
+ * @const
+ */
+ "MARKETING": "MARKETING",
+ /**
+ * value: "MERGE"
+ * @const
+ */
+ "MERGE": "MERGE",
+ /**
+ * value: "ONLINE_STORE"
+ * @const
+ */
+ "ONLINE_STORE": "ONLINE_STORE",
+ /**
+ * value: "INSTANT_PROFILE"
+ * @const
+ */
+ "INSTANT_PROFILE": "INSTANT_PROFILE",
+ /**
+ * value: "TERMINAL"
+ * @const
+ */
+ "TERMINAL": "TERMINAL",
+ /**
+ * value: "THIRD_PARTY"
+ * @const
+ */
+ "THIRD_PARTY": "THIRD_PARTY",
+ /**
+ * value: "THIRD_PARTY_IMPORT"
+ * @const
+ */
+ "THIRD_PARTY_IMPORT": "THIRD_PARTY_IMPORT",
+ /**
+ * value: "UNMERGE_RECOVERY"
+ * @const
+ */
+ "UNMERGE_RECOVERY": "UNMERGE_RECOVERY" };
+
+ /**
+ * Allowed values for the rule
property.
+ * @enum {String}
+ * @readonly
+ */
+ exports.RuleEnum = {
+ /**
+ * value: "INCLUDE"
+ * @const
+ */
+ "INCLUDE": "INCLUDE",
+ /**
+ * value: "EXCLUDE"
+ * @const
+ */
+ "EXCLUDE": "EXCLUDE" };
+
+
+module.exports = exports;
+
+
+
diff --git a/src/model/CustomerFilter.js b/src/model/CustomerFilter.js
new file mode 100644
index 0000000..7442102
--- /dev/null
+++ b/src/model/CustomerFilter.js
@@ -0,0 +1,85 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+var CustomerCreationSourceFilter = require('./CustomerCreationSourceFilter');
+var TimeRange = require('./TimeRange');
+
+
+
+
+/**
+ * The CustomerFilter model module.
+ * @module model/CustomerFilter
+ */
+
+/**
+ * Constructs a new CustomerFilter
.
+ * Represents a set of [`CustomerQuery`](#type-customerquery) filters used to limit the set of Customers returned by [`SearchCustomers`](#endpoint-seachcustomers).
+ * @alias module:model/CustomerFilter
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+
+
+
+};
+
+/**
+ * Constructs a CustomerFilter
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/CustomerFilter} obj Optional instance to populate.
+ * @return {module:model/CustomerFilter} The populated CustomerFilter
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('creation_source')) {
+ obj['creation_source'] = CustomerCreationSourceFilter.constructFromObject(data['creation_source']);
+ }
+ if (data.hasOwnProperty('created_at')) {
+ obj['created_at'] = TimeRange.constructFromObject(data['created_at']);
+ }
+ if (data.hasOwnProperty('updated_at')) {
+ obj['updated_at'] = TimeRange.constructFromObject(data['updated_at']);
+ }
+ }
+ return obj;
+}
+
+/**
+ * A filter to select customers based on their creation source.
+ * @member {module:model/CustomerCreationSourceFilter} creation_source
+ */
+exports.prototype['creation_source'] = undefined;
+/**
+ * A filter to select customers based on when they were created.
+ * @member {module:model/TimeRange} created_at
+ */
+exports.prototype['created_at'] = undefined;
+/**
+ * A filter to select customers based on when they were updated.
+ * @member {module:model/TimeRange} updated_at
+ */
+exports.prototype['updated_at'] = undefined;
+
+
+
+module.exports = exports;
+
+
+
diff --git a/src/model/CustomerInclusionExclusion.js b/src/model/CustomerInclusionExclusion.js
new file mode 100644
index 0000000..19bbd2d
--- /dev/null
+++ b/src/model/CustomerInclusionExclusion.js
@@ -0,0 +1,45 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+
+
+/**
+ * Enum class CustomerInclusionExclusion.
+ * @enum {}
+ * @readonly
+ */
+var exports = {
+ /**
+ * value: "INCLUDE"
+ * @const
+ */
+ "INCLUDE": "INCLUDE",
+ /**
+ * value: "EXCLUDE"
+ * @const
+ */
+ "EXCLUDE": "EXCLUDE"};
+
+/**
+ * Returns a CustomerInclusionExclusion
enum value from a Javascript object name.
+ * @param {Object} data The plain JavaScript object containing the name of the enum value.
+ * @return {module:model/CustomerInclusionExclusion} The enum CustomerInclusionExclusion
value.
+ */
+exports.constructFromObject = function(object) {
+ return object;
+}
+
+module.exports = exports;
+
+
diff --git a/src/model/CustomerQuery.js b/src/model/CustomerQuery.js
new file mode 100644
index 0000000..95f79df
--- /dev/null
+++ b/src/model/CustomerQuery.js
@@ -0,0 +1,76 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+var CustomerFilter = require('./CustomerFilter');
+var CustomerSort = require('./CustomerSort');
+
+
+
+
+/**
+ * The CustomerQuery model module.
+ * @module model/CustomerQuery
+ */
+
+/**
+ * Constructs a new CustomerQuery
.
+ * Represents a query (filtering and sorting criteria) used to search for customer profiles.
+ * @alias module:model/CustomerQuery
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+
+
+};
+
+/**
+ * Constructs a CustomerQuery
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/CustomerQuery} obj Optional instance to populate.
+ * @return {module:model/CustomerQuery} The populated CustomerQuery
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('filter')) {
+ obj['filter'] = CustomerFilter.constructFromObject(data['filter']);
+ }
+ if (data.hasOwnProperty('sort')) {
+ obj['sort'] = CustomerSort.constructFromObject(data['sort']);
+ }
+ }
+ return obj;
+}
+
+/**
+ * A list of filter criteria.
+ * @member {module:model/CustomerFilter} filter
+ */
+exports.prototype['filter'] = undefined;
+/**
+ * Sort criteria for query results. The default sort behavior is to order customers alphabetically by `given_name` and `last_name`.
+ * @member {module:model/CustomerSort} sort
+ */
+exports.prototype['sort'] = undefined;
+
+
+
+module.exports = exports;
+
+
+
diff --git a/src/model/CustomerSort.js b/src/model/CustomerSort.js
new file mode 100644
index 0000000..7796952
--- /dev/null
+++ b/src/model/CustomerSort.js
@@ -0,0 +1,108 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+
+
+
+
+/**
+ * The CustomerSort model module.
+ * @module model/CustomerSort
+ */
+
+/**
+ * Constructs a new CustomerSort
.
+ * Indicates the field to use for sorting customer profiles. For example, by total money spent with the merchant or the date of their first purchase.
+ * @alias module:model/CustomerSort
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+
+
+};
+
+/**
+ * Constructs a CustomerSort
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/CustomerSort} obj Optional instance to populate.
+ * @return {module:model/CustomerSort} The populated CustomerSort
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('field')) {
+ obj['field'] = ApiClient.convertToType(data['field'], 'String');
+ }
+ if (data.hasOwnProperty('order')) {
+ obj['order'] = ApiClient.convertToType(data['order'], 'String');
+ }
+ }
+ return obj;
+}
+
+/**
+ * The field to sort the results on. It could be the total money spent at the merchant, the date of the first visit (etc). Default value: `DEFAULT`.
+ * @member {module:model/CustomerSort.FieldEnum} field
+ */
+exports.prototype['field'] = undefined;
+/**
+ * Indicates the order in which results should be displayed based on the value of the sort field. String comparisons use standard alphabetic comparison to determine order. Strings representing numbers are sorted as strings. Default value: `ASC`.
+ * @member {module:model/CustomerSort.OrderEnum} order
+ */
+exports.prototype['order'] = undefined;
+
+
+ /**
+ * Allowed values for the field
property.
+ * @enum {String}
+ * @readonly
+ */
+ exports.FieldEnum = {
+ /**
+ * value: "DEFAULT"
+ * @const
+ */
+ "DEFAULT": "DEFAULT",
+ /**
+ * value: "CREATED_AT"
+ * @const
+ */
+ "CREATED_AT": "CREATED_AT" };
+
+ /**
+ * Allowed values for the order
property.
+ * @enum {String}
+ * @readonly
+ */
+ exports.OrderEnum = {
+ /**
+ * value: "DESC"
+ * @const
+ */
+ "DESC": "DESC",
+ /**
+ * value: "ASC"
+ * @const
+ */
+ "ASC": "ASC" };
+
+
+module.exports = exports;
+
+
+
diff --git a/src/model/Error.js b/src/model/Error.js
index 2c1ca9b..5257112 100644
--- a/src/model/Error.js
+++ b/src/model/Error.js
@@ -345,6 +345,11 @@ exports.prototype['field'] = undefined;
* @const
*/
"NO_FIELDS_SET": "NO_FIELDS_SET",
+ /**
+ * value: "DEPRECATED_FIELD_SET"
+ * @const
+ */
+ "DEPRECATED_FIELD_SET": "DEPRECATED_FIELD_SET",
/**
* value: "CARD_EXPIRED"
* @const
@@ -500,6 +505,11 @@ exports.prototype['field'] = undefined;
* @const
*/
"NOT_FOUND": "NOT_FOUND",
+ /**
+ * value: "METHOD_NOT_ALLOWED"
+ * @const
+ */
+ "METHOD_NOT_ALLOWED": "METHOD_NOT_ALLOWED",
/**
* value: "REQUEST_TIMEOUT"
* @const
diff --git a/src/model/ErrorCode.js b/src/model/ErrorCode.js
index abaf54c..bdfc3da 100644
--- a/src/model/ErrorCode.js
+++ b/src/model/ErrorCode.js
@@ -235,6 +235,11 @@ var exports = {
* @const
*/
"NO_FIELDS_SET": "NO_FIELDS_SET",
+ /**
+ * value: "DEPRECATED_FIELD_SET"
+ * @const
+ */
+ "DEPRECATED_FIELD_SET": "DEPRECATED_FIELD_SET",
/**
* value: "CARD_EXPIRED"
* @const
@@ -390,6 +395,11 @@ var exports = {
* @const
*/
"NOT_FOUND": "NOT_FOUND",
+ /**
+ * value: "METHOD_NOT_ALLOWED"
+ * @const
+ */
+ "METHOD_NOT_ALLOWED": "METHOD_NOT_ALLOWED",
/**
* value: "REQUEST_TIMEOUT"
* @const
diff --git a/src/model/ListCustomersRequest.js b/src/model/ListCustomersRequest.js
index 2639be4..cb3f822 100644
--- a/src/model/ListCustomersRequest.js
+++ b/src/model/ListCustomersRequest.js
@@ -65,12 +65,12 @@ exports.constructFromObject = function(data, obj) {
*/
exports.prototype['cursor'] = undefined;
/**
- * Indicates how Customers should be sorted. Default: `DEFAULT`.
+ * Indicates how Customers should be sorted. Default: `DEFAULT`. See [CustomerSortField](#type-customersortfield) for possible values.
* @member {module:model/ListCustomersRequest.SortFieldEnum} sort_field
*/
exports.prototype['sort_field'] = undefined;
/**
- * Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`.
+ * Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`. See [SortOrder](#type-sortorder) for possible values.
* @member {module:model/ListCustomersRequest.SortOrderEnum} sort_order
*/
exports.prototype['sort_order'] = undefined;
diff --git a/src/model/OrderLineItem.js b/src/model/OrderLineItem.js
index f741d70..03f0c73 100644
--- a/src/model/OrderLineItem.js
+++ b/src/model/OrderLineItem.js
@@ -30,7 +30,7 @@ var OrderLineItemTax = require('./OrderLineItemTax');
* Represents a line item in an order. Each line item describes a different product to purchase, with its own quantity and price details.
* @alias module:model/OrderLineItem
* @class
- * @param quantity {String} The quantity purchased, as a string representation of a number.
+ * @param quantity {String} The quantity purchased, as a string representation of a number. This string must have a positive integer value.
*/
var exports = function(quantity) {
var _this = this;
@@ -110,7 +110,7 @@ exports.constructFromObject = function(data, obj) {
*/
exports.prototype['name'] = undefined;
/**
- * The quantity purchased, as a string representation of a number.
+ * The quantity purchased, as a string representation of a number. This string must have a positive integer value.
* @member {String} quantity
*/
exports.prototype['quantity'] = undefined;
diff --git a/src/model/SearchCustomersRequest.js b/src/model/SearchCustomersRequest.js
new file mode 100644
index 0000000..9390d1c
--- /dev/null
+++ b/src/model/SearchCustomersRequest.js
@@ -0,0 +1,84 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+var CustomerQuery = require('./CustomerQuery');
+
+
+
+
+/**
+ * The SearchCustomersRequest model module.
+ * @module model/SearchCustomersRequest
+ */
+
+/**
+ * Constructs a new SearchCustomersRequest
.
+ * Defines the fields included in the request body for the [SearchCustomers](#endpoint-searchcustomer) endpoint.
+ * @alias module:model/SearchCustomersRequest
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+
+
+
+};
+
+/**
+ * Constructs a SearchCustomersRequest
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/SearchCustomersRequest} obj Optional instance to populate.
+ * @return {module:model/SearchCustomersRequest} The populated SearchCustomersRequest
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('cursor')) {
+ obj['cursor'] = ApiClient.convertToType(data['cursor'], 'String');
+ }
+ if (data.hasOwnProperty('limit')) {
+ obj['limit'] = ApiClient.convertToType(data['limit'], 'Number');
+ }
+ if (data.hasOwnProperty('query')) {
+ obj['query'] = CustomerQuery.constructFromObject(data['query']);
+ }
+ }
+ return obj;
+}
+
+/**
+ * Include the pagination cursor in subsequent calls to this endpoint to retrieve the next set of results associated with the original query. See [Paginating results](#paginatingresults) for more information.
+ * @member {String} cursor
+ */
+exports.prototype['cursor'] = undefined;
+/**
+ * A limit on the number of results to be returned in a single page. The limit is advisory - the implementation may return more or fewer results. If the supplied limit is negative, zero, or is higher than the maximum limit of 1,000, it will be ignored.
+ * @member {Number} limit
+ */
+exports.prototype['limit'] = undefined;
+/**
+ * Query customers based on the given conditions and sort order. Calling SearchCustomers without an explicit query parameter will return all customers ordered alphabetically based on `given_name` and `family_name`.
+ * @member {module:model/CustomerQuery} query
+ */
+exports.prototype['query'] = undefined;
+
+
+
+module.exports = exports;
+
+
+
diff --git a/src/model/SearchCustomersResponse.js b/src/model/SearchCustomersResponse.js
new file mode 100644
index 0000000..4358775
--- /dev/null
+++ b/src/model/SearchCustomersResponse.js
@@ -0,0 +1,85 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+var Customer = require('./Customer');
+var Error = require('./Error');
+
+
+
+
+/**
+ * The SearchCustomersResponse model module.
+ * @module model/SearchCustomersResponse
+ */
+
+/**
+ * Constructs a new SearchCustomersResponse
.
+ * Defines the fields that are included in the response body of a request to the [SearchCustomers](#endpoint-searchcustomers) endpoint. One of `errors` or `customers` is present in a given response (never both).
+ * @alias module:model/SearchCustomersResponse
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+
+
+
+};
+
+/**
+ * Constructs a SearchCustomersResponse
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/SearchCustomersResponse} obj Optional instance to populate.
+ * @return {module:model/SearchCustomersResponse} The populated SearchCustomersResponse
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('errors')) {
+ obj['errors'] = ApiClient.convertToType(data['errors'], [Error]);
+ }
+ if (data.hasOwnProperty('customers')) {
+ obj['customers'] = ApiClient.convertToType(data['customers'], [Customer]);
+ }
+ if (data.hasOwnProperty('cursor')) {
+ obj['cursor'] = ApiClient.convertToType(data['cursor'], 'String');
+ }
+ }
+ return obj;
+}
+
+/**
+ * Any errors that occurred during the request.
+ * @member {Array.TimeRange
.
+ * Represents a generic time range. The start and end values are represented in RFC-3339 format. Time ranges are customized to be inclusive or exclusive based on the needs of a particular endpoint. Refer to the relevent endpoint-specific documentation to determine how time ranges are handled.
+ * @alias module:model/TimeRange
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+
+
+};
+
+/**
+ * Constructs a TimeRange
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/TimeRange} obj Optional instance to populate.
+ * @return {module:model/TimeRange} The populated TimeRange
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('start_at')) {
+ obj['start_at'] = ApiClient.convertToType(data['start_at'], 'String');
+ }
+ if (data.hasOwnProperty('end_at')) {
+ obj['end_at'] = ApiClient.convertToType(data['end_at'], 'String');
+ }
+ }
+ return obj;
+}
+
+/**
+ * A datetime value in RFC-3339 format indicating when the time range starts.
+ * @member {String} start_at
+ */
+exports.prototype['start_at'] = undefined;
+/**
+ * A datetime value in RFC-3339 format indicating when the time range ends.
+ * @member {String} end_at
+ */
+exports.prototype['end_at'] = undefined;
+
+
+
+module.exports = exports;
+
+
+
diff --git a/src/model/V1AdjustInventoryRequest.js b/src/model/V1AdjustInventoryRequest.js
index e17b207..ea9989f 100644
--- a/src/model/V1AdjustInventoryRequest.js
+++ b/src/model/V1AdjustInventoryRequest.js
@@ -49,7 +49,7 @@ exports.constructFromObject = function(data, obj) {
obj['quantity_delta'] = ApiClient.convertToType(data['quantity_delta'], 'Number');
}
if (data.hasOwnProperty('adjustment_type')) {
- obj['adjustment_type'] = ApiClient.convertToType(data['adjustment_type'], 'Number');
+ obj['adjustment_type'] = ApiClient.convertToType(data['adjustment_type'], 'String');
}
if (data.hasOwnProperty('memo')) {
obj['memo'] = ApiClient.convertToType(data['memo'], 'String');
@@ -65,7 +65,7 @@ exports.constructFromObject = function(data, obj) {
exports.prototype['quantity_delta'] = undefined;
/**
* The reason for the inventory adjustment.
- * @member {Number} adjustment_type
+ * @member {module:model/V1AdjustInventoryRequest.AdjustmentTypeEnum} adjustment_type
*/
exports.prototype['adjustment_type'] = undefined;
/**
@@ -75,6 +75,28 @@ exports.prototype['adjustment_type'] = undefined;
exports.prototype['memo'] = undefined;
+ /**
+ * Allowed values for the adjustment_type
property.
+ * @enum {String}
+ * @readonly
+ */
+ exports.AdjustmentTypeEnum = {
+ /**
+ * value: "SALE"
+ * @const
+ */
+ "SALE": "SALE",
+ /**
+ * value: "RECEIVE_STOCK"
+ * @const
+ */
+ "RECEIVE_STOCK": "RECEIVE_STOCK",
+ /**
+ * value: "MANUAL_ADJUST"
+ * @const
+ */
+ "MANUAL_ADJUST": "MANUAL_ADJUST" };
+
module.exports = exports;
diff --git a/src/model/VoidTransactionResponse.js b/src/model/VoidTransactionResponse.js
index c23a951..c2a477f 100644
--- a/src/model/VoidTransactionResponse.js
+++ b/src/model/VoidTransactionResponse.js
@@ -24,7 +24,7 @@ var Error = require('./Error');
/**
* Constructs a new VoidTransactionResponse
.
- * Defines the fields that are included in the response body of a request to the [CaptureTransaction](#endpoint-capturetransaction) endpoint.
+ * Defines the fields that are included in the response body of a request to the [VoidTransaction](#endpoint-voidtransaction) endpoint.
* @alias module:model/VoidTransactionResponse
* @class
*/
diff --git a/test/model/CustomerCreationSource.spec.js b/test/model/CustomerCreationSource.spec.js
new file mode 100644
index 0000000..3037cd3
--- /dev/null
+++ b/test/model/CustomerCreationSource.spec.js
@@ -0,0 +1,26 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+const SquareConnect = require('../../src/index');
+
+describe('CustomerCreationSource', function() {
+ beforeEach(function() {
+ });
+
+ it('should create an instance of CustomerCreationSource', function() {
+ // uncomment below and update the code to test CustomerCreationSource
+ //var instane = new SquareConnect.CustomerCreationSource();
+ //expect(instance).to.be.a(SquareConnect.CustomerCreationSource);
+ });
+
+});
diff --git a/test/model/CustomerCreationSourceFilter.spec.js b/test/model/CustomerCreationSourceFilter.spec.js
new file mode 100644
index 0000000..7eecca9
--- /dev/null
+++ b/test/model/CustomerCreationSourceFilter.spec.js
@@ -0,0 +1,37 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+const SquareConnect = require('../../src/index');
+
+describe('CustomerCreationSourceFilter', function() {
+ beforeEach(function() {
+ this.api = new SquareConnect.CustomerCreationSourceFilter();
+ });
+
+ it('should create an instance of CustomerCreationSourceFilter', function() {
+ // uncomment below and update the code to test CustomerCreationSourceFilter
+ //var instane = new SquareConnect.CustomerCreationSourceFilter();
+ //expect(instance).to.be.a(SquareConnect.CustomerCreationSourceFilter);
+ });
+
+ it('should have the property values (base name: "values")', function() {
+ // uncomment below and update the code to test the property values
+ //var instane = new SquareConnect.CustomerCreationSourceFilter();
+ //expect(instance).to.be();
+ });
+ it('should have the property rule (base name: "rule")', function() {
+ // uncomment below and update the code to test the property rule
+ //var instane = new SquareConnect.CustomerCreationSourceFilter();
+ //expect(instance).to.be();
+ });
+});
diff --git a/test/model/CustomerFilter.spec.js b/test/model/CustomerFilter.spec.js
new file mode 100644
index 0000000..2497c6a
--- /dev/null
+++ b/test/model/CustomerFilter.spec.js
@@ -0,0 +1,42 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+const SquareConnect = require('../../src/index');
+
+describe('CustomerFilter', function() {
+ beforeEach(function() {
+ this.api = new SquareConnect.CustomerFilter();
+ });
+
+ it('should create an instance of CustomerFilter', function() {
+ // uncomment below and update the code to test CustomerFilter
+ //var instane = new SquareConnect.CustomerFilter();
+ //expect(instance).to.be.a(SquareConnect.CustomerFilter);
+ });
+
+ it('should have the property creationSource (base name: "creation_source")', function() {
+ // uncomment below and update the code to test the property creationSource
+ //var instane = new SquareConnect.CustomerFilter();
+ //expect(instance).to.be();
+ });
+ it('should have the property createdAt (base name: "created_at")', function() {
+ // uncomment below and update the code to test the property createdAt
+ //var instane = new SquareConnect.CustomerFilter();
+ //expect(instance).to.be();
+ });
+ it('should have the property updatedAt (base name: "updated_at")', function() {
+ // uncomment below and update the code to test the property updatedAt
+ //var instane = new SquareConnect.CustomerFilter();
+ //expect(instance).to.be();
+ });
+});
diff --git a/test/model/CustomerInclusionExclusion.spec.js b/test/model/CustomerInclusionExclusion.spec.js
new file mode 100644
index 0000000..f109a8e
--- /dev/null
+++ b/test/model/CustomerInclusionExclusion.spec.js
@@ -0,0 +1,26 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+const SquareConnect = require('../../src/index');
+
+describe('CustomerInclusionExclusion', function() {
+ beforeEach(function() {
+ });
+
+ it('should create an instance of CustomerInclusionExclusion', function() {
+ // uncomment below and update the code to test CustomerInclusionExclusion
+ //var instane = new SquareConnect.CustomerInclusionExclusion();
+ //expect(instance).to.be.a(SquareConnect.CustomerInclusionExclusion);
+ });
+
+});
diff --git a/test/model/CustomerQuery.spec.js b/test/model/CustomerQuery.spec.js
new file mode 100644
index 0000000..b417a57
--- /dev/null
+++ b/test/model/CustomerQuery.spec.js
@@ -0,0 +1,37 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+const SquareConnect = require('../../src/index');
+
+describe('CustomerQuery', function() {
+ beforeEach(function() {
+ this.api = new SquareConnect.CustomerQuery();
+ });
+
+ it('should create an instance of CustomerQuery', function() {
+ // uncomment below and update the code to test CustomerQuery
+ //var instane = new SquareConnect.CustomerQuery();
+ //expect(instance).to.be.a(SquareConnect.CustomerQuery);
+ });
+
+ it('should have the property filter (base name: "filter")', function() {
+ // uncomment below and update the code to test the property filter
+ //var instane = new SquareConnect.CustomerQuery();
+ //expect(instance).to.be();
+ });
+ it('should have the property sort (base name: "sort")', function() {
+ // uncomment below and update the code to test the property sort
+ //var instane = new SquareConnect.CustomerQuery();
+ //expect(instance).to.be();
+ });
+});
diff --git a/test/model/CustomerSort.spec.js b/test/model/CustomerSort.spec.js
new file mode 100644
index 0000000..03ab99b
--- /dev/null
+++ b/test/model/CustomerSort.spec.js
@@ -0,0 +1,37 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+const SquareConnect = require('../../src/index');
+
+describe('CustomerSort', function() {
+ beforeEach(function() {
+ this.api = new SquareConnect.CustomerSort();
+ });
+
+ it('should create an instance of CustomerSort', function() {
+ // uncomment below and update the code to test CustomerSort
+ //var instane = new SquareConnect.CustomerSort();
+ //expect(instance).to.be.a(SquareConnect.CustomerSort);
+ });
+
+ it('should have the property field (base name: "field")', function() {
+ // uncomment below and update the code to test the property field
+ //var instane = new SquareConnect.CustomerSort();
+ //expect(instance).to.be();
+ });
+ it('should have the property order (base name: "order")', function() {
+ // uncomment below and update the code to test the property order
+ //var instane = new SquareConnect.CustomerSort();
+ //expect(instance).to.be();
+ });
+});
diff --git a/test/model/SearchCustomersRequest.spec.js b/test/model/SearchCustomersRequest.spec.js
new file mode 100644
index 0000000..4df3a21
--- /dev/null
+++ b/test/model/SearchCustomersRequest.spec.js
@@ -0,0 +1,42 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+const SquareConnect = require('../../src/index');
+
+describe('SearchCustomersRequest', function() {
+ beforeEach(function() {
+ this.api = new SquareConnect.SearchCustomersRequest();
+ });
+
+ it('should create an instance of SearchCustomersRequest', function() {
+ // uncomment below and update the code to test SearchCustomersRequest
+ //var instane = new SquareConnect.SearchCustomersRequest();
+ //expect(instance).to.be.a(SquareConnect.SearchCustomersRequest);
+ });
+
+ it('should have the property cursor (base name: "cursor")', function() {
+ // uncomment below and update the code to test the property cursor
+ //var instane = new SquareConnect.SearchCustomersRequest();
+ //expect(instance).to.be();
+ });
+ it('should have the property limit (base name: "limit")', function() {
+ // uncomment below and update the code to test the property limit
+ //var instane = new SquareConnect.SearchCustomersRequest();
+ //expect(instance).to.be();
+ });
+ it('should have the property query (base name: "query")', function() {
+ // uncomment below and update the code to test the property query
+ //var instane = new SquareConnect.SearchCustomersRequest();
+ //expect(instance).to.be();
+ });
+});
diff --git a/test/model/SearchCustomersResponse.spec.js b/test/model/SearchCustomersResponse.spec.js
new file mode 100644
index 0000000..1a941f3
--- /dev/null
+++ b/test/model/SearchCustomersResponse.spec.js
@@ -0,0 +1,42 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+const SquareConnect = require('../../src/index');
+
+describe('SearchCustomersResponse', function() {
+ beforeEach(function() {
+ this.api = new SquareConnect.SearchCustomersResponse();
+ });
+
+ it('should create an instance of SearchCustomersResponse', function() {
+ // uncomment below and update the code to test SearchCustomersResponse
+ //var instane = new SquareConnect.SearchCustomersResponse();
+ //expect(instance).to.be.a(SquareConnect.SearchCustomersResponse);
+ });
+
+ it('should have the property errors (base name: "errors")', function() {
+ // uncomment below and update the code to test the property errors
+ //var instane = new SquareConnect.SearchCustomersResponse();
+ //expect(instance).to.be();
+ });
+ it('should have the property customers (base name: "customers")', function() {
+ // uncomment below and update the code to test the property customers
+ //var instane = new SquareConnect.SearchCustomersResponse();
+ //expect(instance).to.be();
+ });
+ it('should have the property cursor (base name: "cursor")', function() {
+ // uncomment below and update the code to test the property cursor
+ //var instane = new SquareConnect.SearchCustomersResponse();
+ //expect(instance).to.be();
+ });
+});
diff --git a/test/model/TimeRange.spec.js b/test/model/TimeRange.spec.js
new file mode 100644
index 0000000..e570c33
--- /dev/null
+++ b/test/model/TimeRange.spec.js
@@ -0,0 +1,37 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+const SquareConnect = require('../../src/index');
+
+describe('TimeRange', function() {
+ beforeEach(function() {
+ this.api = new SquareConnect.TimeRange();
+ });
+
+ it('should create an instance of TimeRange', function() {
+ // uncomment below and update the code to test TimeRange
+ //var instane = new SquareConnect.TimeRange();
+ //expect(instance).to.be.a(SquareConnect.TimeRange);
+ });
+
+ it('should have the property startAt (base name: "start_at")', function() {
+ // uncomment below and update the code to test the property startAt
+ //var instane = new SquareConnect.TimeRange();
+ //expect(instance).to.be();
+ });
+ it('should have the property endAt (base name: "end_at")', function() {
+ // uncomment below and update the code to test the property endAt
+ //var instane = new SquareConnect.TimeRange();
+ //expect(instance).to.be();
+ });
+});
diff --git a/travis-ci/accounts.enc b/travis-ci/accounts.enc
index 0e25af3..380c87e 100644
Binary files a/travis-ci/accounts.enc and b/travis-ci/accounts.enc differ