Skip to content

Commit

Permalink
fix(javascript): enable cache (#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
Haroenv committed May 31, 2022
1 parent d62318b commit b62b861
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions specs/recommend/paths/getRecommendations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ post:
- recommendations
operationId: getRecommendations
x-use-read-transporter: true
x-cacheable: true
summary: Get results.
description: Returns recommendations or trending results, for a specific model and `objectID`.
requestBody:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ post:
- Dictionaries
operationId: searchDictionaryEntries
x-use-read-transporter: true
x-cacheable: true
description: Search the dictionary entries.
summary: Search a dictionary entries.
parameters:
Expand Down
1 change: 1 addition & 0 deletions specs/search/paths/multiclusters/searchUserIds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ post:
- Clusters
operationId: searchUserIds
x-use-read-transporter: true
x-cacheable: true
summary: Search userID.
description: >
Search for userIDs.
Expand Down
1 change: 1 addition & 0 deletions specs/search/paths/objects/multipleGetObjects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ post:
- Records
operationId: getObjects
x-use-read-transporter: true
x-cacheable: true
summary: Retrieve one or more objects.
description: Retrieve one or more objects, potentially from different indices, in a single API call.
requestBody:
Expand Down
1 change: 1 addition & 0 deletions specs/search/paths/rules/searchRules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ post:
- Rules
operationId: searchRules
x-use-read-transporter: true
x-cacheable: true
summary: Search for rules.
description: Search for rules matching various criteria.
parameters:
Expand Down
1 change: 1 addition & 0 deletions specs/search/paths/search/search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ post:
- Search
operationId: search
x-use-read-transporter: true
x-cacheable: true
summary: Search multiple indices.
description: Perform a search operation targeting one or many indices.
requestBody:
Expand Down
1 change: 1 addition & 0 deletions specs/search/paths/search/searchForFacetValues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ post:
- Search
operationId: searchForFacetValues
x-use-read-transporter: true
x-cacheable: true
summary: Search for values of a given facet.
description: Search for values of a given facet, optionally restricting the returned values to those contained in objects matching other search criteria.
parameters:
Expand Down
1 change: 1 addition & 0 deletions specs/search/paths/search/searchSingleIndex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ post:
- Search
operationId: searchSingleIndex
x-use-read-transporter: true
x-cacheable: true
summary: Search in a single index.
description: Perform a search operation targeting one specific index.
parameters:
Expand Down
1 change: 1 addition & 0 deletions specs/search/paths/synonyms/searchSynonyms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ post:
- Synonyms
operationId: searchSynonyms
x-use-read-transporter: true
x-cacheable: true
summary: Search synonyms.
description: Search or browse all synonyms, optionally filtering them by type.
parameters:
Expand Down
3 changes: 3 additions & 0 deletions templates/javascript/api-single.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ export function create{{capitalizedApiName}}(options: CreateClientOptions{{#hasR
{{#vendorExtensions.x-use-read-transporter}}
useReadTransporter: true,
{{/vendorExtensions.x-use-read-transporter}}
{{#vendorExtensions.x-cacheable}}
cacheable: true,
{{/vendorExtensions.x-cacheable}}
};

return transporter.request(request, {
Expand Down

0 comments on commit b62b861

Please sign in to comment.