PasteMyst API Wrapper for Julia.
Type ]
into the Julia REPL.
Then type, add PasteMyst
, then just press enter and you're ready to go!
This function is used to retrieve a paste from the PasteMyst website.
pasteID::String
- The ID of the paste.authkey::String
(Optional) - The API key used for Authentication for retrieving private pastes.
A paste
struct.
Get a paste and check if it exists.
pasteID::String
- The ID of the paste.authkey::String
(Optional) - The API key used for Authentication for checking private pastes. (If not provided and is checking private pastes, It will return false.)
A boolean.
Create a paste.
createInfo::PasteCreateInfo
- The information of the paste you're going to create.authkey::String
(Optional) - The authentication key (API key) used for creating a paste on an account.
The paste
struct of the created paste.
Deletes a paste.
authkey::String
- The authentication key (API key) used for deleting a paste the account owning this key owned.pasteID::String
- The ID of the paste you wanted to delete.
None, Or a HTTP response code in case the website didn't return 200 as the HTTP status code.
Edits a paste.
authkey::String
- The authentication key (API key) used for editing a paste the account owning this key owned.pasteID::String
- The ID of the paste you wanted to edit.pasteinfo::pasteEditInfo
orpaste
- The information of the edit. So that it's easy to use, I've made an overload of this function where you can directly pass the edited paste object into the function instead of doing the conversion frompaste
topasteEditInfo
manually.
A paste
struct, or a HTTP code if the request didn't return a 200 as the status.
Fetch data about a programming language from the file extension.
extension::String
The programming language's file extension.
Field | Type | Description | Nullable |
name | String | The name of the language. | No |
mode | String | The language mode to be used in the editor. | No |
mimes | Vector{String} | List of mimes used by the language. | No |
ext | Vector{String} | List of file extensions used by the language. | Yes |
color | String | The color representing the language. | Yes |
Fetch data about a programming language from the programming language name.
name::String
The name of the programming language.
Field | Type | Description | Nullable |
name | String | The name of the language. | No |
mode | String | The language mode to be used in the editor. | No |
mimes | Vector{String} | List of mimes used by the language. | No |
ext | Vector{String} | List of file extensions used by the language. | Yes |
color | String | The color representing the language. | Yes |
Get the number of active pastes on PasteMyst.
None
An Int64 of the active pastes.
Fetches if a user exists.
username::String
The username of the user.
A boolean or a HTTP status code if the website returned other status code than 200 or 404.
Get an information about a user from their username.
username::String
The username of the user.
Field | Type | Description |
_id | String | The ID of the user. |
username | String | The username of the user. |
avatarUrl | String | The URL of their avatar image. |
defaultLang | String | The default language. |
publicProfile | Bool | If they had a public profile or not. |
supporterLength | UInt32 | How long has the user been a supporter for, 0 if not a supporter. |
contributor | Bool | If a user is a contributor of PasteMyst. |
Get the user from the authorization key (API key).
authkey::String
The authorization key (API key) used to retrieve the user.
Field | Type | Description |
_id | String | The ID of the user. |
username | String | The username of the user. |
avatarUrl | String | The URL of their avatar image. |
defaultLang | String | The default language. |
publicProfile | Bool | If they had a public profile or not. |
supporterLength | UInt32 | How long has the user been a supporter for, 0 if not a supporter. |
contributor | Bool | If a user is a contributor of PasteMyst. |
stars | Vector{String} | List of paste IDs of the paste user has starred. |
serviceIds | Dict | User IDs of the service the user used to create an account. |
Get the list of the pastes the user have created.
authkey::String
The authorization key (API key) of the user.
A list of paste IDs. (Type of Vector{String}
)
A Pasty.
This struct is mutable.
_id::String
- ID of the pasty.language::String
- Language of the pasty.title::String
- Title of the pasty.code::String
- Contents of the pasty.
An information about an edit in a paste.
This struct is not mutable.
_id::String
- A unique ID of the edit.editId::String
- ID of the edit, Multiple edits can share the same ID representing that multiple fields were changed at the same time.editType::Number
- Type of the edit. Possible values are 0 (Title), 1 (Pasty title), 2 (Pasty language), 3 (Pasty content), 4 (Pasty added), 5 (Pasty removed)metadata::Vector{String}
- Various metadata used internally by PasteMyst.edit::String
- Stores the old data before the edit.editedAt::Number
- The time when the edit was made in Unix timestamp.
A struct used for sending edit requests.
This struct is mutable.
title::String
- The paste title.isPrivate::Bool
- A boolean value indicating if a paste is private.isPublic::Bool
- A boolean value indicating if a paste is public.tags::Vector{String}
- The list of tags.pasties::Vector{pasty}
- The list of pasty in the paste, This cannot be empty.
A struct representing a paste.
This struct is mutable.
_id::String
- The ID of the paste.ownerId::String
- The ID of the owner. If it doesn't have an owner, The value will be "".title::String
- The paste title.createdAt::UInt64
- A unix timestamp of when the paste is created.expiresIn::String
- When the paste will expire, possible values arenever
,1h
,2h
,10h
,1d
,2d
,1w
,1m
,1y
.deletesAt::UInt64
- When the paste will be deleted, if it has no expiry time it's set to 0.stars::UInt64
- The number of stars the paste received.isPrivate::Bool
- A boolean value indicating if a paste is private.isPublic::Bool
- A boolean value indicating if a paste is public.tags::Vector{String}
- The list of tags.pasties::Vector{pasty}
- The list of pasty in the paste, This cannot be empty.edits::Vector{edit}
- Edit history.
The required information to create a pasty.
This struct is not mutable.
title::String
- The title of the pasty.language::String
- The programming language of the content of the pasty.code::String
- Contents of the pasty.
The required information to create a paste.
This struct is not mutable.
title::String
- The title of the paste.expiresIn::String
- When the paste will expire, possible values arenever
,1h
,2h
,10h
,1d
,2d
,1w
,1m
,1y
.isPrivate::Bool
- A boolean value indicating if a paste is private.isPublic::Bool
- A boolean value indicating if a paste is public.tags::Vector{String}
- The list of tags.pasties::Vector{pasty}
- The list of pasty in the paste, This cannot be empty.