-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename KuzzleRequest to RequestPayload (#565)
Rename KuzzleRequest and KuzzleResponse to RequestPayload and ResponsePayload Also move type definitions to types/ Those types are exactly the same as in Kuzzle.
- Loading branch information
Showing
33 changed files
with
565 additions
and
470 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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,34 @@ | ||
/** | ||
* ApiKey | ||
*/ | ||
export type ApiKey = { | ||
/** | ||
* ApiKey unique ID | ||
*/ | ||
_id: string; | ||
/** | ||
* ApiKey content | ||
*/ | ||
_source: { | ||
/** | ||
* User kuid | ||
*/ | ||
userId: string; | ||
/** | ||
* Expiration date in Epoch-millis format (-1 if the token never expires) | ||
*/ | ||
expiresAt: number; | ||
/** | ||
* Original TTL in ms | ||
*/ | ||
ttl: number; | ||
/** | ||
* API key description | ||
*/ | ||
description: string; | ||
/** | ||
* Authentication token associated with this API key | ||
*/ | ||
token: string; | ||
} | ||
} |
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,72 @@ | ||
import { JSONObject } from './JSONObject'; | ||
|
||
/** | ||
* Kuzzle metadata | ||
* @see https://docs.kuzzle.io/core/2/guides/essentials/document-metadata/ | ||
*/ | ||
export interface DocumentMetadata { | ||
_kuzzle_info: { | ||
/** | ||
* Kuid of the user who created the document | ||
*/ | ||
author: string, | ||
/** | ||
* Creation date in micro-timestamp | ||
*/ | ||
createdAt: number, | ||
/** | ||
* Kuid of the user who last updated the document | ||
*/ | ||
updater: string | null, | ||
/** | ||
* Update date in micro-timestamp | ||
*/ | ||
updatedAt: number | null | ||
} | ||
} | ||
|
||
/** | ||
* Represents the `_source` property of the document | ||
*/ | ||
export interface DocumentContent extends DocumentMetadata { | ||
[key: string]: JSONObject | any, | ||
} | ||
|
||
/** | ||
* Kuzzle document | ||
* | ||
* @property _id | ||
* @property _version | ||
* @property _source | ||
*/ | ||
export class Document { | ||
/** | ||
* Document unique ID | ||
*/ | ||
_id: string; | ||
/** | ||
* Document Version (generated by Elasticsearch) | ||
*/ | ||
_version?: number; | ||
/** | ||
* Document Content | ||
*/ | ||
_source: DocumentContent; | ||
|
||
[key: string]: JSONObject | any; | ||
} | ||
|
||
/** | ||
* Document retrieved from a search | ||
* | ||
* @property _id | ||
* @property _version | ||
* @property _source | ||
* @property _score | ||
*/ | ||
export interface DocumentHit extends Document { | ||
/** | ||
* Relevance score | ||
*/ | ||
_score: number; | ||
} |
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,36 @@ | ||
/** | ||
* HTTP routes definition format | ||
* @example | ||
* { | ||
* <controller>: { | ||
* <action>: { verb: <verb>, url: <url> } | ||
* } | ||
* } | ||
* | ||
* { | ||
* 'my-plugin/my-controller': { | ||
* action: { verb: 'GET', url: '/some/url' }, | ||
* action2: { verb: 'GET', url: '/some/url/with/:parameter' } | ||
* } | ||
* } | ||
*/ | ||
export type HttpRoutes = { | ||
/** | ||
* Controller name | ||
*/ | ||
[controller: string]: { | ||
/** | ||
* Action name | ||
*/ | ||
[action: string]: { | ||
/** | ||
* HTTP verb | ||
*/ | ||
verb: string, | ||
/** | ||
* URL | ||
*/ | ||
url: string | ||
} | ||
} | ||
} |
Oops, something went wrong.