-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(clients): add
usage
client (#2960)
- Loading branch information
Showing
10 changed files
with
170 additions
and
13 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
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
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
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
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
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
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,54 @@ | ||
[ | ||
{ | ||
"testName": "calls api with correct read host", | ||
"autoCreateClient": false, | ||
"steps": [ | ||
{ | ||
"type": "createClient", | ||
"parameters": { | ||
"appId": "test-app-id", | ||
"apiKey": "test-api-key" | ||
}, | ||
"expected": {} | ||
}, | ||
{ | ||
"type": "method", | ||
"object": "$client", | ||
"path": "customGet", | ||
"parameters": { | ||
"path": "test" | ||
}, | ||
"expected": { | ||
"type": "host", | ||
"match": "test-app-id-dsn.algolia.net" | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"testName": "calls api with correct write host", | ||
"autoCreateClient": false, | ||
"steps": [ | ||
{ | ||
"type": "createClient", | ||
"parameters": { | ||
"appId": "test-app-id", | ||
"apiKey": "test-api-key" | ||
}, | ||
"expected": {} | ||
}, | ||
{ | ||
"type": "method", | ||
"object": "$client", | ||
"path": "customPost", | ||
"parameters": { | ||
"path": "test" | ||
}, | ||
"expected": { | ||
"type": "host", | ||
"match": "test-app-id.algolia.net" | ||
} | ||
} | ||
] | ||
} | ||
] |
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 @@ | ||
[ | ||
{ | ||
"testName": "client throws with invalid parameters", | ||
"autoCreateClient": false, | ||
"steps": [ | ||
{ | ||
"type": "createClient", | ||
"expected": { | ||
"error": "`appId` is missing." | ||
} | ||
}, | ||
{ | ||
"type": "createClient", | ||
"parameters": { | ||
"apiKey": "my-api-key" | ||
}, | ||
"expected": { | ||
"error": "`appId` is missing." | ||
} | ||
}, | ||
{ | ||
"type": "createClient", | ||
"parameters": { | ||
"appId": "my-app-id" | ||
}, | ||
"expected": { | ||
"error": "`apiKey` is missing." | ||
} | ||
} | ||
] | ||
} | ||
] |
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,19 @@ | ||
[ | ||
{ | ||
"testName": "getIndexUsage with minimal parameters", | ||
"parameters": { | ||
"statistic": "queries_operations", | ||
"indexName": "myIndexName", | ||
"startDate": "2024-04-03T12:46:43Z", | ||
"endDate": "2024-04-05T12:46:43Z" | ||
}, | ||
"request": { | ||
"path": "/1/usage/queries_operations/myIndexName", | ||
"method": "GET", | ||
"queryParameters": { | ||
"startDate": "2024-04-03T12%3A46%3A43Z", | ||
"endDate": "2024-04-05T12%3A46%3A43Z" | ||
} | ||
} | ||
} | ||
] |
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 @@ | ||
[ | ||
{ | ||
"testName": "getUsage with minimal parameters", | ||
"parameters": { | ||
"statistic": "queries_operations", | ||
"startDate": "2024-04-03T12:46:43Z", | ||
"endDate": "2024-04-05T12:46:43Z" | ||
}, | ||
"request": { | ||
"path": "/1/usage/queries_operations", | ||
"method": "GET", | ||
"queryParameters": { | ||
"startDate": "2024-04-03T12%3A46%3A43Z", | ||
"endDate": "2024-04-05T12%3A46%3A43Z" | ||
} | ||
} | ||
} | ||
] |
aee3fde
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Published on https://api-clients-automation.netlify.app as production
🚀 Deployed on https://66101d41daf78d0e03a23e1a--api-clients-automation.netlify.app