geasty
Version:
Simple and easy to use Gist API client
1 lines • 27.1 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","names":["baseFetchOptions: FetchOptions"],"sources":["../src/types.ts","../src/constant.ts","../src/utils.ts","../src/geasty.ts","../src/index.ts"],"sourcesContent":["// ########### Geasty Methods Options ###########\ninterface PaginationOptions {\n /**\n * The page number of the results to fetch.\n *\n * @default 1\n */\n page?: number\n /**\n * The number of results per page (max 100).\n *\n * @default 30\n */\n per_page?: number\n}\n\nexport interface GeastyOptions {\n /**\n * Fine-grained personal access tokens\n *\n * @see https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token\n */\n access_token?: string\n}\n\nexport interface CreateAGistOptions {\n /**\n * Description of the gist\n */\n description?: string\n /**\n * Flag indicating whether the gist is public\n */\n public?: boolean\n /**\n * Names and content for the files that make up the gist\n *\n * @example\n * ```ts\n * {\n * 'test.txt': {\n * content: 'Hello World!'\n * }\n * }\n * ```\n */\n files: {\n /**\n * A user-defined key to represent an item in files.\n */\n [key: string]: {\n /**\n * The new content of the file.\n */\n content: string\n }\n }\n}\n\nexport interface UpdateAGistOptions {\n /**\n * The unique identifier of the gist.\n */\n gistId: string\n /**\n * The description of the gist.\n */\n description?: string\n /**\n * The gist files to be updated, renamed, or deleted. Each key must match the current filename (including extension) of the targeted gist file. For example: hello.py.\n *\n * To delete a file, set the whole file to null. For example: hello.py : null. The file will also be deleted if the specified object does not contain at least one of content or filename.\n */\n files?: {\n /**\n * A user-defined key to represent an item in files.\n */\n [key: string]: {\n /**\n * The new content of the file.\n */\n content?: string\n /**\n * The new filename for the file.\n */\n filename?: string | null\n }\n }\n}\n\nexport interface GetGistsOptions extends PaginationOptions {\n /**\n * Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\n *\n * @see https://en.wikipedia.org/wiki/ISO_8601\n */\n since?: string // YYYY-MM-DDTHH:MM:SSZ\n}\n\nexport interface GetGistForUserOptions extends GetGistsOptions {\n /**\n * The handle for the GitHub user account.\n */\n username: string\n}\n\nexport interface GetGistForksOrCommitsOptions extends PaginationOptions {\n /**\n * The unique identifier of the gist.\n */\n gistId: string\n}\n\n// ################## Gist Types ##################\n\ninterface GistConstructorOptions {\n id: string\n node_id: string\n description?: string\n public: boolean\n created_at: string\n updated_at: string\n files: GistFile[]\n owner: GistUser\n comments: number\n comments_enabled: boolean\n}\n\nexport class Gist {\n id: string\n node_id: string\n description?: string\n public: boolean\n created_at: string\n updated_at: string\n files: GistFile[]\n owner: GistUser\n comments: number\n comments_enabled: boolean\n\n constructor(options: GistConstructorOptions) {\n this.id = options.id\n this.node_id = options.node_id\n this.description = options.description\n this.public = options.public\n this.created_at = options.created_at\n this.updated_at = options.updated_at\n this.files = options.files\n this.owner = options.owner\n this.comments = options.comments\n this.comments_enabled = options.comments_enabled\n }\n}\n\ninterface GistFileConstructorOptions {\n filename: string\n type?: string\n raw_url?: string\n size?: number\n language?: string\n encoding?: 'base64' | 'utf-8'\n content?: string\n truncated?: boolean\n}\n\nexport class GistFile {\n filename: string\n type?: string\n raw_url?: string\n size?: number\n language?: string\n encoding?: 'base64' | 'utf-8'\n content?: string\n truncated?: boolean\n\n constructor(options: GistFileConstructorOptions) {\n this.filename = options.filename\n this.type = options.type\n this.raw_url = options.raw_url\n this.size = options.size\n this.language = options.language\n this.encoding = options.encoding\n this.content = options.content\n this.truncated = options.truncated\n }\n\n async getContentByRawURL() {\n // TODO: implement fetch content by raw_url\n }\n}\n\ninterface GistUserConstructorOptions {\n id: number\n node_id: string\n login: string\n name?: string\n email?: string\n url: string\n type: string\n site_admin: boolean\n}\n\nexport class GistUser {\n id: number\n login: string\n node_id: string\n name?: string\n email?: string\n url: string\n type: string\n site_admin: boolean\n\n constructor(options: GistUserConstructorOptions) {\n this.id = options.id\n this.login = options.login\n this.node_id = options.node_id\n this.name = options.name || options.login\n this.email = options.email\n this.url = options.url\n this.type = options.type\n this.site_admin = options.site_admin\n }\n}\n\ninterface GistCommitConstructorOptions {\n url: string\n version: string\n user?: GistUser\n change_status: {\n total?: number\n additions?: number\n deletions?: number\n }\n committed_at: string\n}\n\nexport class GistCommit {\n url: string\n version: string\n committed_at: string\n user?: GistUser\n change_status: {\n total?: number\n additions?: number\n deletions?: number\n }\n\n constructor(options: GistCommitConstructorOptions) {\n this.url = options.url\n this.version = options.version\n this.committed_at = options.committed_at\n this.user = options.user\n this.change_status = options.change_status\n }\n}\n","export const BASE_URL = 'https://api.github.com'\nexport const GITHUB_API_VERSION = '2022-11-28'\n","import type { FetchOptions } from 'ofetch'\nimport { ofetch } from 'ofetch'\nimport { BASE_URL, GITHUB_API_VERSION } from './constant'\n\nexport function requestFactory(accessToken?: string) {\n const baseHeaders = {\n 'Accept': 'application/vnd.github+json',\n 'X-GitHub-Api-Version': GITHUB_API_VERSION,\n }\n\n const baseFetchOptions: FetchOptions = {\n baseURL: BASE_URL,\n headers: baseHeaders,\n parseResponse: JSON.parse,\n }\n\n if (accessToken) {\n return ofetch.create({\n ...baseFetchOptions,\n headers: {\n ...baseHeaders,\n Authorization: `Bearer ${accessToken}`,\n },\n })\n }\n return ofetch.create(baseFetchOptions)\n}\n\n// type utils\nexport type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] }\n","import type { $Fetch } from 'ofetch'\nimport type {\n CreateAGistOptions,\n GeastyOptions,\n GetGistForksOrCommitsOptions,\n GetGistForUserOptions,\n GetGistsOptions,\n UpdateAGistOptions,\n} from './types'\nimport type { WithRequired } from './utils'\nimport { FetchError } from 'ofetch'\nimport {\n Gist,\n GistCommit,\n GistFile,\n GistUser,\n} from './types'\nimport { requestFactory } from './utils'\n\nexport default class Geasty {\n /**\n * Access token for gist api authentication\n *\n * @private\n */\n private _accessToken?: string\n\n /**\n * Request instance\n *\n * @private\n */\n private _req: $Fetch\n\n /**\n * @param options Geasty options\n * @param options.access_token Fine-grained personal access tokens\n *\n * @example\n * ```ts\n * const geasty = new Geast({\n * access_token: 'your_access_token_created_by_github'\n * })\n * ```\n */\n constructor(options?: GeastyOptions) {\n this._accessToken = options?.access_token\n this._req = requestFactory(options?.access_token)\n }\n\n // ################## create ##################\n\n /**\n * Allows you to add a new gist with one or more files.\n *\n * @param options\n * @param options.description Description of the gist\n * @param options.public Flag indicating whether the gist is public\n * @param options.files Names and content for the files that make up the gist\n * @returns The created gist\n *\n * @example\n * ```ts\n * creaetAGist({\n * description: 'Example Gist',\n * public: true,\n * files: {'test.txt': {content: 'Hello World!'}},\n * })\n * ```\n */\n async createAGist(options: CreateAGistOptions) {\n const resp = await this._req('gists', {\n method: 'POST',\n body: JSON.stringify(options),\n })\n const gist = this._generateGist(resp)\n return gist\n }\n\n // ################## delete ##################\n\n /**\n * Delete a gist.\n * The fine-grained token must have the following permission set:\n * - \"Gists\" user permissions (write)\n *\n * @param gistId The unique identifier of the gist.\n *\n * @example\n * ```ts\n * deleteAGist('gist_id')\n * ```\n */\n async deleteAGist(gistId: string) {\n await this._req(`gists/${gistId}`, {\n method: 'DELETE',\n })\n }\n\n // ################## update ##################\n\n /**\n * Allows you to update a gist's description and to update, delete, or rename gist files. Files from the previous version of the gist that aren't explicitly changed during an edit are unchanged.\n * The fine-grained token must have the following permission set:\n * - \"Gists\" user permissions (write)\n *\n * @param options\n * @param options.gistId The unique identifier of the gist.\n * @param options.description The description of the gist.\n * @param options.files The gist files to be updated, renamed, or deleted.\n * @returns Updated gist\n *\n * @example\n * ```ts\n * updateAGist({\n * gistId: 'gist_id',\n * description: 'Updated Description',\n * files: {'test.txt': {content: 'Hello Geasty!'}},\n * })\n * ```\n */\n async updateAGist(\n options: WithRequired<UpdateAGistOptions, 'description'>\n | WithRequired<UpdateAGistOptions, 'files'>,\n ) {\n const { gistId, ...rest } = options\n const resp = await this._req(`gists/${gistId}`, {\n method: 'PATCH',\n body: JSON.stringify(rest),\n })\n const gist = this._generateGist(resp)\n return gist\n }\n\n // ################## get ##################\n\n /**\n * Lists the authenticated user's gists or if called anonymously, this returns all public gists.\n *\n * @param options\n * @param options.since Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\n * @param options.page The page number of the results to fetch.\n * @param options.per_page The number of results per page (max 100).\n * @returns List of gists\n *\n * @example\n * ```ts\n * getAllGists({\n * since: '2023-01-01T00:00:00Z',\n * page: 1,\n * per_page: 10,\n * })\n * ```\n */\n async getAllGists(options?: GetGistsOptions) {\n const resp = await this._req('gists', {\n query: options,\n })\n const gists = this._generateGists(resp)\n return gists\n }\n\n /**\n * Gets a specified gist.\n *\n * @param gistId The unique identifier of the gist.\n * @returns Gist that matches the gist ID\n *\n * @example\n * ```ts\n * getAGist('gist_id')\n * ```\n */\n async getAGist(gistId: string) {\n const resp = await this._req(`gists/${gistId}`)\n const gist = this._generateGist(resp)\n return gist\n }\n\n /**\n * Lists public gists for the specified user.\n *\n * @param options\n * @param options.username The handle for the GitHub user account\n * @param options.since Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\n * @param options.page The page number of the results to fetch.\n * @param options.per_page The number of results per page (max 100).\n * @returns List of public gists for the specified user\n *\n * @example\n * ```ts\n * getGistsForUser({\n * username: 'github_username',\n * since: '2023-01-01T00:00:00Z',\n * page: 1,\n * per_page: 10,\n * })\n * ```\n */\n async getGistsForUser(options: GetGistForUserOptions) {\n const { username, ...rest } = options\n const resp = await this._req(`users/${options?.username}/gists`, {\n query: rest,\n })\n const gists = this._generateGists(resp)\n return gists\n }\n\n /**\n * Gets a specified gist revision.\n *\n * @param gistId The unique identifier of the gist\n * @param sha The sha of the gist revision\n * @returns Gist revision that matches the gist ID and sha\n *\n * @example\n * ```ts\n * getAGistRevision('gist_id', 'sha')\n * ```\n */\n async getAGistRevision(gistId: string, sha: string) {\n const resp = await this._req(`gists/${gistId}/${sha}`)\n const gists = this._generateGists(resp)\n return gists\n }\n\n /**\n * List public gists sorted by most recently updated to least recently updated.\n *\n * @param options\n * @param options.since Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\n * @param options.page The page number of the results to fetch.\n * @param options.per_page The number of results per page (max 100).\n * @returns List of gists\n *\n * @example\n * ```ts\n * getPublicGists({\n * since: '2023-01-01T00:00:00Z',\n * page: 1,\n * per_page: 10,\n * })\n * ```\n */\n async getPublicGists(options?: GetGistsOptions) {\n const resp = await this._req('gists/public', {\n query: options,\n })\n const gists = this._generateGists(resp)\n return gists\n }\n\n /**\n * List the authenticated user's starred gists.\n *\n * @param options\n * @param options.since Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\n * @param options.page The page number of the results to fetch.\n * @param options.per_page The number of results per page (max 100).\n * @returns List of starred gists\n *\n * @example\n * ```ts\n * getStarredGists({\n * since: '2023-01-01T00:00:00Z',\n * page: 1,\n * per_page: 10,\n * })\n * ```\n */\n async getStarredGists(options?: GetGistsOptions) {\n const resp = await this._req('gists/starred', {\n query: options,\n })\n const gists = this._generateGists(resp)\n return gists\n }\n\n /**\n * List gist forks.\n *\n * @param options\n * @param options.gistId The unique identifier of the gist.\n * @param options.page The page number of the results to fetch.\n * @param options.per_page The number of results per page (max 100).\n * @returns List of gist forks\n *\n * @example\n * ```ts\n * getGistForks({\n * gistId: 'gist_id',\n * page: 1,\n * per_page: 10,\n * })\n * ```\n */\n async getGistForks(options: GetGistForksOrCommitsOptions) {\n const { gistId, ...rest } = options\n const resp = await this._req(`gists/${gistId}/forks`, {\n query: rest,\n })\n const gists = this._generateGists(resp)\n return gists\n }\n\n /**\n * List gist commits.\n *\n * @param options\n * @param options.gistId The unique identifier of the gist.\n * @param options.page The page number of the results to fetch.\n * @param options.per_page The number of results per page (max 100).\n * @returns List of gist commits\n *\n * @example\n * ```ts\n * getGistCommits({\n * gistId: 'gist_id',\n * page: 1,\n * per_page: 10,\n * })\n * ```\n */\n async getGistCommits(options: GetGistForksOrCommitsOptions) {\n const { gistId, ...rest } = options\n const resp = await this._req(`gists/${gistId}/commits`, {\n query: rest,\n })\n const commits = this._generateCommits(resp)\n return commits\n }\n\n // ################## other ##################\n\n /**\n * Check if a gist is starred.\n *\n * @param gistId The unique identifier of the gist.\n * @returns Boolean indicating whether the gist is starred\n *\n * @example\n * ```ts\n * isGistStarred('gist_id')\n * ```\n */\n async isGistStarred(gistId: string) {\n try {\n await this._req(`gists/${gistId}/star`)\n }\n catch (error) {\n if (error instanceof FetchError && error.status === 404) {\n return false\n }\n throw error\n }\n return true\n }\n\n /**\n * Star a gist.\n * The fine-grained token must have the following permission set:\n * - \"Gists\" user permissions (write)\n *\n * @param gistId The unique identifier of the gist.\n *\n * @example\n * ```ts\n * starAGist('gist_id')\n * ```\n */\n async starAGist(gistId: string) {\n await this._req(`gists/${gistId}/star`, {\n method: 'PUT',\n })\n }\n\n /**\n * Unstar a gist.\n * The fine-grained token must have the following permission set:\n * - \"Gists\" user permissions (write)\n *\n * @param gistId The unique identifier of the gist.\n *\n * @example\n * ```ts\n * unstarAGist('gist_id')\n * ```\n */\n async unstarAGist(gistId: string) {\n await this._req(`gists/${gistId}/star`, {\n method: 'DELETE',\n })\n }\n\n /**\n * Fork a gist.\n * The fine-grained token must have the following permission set:\n * - \"Gists\" user permissions (write)\n *\n * @param gistId The unique identifier of the gist.\n *\n * @example\n * ```ts\n * forkAGist('gist_id')\n * ```\n */\n async forkAGist(gistId: string) {\n await this._req(`gists/${gistId}/forks`)\n }\n\n // ################## utils ##################\n\n /**\n * Get the raw content of a gist file.\n *\n * @param options\n * @param options.username The handle for the GitHub user account\n * @param options.gistId The unique identifier of the gist\n * @param options.filename The name of the file within the gist. If not provided, the raw content of the first file in the gist will be returned.\n * @returns Raw content of the gist file\n *\n * @example\n * ```ts\n * getRawGistFileContent({\n * username: 'github_username',\n * gistId: 'gist_id',\n * filename: 'file_name.txt',\n * })\n * ```\n */\n async getRawGistFileContent(options: {\n /**\n * The handle for the GitHub user account.\n */\n username: string\n /**\n * The unique identifier of the gist.\n */\n gistId: string\n /**\n * The name of the file within the gist. If not provided, the raw content of the first file in the gist will be returned.\n */\n filename?: string\n }) {\n const url = `https://gist.githubusercontent.com/${options.username}/${options.gistId}/raw${options.filename ? `/${options.filename}` : ''}`\n const content = await this._req(url, {\n parseResponse: r => r,\n })\n return content\n }\n\n /**\n * Check if access token is provided.\n *\n * @returns Boolean indicating whether access token is provided\n */\n hasAccessToken() {\n return this._accessToken !== undefined\n }\n\n /**\n * Generate GistFile instance.\n *\n * @param options\n * @returns GistFile instance\n */\n private _generateGistFile(options: any) {\n return new GistFile({\n filename: options.filename,\n type: options.type,\n raw_url: options.raw_url,\n size: options.size,\n language: options.language,\n encoding: options.encoding,\n content: options.content,\n truncated: options.truncated,\n })\n }\n\n /**\n * Generate array of GistFile instances.\n *\n * @param options\n * @returns Array of GistFile instances\n */\n private _generateGistFiles(options: any) {\n const files = Object.entries(options).map(([filename, file]: [string, any]) => {\n return this._generateGistFile({\n filename,\n ...file,\n })\n })\n return files\n }\n\n /**\n * Generate GistUser instance.\n *\n * @param options\n * @returns GistUser instance\n */\n private _generateGistUser(options: any) {\n return new GistUser({\n id: options.id,\n login: options.login,\n node_id: options.node_id,\n url: options.url,\n name: options.name,\n email: options.email,\n type: options.type,\n site_admin: options.site_admin,\n })\n }\n\n /**\n * Generate Gist instance.\n *\n * @param options\n * @returns Gist instance\n */\n private _generateGist(options: any) {\n const files = this._generateGistFiles(options.files)\n const owner = this._generateGistUser(options.owner)\n return new Gist({\n id: options.id,\n node_id: options.node_id,\n description: options.description,\n public: options.public,\n created_at: options.created_at,\n updated_at: options.updated_at,\n files,\n owner,\n comments: options.comments,\n comments_enabled: options.comments_enabled,\n })\n }\n\n /**\n * Generate array of Gist instances.\n *\n * @param options\n * @returns Array of Gist instances\n */\n private _generateGists(options: any) {\n const gists: Gist[] = options.map((gist: any) => {\n return this._generateGist(gist)\n })\n return gists\n }\n\n /**\n * Generate GistCommit instance.\n *\n * @param options\n * @returns GistCommit instance\n */\n private _generateCommit(options: any) {\n const user = this._generateGistUser(options.user)\n return new GistCommit({\n url: options.url,\n version: options.version,\n committed_at: options.committed_at,\n user,\n change_status: options.change_status,\n })\n }\n\n /**\n * Generate array of GistCommit instances.\n *\n * @param options\n * @returns Array of GistCommit instances\n */\n private _generateCommits(options: any) {\n const commits: GistCommit[] = options.map((commit: any) => {\n return this._generateCommit(commit)\n })\n return commits\n }\n}\n","import Geasty from './geasty'\n\nexport default Geasty\n"],"mappings":";;;AAgIA,IAAa,OAAb,MAAkB;CAChB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA,YAAY,SAAiC;AAC3C,OAAK,KAAK,QAAQ;AAClB,OAAK,UAAU,QAAQ;AACvB,OAAK,cAAc,QAAQ;AAC3B,OAAK,SAAS,QAAQ;AACtB,OAAK,aAAa,QAAQ;AAC1B,OAAK,aAAa,QAAQ;AAC1B,OAAK,QAAQ,QAAQ;AACrB,OAAK,QAAQ,QAAQ;AACrB,OAAK,WAAW,QAAQ;AACxB,OAAK,mBAAmB,QAAQ;;;AAepC,IAAa,WAAb,MAAsB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA,YAAY,SAAqC;AAC/C,OAAK,WAAW,QAAQ;AACxB,OAAK,OAAO,QAAQ;AACpB,OAAK,UAAU,QAAQ;AACvB,OAAK,OAAO,QAAQ;AACpB,OAAK,WAAW,QAAQ;AACxB,OAAK,WAAW,QAAQ;AACxB,OAAK,UAAU,QAAQ;AACvB,OAAK,YAAY,QAAQ;;CAG3B,MAAM,qBAAqB;;AAgB7B,IAAa,WAAb,MAAsB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA,YAAY,SAAqC;AAC/C,OAAK,KAAK,QAAQ;AAClB,OAAK,QAAQ,QAAQ;AACrB,OAAK,UAAU,QAAQ;AACvB,OAAK,OAAO,QAAQ,QAAQ,QAAQ;AACpC,OAAK,QAAQ,QAAQ;AACrB,OAAK,MAAM,QAAQ;A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