-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from vtex-apps/feat/new
first version
- Loading branch information
Showing
61 changed files
with
6,657 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!--- Provide a general summary of the issue in the Title above --> | ||
|
||
## Expected Behavior | ||
<!--- If you're describing a bug, tell us what should happen --> | ||
<!--- If you're suggesting a change/improvement, tell us how it should work --> | ||
|
||
## Current Behavior | ||
<!--- If describing a bug, tell us what happens instead of the expected behavior --> | ||
<!--- If suggesting a change/improvement, explain the difference from current behavior --> | ||
|
||
## Possible Solution | ||
<!--- Not obligatory, but suggest a fix/reason for the bug, --> | ||
<!--- or ideas how to implement the addition or change --> | ||
|
||
## Steps to Reproduce (for bugs) | ||
<!--- Provide a link to a live example, or an unambiguous set of steps to --> | ||
<!--- reproduce this bug. Include code to reproduce, if relevant --> | ||
1. | ||
2. | ||
3. | ||
4. | ||
|
||
## Context | ||
<!--- How has this issue affected you? What are you trying to accomplish? --> | ||
<!--- Providing context helps us come up with a solution that is most useful in the real world --> | ||
|
||
## Your Environment | ||
<!--- Include as many relevant details about the environment you experienced the bug in --> | ||
* Version used: | ||
* Environment name and version (e.g. Chrome 39, node.js 5.4): | ||
* Operating System and version (desktop or mobile): | ||
* Link to your project: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#### What problem is this solving? | ||
|
||
<!--- What is the motivation and context for this change? --> | ||
|
||
#### How should this be manually tested? | ||
|
||
[Workspace](url) | ||
|
||
#### Checklist/Reminders | ||
|
||
- [ ] Updated `README.md`. | ||
- [ ] Updated `CHANGELOG.md`. | ||
- [ ] Linked this PR to a Clubhouse story (if applicable). | ||
- [ ] Updated/created tests (important for bug fixes). | ||
- [ ] Deleted the workspace after merging this PR (if applicable). | ||
|
||
#### Screenshots or example usage | ||
|
||
#### Type of changes | ||
|
||
<!--- Add a ✔️ where applicable --> | ||
✔️ | Type of Change | ||
---|--- | ||
_ | Bug fix <!-- a non-breaking change which fixes an issue --> | ||
_ | New feature <!-- a non-breaking change which adds functionality --> | ||
_ | Breaking change <!-- fix or feature that would cause existing functionality to change --> | ||
_ | Technical improvements <!-- chores, refactors and overall reduction of technical debt --> | ||
|
||
#### Notes | ||
|
||
<!-- Put any relevant information that doesn't fit in the other sections here. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules | ||
node/**/!(main).js | ||
node/**/*.js.map | ||
.vscode/ | ||
.DS_Store | ||
node/package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CHANGELOG.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"semi": false, | ||
"singleQuote": true, | ||
"trailingComma": "es5", | ||
"jsxBracketSameLine": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.DS_Store | ||
.git | ||
node_modules/ | ||
node/node_modules/ | ||
node/tslint.json | ||
react/node_modules/ | ||
.vscode/ | ||
.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
### Added | ||
- First version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
type Query { | ||
""" | ||
Returns a specified product | ||
""" | ||
product( | ||
""" | ||
Product slug | ||
""" | ||
slug: String | ||
""" | ||
Product identifier | ||
""" | ||
identifier: ProductUniqueIdentifier | ||
): Product @cacheControl(scope: SEGMENT, maxAge: SHORT) @withSegment | ||
|
||
""" | ||
Returns products list filtered and ordered | ||
""" | ||
productSearch( | ||
""" | ||
Terms that is used in search e.g.: eletronics/samsung | ||
""" | ||
query: String = "" | ||
""" | ||
Defines terms types: Brand, Category, Department e.g.: c,b | ||
""" | ||
map: String = "" | ||
""" | ||
Filter by category. {a}/{b} - {a} and {b} are categoryIds | ||
""" | ||
category: String = "" | ||
""" | ||
Array of product specification. specificationFilter_{a}:{b} - {a} is the specificationId, {b} = specification value | ||
""" | ||
specificationFilters: [String] | ||
""" | ||
Filter by price range. e.g.: {a} TO {b} - {a} is the minimum price "from" and {b} is the highest price "to" | ||
""" | ||
priceRange: String = "" | ||
""" | ||
Filter by collection. where collection also know as productClusterId | ||
""" | ||
collection: String = "" | ||
""" | ||
Filter by availability at a specific sales channel. e.g.: salesChannel:4 if want filter by available products for the sales channel 4 | ||
""" | ||
salesChannel: String = "" | ||
""" | ||
Order by a criteria. OrderByPriceDESC/OrderByPriceASC, OrderByTopSaleDESC, OrderByReviewRateDESC, OrderByNameASC/OrderByNameDESC, OrderByReleaseDateDESC, OrderByBestDiscountDESC | ||
""" | ||
orderBy: String = "OrderByPriceDESC" | ||
""" | ||
Pagination item start | ||
""" | ||
from: Int = 0 | ||
""" | ||
Pagination item end | ||
""" | ||
to: Int = 9 | ||
""" | ||
If true, uses isAvailablePerSalesChannel_ parameter on query with segment's sales channel. Will override any given salesChannel arg | ||
""" | ||
hideUnavailableItems: Boolean = false | ||
): ProductSearch @cacheControl(scope: SEGMENT, maxAge: SHORT) @withSegment | ||
|
||
searchMetadata( | ||
""" | ||
Terms that is used in search e.g.: eletronics/samsung | ||
""" | ||
query: String = "" | ||
""" | ||
Defines terms types: Brand, Category, Department e.g.: c,b | ||
""" | ||
map: String = "" | ||
): SearchMetadata @cacheControl(scope: SEGMENT, maxAge: SHORT) @withSegment | ||
|
||
""" | ||
Returns products list filtered and ordered | ||
""" | ||
products( | ||
""" | ||
Terms that is used in search e.g.: eletronics/samsung | ||
""" | ||
query: String = "" | ||
""" | ||
Defines terms types: Brand, Category, Department e.g.: c,b | ||
""" | ||
map: String = "" | ||
""" | ||
Filter by category. {a}/{b} - {a} and {b} are categoryIds | ||
""" | ||
category: String = "" | ||
""" | ||
Array of product specification. specificationFilter_{a}:{b} - {a} is the specificationId, {b} = specification value | ||
""" | ||
specificationFilters: [String] | ||
""" | ||
Filter by price range. e.g.: {a} TO {b} - {a} is the minimum price "from" and {b} is the highest price "to" | ||
""" | ||
priceRange: String = "" | ||
""" | ||
Filter by collection. where collection also know as productClusterId | ||
""" | ||
collection: String = "" | ||
""" | ||
Filter by availability at a specific sales channel. e.g.: salesChannel:4 if want filter by available products for the sales channel 4 | ||
""" | ||
salesChannel: String = "" | ||
""" | ||
Order by a criteria. OrderByPriceDESC/OrderByPriceASC, OrderByTopSaleDESC, OrderByReviewRateDESC, OrderByNameASC/OrderByNameDESC, OrderByReleaseDateDESC, OrderByBestDiscountDESC | ||
""" | ||
orderBy: String = "OrderByPriceDESC" | ||
""" | ||
Pagination item start | ||
""" | ||
from: Int = 0 | ||
""" | ||
Pagination item end | ||
""" | ||
to: Int = 9 | ||
""" | ||
If true, uses isAvailablePerSalesChannel_ parameter on query with segment's sales channel. Will override any given salesChannel arg | ||
""" | ||
hideUnavailableItems: Boolean = false | ||
): [Product] @cacheControl(scope: SEGMENT, maxAge: SHORT) @withSegment | ||
|
||
productRecommendations( | ||
identifier: ProductUniqueIdentifier | ||
type: CrossSelingInputEnum | ||
): [Product] @cacheControl(scope: SEGMENT, maxAge: SHORT) @withSegment | ||
|
||
productsByIdentifier( | ||
field: ProductUniqueIdentifierField! | ||
values: [ID!] | ||
): [Product] @cacheControl(scope: SEGMENT, maxAge: SHORT) @withSegment | ||
|
||
""" | ||
Returns facets category | ||
""" | ||
facets( | ||
""" | ||
Terms that is used in search e.g.: eletronics/samsung | ||
""" | ||
query: String = "" | ||
""" | ||
Defines terms types: Brand, Category, Department e.g.: c,b | ||
""" | ||
map: String = "" | ||
""" | ||
If true, uses isAvailablePerSalesChannel_ parameter on query with segment's sales channel. | ||
""" | ||
hideUnavailableItems: Boolean = false | ||
): Facets @cacheControl(scope: SEGMENT, maxAge: MEDIUM) @withSegment | ||
|
||
""" | ||
Get auto complete suggestions in search | ||
""" | ||
autocomplete( | ||
""" | ||
Number of items that is returned | ||
""" | ||
maxRows: Int = 12 | ||
""" | ||
Terms that is used in search e.g.: iphone | ||
""" | ||
searchTerm: String | ||
): Suggestions @cacheControl(scope: SEGMENT, maxAge: MEDIUM) @withSegment | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
""" Benefit of a Product """ | ||
type Benefit { | ||
""" Flag which indicates if the benefit is featured or not """ | ||
featured: Boolean | ||
""" Id of the product which the benefit is associated """ | ||
id: String | ||
""" Name of the benefit """ | ||
name: String | ||
""" Items of the benefit """ | ||
items: [BenefitItem] | ||
""" Type of benefit """ | ||
teaserType: String | ||
} | ||
|
||
type BenefitItem { | ||
""" Product itself """ | ||
benefitProduct: Product | ||
""" IDs of the SKU Items that are taking part in the benefit """ | ||
benefitSKUIds: [String] | ||
""" Discount applied to the benefit product """ | ||
discount: Float | ||
""" Minimum quantity of the benefit product that is required to validate the benefit """ | ||
minQuantity: Int | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
type Brand { | ||
""" slug is used as cacheId """ | ||
cacheId: ID | ||
""" Brand id """ | ||
id: Int | ||
""" Brand logo """ | ||
imageUrl: String | ||
""" Text link""" | ||
slug: String | ||
""" Name of brand """ | ||
name: String @translatable | ||
""" Title used by html tag""" | ||
titleTag: String @translatable | ||
""" Description used by html tag""" | ||
metaTagDescription: String @translatable | ||
""" Brand is active """ | ||
active: Boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
type Category { | ||
""" id is used as cacheId """ | ||
cacheId: ID | ||
""" URI of category """ | ||
href: String | ||
""" Category text link """ | ||
slug: String | ||
""" Category ID """ | ||
id: Int | ||
""" Category name """ | ||
name: String @translatable | ||
""" Title used by html tag""" | ||
titleTag: String @translatable | ||
""" Description used by html tag""" | ||
hasChildren: Boolean | ||
""" Has children categories """ | ||
metaTagDescription: String @translatable | ||
""" Categories children """ | ||
children: [Category] | ||
} |
Oops, something went wrong.