This repository has been archived by the owner on Aug 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Found a bug. Anyways, here's the deal:
1. It's getting close to API stability. 2. After API stability come the UAT tests and the whole big gun quality control. 3. Once it's black-box tested inside & out we can finally clean up the code under the hood. 4. After cleanin' up, it'll be a release of version 1.0.0
- Loading branch information
1 parent
57d135c
commit 87d7ec1
Showing
8 changed files
with
52 additions
and
25 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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import {Description} from '#description'; | ||
|
||
/** | ||
* @summary | ||
* Describes an identified resource. | ||
* @description | ||
* Used for `Read` and `Delete` mostly but not exclusively. | ||
* Apply this type for cases where you would want to support | ||
* an identifier parameter. | ||
* @group Core API | ||
*/ | ||
export type IdentityAware = { | ||
/** | ||
* @summary | ||
* The name of the identifier parameter. | ||
* @description | ||
* This is the name of the parameter that will be used to | ||
* extract the resource's identifier from the NextJS request. | ||
*/ | ||
idParameterName: string; | ||
}; | ||
|
||
/** | ||
* @summary | ||
* Determines if a description is identity aware. | ||
* @param v The description to test. | ||
* @returns True if the description is identity aware, false otherwise. | ||
* @template R The type of the resource. | ||
* @template I The type of the identifier. | ||
* @template Q The type of the query. | ||
* @group Core API | ||
*/ | ||
export const isIdentityAware = <R, I, Q>( | ||
v: Description<R, I, Q> | ||
): v is IdentityAware & Description<R, I, Q> => { | ||
const candidate = v as IdentityAware; | ||
return typeof candidate.idParameterName === '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
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