generated from ubiquity/ts-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from gitcoindev/feat-npm-module
- Loading branch information
Showing
19 changed files
with
7,814 additions
and
6,014 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/ |
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 |
---|---|---|
|
@@ -7,4 +7,6 @@ node_modules | |
.pnp.cjs | ||
.pnp.loader.mjs | ||
static/dist | ||
.env | ||
.env | ||
# vscode | ||
.vscode |
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,8 +1,3 @@ | ||
# `@ubiquity/ts-template` | ||
# `@ubiquity-logger` | ||
|
||
This template repository includes support for the following: | ||
|
||
- TypeScript | ||
- Environment Variables | ||
- Conventional Commits | ||
- Automatic publishing of pull requests to Cloudflare Pages | ||
Ubiquity logger NPM module. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { SupabaseClient } from "@supabase/supabase-js"; | ||
import { Context } from "probot"; | ||
import { LogLevel, PrettyLogs } from "./pretty-logs.js"; | ||
|
||
declare class LogReturn { | ||
logMessage: LogMessage; | ||
metadata?: any; | ||
constructor(logMessage: LogMessage, metadata?: any); | ||
} | ||
type FunctionPropertyNames<T> = { | ||
[K in keyof T]: T[K] extends (...args: any[]) => any ? K : never; | ||
}[keyof T]; | ||
type PublicMethods<T> = Exclude<FunctionPropertyNames<T>, "constructor" | keyof object>; | ||
type LogMessage = { | ||
raw: string; | ||
diff: string; | ||
level: LogLevel; | ||
type: PublicMethods<Logs>; | ||
}; | ||
declare class Logs { | ||
private _supabase; | ||
private _context; | ||
private _maxLevel; | ||
private _queue; | ||
private _concurrency; | ||
private _retryDelay; | ||
private _throttleCount; | ||
private _retryLimit; | ||
static console: PrettyLogs; | ||
private _log; | ||
private _addDiagnosticInformation; | ||
ok(log: string, metadata?: any, postComment?: boolean): LogReturn | null; | ||
info(log: string, metadata?: any, postComment?: boolean): LogReturn | null; | ||
error(log: string, metadata?: any, postComment?: boolean): LogReturn | null; | ||
debug(log: string, metadata?: any, postComment?: boolean): LogReturn | null; | ||
fatal(log: string, metadata?: any, postComment?: boolean): LogReturn | null; | ||
verbose(log: string, metadata?: any, postComment?: boolean): LogReturn | null; | ||
constructor(supabase: SupabaseClient, retryLimit: number, logLevel: LogLevel, context: Context | null); | ||
private _sendLogsToSupabase; | ||
private _processLogs; | ||
private _retryLog; | ||
private _processLogQueue; | ||
private _throttle; | ||
private _addToQueue; | ||
private _save; | ||
static _commentMetaData(metadata: any, level: LogLevel): string; | ||
private _diffColorCommentMessage; | ||
private _postComment; | ||
private _getNumericLevel; | ||
static convertErrorsIntoObjects(obj: any): any; | ||
} | ||
|
||
export { type LogMessage, LogReturn, Logs }; |
Oops, something went wrong.