-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update contract for registerContextProvider (#17954)
We're trialling open context providers internally. Not ready yet to call this a public API but we will maintain firmer guarantees on this function going forward. Issues already uncovered by doing this that the more general open framework will have to deal with: * `SdkProvider` would need to be open and stable * What if the provider doesn't need account/region? * Schema validation in query and response * Side channel instructions to the context framework * (not to mention: how will the code get on the user's machine?) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Showing
5 changed files
with
117 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
export interface ContextProviderPlugin { | ||
getValue(args: {[key: string]: any}): Promise<any>; | ||
} | ||
|
||
export function isContextProviderPlugin(x: unknown): x is ContextProviderPlugin { | ||
return typeof x === 'object' && !!x && !!(x as any).getValue; | ||
} |
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