#
Class: ActuallyColabRESTClient#
Constructors#
constructor+ new ActuallyColabRESTClient(baseURL
: string): ActuallyColabRESTClient
Initializes a new client wrapper for the Actually Colab API.
#
Parameters:Name | Type | Description |
---|---|---|
baseURL | string | Actually Colab API basename |
Returns: ActuallyColabRESTClient
Defined in: src/REST/client.ts:15
#
Properties#
axiosInstance• Private
axiosInstance: AxiosInstance
Defined in: src/REST/client.ts:15
#
Methods#
createNotebookâ–¸ createNotebook(name
: string, language?
: python, cells?
: Pick<DCell, language | contents>[]): Promise<Notebook>
Creates the metadata for a new notebook.
#
Parameters:Name | Type | Default value | Description |
---|---|---|---|
name | string | - | human-readable name of the notebook |
language | python | 'python' | runtime language for the notebook |
cells? | Pick<DCell, language | contents>[] | - | - |
Returns: Promise<Notebook>
Defined in: src/REST/client.ts:116
#
createWorkshopâ–¸ createWorkshop(name
: string, description
: string, cells?
: Pick<DCell, language | contents>[]): Promise<Workshop>
Creates the metadata for a new workshop.
#
Parameters:Name | Type | Description |
---|---|---|
name | string | human-readable name of the workshop |
description | string | human-readable description of the workshop |
cells? | Pick<DCell, language | contents>[] | cell contents to pre-insert |
Returns: Promise<Workshop>
Defined in: src/REST/client.ts:155
#
devLoginâ–¸ devLogin(email
: string, name?
: string): Promise<{ sessionToken
: string ; user
: DUser }>
Attempts to login. On success, stores the token.
#
Parameters:Name | Type | Description |
---|---|---|
email | string | the user's email address |
name? | string | optional, sets the name of the user |
Returns: Promise<{ sessionToken
: string ; user
: DUser }>
Defined in: src/REST/client.ts:63
#
getNotebookContentsâ–¸ getNotebookContents(nb_id
: string): Promise<NotebookContents>
Fetches cells and outputs for a specific notebook.
#
Parameters:Name | Type | Description |
---|---|---|
nb_id | string | id of the notebook to fetch |
Returns: Promise<NotebookContents>
Defined in: src/REST/client.ts:102
#
getNotebooksForUserâ–¸ getNotebooksForUser(): Promise<Notebook[]>
Fetches all notebooks that this user has access to.
Returns: Promise<Notebook[]>
Defined in: src/REST/client.ts:93
#
getWorkshopsForUserâ–¸ getWorkshopsForUser(): Promise<Workshop[]>
Fetches all workshops that this user has access to.
Returns: Promise<Workshop[]>
Defined in: src/REST/client.ts:170
#
loginâ–¸ Private
login(loginData
: LoginData): Promise<{ sessionToken
: string ; user
: DUser }>
#
Parameters:Name | Type |
---|---|
loginData | LoginData |
Returns: Promise<{ sessionToken
: string ; user
: DUser }>
Defined in: src/REST/client.ts:40
#
loginWithGoogleIdTokenâ–¸ loginWithGoogleIdToken(idToken
: string): Promise<{ sessionToken
: string ; user
: DUser }>
Attempts to login with Google ID Token. On success, stores the token.
#
Parameters:Name | Type | Description |
---|---|---|
idToken | string | from Google Auth |
Returns: Promise<{ sessionToken
: string ; user
: DUser }>
Defined in: src/REST/client.ts:75
#
refreshSessionTokenâ–¸ refreshSessionToken(sessionToken
: string): Promise<{ sessionToken
: string ; user
: DUser }>
Attempts to refresh session token. On success, stores the token.
#
Parameters:Name | Type | Description |
---|---|---|
sessionToken | string | JWT from Actually Colab service |
Returns: Promise<{ sessionToken
: string ; user
: DUser }>
Defined in: src/REST/client.ts:86
#
setSessionTokenâ–¸ setSessionToken(sessionToken
: string): void
Sets the authorization header for all requests.
#
Parameters:Name | Type | Description |
---|---|---|
sessionToken | string | the actually colab token for the user |
Returns: void
Defined in: src/REST/client.ts:36
#
shareNotebookâ–¸ shareNotebook(email
: string, nb_id
: string, access_level
: NotebookAccessLevelType): Promise<Notebook>
Shares a notebook with another user. The requesting user must have Full Access to share the notebook.
#
Parameters:Name | Type | Description |
---|---|---|
email | string | user to share with |
nb_id | string | id of the notebook to share |
access_level | NotebookAccessLevelType | permissions level for the user that the notebook is being shared with |
Returns: Promise<Notebook>
Defined in: src/REST/client.ts:138