repo_name string | dataset string | owner string | lang string | func_name string | code string | docstring string | url string | sha string |
|---|---|---|---|---|---|---|---|---|
maxun | github_2023 | getmaxun | typescript | getShadowPath | const getShadowPath = (el: HTMLElement) => {
const path = [];
let current = el;
let depth = 0;
const MAX_DEPTH = 4;
while (current && depth < MAX_DEPTH) {
const rootNode = current.getRootNode();
if (rootNode instanceof ShadowRoot) {
... | // Get complete path up to document root | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/selector.ts#L1346-L1367 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | genValidAttributeFilter | function genValidAttributeFilter(element: HTMLElement, attributes: string[]) {
const attrSet = genAttributeSet(element, attributes);
return (name: string) => attrSet.has(name);
} | // Gets all attributes that aren't null and empty | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/selector.ts#L1499-L1503 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | isCharacterNumber | function isCharacterNumber(char: string) {
return char.length === 1 && char.match(/[0-9]/);
} | // isCharacterNumber | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/selector.ts#L1520-L1522 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | traverseShadowDOM | const traverseShadowDOM = (element: HTMLElement): HTMLElement => {
let current = element;
let deepest = current;
let shadowRoot = current.shadowRoot;
while (shadowRoot) {
const shadowElement = shadowRoot.elementFromPoint(x, y) as HTMLElement;
... | // Function to traverse shadow DOM | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/selector.ts#L1573-L1588 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | getNonUniqueSelector | function getNonUniqueSelector(element: HTMLElement): string {
let selector = element.tagName.toLowerCase();
if (selector === 'td' && element.parentElement) {
// Find position among td siblings
const siblings = Array.from(element.parentElement.children);
const pos... | // Basic selector generation | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/selector.ts#L1637-L1683 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | getNonUniqueSelector | function getNonUniqueSelector(element: HTMLElement): string {
let selector = element.tagName.toLowerCase();
if (selector === 'td' && element.parentElement) {
const siblings = Array.from(element.parentElement.children);
const position = siblings.indexOf(element) + 1;
... | // Generate basic selector from element's tag and classes | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/selector.ts#L1903-L1948 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | getContextPath | function getContextPath(element: HTMLElement): DOMContext[] {
const path: DOMContext[] = [];
let current = element;
let depth = 0;
const MAX_DEPTH = 4;
while (current && depth < MAX_DEPTH) {
// Check for shadow DOM
const rootNode = cur... | // Get complete context path (both iframe and shadow DOM) | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/selector.ts#L1686-L1727 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | getNonUniqueSelector | function getNonUniqueSelector(element: HTMLElement): string {
let selector = element.tagName.toLowerCase();
if (selector === 'td' && element.parentElement) {
const siblings = Array.from(element.parentElement.children);
const position = siblings.indexOf(element) + 1;
return... | // Function to get a non-unique selector based on tag and class (if present) | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/selector.ts#L2058-L2104 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | getSelectorPath | function getSelectorPath(element: HTMLElement): string {
if (!element || !element.parentElement) return '';
const elementSelector = getNonUniqueSelector(element);
// Check for shadow DOM context
const rootNode = element.getRootNode();
if (rootNode instanceof ShadowRoot)... | // Function to generate selector path from an element to its parent | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/selector.ts#L2107-L2130 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | getSpecialContextChildren | function getSpecialContextChildren(element: HTMLElement): HTMLElement[] {
const children: HTMLElement[] = [];
// Get shadow DOM children
const shadowRoot = element.shadowRoot;
if (shadowRoot) {
const shadowElements = Array.from(shadowRoot.querySelectorAll('*')) as HTML... | // Function to get all children from special contexts | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/selector.ts#L2134-L2160 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | getAllDescendantSelectors | function getAllDescendantSelectors(element: HTMLElement): string[] {
let selectors: string[] = [];
// Handle regular DOM children
const children = Array.from(element.children) as HTMLElement[];
for (const child of children) {
const childPath = getSelectorPath(child);
... | // Function to recursively get all descendant selectors including shadow DOM and iframes | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/selector.ts#L2163-L2199 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | promiseAllP | function promiseAllP(items: any, block: any) {
let promises: any = [];
items.forEach(function(item : any, index: number) {
promises.push( function(item,i) {
return new Promise(function(resolve, reject) {
// @ts-ignore
return block.apply(this,[item,index,resolve,reject]);
});
}(it... | /**
* A helper function to apply a callback to the all resolved
* promises made out of an array of the items.
* @param items An array of items.
* @param block The function to call for each item after the promise for it was resolved.
* @returns {Promise<any[]>}
* @category WorkflowManagement-Storage
*/ | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/storage.ts#L71-L82 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowGenerator.constructor | public constructor(socket: Socket) {
this.socket = socket;
this.registerEventHandlers(socket);
this.initializeSocketListeners();
} | /**
* The public constructor of the WorkflowGenerator.
* Takes socket for communication as a parameter and registers some important events on it.
* @param socket The socket used to communicate with the client.
* @constructor
*/ | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Generator.ts#L76-L80 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowGenerator.initializeSocketListeners | private initializeSocketListeners() {
this.socket.on('setGetList', (data: { getList: boolean }) => {
this.getList = data.getList;
});
this.socket.on('listSelector', (data: { selector: string }) => {
this.listSelector = data.selector;
})
this.socket.on('setPaginationMode', (data: { pagina... | /**
* Initializes the socket listeners for the generator.
*/ | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Generator.ts#L120-L130 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowGenerator.addPairToWorkflowAndNotifyClient | private registerEventHandlers = (socket: Socket) => {
socket.on('save', (data) => {
const { fileName, userId, isLogin } = data;
logger.log('debug', `Saving workflow ${fileName} for user ID ${userId}`);
this.saveNewWorkflow(fileName, userId, isLogin);
});
socket.on('new-recording', () => this... | /**
* Adds a newly generated pair to the workflow and notifies the client about it by
* sending the updated workflow through socket.
*
* Checks some conditions for the correct addition of the pair.
* 1. The pair's action selector is already in the workflow as a different pair's where selector
* If ... | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Generator.ts | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowGenerator.getLastUsedSelectorInfo | private async getLastUsedSelectorInfo(page: Page, selector: string) {
const elementHandle = await page.$(selector);
if (elementHandle) {
const tagName = await elementHandle.evaluate(el => (el as HTMLElement).tagName);
// TODO: based on tagName, send data. Always innerText won't hold true. For now, c... | /**
* Returns tag name and text content for the specified selector
* used in customAction for decision modal
*/ | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Generator.ts#L538-L548 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowGenerator.updateWorkflowFile | public updateWorkflowFile = (workflowFile: WorkflowFile, meta: MetaData) => {
this.recordingMeta = meta;
const params = this.checkWorkflowForParams(workflowFile);
if (params) {
this.recordingMeta.params = params;
}
this.workflowRecord = workflowFile;
} | /**
* Enables to update the generated workflow file.
* Adds a generated flag action for possible pausing during the interpretation.
* Used for loading a recorded workflow to already initialized Generator.
* @param workflowFile The workflow file to be used as a replacement for the current generated workflow.... | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Generator.ts#L688-L695 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowGenerator.saveNewWorkflow | public saveNewWorkflow = async (fileName: string, userId: number, isLogin: boolean) => {
const recording = this.optimizeWorkflow(this.workflowRecord);
try {
this.recordingMeta = {
name: fileName,
id: uuid(),
createdAt: this.recordingMeta.createdAt || new Date().toLocaleString(),
... | /**
* Creates a recording metadata and stores the curren workflow
* with the metadata to the file system.
* @param fileName The name of the file.
* @returns {Promise<void>}
*/ | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Generator.ts#L703-L735 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowGenerator.generateSelector | private generateSelector = async (page: Page, coordinates: Coordinates, action: ActionType) => {
const elementInfo = await getElementInformation(page, coordinates, this.listSelector, this.getList);
const selectorBasedOnCustomAction = (this.getList === true)
? await getNonUniqueSelectors(page, coordinates,... | /**
* Uses a system of functions to generate a correct and unique css selector
* according to the action being performed.
* @param page The page to be used for obtaining the information and selector.
* @param coordinates The coordinates of the element.
* @param action The action for which the selector is... | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Generator.ts#L746-L783 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowGenerator.generateDataForHighlighter | public generateDataForHighlighter = async (page: Page, coordinates: Coordinates) => {
const rect = await getRect(page, coordinates, this.listSelector, this.getList);
const displaySelector = await this.generateSelector(page, coordinates, ActionType.Click);
const elementInfo = await getElementInformation(page... | /**
* Generates data for highlighting the element on client side and emits the
* highlighter event to the client.
* @param page The page to be used for obtaining data.
* @param coordinates The coordinates of the element.
* @returns {Promise<void>}
*/ | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Generator.ts#L792-L819 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowGenerator.notifyUrlChange | public notifyUrlChange = (url: string) => {
if (this.socket) {
this.socket.emit('urlChanged', url);
}
} | /**
* Notifies the client about the change of the url if navigation
* happens after some performed action.
* @param url The new url.
* @param fromNavBar Whether the navigation is from the simulated browser's navbar or not.
* @returns void
*/ | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Generator.ts#L828-L832 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowGenerator.notifyOnNewTab | public notifyOnNewTab = (page: Page, pageIndex: number) => {
if (this.socket) {
page.on('close', () => {
this.socket.emit('tabHasBeenClosed', pageIndex);
})
const parsedUrl = new URL(page.url());
const host = parsedUrl.hostname?.match(/\b(?!www\.)[a-zA-Z0-9]+/g)?.join('.');
thi... | /**
* Notifies the client about the new tab if popped-up
* @param page The page to be used for obtaining data.
* @param pageIndex The index of the page.
* @returns void
*/ | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Generator.ts#L840-L849 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowGenerator.onGoBack | public onGoBack = (newUrl: string) => {
//it's safe to always add a go back action to the first rule in the workflow
this.workflowRecord.workflow[0].what.push({
action: 'goBack',
args: [{ waitUntil: 'commit' }],
});
this.notifyUrlChange(newUrl);
this.socket.emit('workflow', this.workflow... | /**
* Generates a pair for navigating to the previous page.
* This function alone adds the pair to the workflow and notifies the client.
* It's safe to always add a go back action to the first rule in the workflow and do not check
* general conditions for adding a pair to the workflow.
* @param newUrl Th... | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Generator.ts#L859-L867 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowGenerator.onGoForward | public onGoForward = (newUrl: string) => {
//it's safe to always add a go forward action to the first rule in the workflow
this.workflowRecord.workflow[0].what.push({
action: 'goForward',
args: [{ waitUntil: 'commit' }],
});
this.notifyUrlChange(newUrl);
this.socket.emit('workflow', this... | /**
* Generates a pair for navigating to the next page.
* This function alone adds the pair to the workflow and notifies the client.
* It's safe to always add a go forward action to the first rule in the workflow and do not check
* general conditions for adding a pair to the workflow.
* @param newUrl The... | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Generator.ts#L877-L885 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowGenerator.IsOverShadowingAction | private IsOverShadowingAction = async (pair: WhereWhatPair, page: Page) => {
type possibleOverShadow = {
index: number;
isOverShadowing: boolean;
}
const possibleOverShadow: possibleOverShadow[] = [];
const haveSameUrl = this.workflowRecord.workflow
.filter((p, index) => {
if ... | /**
* Checks and returns possible pairs that would get over-shadowed by the pair
* from the current workflow.
* @param pair The pair that could be over-shadowing.
* @param page The page to be used for checking the visibility and accessibility of the selectors.
* @private
* @returns {Promise<PossibleOv... | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Generator.ts#L895-L925 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowGenerator.handleOverShadowing | private handleOverShadowing = async (pair: WhereWhatPair, page: Page, index: number): Promise<boolean> => {
const overShadowing = (await this.IsOverShadowingAction(pair, page))
.filter((p) => p.isOverShadowing);
if (overShadowing.length !== 0) {
for (const overShadowedAction of overShadowing) {
... | /**
* General over-shadowing handler.
* Checks for possible over-shadowed pairs and if found,
* adds the pair to the workflow in the correct way.
* @param pair The pair that could be over-shadowing.
* @param page The page to be used for checking the visibility and accessibility of the selectors.
* @pr... | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Generator.ts#L937-L964 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowGenerator.getBestUrl | private getBestUrl = (url: string) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' || parsedUrl.protocol === 'http:' ? `${parsedUrl.protocol}//` : parsedUrl.protocol;
const regex = new RegExp(/(?=.*[A-Z])/g)
// remove all params with uppercase letters, they are most... | /**
* Returns the best possible url representation for a where condition according to the heuristics.
* @param url The url to be checked and possibly replaced.
* @private
* @returns {string | {$regex: string}}
*/ | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Generator.ts#L972-L997 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowGenerator.checkWorkflowForParams | private checkWorkflowForParams = (workflow: WorkflowFile): string[] | null => {
// for now the where condition cannot have any params, so we're checking only what part of the pair
// where only the args part of what condition can have a parameter
for (const pair of workflow.workflow) {
for (const cond... | /**
* Returns parameters if present in the workflow or null.
* @param workflow The workflow to be checked.
*/ | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Generator.ts#L1003-L1022 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowGenerator.optimizeWorkflow | private optimizeWorkflow = (workflow: WorkflowFile) => {
// replace a sequence of press actions by a single fill action
let input = {
selector: '',
value: '',
type: '',
actionCounter: 0,
};
const pushTheOptimizedAction = (pair: WhereWhatPair, index: number) => {
if (input... | /**
* A function for workflow optimization once finished.
* @param workflow The workflow to be optimized.
*/ | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Generator.ts#L1028-L1099 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowGenerator.getParams | public getParams = (): string[] | null => {
return this.checkWorkflowForParams(this.workflowRecord);
} | /**
* Returns workflow params from the stored metadata.
*/ | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Generator.ts#L1104-L1106 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowGenerator.clearLastIndex | public clearLastIndex = () => {
this.generatedData.lastIndex = null;
} | /**
* Clears the last generated data index.
*/ | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Generator.ts#L1111-L1113 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | processWorkflow | function processWorkflow(workflow: WorkflowFile, checkLimit: boolean = false): WorkflowFile {
const processedWorkflow = JSON.parse(JSON.stringify(workflow)) as WorkflowFile;
processedWorkflow.workflow.forEach((pair) => {
pair.what.forEach((action) => {
// Handle limit validation for scrapeList action
... | /**
* Decrypts any encrypted inputs in the workflow. If checkLimit is true, it will also handle the limit validation for scrapeList action.
* @param workflow The workflow to decrypt.
* @param checkLimit If true, it will handle the limit validation for scrapeList action.
*/ | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Interpreter.ts#L13-L49 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowInterpreter.constructor | constructor(socket: Socket) {
this.socket = socket;
} | /**
* A public constructor taking a socket instance for communication with the client.
* @param socket Socket.io socket instance enabling communication with the client (frontend) side.
* @constructor
*/ | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Interpreter.ts#L117-L119 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowInterpreter.subscribeToPausing | public subscribeToPausing = () => {
this.socket.on('pause', () => {
this.interpretationIsPaused = true;
});
this.socket.on('resume', () => {
this.interpretationIsPaused = false;
if (this.interpretationResume) {
this.interpretationResume();
this.socket.emit('log', '----- The... | /**
* Subscribes to the events that are used to control the interpretation.
* The events are pause, resume, step and breakpoints.
* Step is used to interpret a single pair and pause on the other matched pair.
* @returns void
*/ | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Interpreter.ts#L127-L151 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowInterpreter.interpretRecordingInEditor | public interpretRecordingInEditor = async (
workflow: WorkflowFile,
page: Page,
updatePageOnPause: (page: Page) => void,
settings: InterpreterSettings,
) => {
const params = settings.params ? settings.params : null;
delete settings.params;
const processedWorkflow = processWorkflow(workflo... | /**
* Sets up the instance of {@link Interpreter} and interprets
* the workflow inside the recording editor.
* Cleans up this interpreter instance after the interpretation is finished.
* @param workflow The workflow to interpret.
* @param page The page instance used to interact with the browser.
* @pa... | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Interpreter.ts | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | WorkflowInterpreter.InterpretRecording | public InterpretRecording = async (
workflow: WorkflowFile,
page: Page,
updatePageOnPause: (page: Page) => void,
settings: InterpreterSettings
) => {
const params = settings.params ? settings.params : null;
delete settings.params;
const processedWorkflow = processWorkflow(workflow);
... | /**
* Interprets the recording as a run.
* @param workflow The workflow to interpret.
* @param page The page instance used to interact with the browser.
* @param settings The settings to use for the interpretation.
*/ | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/server/src/workflow-management/classes/Interpreter.ts#L259-L338 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | getAndClearCookie | const getAndClearCookie = (name: string) => {
const value = document.cookie
.split('; ')
.find(row => row.startsWith(`${name}=`))
?.split('=')[1];
if (value) {
document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`;
}
return valu... | // Helper function to get and clear a cookie | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/src/components/robot/Recordings.tsx#L48-L59 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
maxun | github_2023 | getmaxun | typescript | isPrintableCharacter | const isPrintableCharacter = (char: string): boolean => {
return char.length === 1 && !!char.match(/^[\x20-\x7E]$/);
}; | // Helper function to check if a character is printable | https://github.com/getmaxun/maxun/blob/be7c599195a0e2a1c08a28a9eb094a79359a3e9c/src/components/robot/RobotEdit.tsx#L131-L133 | be7c599195a0e2a1c08a28a9eb094a79359a3e9c |
harper | github_2023 | Automattic | typescript | test | function test(){} | /** This is a doc comment.
* Since there are no keywords it _sould_ be checked. */ | https://github.com/Automattic/harper/blob/c963a156a27a669fc5ecacd7509ff699b7a1f242/harper-comments/tests/language_support_sources/jsdoc.ts#L3-L3 | c963a156a27a669fc5ecacd7509ff699b7a1f242 |
harper | github_2023 | Automattic | typescript | foo | function foo(n, o, d) {
return n
} | /** Here is another example: {@link this sould also b unchecked}. But this _sould_ be.*/ | https://github.com/Automattic/harper/blob/c963a156a27a669fc5ecacd7509ff699b7a1f242/harper-comments/tests/language_support_sources/jsdoc.ts#L24-L26 | c963a156a27a669fc5ecacd7509ff699b7a1f242 |
harper | github_2023 | Automattic | typescript | test | function test() {} | // This is an example of an problematic comment | https://github.com/Automattic/harper/blob/c963a156a27a669fc5ecacd7509ff699b7a1f242/harper-comments/tests/language_support_sources/multiline_comments.ts#L3-L3 | c963a156a27a669fc5ecacd7509ff699b7a1f242 |
harper | github_2023 | Automattic | typescript | arbitrary | function arbitrary() {} | /***
* This is an example of a possible error:
* these subsequent lines should not be considered a new sentence and should
* produce no errors.
*/ | https://github.com/Automattic/harper/blob/c963a156a27a669fc5ecacd7509ff699b7a1f242/harper-comments/tests/language_support_sources/multiline_comments.ts#L10-L10 | c963a156a27a669fc5ecacd7509ff699b7a1f242 |
harper | github_2023 | Automattic | typescript | LocalLinter.initialize | private async initialize(): Promise<void> {
if (!this.inner) {
const wasm = await loadWasm();
wasm.setup();
this.inner = wasm.Linter.new();
}
} | /** Initialize the WebAssembly and construct the inner Linter. */ | https://github.com/Automattic/harper/blob/c963a156a27a669fc5ecacd7509ff699b7a1f242/packages/harper.js/src/LocalLinter.ts#L12-L18 | c963a156a27a669fc5ecacd7509ff699b7a1f242 |
harper | github_2023 | Automattic | typescript | WorkerLinter.rpc | private async rpc(procName: string, args: any[]): Promise<any> {
const promise = new Promise((resolve, reject) => {
this.requestQueue.push({
resolve,
reject,
request: { procName, args }
});
this.submitRemainingRequests();
});
return promise;
} | /** Run a procedure on the remote worker. */ | https://github.com/Automattic/harper/blob/c963a156a27a669fc5ecacd7509ff699b7a1f242/packages/harper.js/src/WorkerLinter/index.ts#L133-L145 | c963a156a27a669fc5ecacd7509ff699b7a1f242 |
harper | github_2023 | Automattic | typescript | HarperPlugin.constructEditorLinter | private constructEditorLinter(): Extension {
return linter(
async (view) => {
const text = view.state.doc.sliceString(-1);
const chars = toArray(text);
const lints = await this.harper.lint(text);
return lints.map((lint) => {
const span = lint.span();
span.start = charIndexToCodePointIn... | /** Construct the linter plugin that actually shows the errors. */ | https://github.com/Automattic/harper/blob/c963a156a27a669fc5ecacd7509ff699b7a1f242/packages/obsidian-plugin/src/index.ts#L167-L230 | c963a156a27a669fc5ecacd7509ff699b7a1f242 |
harper | github_2023 | Automattic | typescript | charIndexToCodePointIndex | function charIndexToCodePointIndex(index: number, sourceChars: string[]): number {
let traversed = 0;
for (let i = 0; i < index; i++) {
const delta = sourceChars[i].length;
traversed += delta;
}
return traversed;
} | /** Harper returns positions based on char indexes,
* but Obsidian identifies locations in documents based on Unicode code points.
* This converts between from the former to the latter.*/ | https://github.com/Automattic/harper/blob/c963a156a27a669fc5ecacd7509ff699b7a1f242/packages/obsidian-plugin/src/index.ts#L236-L246 | c963a156a27a669fc5ecacd7509ff699b7a1f242 |
vechain-dapp-kit | github_2023 | vechain | typescript | AppComponent.ngOnInit | public ngOnInit(): void {
const walletConnectOptions = {
projectId: 'a0b855ceaf109dbc8426479a4c3d38d8',
metadata: {
name: 'Sample VeChain dApp',
description: 'A sample VeChain dApp',
url: window.location.origin,
icons: [`${w... | // ------------------------------------------------------------------------------- | https://github.com/vechain/vechain-dapp-kit/blob/614d863ea5a3bb27d0c65a5446fad7c937c5e2b6/examples/sample-angular-app/src/app/app.component.ts#L16-L53 | 614d863ea5a3bb27d0c65a5446fad7c937c5e2b6 |
vechain-dapp-kit | github_2023 | vechain | typescript | CustomWalletConnectModal.openModal | openModal(options: OpenOptions): Promise<void> {
DAppKitLogger.debug('CustomWalletConnectModal', 'opening the wc modal');
dispatchCustomEvent('vdk-open-wc-qrcode', options);
return Promise.resolve();
} | /**
* WalletConnect
*/ | https://github.com/vechain/vechain-dapp-kit/blob/614d863ea5a3bb27d0c65a5446fad7c937c5e2b6/packages/dapp-kit-ui/src/classes/custom-wallet-connect-modal.ts#L37-L41 | 614d863ea5a3bb27d0c65a5446fad7c937c5e2b6 |
vechain-dapp-kit | github_2023 | vechain | typescript | createThorDriver | const createThorDriver = (
node: string,
genesis: Connex.Thor.Block,
net: Net,
): DriverNoVendor => {
// Stringify the certificate to hash
const certificateToHash = JSON.stringify({
node,
genesis,
});
// Encode the certificate to hash
const encodedCertificateToHash = new... | /**
* START: TEMPORARY COMMENT
* For hashing we will improve SDK conversion and encoding later
* END: TEMPORARY COMMENT
*
* Create a new Thor driver
*
* @param node - The node URL
* @param genesis - The genesis block
* @param net - The network
*/ | https://github.com/vechain/vechain-dapp-kit/blob/614d863ea5a3bb27d0c65a5446fad7c937c5e2b6/packages/dapp-kit/src/dapp-kit.ts#L25-L52 | 614d863ea5a3bb27d0c65a5446fad7c937c5e2b6 |
vechain-dapp-kit | github_2023 | vechain | typescript | WalletManager.signConnectionCertificate | setAccountDomain = (address: string | null): void => {
if (address) {
this.state.isAccountDomainLoading = true;
getAccountDomain({ address, driver: this.driver })
.then((domain) => {
this.state.accountDomain = domain;
})
... | /**
* Sign a connection certificate
* this is needed for wallet connect connections when a connection certificate is required
*/ | https://github.com/vechain/vechain-dapp-kit/blob/614d863ea5a3bb27d0c65a5446fad7c937c5e2b6/packages/dapp-kit/src/classes/wallet-manager.ts | 614d863ea5a3bb27d0c65a5446fad7c937c5e2b6 |
vechain-dapp-kit | github_2023 | vechain | typescript | listenToEvents | const listenToEvents = (_client: SignClient): void => {
_client.on('session_update', ({ topic, params }): void => {
DAppKitLogger.debug('wallet connect signer', 'session_update', {
topic,
params,
});
const { namespaces } = params;
c... | // listen for session updates | https://github.com/vechain/vechain-dapp-kit/blob/614d863ea5a3bb27d0c65a5446fad7c937c5e2b6/packages/dapp-kit/src/utils/create-wc-signer.ts#L59-L76 | 614d863ea5a3bb27d0c65a5446fad7c937c5e2b6 |
vechain-dapp-kit | github_2023 | vechain | typescript | restoreSession | const restoreSession = (_client: SignClient): void => {
if (typeof session !== 'undefined') return;
DAppKitLogger.debug('wallet connect signer', 'restore session');
const sessionKeys = _client.session.keys;
for (const key of sessionKeys) {
const _session = _client.session.g... | // restore a session if undefined | https://github.com/vechain/vechain-dapp-kit/blob/614d863ea5a3bb27d0c65a5446fad7c937c5e2b6/packages/dapp-kit/src/utils/create-wc-signer.ts#L79-L96 | 614d863ea5a3bb27d0c65a5446fad7c937c5e2b6 |
vechain-dapp-kit | github_2023 | vechain | typescript | validateSession | const validateSession = (
requestedAddress?: string,
): SessionAccount | undefined => {
if (!session) return;
DAppKitLogger.debug('wallet connect signer', 'validate session');
const firstAccount = session.namespaces.vechain.accounts[0];
const address = firstAccount.split(':... | /**
* Validates the requested account and network against a request
* @param requestedAddress - The optional requested account address
*/ | https://github.com/vechain/vechain-dapp-kit/blob/614d863ea5a3bb27d0c65a5446fad7c937c5e2b6/packages/dapp-kit/src/utils/create-wc-signer.ts#L102-L128 | 614d863ea5a3bb27d0c65a5446fad7c937c5e2b6 |
vechain-dapp-kit | github_2023 | vechain | typescript | isPasswordSubmitted | const isPasswordSubmitted = async () => {
return extension.driver.isElementPresent(
Locators.byRole('goToImportWallet'),
);
}; | /**
* Checks for next screen's elements
*/ | https://github.com/vechain/vechain-dapp-kit/blob/614d863ea5a3bb27d0c65a5446fad7c937c5e2b6/tests/e2e/src/extension/flows/SetupPasswordFlows.ts#L32-L36 | 614d863ea5a3bb27d0c65a5446fad7c937c5e2b6 |
vechain-dapp-kit | github_2023 | vechain | typescript | ExtensionDriver.getBaseUrl | public getBaseUrl = async (): Promise<string> => {
if (this.extensionUrl) return this.extensionUrl;
await this.get('chrome://extensions');
const extensionId: string = await this.executeScript(`
return document.querySelector("extensions-manager").shadowRoot
.querySelector("extensi... | /**
* This method is built on the assumption that our extension is the only one existing
*/ | https://github.com/vechain/vechain-dapp-kit/blob/614d863ea5a3bb27d0c65a5446fad7c937c5e2b6/tests/e2e/src/extension/selenium/WebDriver.ts | 614d863ea5a3bb27d0c65a5446fad7c937c5e2b6 |
vechain-dapp-kit | github_2023 | vechain | typescript | goToUrl | const goToUrl = async (url: string): Promise<string> => {
await extension.driver.get(url);
await extension.driver.sleep(1000);
return extension.driver.getWindowHandle();
}; | /**
* @returns the window handle of the given URL
*/ | https://github.com/vechain/vechain-dapp-kit/blob/614d863ea5a3bb27d0c65a5446fad7c937c5e2b6/tests/e2e/src/extension/utils/NavigationUtils.ts#L12-L16 | 614d863ea5a3bb27d0c65a5446fad7c937c5e2b6 |
multiwoven | github_2023 | Multiwoven | typescript | useQueryWrapper | const useQueryWrapper = <TData, TError = unknown>(
key: QueryKey,
queryFn: QueryFunction<TData>,
options?: Omit<UseQueryOptions<TData, TError>, 'queryKey' | 'queryFn'>,
): UseQueryResult<TData, TError> => {
const activeWorkspaceId = useStore((state) => state.workspaceId);
const queryOptions: UseQueryOptions<... | // Custom hook for queries with workspace ID check | https://github.com/Multiwoven/multiwoven/blob/21bf4c88c80d9b98f0ea146e66620f3dd8e6c6ab/ui/src/hooks/useQueryWrapper.tsx#L11-L26 | 21bf4c88c80d9b98f0ea146e66620f3dd8e6c6ab |
multiwoven | github_2023 | Multiwoven | typescript | createAxiosInstance | function createAxiosInstance(apiHost: string) {
const instance = axios.create({
baseURL: `${apiHost}`,
});
instance.interceptors.request.use(function requestSuccess(config) {
const token = Cookies.get('authToken');
config.headers['Content-Type'] = 'application/json';
config.headers['Workspace-Id'... | // Function to create axios instance with the current apiHost | https://github.com/Multiwoven/multiwoven/blob/21bf4c88c80d9b98f0ea146e66620f3dd8e6c6ab/ui/src/services/axios.ts#L13-L56 | 21bf4c88c80d9b98f0ea146e66620f3dd8e6c6ab |
multiwoven | github_2023 | Multiwoven | typescript | SignUp | const SignUp = (): JSX.Element => {
const [submitting, setSubmitting] = useState(false);
const navigate = useNavigate();
const showToast = useCustomToast();
const apiErrorToast = useAPIErrorsToast();
const errorToast = useErrorToast();
const { mutateAsync } = useMutation({
mutationFn: (values: SignUpPa... | // import isValidEmailDomain from '@/utils/isValidEmailDomain'; | https://github.com/Multiwoven/multiwoven/blob/21bf4c88c80d9b98f0ea146e66620f3dd8e6c6ab/ui/src/views/Authentication/SignUp/SignUp.tsx#L15-L85 | 21bf4c88c80d9b98f0ea146e66620f3dd8e6c6ab |
alien-signals | github_2023 | stackblitz | typescript | runEffect | function runEffect(e: Effect): void {
const prevSub = activeSub;
activeSub = e;
startTracking(e);
try {
e.fn();
} finally {
activeSub = prevSub;
endTracking(e);
}
} | //#endregion | https://github.com/stackblitz/alien-signals/blob/59e393501597f6c8c4cf08c4e540c4517841a0cb/src/index.ts#L140-L150 | 59e393501597f6c8c4cf08c4e540c4517841a0cb |
alien-signals | github_2023 | stackblitz | typescript | computedGetter | function computedGetter<T>(this: Computed<T>): T {
const flags = this.flags;
if (flags & (SubscriberFlags.Dirty | SubscriberFlags.PendingComputed)) {
processComputedUpdate(this, flags);
}
if (activeSub !== undefined) {
link(this, activeSub);
} else if (activeScope !== undefined) {
link(this, activeScope);
}... | //#endregion | https://github.com/stackblitz/alien-signals/blob/59e393501597f6c8c4cf08c4e540c4517841a0cb/src/index.ts#L188-L199 | 59e393501597f6c8c4cf08c4e540c4517841a0cb |
alien-signals | github_2023 | stackblitz | typescript | linkNewDep | function linkNewDep(dep: Dependency, sub: Subscriber, nextDep: Link | undefined, depsTail: Link | undefined): Link {
const newLink: Link = {
dep,
sub,
nextDep,
prevSub: undefined,
nextSub: undefined,
};
if (depsTail === undefined) {
sub.deps = newLink;
} else {
depsTail.nextDep = newLink;
... | /**
* Creates and attaches a new link between the given dependency and subscriber.
*
* Reuses a link object from the linkPool if available. The newly formed link
* is added to both the dependency's linked list and the subscriber's linked list.
*
* @param dep - The dependency to link.
* @param sub - The... | https://github.com/stackblitz/alien-signals/blob/59e393501597f6c8c4cf08c4e540c4517841a0cb/src/system.ts#L346-L373 | 59e393501597f6c8c4cf08c4e540c4517841a0cb |
alien-signals | github_2023 | stackblitz | typescript | checkDirty | function checkDirty(link: Link): boolean {
let stack = 0;
let dirty: boolean;
top: do {
dirty = false;
const dep = link.dep;
if ('flags' in dep) {
const depFlags = dep.flags;
if ((depFlags & (SubscriberFlags.Computed | SubscriberFlags.Dirty)) === (SubscriberFlags.Computed | SubscriberFlags.Dirt... | /**
* Recursively checks and updates all computed subscribers marked as pending.
*
* It traverses the linked structure using a stack mechanism. For each computed
* subscriber in a pending state, updateComputed is called and shallowPropagate
* is triggered if a value changes. Returns whether any updates occur... | https://github.com/stackblitz/alien-signals/blob/59e393501597f6c8c4cf08c4e540c4517841a0cb/src/system.ts#L385-L460 | 59e393501597f6c8c4cf08c4e540c4517841a0cb |
alien-signals | github_2023 | stackblitz | typescript | shallowPropagate | function shallowPropagate(link: Link): void {
do {
const sub = link.sub;
const subFlags = sub.flags;
if ((subFlags & (SubscriberFlags.PendingComputed | SubscriberFlags.Dirty)) === SubscriberFlags.PendingComputed) {
sub.flags = subFlags | SubscriberFlags.Dirty | SubscriberFlags.Notified;
if ((subFlags... | /**
* Quickly propagates PendingComputed status to Dirty for each subscriber in the chain.
*
* If the subscriber is also marked as an effect, it is added to the queuedEffects list
* for later processing.
*
* @param link - The head of the linked list to process.
*/ | https://github.com/stackblitz/alien-signals/blob/59e393501597f6c8c4cf08c4e540c4517841a0cb/src/system.ts#L470-L487 | 59e393501597f6c8c4cf08c4e540c4517841a0cb |
alien-signals | github_2023 | stackblitz | typescript | isValidLink | function isValidLink(checkLink: Link, sub: Subscriber): boolean {
const depsTail = sub.depsTail;
if (depsTail !== undefined) {
let link = sub.deps!;
do {
if (link === checkLink) {
return true;
}
if (link === depsTail) {
break;
}
link = link.nextDep!;
} while (link !== undefine... | /**
* Verifies whether the given link is valid for the specified subscriber.
*
* It iterates through the subscriber's link list (from sub.deps to sub.depsTail)
* to determine if the provided link object is part of that chain.
*
* @param checkLink - The link object to validate.
* @param sub - The subscri... | https://github.com/stackblitz/alien-signals/blob/59e393501597f6c8c4cf08c4e540c4517841a0cb/src/system.ts#L499-L514 | 59e393501597f6c8c4cf08c4e540c4517841a0cb |
alien-signals | github_2023 | stackblitz | typescript | clearTracking | function clearTracking(link: Link): void {
do {
const dep = link.dep;
const nextDep = link.nextDep;
const nextSub = link.nextSub;
const prevSub = link.prevSub;
if (nextSub !== undefined) {
nextSub.prevSub = prevSub;
} else {
dep.subsTail = prevSub;
}
if (prevSub !== undefined) {
... | /**
* Clears dependency-subscription relationships starting at the given link.
*
* Detaches the link from both the dependency and subscriber, then continues
* to the next link in the chain. The link objects are returned to linkPool for reuse.
*
* @param link - The head of a linked chain to be cleared.
... | https://github.com/stackblitz/alien-signals/blob/59e393501597f6c8c4cf08c4e540c4517841a0cb/src/system.ts#L524-L559 | 59e393501597f6c8c4cf08c4e540c4517841a0cb |
pro-chat | github_2023 | ant-design | typescript | ShouldUpdateItem.shouldComponentUpdate | shouldComponentUpdate(nextProps: any) {
if (nextProps.shouldUpdate) {
return nextProps.shouldUpdate(this.props, nextProps);
}
try {
return (
!isEqual(this.props.content, nextProps?.content) ||
!isEqual(this.props.loading, nextProps?.loading) ||
!isEqual(this.props.chatIte... | /**
* 判断组件是否需要更新。
* @param nextProps - 下一个属性对象。
* @returns 如果需要更新则返回 true,否则返回 false。
*/ | https://github.com/ant-design/pro-chat/blob/73be565e1b00787435fd951df7fbc684db7923d5/src/ChatList/ShouldUpdateItem.tsx#L19-L33 | 73be565e1b00787435fd951df7fbc684db7923d5 |
pro-chat | github_2023 | ant-design | typescript | compilerMessages | const compilerMessages = (slicedMessages: ChatMessage[]) => {
const compiler = template(config.inputTemplate, { interpolate: /{{([\S\s]+?)}}/g });
return slicedMessages.map((m) => {
if (m.role === 'user') {
try {
return { ...m, content: compiler({ text: m.content }) };
... | // 2. 替换 inputMessage 模板 | https://github.com/ant-design/pro-chat/blob/73be565e1b00787435fd951df7fbc684db7923d5/src/ProChat/store/action.ts#L211-L225 | 73be565e1b00787435fd951df7fbc684db7923d5 |
pro-chat | github_2023 | ant-design | typescript | checkAndToggleChatLoading | const checkAndToggleChatLoading = () => {
clearTimeout(timeoutId); // 清除任何现有的计时器
// 等待队列内容输出完毕
if (outputQueue === undefined || outputQueue.length === 0 || outputQueue.toString() === '') {
// 当队列为空时
toggleChatLoading(false, undefined, t('generateMessage(end)') as string);
clear... | // 用于存储轮询队列的计时器id | https://github.com/ant-design/pro-chat/blob/73be565e1b00787435fd951df7fbc684db7923d5/src/ProChat/store/action.ts#L311-L322 | 73be565e1b00787435fd951df7fbc684db7923d5 |
pro-chat | github_2023 | ant-design | typescript | stopAnimation | const stopAnimation = () => {
isAnimationActive = false;
if (animationTimeoutId !== null) {
clearTimeout(animationTimeoutId);
animationTimeoutId = null;
}
}; | // when you need to stop the animation, call this function | https://github.com/ant-design/pro-chat/blob/73be565e1b00787435fd951df7fbc684db7923d5/src/ProChat/store/action.ts#L486-L492 | 73be565e1b00787435fd951df7fbc684db7923d5 |
pro-chat | github_2023 | ant-design | typescript | startAnimation | const startAnimation = (speed = 2) =>
new Promise<void>((resolve) => {
if (isAnimationActive) {
resolve();
return;
}
isAnimationActive = true;
const updateText = () => {
// 如果动画已经不再激活,则停止更新文本
if (!isAnimationActive) {
clearTimeou... | // define startAnimation function to display the text in buffer smooth | https://github.com/ant-design/pro-chat/blob/73be565e1b00787435fd951df7fbc684db7923d5/src/ProChat/store/action.ts#L496-L543 | 73be565e1b00787435fd951df7fbc684db7923d5 |
pro-chat | github_2023 | ant-design | typescript | onMouseMove | const onMouseMove = (e: MouseEvent) => {
const bound = element.getBoundingClientRect();
setOffset({ x: e.clientX - bound.x, y: e.clientY - bound.y });
setOutside(false);
}; | // debounce? | https://github.com/ant-design/pro-chat/blob/73be565e1b00787435fd951df7fbc684db7923d5/src/components/Spotlight/index.tsx#L17-L21 | 73be565e1b00787435fd951df7fbc684db7923d5 |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.accountApiApiUinApiPost | public accountApiApiUinApiPost(uin: number, name: string, body: object, options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).accountApiApiUinApiPost(uin, name, body, options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary Account Api
* @param {number} uin
* @param {string} name
* @param {object} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2087-L2089 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.accountConfigDeleteApiUinConfigDelete | public accountConfigDeleteApiUinConfigDelete(uin: number, options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).accountConfigDeleteApiUinConfigDelete(uin, options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary Account Config Delete
* @param {number} uin
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2099-L2101 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.accountConfigReadApiUinConfigGet | public accountConfigReadApiUinConfigGet(uin: number, options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).accountConfigReadApiUinConfigGet(uin, options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary Account Config Read
* @param {number} uin
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2111-L2113 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.accountConfigWriteApiUinConfigPatch | public accountConfigWriteApiUinConfigPatch(uin: number, accountConfigFile: AccountConfigFile, options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).accountConfigWriteApiUinConfigPatch(uin, accountConfigFile, options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary Account Config Write
* @param {number} uin
* @param {AccountConfigFile} accountConfigFile
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2124-L2126 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.accountDeviceDeleteApiUinDeviceDelete | public accountDeviceDeleteApiUinDeviceDelete(uin: number, options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).accountDeviceDeleteApiUinDeviceDelete(uin, options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary Account Device Delete
* @param {number} uin
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2136-L2138 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.accountDeviceReadApiUinDeviceGet | public accountDeviceReadApiUinDeviceGet(uin: number, options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).accountDeviceReadApiUinDeviceGet(uin, options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary Account Device Read
* @param {number} uin
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2148-L2150 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.accountDeviceWriteApiUinDevicePatch | public accountDeviceWriteApiUinDevicePatch(uin: number, deviceInfo: DeviceInfo, options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).accountDeviceWriteApiUinDevicePatch(uin, deviceInfo, options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary Account Device Write
* @param {number} uin
* @param {DeviceInfo} deviceInfo
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2161-L2163 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.accountSessionDeleteApiUinSessionDelete | public accountSessionDeleteApiUinSessionDelete(uin: number, options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).accountSessionDeleteApiUinSessionDelete(uin, options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary Account Session Delete
* @param {number} uin
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2173-L2175 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.accountSessionReadApiUinSessionGet | public accountSessionReadApiUinSessionGet(uin: number, options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).accountSessionReadApiUinSessionGet(uin, options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary Account Session Read
* @param {number} uin
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2185-L2187 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.accountSessionWriteApiUinSessionPatch | public accountSessionWriteApiUinSessionPatch(uin: number, sessionTokenFile: SessionTokenFile, options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).accountSessionWriteApiUinSessionPatch(uin, sessionTokenFile, options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary Account Session Write
* @param {number} uin
* @param {SessionTokenFile} sessionTokenFile
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2198-L2200 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.allAccountsApiAccountsGet | public allAccountsApiAccountsGet(nicknameCache?: number, options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).allAccountsApiAccountsGet(nicknameCache, options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary All Accounts
* @param {number} [nicknameCache]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2210-L2212 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.createAccountApiUinPut | public createAccountApiUinPut(uin: number, accountCreation?: AccountCreation, options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).createAccountApiUinPut(uin, accountCreation, options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary Create Account
* @param {number} uin
* @param {AccountCreation} [accountCreation]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2223-L2225 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.deleteAccountApiUinDelete | public deleteAccountApiUinDelete(uin: number, withFile?: boolean, options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).deleteAccountApiUinDelete(uin, withFile, options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary Delete Account
* @param {number} uin
* @param {boolean} [withFile]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2236-L2238 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.processInputLineApiUinProcessLogsPost | public processInputLineApiUinProcessLogsPost(uin: number, stdinInputContent: StdinInputContent, options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).processInputLineApiUinProcessLogsPost(uin, stdinInputContent, options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary Process Input Line
* @param {number} uin
* @param {StdinInputContent} stdinInputContent
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2249-L2251 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.processLogsHistoryApiUinProcessLogsGet | public processLogsHistoryApiUinProcessLogsGet(uin: number, reverse?: boolean, options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).processLogsHistoryApiUinProcessLogsGet(uin, reverse, options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary Process Logs History
* @param {number} uin
* @param {boolean} [reverse]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2262-L2264 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.processStartApiUinProcessPut | public processStartApiUinProcessPut(uin: number, options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).processStartApiUinProcessPut(uin, options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary Process Start
* @param {number} uin
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2274-L2276 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.processStatusApiUinProcessStatusGet | public processStatusApiUinProcessStatusGet(uin: number, options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).processStatusApiUinProcessStatusGet(uin, options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary Process Status
* @param {number} uin
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2286-L2288 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.processStopApiUinProcessDelete | public processStopApiUinProcessDelete(uin: number, options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).processStopApiUinProcessDelete(uin, options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary Process Stop
* @param {number} uin
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2298-L2300 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.systemLogsHistoryApiLogsGet | public systemLogsHistoryApiLogsGet(reverse?: boolean, options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).systemLogsHistoryApiLogsGet(reverse, options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary System Logs History
* @param {boolean} [reverse]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2310-L2312 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.systemStatusApiStatusGet | public systemStatusApiStatusGet(options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).systemStatusApiStatusGet(options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary System Status
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2321-L2323 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.loginApi | public loginApi(username: string, password: string, options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).loginApi(username, password, options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary 登录API
* @param {string} username 用户名
* @param {string} password 密码
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2334-L2336 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | ApiApi.checkLoginStatus | public checkLoginStatus(options?: AxiosRequestConfig) {
return ApiApiFp(this.configuration).checkLoginStatus(options).then((request) => request(this.axios, this.basePath));
} | /**
*
* @summary 检查登录状态
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/ | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/api.ts#L2345-L2347 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
Gensokyo | github_2023 | Hoshinonyaruko | typescript | Configuration.isJsonMime | public isJsonMime(mime: string): boolean {
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
} | /**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON,... | https://github.com/Hoshinonyaruko/Gensokyo/blob/043f80cf2bc0063ae193bb44549275d6c2530cdd/frontend/src/api/configuration.ts#L97-L100 | 043f80cf2bc0063ae193bb44549275d6c2530cdd |
agentcloud | github_2023 | rnadigital | typescript | gracefulStop | const gracefulStop = () => {
log('SIGINT SIGNAL RECEIVED');
db.client().close();
redis.close();
process.exit(0);
}; | //graceful stop handling | https://github.com/rnadigital/agentcloud/blob/9ebed808f9b49541882b384f29a1a79ca80fae50/webapp/src/server.ts#L107-L112 | 9ebed808f9b49541882b384f29a1a79ca80fae50 |
agentcloud | github_2023 | rnadigital | typescript | fetchModelFormData | async function fetchModelFormData() {
await API.getModels({ resourceSlug }, dispatch, setError, router);
} | // const { } = state as any; //TODO: secrets here | https://github.com/rnadigital/agentcloud/blob/9ebed808f9b49541882b384f29a1a79ca80fae50/webapp/src/components/CreateModelModal.tsx#L24-L26 | 9ebed808f9b49541882b384f29a1a79ca80fae50 |
agentcloud | github_2023 | rnadigital | typescript | ScriptEditor | const ScriptEditor = (props: ScriptEditorProps): JSX.Element => {
const { code, setCode, editorOptions, onInitializePane, height, language, editorJsonSchema } =
props;
const monacoEditorRef = useRef<typeof monaco.editor>(null);
const editorRef = useRef<any | null>(null);
// monaco takes years to mount, so this ... | // | https://github.com/rnadigital/agentcloud/blob/9ebed808f9b49541882b384f29a1a79ca80fae50/webapp/src/components/Editor.tsx#L44-L66 | 9ebed808f9b49541882b384f29a1a79ca80fae50 |
agentcloud | github_2023 | rnadigital | typescript | fetchDatasource | async function fetchDatasource() {
if (datasourceId) {
await API.getDatasource(
{
resourceSlug,
datasourceId
},
res => {
const datasource = res?.datasource;
if (datasource?.status === DatasourceStatus.READY) {
router.push(`/${resourceSlug}/connections`);
}
},
() =... | // Added dependency array | https://github.com/rnadigital/agentcloud/blob/9ebed808f9b49541882b384f29a1a79ca80fae50/webapp/src/components/connections/DatasourceSyncing.tsx#L26-L43 | 9ebed808f9b49541882b384f29a1a79ca80fae50 |
agentcloud | github_2023 | rnadigital | typescript | fetchDatasource | async function fetchDatasource() {
if (datasourceId) {
await API.getDatasource(
{
resourceSlug,
datasourceId
},
res => {
const datasource = res?.datasource;
if (datasource?.status === DatasourceStatus.READY) {
router.push(`/${resourceSlug}/apps`);
}
},
() => {},
... | // Added dependency array | https://github.com/rnadigital/agentcloud/blob/9ebed808f9b49541882b384f29a1a79ca80fae50/webapp/src/components/onboarding/DatasourceSyncing.tsx#L25-L42 | 9ebed808f9b49541882b384f29a1a79ca80fae50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.