Skip to content

Commit

Permalink
Merge branch 'main' into feat/retailmedia
Browse files Browse the repository at this point in the history
  • Loading branch information
mzanoni committed Jun 24, 2024
2 parents ec02fca + 34aa5b1 commit 3ad29a5
Show file tree
Hide file tree
Showing 10 changed files with 318 additions and 90 deletions.
34 changes: 17 additions & 17 deletions packages/client/package-lock.json

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

7 changes: 3 additions & 4 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@relewise/client",
"version": "1.25.0",
"version": "1.28.0",
"description": "Relewise is a next generation personalization SaaS-platform, which offers functionality within product- and content recommendations and personalized search. This official SDK helps you interact with our API.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -33,9 +33,8 @@
"build:types": "tsc -p ./tsconfig.json --outDir build --declaration true && api-extractor run",
"clean": "rimraf ./build ./dist ./docs",
"gen-api": "swagger-typescript-api -p https://api.relewise.com/public/swagger.json -o src/models --modular --no-client --enum-names-as-values",
"gen-api-retail-media": "swagger-typescript-api -p [RETAIL_MEDIA_DATASET] -o src/models --modular --no-client --enum-names-as-values",
"gen-api-dev": "swagger-typescript-api -p swagger.json -o src/models --modular --no-client --enum-names-as-values",
"publish": "npm run gen-api-dev && npm run build && npm run build:types"
"publish": "npm run gen-api && npm run build && npm run build:types"
},
"devDependencies": {
"@microsoft/api-extractor": "^7.28.6",
Expand All @@ -60,6 +59,6 @@
"@typescript-eslint/parser": "^5.34.0"
},
"dependencies": {
"cross-fetch": "^3.1.5"
"cross-fetch": "^4.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ export class BrandSettingsRecommendationBuilder extends RecommendationRequestBui
super(settings);
}

public setSelectedBrandProperties(brandProperties: Partial<SelectedBrandPropertiesSettings>): this {
this.recommendationSettings.selectedBrandProperties = brandProperties as SelectedBrandPropertiesSettings;
/**
* Select the properties of the brand to be returned, by default only the brand id is returned.
* @param brandProperties
*/
public setSelectedBrandProperties(brandProperties: Partial<SelectedBrandPropertiesSettings> | null): this {
this.recommendationSettings.selectedBrandProperties = brandProperties as SelectedBrandPropertiesSettings | null;

return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ export class ContentCategorySettingsRecommendationBuilder extends Recommendation
super(settings);
}

public setSelectedContentCategoryProperties(ContentCategoryProperties: Partial<SelectedContentCategoryPropertiesSettings>): this {
this.recommendationSettings.selectedContentCategoryProperties = ContentCategoryProperties as SelectedContentCategoryPropertiesSettings;
/**
* Select the properties of the content category to be returned, by default only the content category id is returned.
* @param contentCategoryProperties
*/
public setSelectedContentCategoryProperties(contentCategoryProperties: Partial<SelectedContentCategoryPropertiesSettings> | null): this {
this.recommendationSettings.selectedContentCategoryProperties = contentCategoryProperties as SelectedContentCategoryPropertiesSettings | null;

return this;
}

public setNumberOfRecommendations(count: number): this {
this.recommendationSettings.numberOfRecommendations = count;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ export class ContentSettingsRecommendationBuilder extends RecommendationRequestB
super(settings);
}

public setSelectedContentProperties(contentProperties: Partial<SelectedContentPropertiesSettings>): this {
this.recommendationSettings.selectedContentProperties = contentProperties as SelectedContentPropertiesSettings;
/**
* Select the properties of the content to be returned, by default only the content id is returned.
* @param contentProperties
*/
public setSelectedContentProperties(contentProperties: Partial<SelectedContentPropertiesSettings> | null): this {
this.recommendationSettings.selectedContentProperties = contentProperties as SelectedContentPropertiesSettings | null;

return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,32 @@ export class ProductSettingsRecommendationBuilder extends RecommendationRequestB
super(settings);
}

public setSelectedProductProperties(productProperties: Partial<SelectedProductPropertiesSettings>): this {
this.recommendationSettings.selectedProductProperties = productProperties as SelectedProductPropertiesSettings;
/**
* Select the properties of the product to be returned, by default only the product id is returned.
* @param productProperties
*/
public setSelectedProductProperties(productProperties: Partial<SelectedProductPropertiesSettings> | null): this {
this.recommendationSettings.selectedProductProperties = productProperties as SelectedProductPropertiesSettings | null;

return this;
}

public setSelectedVariantProperties(variantProperties: Partial<SelectedVariantPropertiesSettings>): this {
this.recommendationSettings.selectedVariantProperties = variantProperties as SelectedVariantPropertiesSettings;
/**
* Select the properties of the variant to be returned, by default only the variant id is returned.
* @param variantProperties
*/
public setSelectedVariantProperties(variantProperties: Partial<SelectedVariantPropertiesSettings> | null): this {
this.recommendationSettings.selectedVariantProperties = variantProperties as SelectedVariantPropertiesSettings | null;

return this;
}

public setSelectedBrandProperties(brandProperties: Partial<SelectedBrandPropertiesSettings>): this {
this.recommendationSettings.selectedBrandProperties = brandProperties as SelectedBrandPropertiesSettings;
/**
* Select the properties of the brand to be returned, by default only the brand id is returned.
* @param brandProperties
*/
public setSelectedBrandProperties(brandProperties: Partial<SelectedBrandPropertiesSettings> | null): this {
this.recommendationSettings.selectedBrandProperties = brandProperties as SelectedBrandPropertiesSettings | null;

return this;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/builders/search/facetBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class FacetBuilder {
return this;
}

public addProductCategoryHierarchyFacet(categorySelectionStrategy: 'ImmediateParent' | 'Ancestors', selectedValues: CategoryPath[] | null = null, selectedPropertiesSettings?: Partial<SelectedProductCategoryPropertiesSettings>, facetSettings?: FacetSettings): this {
public addProductCategoryHierarchyFacet(categorySelectionStrategy: 'ImmediateParent' | 'Ancestors' | 'Descendants', selectedValues: CategoryPath[] | null = null, selectedPropertiesSettings?: Partial<SelectedProductCategoryPropertiesSettings>, facetSettings?: FacetSettings): this {
const facet: CategoryHierarchyFacet = {
$type: 'Relewise.Client.DataTypes.Search.Facets.Queries.CategoryHierarchyFacet, Relewise.Client',
categorySelectionStrategy: categorySelectionStrategy,
Expand All @@ -62,7 +62,7 @@ export class FacetBuilder {
return this;
}

public addContentCategoryHierarchyFacet(categorySelectionStrategy: 'ImmediateParent' | 'Ancestors', selectedValues: CategoryPath[] | null = null, selectedPropertiesSettings?: Partial<SelectedContentCategoryPropertiesSettings>, facetSettings?: FacetSettings): this {
public addContentCategoryHierarchyFacet(categorySelectionStrategy: 'ImmediateParent' | 'Ancestors' | 'Descendants', selectedValues: CategoryPath[] | null = null, selectedPropertiesSettings?: Partial<SelectedContentCategoryPropertiesSettings>, facetSettings?: FacetSettings): this {
const facet: CategoryHierarchyFacet = {
$type: 'Relewise.Client.DataTypes.Search.Facets.Queries.CategoryHierarchyFacet, Relewise.Client',
categorySelectionStrategy: categorySelectionStrategy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ export class ProductCategorySearchBuilder extends SearchRequestBuilder implement
super(settings)
}

public setSelectedCategoryProperties(productCategoryProperties: Partial<SelectedProductCategoryPropertiesSettings>): this {
this.searchSettings.selectedCategoryProperties = productCategoryProperties as SelectedProductCategoryPropertiesSettings;
/**
* Select the properties of the product category to be returned, by default only the product category id is returned.
* @param productCategoryProperties
*/
public setSelectedCategoryProperties(productCategoryProperties: Partial<SelectedProductCategoryPropertiesSettings> | null): this {
this.searchSettings.selectedCategoryProperties = productCategoryProperties as SelectedProductCategoryPropertiesSettings | null;

return this;
}
Expand Down
24 changes: 18 additions & 6 deletions packages/client/src/builders/search/productSearchBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,32 @@ export class ProductSearchBuilder extends SearchRequestBuilder implements Search
super(settings)
}

public setSelectedProductProperties(productProperties: Partial<SelectedProductPropertiesSettings>): this {
this.searchSettings.selectedProductProperties = productProperties as SelectedProductPropertiesSettings;
/**
* Select the properties of the product to be returned, by default only the product id is returned.
* @param productProperties
*/
public setSelectedProductProperties(productProperties: Partial<SelectedProductPropertiesSettings> | null): this {
this.searchSettings.selectedProductProperties = productProperties as SelectedProductPropertiesSettings | null;

return this;
}

public setSelectedVariantProperties(variantProperties: Partial<SelectedVariantPropertiesSettings>): this {
this.searchSettings.selectedVariantProperties = variantProperties as SelectedVariantPropertiesSettings;
/**
* Select the properties of the variant to be returned, by default only the variant id is returned.
* @param variantProperties
*/
public setSelectedVariantProperties(variantProperties: Partial<SelectedVariantPropertiesSettings> | null): this {
this.searchSettings.selectedVariantProperties = variantProperties as SelectedVariantPropertiesSettings | null;

return this;
}

public setSelectedBrandProperties(brandProperties: Partial<SelectedBrandPropertiesSettings>): this {
this.searchSettings.selectedBrandProperties = brandProperties as SelectedBrandPropertiesSettings;
/**
* Select the properties of the brand to be returned, by default only the brand id is returned.
* @param brandProperties
*/
public setSelectedBrandProperties(brandProperties: Partial<SelectedBrandPropertiesSettings> | null): this {
this.searchSettings.selectedBrandProperties = brandProperties as SelectedBrandPropertiesSettings | null;

return this;
}
Expand Down
Loading

0 comments on commit 3ad29a5

Please sign in to comment.