Skip to content

Commit

Permalink
Merge pull request #363 from Nosto/release/7.3.0
Browse files Browse the repository at this point in the history
Release/7.3.0
  • Loading branch information
supercid committed Feb 8, 2024
2 parents 8f14a91 + 1cab305 commit 9588f93
Show file tree
Hide file tree
Showing 37 changed files with 2,824 additions and 35 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning (http://semver.org/).

### 7.3.0
* Add support for parent cateogory ids in the Product model
* Logs a message if API responses are empty

### 7.2.1
* Fix an issue where passing an empty array to Category Merchandising rules parameter would cause an the rules to be ignored

### 7.2.0
* Add support for search requests

### 7.1.1
* Restore the DeleteProduct operation (from 6.2.2)
Expand Down
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nosto/php-sdk",
"version": "7.1.1",
"version": "7.3.0",
"description": "PHP SDK for developing Nosto modules for e-commerce platforms",
"license": "BSD-3-Clause",
"require-dev": {
Expand Down Expand Up @@ -50,6 +50,9 @@
"ci:inspect": "./inspect.sh"
},
"config": {
"process-timeout": 3600
"process-timeout": 3600,
"allow-plugins": {
"codeception/c3": true
}
}
}
49 changes: 31 additions & 18 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
NOSTO_SERVER_URL=connect.nosto.com
NOSTO_EMAIL_WIDGET_BASE_URL=https://connect.nosto.com
NOSTO_API_BASE_URL=https://api.nosto.com
NOSTO_SEARCH_BASE_URL=https://search.nosto.com
NOSTO_OAUTH_BASE_URL=https://my.nosto.com/oauth
NOSTO_WEB_HOOK_BASE_URL=https://my.nosto.com
NOSTO_GRAPHQL_BASE_URL=https://api.nosto.com
28 changes: 27 additions & 1 deletion src/Model/Product/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,15 @@ class Product extends AbstractObject implements
private $categories;

/**
* @var StringCollection collection of product category strings.
* @var StringCollection collection of product category ids strings.
*/
private $categoryIds;

/**
* @var StringCollection product parent categories ids.
*/
private $parentCategoryIds;

/**
* @var string the product description.
*/
Expand Down Expand Up @@ -266,6 +271,7 @@ public function __construct()
$this->alternateImageUrls = new StringCollection('alternate_image_urls', 'alternate_image_url');
$this->categories = new StringCollection('categories', 'category');
$this->categoryIds = new StringCollection('category_ids', 'category_id');
$this->parentCategoryIds = new StringCollection('parent_category_ids', 'parent_category_id');
}

/**
Expand Down Expand Up @@ -595,6 +601,26 @@ public function setCategoryIds(array $categoryIds)
$this->categoryIds->setData($categoryIds);
}

/**
* Sets the product parent category ids.
*
* @param array $parentCategoryIds the list of parent category ids.
*/
public function setParentCategoryIds(array $parentCategoryIds)
{
$this->parentCategoryIds->setData($parentCategoryIds);
}

/**
* Returns the product parent category ids
*
* @return array
*/
public function getParentCategoryIds()
{
return $this->parentCategoryIds->getData();
}

/**
* Adds a category to the product.
*
Expand Down
6 changes: 6 additions & 0 deletions src/Nosto.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class Nosto
const DEFAULT_NOSTO_OAUTH_BASE_URL = 'https://my.nosto.com/oauth';
const DEFAULT_NOSTO_API_BASE_URL = 'https://api.nosto.com';
const DEFAULT_NOSTO_GRAPHQL_BASE_URL = 'https://api.nosto.com';
const DEFAULT_NOSTO_SEARCH_BASE_URL = 'https://search.nosto.com';

const URL_PARAM_MESSAGE_TYPE = 'message_type';
const URL_PARAM_MESSAGE_CODE = 'message_code';
Expand Down Expand Up @@ -109,6 +110,11 @@ public static function getGraphqlBaseUrl()
return self::getEnvVariable('NOSTO_GRAPHQL_BASE_URL', self::DEFAULT_NOSTO_GRAPHQL_BASE_URL);
}

public static function getSearchBaseUrl()
{
return self::getEnvVariable('NOSTO_SEARCH_BASE_URL', self::DEFAULT_NOSTO_SEARCH_BASE_URL);
}

/**
* Throws a new HttpException exception with info about both the
* request and response.
Expand Down
5 changes: 3 additions & 2 deletions src/Operation/AbstractOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
use Nosto\NostoException;
use Nosto\Request\Http\HttpRequest;
use Nosto\Request\Graphql\GraphqlRequest;
use Nosto\Request\Graphql\SearchRequest;
use Nosto\Result\ResultHandler;

/**
Expand Down Expand Up @@ -69,7 +70,7 @@ abstract class AbstractOperation
* @param string|null $nostoAccount
* @param string|null $domain
* @param bool $isTokenNeeded
* @return ApiRequest|GraphqlRequest|HttpRequest
* @return ApiRequest|GraphqlRequest|SearchRequest|HttpRequest
* @throws NostoException
*/
protected function initRequest(
Expand Down Expand Up @@ -103,7 +104,7 @@ protected function initRequest(
/**
* Return type of request object
*
* @return HttpRequest|ApiRequest|GraphqlRequest
* @return HttpRequest|ApiRequest|GraphqlRequest|SearchRequest
*/
abstract protected function getRequestType();

Expand Down
Loading

0 comments on commit 9588f93

Please sign in to comment.