File tree Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Original file line number Diff line number Diff line change
1
+ export type AllContexts = {
2
+ created_at : string ;
3
+ id : string ;
4
+ name : string ;
5
+ } [ ] ;
Original file line number Diff line number Diff line change
1
+ import { Hyper } from '../hyper' ;
2
+ import type { AllContexts } from './@types' ;
3
+
4
+ export class Contexts {
5
+ constructor ( private readonly hyper : Hyper ) { }
6
+
7
+ async list ( ) {
8
+ const res = await this . hyper . get < AllContexts > ( {
9
+ endpoint : '/contexts' ,
10
+ } ) ;
11
+
12
+ return res ;
13
+ }
14
+ }
Original file line number Diff line number Diff line change
1
+ export { Contexts } from './contexts' ;
Original file line number Diff line number Diff line change 1
1
import { Types } from './types' ;
2
2
import { Search } from './search' ;
3
+ import { Contexts } from './contexts' ;
3
4
4
5
const baseUrl = process . env . HYPER_BASE_URL || 'https://api.gethyper.ai/v1' ;
5
6
@@ -14,6 +15,7 @@ export class Hyper {
14
15
15
16
readonly types = new Types ( this ) ;
16
17
readonly search = new Search ( this ) ;
18
+ readonly contexts = new Contexts ( this ) ;
17
19
18
20
constructor ( private readonly apiKey ?: string ) {
19
21
if ( ! apiKey ) {
You can’t perform that action at this time.
0 commit comments