Skip to content

feat: add full clients architecture init #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Nov 25, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
nvm use && yarn
```

## Generate clients based on the [`spec.yml` file](./specs/spec.yml)
## Generate clients based on the [`spec_search.yml` file](./specs/spec_search.yml)

```bash
yarn generate
Expand Down
2 changes: 1 addition & 1 deletion openapitools.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"config": "#{cwd}/openapitools.json",
"apiPackage": "client-search",
"output": "#{cwd}/clients/algoliasearch-client-javascript",
"glob": "specs/spec.yml",
"glob": "specs/spec_search.yml",
"gitHost": "algolia",
"gitUserId": "algolia",
"gitRepoId": "algoliasearch-client-javascript",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"playground/javascript/"
],
"scripts": {
"build:spec": "yarn swagger-cli bundle specs/spec.yml --outfile dist/openapi.yml --type yaml",
"build:spec:json": "yarn swagger-cli bundle specs/spec.yml --outfile dist/openapi.json --type json",
"build:spec": "yarn swagger-cli bundle specs/spec_search.yml --outfile dist/openapi.yml --type yaml",
"build:spec:json": "yarn swagger-cli bundle specs/spec_search.yml --outfile dist/openapi.json --type json",
"clean": "rm -rf **/dist **/build **/node_modules",
"client:build-js": "cd clients/algoliasearch-client-javascript/ && yarn install && yarn build && cd ../../",
"client:build": "yarn client:build-js",
Expand Down
1 change: 1 addition & 0 deletions specs/paths/abtesting_client/addAbTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
1 change: 1 addition & 0 deletions specs/paths/abtesting_client/deleteAbTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
delete:
1 change: 1 addition & 0 deletions specs/paths/abtesting_client/getAbTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
1 change: 1 addition & 0 deletions specs/paths/abtesting_client/listAbTests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
1 change: 1 addition & 0 deletions specs/paths/abtesting_client/stopAbTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
1 change: 1 addition & 0 deletions specs/paths/personalization_client/deleteUserProfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
delete:
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
1 change: 1 addition & 0 deletions specs/paths/personalization_client/getUserTokenProfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
delete:
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
1 change: 1 addition & 0 deletions specs/paths/query_suggestions_client/getConfiguration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
1 change: 1 addition & 0 deletions specs/paths/query_suggestions_client/getLogFile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
put:
1 change: 1 addition & 0 deletions specs/paths/recommend_client/getRecommendations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
1 change: 1 addition & 0 deletions specs/paths/search_client/advanced/getLogs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
1 change: 1 addition & 0 deletions specs/paths/search_client/advanced/getTask.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
1 change: 1 addition & 0 deletions specs/paths/search_client/advanced/isAlive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
put:
1 change: 1 addition & 0 deletions specs/paths/search_client/keys/addApiKey.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
1 change: 1 addition & 0 deletions specs/paths/search_client/keys/deleteApiKey.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
delete:
1 change: 1 addition & 0 deletions specs/paths/search_client/keys/getApiKey.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
1 change: 1 addition & 0 deletions specs/paths/search_client/keys/listApiKeys.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
1 change: 1 addition & 0 deletions specs/paths/search_client/keys/restoreApiKey.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
1 change: 1 addition & 0 deletions specs/paths/search_client/keys/updateApiKey.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
put:
1 change: 1 addition & 0 deletions specs/paths/search_client/manage_indices/copyIndex.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
1 change: 1 addition & 0 deletions specs/paths/search_client/manage_indices/deleteIndex.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
delete:
1 change: 1 addition & 0 deletions specs/paths/search_client/manage_indices/listIndices.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
1 change: 1 addition & 0 deletions specs/paths/search_client/multiclusters/assignUserId.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
1 change: 1 addition & 0 deletions specs/paths/search_client/multiclusters/getTopUserIds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
1 change: 1 addition & 0 deletions specs/paths/search_client/multiclusters/getUserId.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
1 change: 1 addition & 0 deletions specs/paths/search_client/multiclusters/listClusters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
1 change: 1 addition & 0 deletions specs/paths/search_client/multiclusters/listUserIds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
1 change: 1 addition & 0 deletions specs/paths/search_client/multiclusters/removeUserId.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
delete:
1 change: 1 addition & 0 deletions specs/paths/search_client/multiclusters/searchUserIds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ post:
operationId: batch
summary: Performs multiple write operations in a single API call
parameters:
- $ref: '../../parameters.yml#/IndexName'
- $ref: '../../../parameters.yml#/IndexName'
requestBody:
required: true
content:
Expand Down Expand Up @@ -48,10 +48,10 @@ post:
additionalProperties: false
properties:
taskID:
$ref: '../../responses/common.yml#/taskID'
$ref: '../../../responses/common.yml#/taskID'
objectIDs:
$ref: '../../responses/common.yml#/objectIDs'
$ref: '../../../responses/common.yml#/objectIDs'
'400':
$ref: '../../responses/BadRequest.yml'
$ref: '../../../responses/BadRequest.yml'
'404':
$ref: '../../responses/IndexNotFound.yml'
$ref: '../../../responses/IndexNotFound.yml'
1 change: 1 addition & 0 deletions specs/paths/search_client/objects/clearObjects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
1 change: 1 addition & 0 deletions specs/paths/search_client/objects/deleteBy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
1 change: 1 addition & 0 deletions specs/paths/search_client/objects/deleteObject.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
delete:
1 change: 1 addition & 0 deletions specs/paths/search_client/objects/getObject.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
1 change: 1 addition & 0 deletions specs/paths/search_client/objects/multipleBatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
1 change: 1 addition & 0 deletions specs/paths/search_client/objects/multipleGetObjects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
1 change: 1 addition & 0 deletions specs/paths/search_client/objects/partialUpdate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ post:
summary: Save object
description: Add an object to the index, automatically assigning it an object ID
parameters:
- $ref: '../../parameters.yml#/IndexName'
- $ref: '../../../parameters.yml#/IndexName'
requestBody:
required: true
content:
Expand All @@ -26,10 +26,10 @@ post:
createdAt:
type: string
taskID:
$ref: '../../responses/common.yml#/taskID'
$ref: '../../../responses/common.yml#/taskID'
objectID:
$ref: '../../responses/common.yml#/objectID'
$ref: '../../../responses/common.yml#/objectID'
'400':
$ref: '../../responses/BadRequest.yml'
$ref: '../../../responses/BadRequest.yml'
'404':
$ref: '../../responses/IndexNotFound.yml'
$ref: '../../../responses/IndexNotFound.yml'
1 change: 1 addition & 0 deletions specs/paths/search_client/objects/updateObject.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
put:
1 change: 1 addition & 0 deletions specs/paths/search_client/rules/batchRules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
1 change: 1 addition & 0 deletions specs/paths/search_client/rules/clearRules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
1 change: 1 addition & 0 deletions specs/paths/search_client/rules/deleteRule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
delete:
1 change: 1 addition & 0 deletions specs/paths/search_client/rules/getRule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
1 change: 1 addition & 0 deletions specs/paths/search_client/rules/saveRule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
put:
1 change: 1 addition & 0 deletions specs/paths/search_client/rules/searchRules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
1 change: 1 addition & 0 deletions specs/paths/search_client/search/browse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ post:
example: products
description: The Algolia index name
query:
$ref: ../../schemas/SearchParams.yml#/searchParams/properties/query
$ref: ../../../schemas/SearchParams.yml#/searchParams/properties/query
type:
type: string
enum: [default, facet]
Expand Down Expand Up @@ -56,8 +56,8 @@ post:
results:
type: array
items:
$ref: ../../schemas/SearchResponse.yml#/searchResponse
$ref: ../../../schemas/SearchResponse.yml#/searchResponse
'400':
$ref: ../../responses/BadRequest.yml
$ref: ../../../responses/BadRequest.yml
'404':
$ref: ../../responses/IndexNotFound.yml
$ref: ../../../responses/IndexNotFound.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ post:
operationId: search
summary: Get search results
parameters:
- $ref: '../../parameters.yml#/IndexName'
- $ref: '../../../parameters.yml#/IndexName'
requestBody:
required: true
content:
application/json:
schema:
oneOf:
- $ref: ../../schemas/SearchParams.yml#/searchParams
- $ref: ../../schemas/SearchParams.yml#/searchParamsString
- $ref: ../../../schemas/SearchParams.yml#/searchParams
- $ref: ../../../schemas/SearchParams.yml#/searchParamsString
responses:
'200':
description: OK
content:
application/json:
schema:
title: singleQueryResponse
$ref: ../../schemas/SearchResponse.yml#/searchResponse
$ref: ../../../schemas/SearchResponse.yml#/searchResponse
'400':
$ref: ../../responses/BadRequest.yml
$ref: ../../../responses/BadRequest.yml
'404':
$ref: ../../responses/IndexNotFound.yml
$ref: ../../../responses/IndexNotFound.yml
1 change: 1 addition & 0 deletions specs/paths/search_client/search/searchForFacetValues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
1 change: 1 addition & 0 deletions specs/paths/search_client/settings/getSettings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
1 change: 1 addition & 0 deletions specs/paths/search_client/settings/setSettings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
put:
1 change: 1 addition & 0 deletions specs/paths/search_client/synonyms/batchSynonyms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
1 change: 1 addition & 0 deletions specs/paths/search_client/synonyms/clearAllSynonyms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
1 change: 1 addition & 0 deletions specs/paths/search_client/synonyms/deleteSynonym.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
delete:
1 change: 1 addition & 0 deletions specs/paths/search_client/synonyms/getSynonym.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
1 change: 1 addition & 0 deletions specs/paths/search_client/synonyms/saveSynonym.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
put:
1 change: 1 addition & 0 deletions specs/paths/search_client/synonyms/searchSynonyms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
1 change: 1 addition & 0 deletions specs/paths/search_client/vault/appendSource.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
post:
1 change: 1 addition & 0 deletions specs/paths/search_client/vault/deleteSource.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
delete:
1 change: 1 addition & 0 deletions specs/paths/search_client/vault/listSources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
get:
1 change: 1 addition & 0 deletions specs/paths/search_client/vault/replaceSources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
put:
46 changes: 46 additions & 0 deletions specs/spec_abtesting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
openapi: 3.0.2
info:
title: A/B Testing API
description: API powering the A/B Testing feature of Algolia.
version: 0.0.1
servers:
- url: https://{appId}-1.algolianet.com
variables:
appId:
default: test
- url: https://{appId}-2.algolianet.com
variables:
appId:
default: test
- url: https://{appId}-3.algolianet.com
variables:
appId:
default: test
- url: https://{appId}-dsn.algolianet.com
variables:
appId:
default: test
components:
securitySchemes:
appId:
type: apiKey
in: header
name: X-Algolia-Application-Id
apiKey:
type: apiKey
in: header
name: X-Algolia-API-Key
security:
- appId: []
apiKey: []
paths:
# /2/abtests:
# $ref: './paths/abtesting_client/addAbTest.yml'
# /2/abtests/{id}:
# $ref: './paths/abtesting_client/getAbTest.yml'
# /2/abtests:
# $ref: './paths/abtesting_client/listAbTests.yml'
# /2/abtests/{id}/stop:
# $ref: './paths/abtesting_client/stopAbTest.yml'
# /2/abtests/{id}:
# $ref: './paths/abtesting_client/deleteAbTest.yml'
44 changes: 44 additions & 0 deletions specs/spec_personalization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
openapi: 3.0.2
info:
title: Personalization API
description: API powering the Personalization feature of Algolia.
version: 0.0.1
servers:
- url: https://{appId}-1.algolianet.com
variables:
appId:
default: test
- url: https://{appId}-2.algolianet.com
variables:
appId:
default: test
- url: https://{appId}-3.algolianet.com
variables:
appId:
default: test
- url: https://{appId}-dsn.algolianet.com
variables:
appId:
default: test
components:
securitySchemes:
appId:
type: apiKey
in: header
name: X-Algolia-Application-Id
apiKey:
type: apiKey
in: header
name: X-Algolia-API-Key
security:
- appId: []
apiKey: []
paths:
# /1/profiles/personalization/{userToken}:
# $ref: './paths/personalization_client/getUserTokenProfile.yml'
# /1/profiles/{userToken}:
# $ref: './paths/personalization_client/deleteUserProfile.yml'
# /1/strategies/personalization:
# $ref: './paths/personalization_client/getPersonalizationStrategy.yml'
# /1/strategies/personalization:
# $ref: './paths/personalization_client/setPersonalizationStrategy.yml'
Loading