-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added additional types for Typescript (#288)
This continues work from #286, adding Typescript type info for other features that have been added.
- Loading branch information
1 parent
629e722
commit e4d8b65
Showing
3 changed files
with
309 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,91 @@ | ||
/* | ||
* Copyright 2021 Lightbend Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** | ||
* @classdesc CloudEvent data. | ||
* | ||
* This exposes CloudEvent data from metadata. Changes made to the Cloudevent are reflected in the backing metadata, | ||
* as are changes to the backing metadata reflected in this CloudEvent. | ||
* | ||
* @class module:akkaserverless.Cloudevent | ||
* @param {module:akkaserverless.Metadata} metadata The metadata backing this CloudEvent. | ||
*/ | ||
|
||
/** | ||
* The metadata backing this CloudEvent. | ||
* | ||
* @name module:akkaserverless.Cloudevent#metadata | ||
* @type {module:akkaserverless.Metadata} | ||
* @readonly | ||
*/ | ||
|
||
/** | ||
* The spec version | ||
* | ||
* @name module:akkaserverless.Cloudevent#specversion | ||
* @type {string | undefined} | ||
* @readonly | ||
*/ | ||
|
||
/** | ||
* The id | ||
* | ||
* @name module:akkaserverless.Cloudevent#id | ||
* @type {string | undefined} | ||
*/ | ||
|
||
/** | ||
* The source | ||
* | ||
* @name module:akkaserverless.Cloudevent#source | ||
* @type {string | undefined} | ||
*/ | ||
|
||
/** | ||
* The type | ||
* | ||
* @name module:akkaserverless.Cloudevent#type | ||
* @type {string | undefined} | ||
*/ | ||
|
||
/** | ||
* The datacontenttype | ||
* | ||
* @name module:akkaserverless.Cloudevent#datacontenttype | ||
* @type {string | undefined} | ||
*/ | ||
|
||
/** | ||
* The dataschema | ||
* | ||
* @name module:akkaserverless.Cloudevent#dataschema | ||
* @type {string | undefined} | ||
*/ | ||
|
||
/** | ||
* The subject | ||
* | ||
* @name module:akkaserverless.Cloudevent#subject | ||
* @type {string | undefined} | ||
*/ | ||
|
||
/** | ||
* The time | ||
* | ||
* @name module:akkaserverless.Cloudevent#time | ||
* @type {Date | undefined} | ||
*/ | ||
|
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,176 @@ | ||
/* | ||
* Copyright 2021 Lightbend Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** | ||
* @classdesc JWT claims. | ||
* | ||
* This exposes an JWT claims that were extracted from the bearer token. | ||
* | ||
* @class module:akkaserverless.JwtClaims | ||
* @param {module:akkaserverless.Metadata} metadata The metadata that the JWT claims com efrom. | ||
*/ | ||
|
||
/** | ||
* The metadata backing this JWT claims object. | ||
* | ||
* @name module:akkaserverless.JwtClaims#metadata | ||
* @type {module:akkaserverless.Metadata} | ||
* @readonly | ||
*/ | ||
|
||
/** | ||
* The issuer | ||
* | ||
* @name module:akkaserverless.JwtClaims#issuer | ||
* @type {string | undefined} | ||
* @readonly | ||
*/ | ||
|
||
/** | ||
* The subject | ||
* | ||
* @name module:akkaserverless.JwtClaims#subject | ||
* @type {string | undefined} | ||
* @readonly | ||
*/ | ||
|
||
/** | ||
* The audience | ||
* | ||
* @name module:akkaserverless.JwtClaims#audience | ||
* @type {string | undefined} | ||
* @readonly | ||
*/ | ||
|
||
/** | ||
* The expiration time | ||
* | ||
* @name module:akkaserverless.JwtClaims#expirationTime | ||
* @type {Date | undefined} | ||
* @readonly | ||
*/ | ||
|
||
/** | ||
* The not before | ||
* | ||
* @name module:akkaserverless.JwtClaims#notBefore | ||
* @type {Date | undefined} | ||
* @readonly | ||
*/ | ||
|
||
/** | ||
* The issued at | ||
* | ||
* @name module:akkaserverless.JwtClaims#issuedAt | ||
* @type {Date | undefined} | ||
* @readonly | ||
*/ | ||
|
||
/** | ||
* The jwt id | ||
* | ||
* @name module:akkaserverless.JwtClaims#jwtId | ||
* @type {string | undefined} | ||
* @readonly | ||
*/ | ||
|
||
/** | ||
* Get the string claim with the given name. | ||
* | ||
* @function module:akkaserverless.JwtClaims#getString | ||
* @param {string} name The name of the claim. | ||
* @returns {string | undefined} the claim, or undefined if it doesn't exist or is not of the right type. | ||
*/ | ||
|
||
/** | ||
* Get the numeric claim with the given name. | ||
* | ||
* @function module:akkaserverless.JwtClaims#getNumber | ||
* @param {string} name The name of the claim. | ||
* @returns {number | undefined} the claim, or undefined if it doesn't exist or is not of the right type. | ||
*/ | ||
|
||
/** | ||
* Get the numeric date claim with the given name. | ||
* | ||
* @function module:akkaserverless.JwtClaims#getNumericDate | ||
* @param {string} name The name of the claim. | ||
* @returns {Date | undefined} the claim, or undefined if it doesn't exist or is not of the right type. | ||
*/ | ||
|
||
/** | ||
* Get the boolean claim with the given name. | ||
* | ||
* @function module:akkaserverless.JwtClaims#getBoolean | ||
* @param {string} name The name of the claim. | ||
* @returns {boolean | undefined} the claim, or undefined if it doesn't exist or is not of the right type. | ||
*/ | ||
|
||
/** | ||
* Get the object claim with the given name. | ||
* | ||
* @function module:akkaserverless.JwtClaims#getObject | ||
* @param {string} name The name of the claim. | ||
* @returns {object | undefined} the claim, or undefined if it doesn't exist or is not of the right type. | ||
*/ | ||
|
||
/** | ||
* Get the string array claim with the given name. | ||
* | ||
* @function module:akkaserverless.JwtClaims#getStringArray | ||
* @param {string} name The name of the claim. | ||
* @returns {string[] | undefined} the claim, or undefined if it doesn't exist or is not of the right type. | ||
*/ | ||
|
||
/** | ||
* Get the numeric array claim with the given name. | ||
* | ||
* @function module:akkaserverless.JwtClaims#getNumberArray | ||
* @param {string} name The name of the claim. | ||
* @returns {number[] | undefined} the claim, or undefined if it doesn't exist or is not of the right type. | ||
*/ | ||
|
||
/** | ||
* Get the boolean array claim with the given name. | ||
* | ||
* @function module:akkaserverless.JwtClaims#getBooleanArray | ||
* @param {string} name The name of the claim. | ||
* @returns {boolean[] | undefined} the claim, or undefined if it doesn't exist or is not of the right type. | ||
*/ | ||
|
||
/** | ||
* Get the object array claim with the given name. | ||
* | ||
* @function module:akkaserverless.JwtClaims#getObjectArray | ||
* @param {string} name The name of the claim. | ||
* @returns {object[] | undefined} the claim, or undefined if it doesn't exist or is not of the right type. | ||
*/ | ||
|
||
/** | ||
* Get the numeric date array claim with the given name. | ||
* | ||
* @function module:akkaserverless.JwtClaims#getNumericDateArray | ||
* @param {string} name The name of the claim. | ||
* @returns {Date[] | undefined} the claim, or undefined if it doesn't exist or is not of the right type. | ||
*/ | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
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