repo_name string | dataset string | owner string | lang string | func_name string | code string | docstring string | url string | sha string |
|---|---|---|---|---|---|---|---|---|
freechat | github_2023 | freechat-fun | typescript | PromisePromptApi.searchPromptSummaryWithHttpInfo | public searchPromptSummaryWithHttpInfo(promptQueryDTO: PromptQueryDTO, _options?: Configuration): Promise<HttpInfo<Array<PromptSummaryDTO>>> {
const result = this.api.searchPromptSummaryWithHttpInfo(promptQueryDTO, _options);
return result.toPromise();
} | /**
* Search prompts: - Specifiable query fields, and relationship: - Scope: private, public_org or public. Private can only search this account. - Username: exact match, only valid when searching public, public_org. If not specified, search all users. - Tags: exact match (support and, or logic). - Model t... | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4014-L4017 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromisePromptApi.searchPromptSummary | public searchPromptSummary(promptQueryDTO: PromptQueryDTO, _options?: Configuration): Promise<Array<PromptSummaryDTO>> {
const result = this.api.searchPromptSummary(promptQueryDTO, _options);
return result.toPromise();
} | /**
* Search prompts: - Specifiable query fields, and relationship: - Scope: private, public_org or public. Private can only search this account. - Username: exact match, only valid when searching public, public_org. If not specified, search all users. - Tags: exact match (support and, or logic). - Model t... | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4024-L4027 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromisePromptApi.searchPublicPromptSummaryWithHttpInfo | public searchPublicPromptSummaryWithHttpInfo(promptQueryDTO: PromptQueryDTO, _options?: Configuration): Promise<HttpInfo<Array<PromptSummaryDTO>>> {
const result = this.api.searchPublicPromptSummaryWithHttpInfo(promptQueryDTO, _options);
return result.toPromise();
} | /**
* Search prompts: - Specifiable query fields, and relationship: - Scope: public(fixed). - Username: exact match. If not specified, search all users. - Tags: exact match (support and, or logic). - Model type: exact match (support and, or logic). - Name: left match. - Type, exact match: string (defau... | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4034-L4037 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromisePromptApi.searchPublicPromptSummary | public searchPublicPromptSummary(promptQueryDTO: PromptQueryDTO, _options?: Configuration): Promise<Array<PromptSummaryDTO>> {
const result = this.api.searchPublicPromptSummary(promptQueryDTO, _options);
return result.toPromise();
} | /**
* Search prompts: - Specifiable query fields, and relationship: - Scope: public(fixed). - Username: exact match. If not specified, search all users. - Tags: exact match (support and, or logic). - Model type: exact match (support and, or logic). - Name: left match. - Type, exact match: string (defau... | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4044-L4047 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromisePromptApi.sendPromptWithHttpInfo | public sendPromptWithHttpInfo(promptAiParamDTO: PromptAiParamDTO, _options?: Configuration): Promise<HttpInfo<LlmResultDTO>> {
const result = this.api.sendPromptWithHttpInfo(promptAiParamDTO, _options);
return result.toPromise();
} | /**
* Send the prompt to the AI service. Note that if the embedding model is called, the return is an embedding array, placed in the details field of the result; the original text is in the text field of the result.
* Send Prompt
* @param promptAiParamDTO Call parameters
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4054-L4057 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromisePromptApi.sendPrompt | public sendPrompt(promptAiParamDTO: PromptAiParamDTO, _options?: Configuration): Promise<LlmResultDTO> {
const result = this.api.sendPrompt(promptAiParamDTO, _options);
return result.toPromise();
} | /**
* Send the prompt to the AI service. Note that if the embedding model is called, the return is an embedding array, placed in the details field of the result; the original text is in the text field of the result.
* Send Prompt
* @param promptAiParamDTO Call parameters
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4064-L4067 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromisePromptApi.streamSendPromptWithHttpInfo | public streamSendPromptWithHttpInfo(promptAiParamDTO: PromptAiParamDTO, _options?: Configuration): Promise<HttpInfo<SseEmitter>> {
const result = this.api.streamSendPromptWithHttpInfo(promptAiParamDTO, _options);
return result.toPromise();
} | /**
* Refer to /api/v2/prompt/send, stream back chunks of the response.
* Send Prompt by Streaming Back
* @param promptAiParamDTO Call parameters
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4074-L4077 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromisePromptApi.streamSendPrompt | public streamSendPrompt(promptAiParamDTO: PromptAiParamDTO, _options?: Configuration): Promise<SseEmitter> {
const result = this.api.streamSendPrompt(promptAiParamDTO, _options);
return result.toPromise();
} | /**
* Refer to /api/v2/prompt/send, stream back chunks of the response.
* Send Prompt by Streaming Back
* @param promptAiParamDTO Call parameters
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4084-L4087 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromisePromptApi.updatePromptWithHttpInfo | public updatePromptWithHttpInfo(promptId: number, promptUpdateDTO: PromptUpdateDTO, _options?: Configuration): Promise<HttpInfo<boolean>> {
const result = this.api.updatePromptWithHttpInfo(promptId, promptUpdateDTO, _options);
return result.toPromise();
} | /**
* Update prompt, refer to /api/v2/prompt/create, required field: promptId. Returns success or failure.
* Update Prompt
* @param promptId The promptId to be updated
* @param promptUpdateDTO The prompt information to be updated
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4095-L4098 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromisePromptApi.updatePrompt | public updatePrompt(promptId: number, promptUpdateDTO: PromptUpdateDTO, _options?: Configuration): Promise<boolean> {
const result = this.api.updatePrompt(promptId, promptUpdateDTO, _options);
return result.toPromise();
} | /**
* Update prompt, refer to /api/v2/prompt/create, required field: promptId. Returns success or failure.
* Update Prompt
* @param promptId The promptId to be updated
* @param promptUpdateDTO The prompt information to be updated
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4106-L4109 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromisePromptTaskApi.createPromptTaskWithHttpInfo | public createPromptTaskWithHttpInfo(promptTaskDTO: PromptTaskDTO, _options?: Configuration): Promise<HttpInfo<string>> {
const result = this.api.createPromptTaskWithHttpInfo(promptTaskDTO, _options);
return result.toPromise();
} | /**
* Create a prompt task.
* Create Prompt Task
* @param promptTaskDTO The prompt task to be added
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4135-L4138 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromisePromptTaskApi.createPromptTask | public createPromptTask(promptTaskDTO: PromptTaskDTO, _options?: Configuration): Promise<string> {
const result = this.api.createPromptTask(promptTaskDTO, _options);
return result.toPromise();
} | /**
* Create a prompt task.
* Create Prompt Task
* @param promptTaskDTO The prompt task to be added
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4145-L4148 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromisePromptTaskApi.deletePromptTaskWithHttpInfo | public deletePromptTaskWithHttpInfo(promptTaskId: string, _options?: Configuration): Promise<HttpInfo<boolean>> {
const result = this.api.deletePromptTaskWithHttpInfo(promptTaskId, _options);
return result.toPromise();
} | /**
* Delete a prompt task.
* Delete Prompt Task
* @param promptTaskId The promptTaskId to be deleted
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4155-L4158 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromisePromptTaskApi.deletePromptTask | public deletePromptTask(promptTaskId: string, _options?: Configuration): Promise<boolean> {
const result = this.api.deletePromptTask(promptTaskId, _options);
return result.toPromise();
} | /**
* Delete a prompt task.
* Delete Prompt Task
* @param promptTaskId The promptTaskId to be deleted
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4165-L4168 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromisePromptTaskApi.getPromptTaskWithHttpInfo | public getPromptTaskWithHttpInfo(promptTaskId: string, _options?: Configuration): Promise<HttpInfo<PromptTaskDetailsDTO>> {
const result = this.api.getPromptTaskWithHttpInfo(promptTaskId, _options);
return result.toPromise();
} | /**
* Get the prompt task details.
* Get Prompt Task
* @param promptTaskId The promptTaskId to be queried
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4175-L4178 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromisePromptTaskApi.getPromptTask | public getPromptTask(promptTaskId: string, _options?: Configuration): Promise<PromptTaskDetailsDTO> {
const result = this.api.getPromptTask(promptTaskId, _options);
return result.toPromise();
} | /**
* Get the prompt task details.
* Get Prompt Task
* @param promptTaskId The promptTaskId to be queried
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4185-L4188 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromisePromptTaskApi.updatePromptTaskWithHttpInfo | public updatePromptTaskWithHttpInfo(promptTaskId: string, promptTaskDTO: PromptTaskDTO, _options?: Configuration): Promise<HttpInfo<boolean>> {
const result = this.api.updatePromptTaskWithHttpInfo(promptTaskId, promptTaskDTO, _options);
return result.toPromise();
} | /**
* Update a prompt task.
* Update Prompt Task
* @param promptTaskId The promptTaskId to be updated
* @param promptTaskDTO The prompt task info to be updated
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4196-L4199 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromisePromptTaskApi.updatePromptTask | public updatePromptTask(promptTaskId: string, promptTaskDTO: PromptTaskDTO, _options?: Configuration): Promise<boolean> {
const result = this.api.updatePromptTask(promptTaskId, promptTaskDTO, _options);
return result.toPromise();
} | /**
* Update a prompt task.
* Update Prompt Task
* @param promptTaskId The promptTaskId to be updated
* @param promptTaskDTO The prompt task info to be updated
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4207-L4210 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseRagApi.cancelRagTaskWithHttpInfo | public cancelRagTaskWithHttpInfo(taskId: number, _options?: Configuration): Promise<HttpInfo<boolean>> {
const result = this.api.cancelRagTaskWithHttpInfo(taskId, _options);
return result.toPromise();
} | /**
* Cancel a RAG task.
* Cancel RAG Task
* @param taskId The taskId to be canceled
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4236-L4239 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseRagApi.cancelRagTask | public cancelRagTask(taskId: number, _options?: Configuration): Promise<boolean> {
const result = this.api.cancelRagTask(taskId, _options);
return result.toPromise();
} | /**
* Cancel a RAG task.
* Cancel RAG Task
* @param taskId The taskId to be canceled
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4246-L4249 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseRagApi.createRagTaskWithHttpInfo | public createRagTaskWithHttpInfo(characterUid: string, ragTaskDTO: RagTaskDTO, _options?: Configuration): Promise<HttpInfo<number>> {
const result = this.api.createRagTaskWithHttpInfo(characterUid, ragTaskDTO, _options);
return result.toPromise();
} | /**
* Create a RAG task.
* Create RAG Task
* @param characterUid The characterUid to be added a RAG task
* @param ragTaskDTO The RAG task to be added
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4257-L4260 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseRagApi.createRagTask | public createRagTask(characterUid: string, ragTaskDTO: RagTaskDTO, _options?: Configuration): Promise<number> {
const result = this.api.createRagTask(characterUid, ragTaskDTO, _options);
return result.toPromise();
} | /**
* Create a RAG task.
* Create RAG Task
* @param characterUid The characterUid to be added a RAG task
* @param ragTaskDTO The RAG task to be added
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4268-L4271 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseRagApi.deleteRagTaskWithHttpInfo | public deleteRagTaskWithHttpInfo(taskId: number, _options?: Configuration): Promise<HttpInfo<boolean>> {
const result = this.api.deleteRagTaskWithHttpInfo(taskId, _options);
return result.toPromise();
} | /**
* Delete a RAG task.
* Delete RAG Task
* @param taskId The taskId to be deleted
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4278-L4281 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseRagApi.deleteRagTask | public deleteRagTask(taskId: number, _options?: Configuration): Promise<boolean> {
const result = this.api.deleteRagTask(taskId, _options);
return result.toPromise();
} | /**
* Delete a RAG task.
* Delete RAG Task
* @param taskId The taskId to be deleted
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4288-L4291 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseRagApi.getRagTaskWithHttpInfo | public getRagTaskWithHttpInfo(taskId: number, _options?: Configuration): Promise<HttpInfo<RagTaskDetailsDTO>> {
const result = this.api.getRagTaskWithHttpInfo(taskId, _options);
return result.toPromise();
} | /**
* Get the RAG task details.
* Get RAG Task
* @param taskId The taskId to be queried
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4298-L4301 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseRagApi.getRagTask | public getRagTask(taskId: number, _options?: Configuration): Promise<RagTaskDetailsDTO> {
const result = this.api.getRagTask(taskId, _options);
return result.toPromise();
} | /**
* Get the RAG task details.
* Get RAG Task
* @param taskId The taskId to be queried
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4308-L4311 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseRagApi.getRagTaskStatusWithHttpInfo | public getRagTaskStatusWithHttpInfo(taskId: number, _options?: Configuration): Promise<HttpInfo<string>> {
const result = this.api.getRagTaskStatusWithHttpInfo(taskId, _options);
return result.toPromise();
} | /**
* Get the RAG task execution status: pending | running | succeeded | failed | canceled.
* Get RAG Task Status
* @param taskId The taskId to be queried status
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4318-L4321 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseRagApi.getRagTaskStatus | public getRagTaskStatus(taskId: number, _options?: Configuration): Promise<string> {
const result = this.api.getRagTaskStatus(taskId, _options);
return result.toPromise();
} | /**
* Get the RAG task execution status: pending | running | succeeded | failed | canceled.
* Get RAG Task Status
* @param taskId The taskId to be queried status
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4328-L4331 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseRagApi.listRagTasksWithHttpInfo | public listRagTasksWithHttpInfo(characterUid: string, _options?: Configuration): Promise<HttpInfo<Array<RagTaskDetailsDTO>>> {
const result = this.api.listRagTasksWithHttpInfo(characterUid, _options);
return result.toPromise();
} | /**
* List the RAG tasks by characterId.
* List RAG Tasks
* @param characterUid The characterUid to be queried
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4338-L4341 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseRagApi.listRagTasks | public listRagTasks(characterUid: string, _options?: Configuration): Promise<Array<RagTaskDetailsDTO>> {
const result = this.api.listRagTasks(characterUid, _options);
return result.toPromise();
} | /**
* List the RAG tasks by characterId.
* List RAG Tasks
* @param characterUid The characterUid to be queried
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4348-L4351 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseRagApi.startRagTaskWithHttpInfo | public startRagTaskWithHttpInfo(taskId: number, _options?: Configuration): Promise<HttpInfo<boolean>> {
const result = this.api.startRagTaskWithHttpInfo(taskId, _options);
return result.toPromise();
} | /**
* Start a RAG task.
* Start RAG Task
* @param taskId The taskId to be started
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4358-L4361 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseRagApi.startRagTask | public startRagTask(taskId: number, _options?: Configuration): Promise<boolean> {
const result = this.api.startRagTask(taskId, _options);
return result.toPromise();
} | /**
* Start a RAG task.
* Start RAG Task
* @param taskId The taskId to be started
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4368-L4371 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseRagApi.updateRagTaskWithHttpInfo | public updateRagTaskWithHttpInfo(taskId: number, ragTaskDTO: RagTaskDTO, _options?: Configuration): Promise<HttpInfo<boolean>> {
const result = this.api.updateRagTaskWithHttpInfo(taskId, ragTaskDTO, _options);
return result.toPromise();
} | /**
* Update a RAG task.
* Update RAG Task
* @param taskId The taskId to be updated
* @param ragTaskDTO The prompt task info to be updated
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4379-L4382 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseRagApi.updateRagTask | public updateRagTask(taskId: number, ragTaskDTO: RagTaskDTO, _options?: Configuration): Promise<boolean> {
const result = this.api.updateRagTask(taskId, ragTaskDTO, _options);
return result.toPromise();
} | /**
* Update a RAG task.
* Update RAG Task
* @param taskId The taskId to be updated
* @param ragTaskDTO The prompt task info to be updated
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4390-L4393 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseTTSServiceApi.listTtsBuiltinSpeakersWithHttpInfo | public listTtsBuiltinSpeakersWithHttpInfo(_options?: Configuration): Promise<HttpInfo<Array<string>>> {
const result = this.api.listTtsBuiltinSpeakersWithHttpInfo(_options);
return result.toPromise();
} | /**
* Return builtin TTS speakers.
* List Builtin Speakers
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4418-L4421 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseTTSServiceApi.listTtsBuiltinSpeakers | public listTtsBuiltinSpeakers(_options?: Configuration): Promise<Array<string>> {
const result = this.api.listTtsBuiltinSpeakers(_options);
return result.toPromise();
} | /**
* Return builtin TTS speakers.
* List Builtin Speakers
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4427-L4430 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseTTSServiceApi.playSampleWithHttpInfo | public playSampleWithHttpInfo(speakerType: string, speaker: string, _options?: Configuration): Promise<HttpInfo<any>> {
const result = this.api.playSampleWithHttpInfo(speakerType, speaker, _options);
return result.toPromise();
} | /**
* Play TTS sample audio of the builtin/custom speaker.
* Play Sample Audio
* @param speakerType The speaker type
* @param speaker The speaker
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4438-L4441 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseTTSServiceApi.playSample | public playSample(speakerType: string, speaker: string, _options?: Configuration): Promise<any> {
const result = this.api.playSample(speakerType, speaker, _options);
return result.toPromise();
} | /**
* Play TTS sample audio of the builtin/custom speaker.
* Play Sample Audio
* @param speakerType The speaker type
* @param speaker The speaker
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4449-L4452 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseTTSServiceApi.speakMessageWithHttpInfo | public speakMessageWithHttpInfo(messageId: number, _options?: Configuration): Promise<HttpInfo<any>> {
const result = this.api.speakMessageWithHttpInfo(messageId, _options);
return result.toPromise();
} | /**
* Read out the message.
* Speak Message
* @param messageId The message id
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4459-L4462 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseTTSServiceApi.speakMessage | public speakMessage(messageId: number, _options?: Configuration): Promise<any> {
const result = this.api.speakMessage(messageId, _options);
return result.toPromise();
} | /**
* Read out the message.
* Speak Message
* @param messageId The message id
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4469-L4472 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseTagManagerForBizAdminApi.createTagWithHttpInfo | public createTagWithHttpInfo(referType: string, referId: string, tag: string, _options?: Configuration): Promise<HttpInfo<boolean>> {
const result = this.api.createTagWithHttpInfo(referType, referId, tag, _options);
return result.toPromise();
} | /**
* Create a tag, tags created by the administrator cannot be deleted by ordinary users.
* Create Tag
* @param referType Tag type (prompt, agent, plugin...)
* @param referId Resource identifier of the tag
* @param tag Tag content
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4500-L4503 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseTagManagerForBizAdminApi.createTag | public createTag(referType: string, referId: string, tag: string, _options?: Configuration): Promise<boolean> {
const result = this.api.createTag(referType, referId, tag, _options);
return result.toPromise();
} | /**
* Create a tag, tags created by the administrator cannot be deleted by ordinary users.
* Create Tag
* @param referType Tag type (prompt, agent, plugin...)
* @param referId Resource identifier of the tag
* @param tag Tag content
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4512-L4515 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseTagManagerForBizAdminApi.deleteTagWithHttpInfo | public deleteTagWithHttpInfo(referType: string, referId: string, tag: string, _options?: Configuration): Promise<HttpInfo<boolean>> {
const result = this.api.deleteTagWithHttpInfo(referType, referId, tag, _options);
return result.toPromise();
} | /**
* Delete a tag, any tag created by anyone can be deleted.
* Delete Tag
* @param referType Tag type (prompt, agent, plugin...)
* @param referId Resource identifier of the tag
* @param tag Tag content
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4524-L4527 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
freechat | github_2023 | freechat-fun | typescript | PromiseTagManagerForBizAdminApi.deleteTag | public deleteTag(referType: string, referId: string, tag: string, _options?: Configuration): Promise<boolean> {
const result = this.api.deleteTag(referType, referId, tag, _options);
return result.toPromise();
} | /**
* Delete a tag, any tag created by anyone can be deleted.
* Delete Tag
* @param referType Tag type (prompt, agent, plugin...)
* @param referId Resource identifier of the tag
* @param tag Tag content
*/ | https://github.com/freechat-fun/freechat/blob/cb80c3708b85cf52c02a91bdc0c9e9ddc14856db/freechat-sdk/typescript/types/PromiseAPI.ts#L4536-L4539 | cb80c3708b85cf52c02a91bdc0c9e9ddc14856db |
Aria-Docs | github_2023 | nisabmohd | typescript | parseMdx | async function parseMdx<Frontmatter>(rawMdx: string) {
return await compileMDX<Frontmatter>({
source: rawMdx,
options: {
parseFrontmatter: true,
mdxOptions: {
rehypePlugins: [
preProcess,
rehypeCodeTitles,
rehypePrism,
rehypeSlug,
rehypeAut... | // can be used for other pages like blogs, Guides etc | https://github.com/nisabmohd/Aria-Docs/blob/29630f770db190999faa03adbf61034677ace4c1/lib/markdown.ts#L38-L57 | 29630f770db190999faa03adbf61034677ace4c1 |
Aria-Docs | github_2023 | nisabmohd | typescript | preProcess | const preProcess = () => (tree: any) => {
visit(tree, (node) => {
if (node?.type === "element" && node?.tagName === "pre") {
const [codeEl] = node.children;
if (codeEl.tagName !== "code") return;
node.raw = codeEl.children?.[0].value;
}
});
}; | // for copying the code in pre | https://github.com/nisabmohd/Aria-Docs/blob/29630f770db190999faa03adbf61034677ace4c1/lib/markdown.ts#L150-L158 | 29630f770db190999faa03adbf61034677ace4c1 |
Aria-Docs | github_2023 | nisabmohd | typescript | postProcess | const postProcess = () => (tree: any) => {
visit(tree, "element", (node) => {
if (node?.type === "element" && node?.tagName === "pre") {
node.properties["raw"] = node.raw;
}
});
}; | // eslint-disable-next-line @typescript-eslint/no-explicit-any | https://github.com/nisabmohd/Aria-Docs/blob/29630f770db190999faa03adbf61034677ace4c1/lib/markdown.ts#L161-L167 | 29630f770db190999faa03adbf61034677ace4c1 |
veloxi | github_2023 | TahaSh | typescript | Plugin.update | update(ts: number, dt: number) {} | // @ts-ignore | https://github.com/TahaSh/veloxi/blob/2eb89939dfdbc063b7a42d98b4a07cd9ba477d31/src/core/Plugin.ts#L359-L359 | 2eb89939dfdbc063b7a42d98b4a07cd9ba477d31 |
veloxi | github_2023 | TahaSh | typescript | CoreView.overlapsWith | overlapsWith(view: View): boolean {
const viewScaledWidth = (view as CoreView)._localWidth * view.scale.x
const viewScaledHeight = (view as CoreView)._localHeight * view.scale.y
const scaledWidth = this._localWidth * this.scale.x
const scaledHeight = this._localHeight * this.scale.y
return (
... | // Using AABB collision detection | https://github.com/TahaSh/veloxi/blob/2eb89939dfdbc063b7a42d98b4a07cd9ba477d31/src/core/View.ts#L389-L401 | 2eb89939dfdbc063b7a42d98b4a07cd9ba477d31 |
Protofy | github_2023 | Protofy-xyz | typescript | handleFilesRequest | const handleFilesRequest = async (req, res) => {
const name = req.params.path || '';
const isDownload = req.query.download
const filepath = path.join(getRoot(req), name);
if (! await fileExists(filepath)) {
res.status(404).send('No such file or directory: ' + filepath)
return
}
... | // Handler function to avoid repeating the same code for both routes | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/apps/core/src/api/files.ts#L47-L122 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | handleFilesWriteRequest | const handleFilesWriteRequest = async (req, res, session) => {
const name = req.params.path || '';
const filepath = path.join(getRoot(req), name);
if (req.body && req.body.hasOwnProperty && req.body.hasOwnProperty("content")) {
await fs.writeFile(filepath, req.body.content)
}
generateEvent(... | //received post requests and creates directories or write files, dependeing on query string param | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/apps/core/src/api/files.ts#L128-L142 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | ProtoSchema.getFieldDefinition | getFieldDefinition(field: string) {
return this.shape[field] ? this.shape[field]._def : undefined
} | //get field definition | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protobase/src/ProtoSchema.ts#L17-L19 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | ProtoSchema.apply | async apply(eventName: string, data: any, transformers: any, prevData?: any) {
let newData = { ...data }
const withEvents = this.is('events')
const keys = Object.keys(withEvents.shape)
for (var i = 0; i < keys.length; i++) {
const key = keys[i]
const currField: an... | //apply generative schema to data | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protobase/src/ProtoSchema.ts#L36-L54 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | ProtoSchema.load | static load(schema: Zod.ZodObject<any>) {
return new ProtoSchema(schema.shape)
} | //generate a protoSchema from a extended zodSchema | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protobase/src/ProtoSchema.ts#L171-L173 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | CapacitiveSoilMoistureSensor.attach | attach(pin) {
return {componentName: 'sensor',payload:
` - platform: ${this.platform}
pin: ${pin}
id: ${this.name}
name: ${this.name}
update_interval: ${this.updateInterval}
attenuation: ${this.attenuation}
`
}
} | // | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protodevice/src/device/CapacitiveSoilMoistureSensor.ts#L15-L25 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | ISOutput.setMqttTopicPrefix | setMqttTopicPrefix(setMqttTopicPrefix){
this.mqttTopicPrefix= setMqttTopicPrefix;
} | /*mqtt:
broker: 192.168.0.45
topic_prefix: protofy-seed/mydevice
on_json_message:
topic: protofy-seed/mydevice/output/pwm1/command
then:
- lambda: |-
if (x.containsKey("pwmLevel")) {
id(pwm1SetLevel).execute(x['pwmLevel']);
}
script:
- id: pw... | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protodevice/src/device/ISOutput.ts#L31-L33 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | NFCReader.attach | attach(pin, deviceComponents) {
const componentObjects = [
{
name: this.type,
config: {
id: this.name,
i2c_id: this.i2cBusId,
update_interval: this.updateInterval,
... | // } | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protodevice/src/device/NFCReader.ts#L47-L95 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | PulseCounter.attach | attach(pin) {
return {componentName: 'sensor',payload:
` - platform: ${this.platform}
pin: ${pin}
id: ${this.name}
name: ${this.name}
`
}
} | // | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protodevice/src/device/PulseCounter.ts#L11-L19 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | Transport.constructor | constructor(public device: SerialPort) {} | //@ts-ignore | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protodevice/src/device/esptool-js/webserial.ts#L7-L7 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | Transport.slip_reader | slip_reader(data: Uint8Array) {
let i = 0;
let data_start = 0,
data_end = 0;
let state = "init";
while (i < data.length) {
if (state === "init" && data[i] == 0xc0) {
data_start = i + 1;
state = "valid_data";
i++;
continue;
}
if (state === "valid_da... | /* this function expects complete packet (hence reader reads for atleast 8 bytes. This function is
* stateless and returns the first wellformed packet only after replacing escape sequence */ | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protodevice/src/device/esptool-js/webserial.ts#L70-L112 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | GPIOSwitch | const GPIOSwitch = ({ node = {}, nodeData = {}, children, color }: any) => {
const nodeParams: Field[] = [
{ label: 'Name', static: true, field: 'param-1', type: 'input' },
{ label: 'Restore Mode', static: true, field: 'param-2', type: 'select', data: ["ALWAYS_ON", "ALWAYS_OFF"] }
] as Field[]
... | // import subsystem from "./utils/subsystem"; | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protodevice/src/nodes/GPIOSwitch.tsx#L5-L20 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | NFCReader | const NFCReader = ({node = {}, nodeData = {}, children, color}: any) => {
const [name, setName] = React.useState(nodeData['param-1'])
const nameErrorMsg = 'Reserved name'
const intervalErrorMsg = 'Add units h/m/s/ms'
const nodeParams: Field[] = [
{
label: 'Name', static: true, field:... | // import { Position } from "reactflow"; | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protodevice/src/nodes/NFCReader.tsx#L7-L27 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | Relay | const Relay = ({ node = {}, nodeData = {}, children, color }: any) => {
const nodeParams: Field[] = [
{ label: 'Name', static: true, field: 'param-1', type: 'input' },
{ label: 'Restore Mode', static: true, field: 'param-2', type: 'select', data: ["ALWAYS_ON", "ALWAYS_OFF"] }
] as Field[]
... | // import subsystem from "./utils/subsystem"; | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protodevice/src/nodes/Relay.tsx#L5-L20 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | SCD4X | const SCD4X = ({node = {}, nodeData = {}, children, color}: any) => {
const [name, setName] = React.useState(nodeData['param-1'])
const nameErrorMsg = 'Reserved name'
const intervalErrorMsg = 'Add units h/m/s/ms'
const nodeParams: Field[] = [
{
label: 'Name', static: true, field: 'pa... | // import { Position } from "reactflow"; | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protodevice/src/nodes/SCD4X.tsx#L7-L29 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | TempHumidity | const TempHumidity = ({ node = {}, nodeData = {}, children, color }: any) => {
const transitionErrorMsg = 'Add units s/ms'
const nodeParams: Field[] = [
{ label: 'Name', static: true, field: 'param-1', type: 'input' },
{
label: 'Model', static: true, field: 'param-2', type: 'select'... | // import { Node, Field, HandleOutput, NodeParams } from '../../flowslib'; | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protodevice/src/nodes/TempHumidity.tsx#L7-L26 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | getEnvVars | const getEnvVars = ()=>{
return {apiUrl: "http://localhost",imagesUrl: "test"}
} | /* MIT License
Copyright (c) 2022-present, PROTOFY.XYZ, S.L.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, mer... | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protodevice/src/oldThings/settings.ts#L26-L28 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | flatten | const flatten = (nodes) => {
const total = []
const toFlow = (node, graph, parentNode) => {
const obj = { ...node }
delete obj.children
if (parentNode) obj.parentNode = parentNode
total.push(obj)
if (node.children && node.children.length) {
... | // console.log('before toFlow: ', nodes) | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protoflow/src/diagram/layouts/ElkLayout.tsx#L45-L68 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | computeZoomFactor | function computeZoomFactor(currentZoom,
b = 4.5,
q = 8,
x0 = 0.99,
maxFactor = 12.5) {
if (currentZoom >= 1) {
return 1; // This means no change in the font, it's at its base size.
}
const a = -maxFactor;
const c = maxFactor;
// Exponential function
const exponential = ... | /**
* Compute the zoom factor based on the current zoom level.
*
* @param {number} currentZoom - The current zoom level (0 to 2).
* @param {number} [b=2] - Controls the steepness of the exponential curve.
* Higher values make the exponential curve steeper.
* @param {number} [q=8.33] - Co... | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protoflow/src/lib/ZoomMath.ts#L22-L48 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | createDateObject | function createDateObject(time, day, monthName, year): Date {
const monthMap = {
january: 0,
february: 1,
march: 2,
april: 3,
may: 4,
june: 5,
july: 6,
august: 7,
september: 8,
october: 9,
november: 10,
december: 11
};
const [hour, m... | //1 marzo 2023 | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protolib/src/bundles/automations/schedule.ts#L23-L49 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | flatten | const flatten = (nodes) => {
const total = []
const toFlow = (node, parentNode) => {
const obj = { ...node, data: {...node.data} }
delete obj.children
if (parentNode) obj.parentNode = parentNode
total.push(obj)
if (node.children && node.childr... | // console.log('before toFlow: ', nodes) | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protolib/src/bundles/devices/deviceDefinitions/DeviceLayout.tsx#L88-L111 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | filter | const filter = (cmd) => (cmd.name != commandName) | // WIP: Not working | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protolib/src/bundles/discord/context/index.ts#L157-L157 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | phpApisAbsolutePath | const phpApisAbsolutePath = (root, file) => fspath.join(process.cwd(), phpApisRoot(getRoot(root)), file) | // fix: here file var could be populated with ../../../ and it will be a path traversing | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protolib/src/bundles/php/phpApi.ts#L10-L10 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | fail | const fail = (returnUrl?) => {
if (returnUrl.includes('_next/data/development/')) {
const basePath = returnUrl.split('_next/data/development')[1].split('.json')[0];
returnUrl = basePath
}
if (returnUrl == "/") returnUrl = undefined
const encodedReturn = encodeURIComponent(returnUrl);
... | //utility functions for nextjs pages | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protolib/src/lib/Session.ts#L72-L85 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | generateEvent | const generateEvent = async (event, token='') => {
try {
await API.post('/api/core/v1/events?token='+token, event, undefined, true)
} catch(e) {
//console.error("Failed to send event: ", e)
}
} | /*
modelName: name of the model, used to generate api urls. for example, if model name is 'test' and prefix is '/api/v1/', then to read an item is: /api/v1/test
the separation from prefix is to allow less parameters for the default scenario (so you dont to write /api/v1/ all the time)
modelType:... | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protonode/src/lib/generateApi.ts#L24-L30 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | ProtoLevelDB.getGroupIndexOptions | async getGroupIndexOptions(groupKey, limit = 100) {
try {
const indexTable = sublevel(this.rootDb, 'indexTable')
const groupIndexes = JSON.parse(await indexTable.get('groupIndexes'))
const index = groupIndexes.find(gi => gi.key == groupKey)
if (index) {
... | //given a groupkey, like 'city', return all possible values for that group | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/protonode/src/lib/dbproviders/leveldb.ts#L217-L235 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | sizeToSpace | function sizeToSpace(v: number) {
if (v === 0) return 0
if (v === 2) return 0.5
if (v === 4) return 1
if (v === 8) return 1.5
if (v <= 16) return Math.round(v * 0.333)
return Math.floor(v * 0.7 - 12)
} | // a bit odd but keeping backward compat for values >8 while fixing below | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/ui/src/tokens/index.tsx#L76-L83 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | cleanHtml | const cleanHtml = (html) => {
const tempDiv = document.createElement('div');
tempDiv.innerHTML = html;
return tempDiv.textContent || tempDiv.innerText || '';
}; | // Clean html is necessawy when copy & paste from other websites or apps (contains metadata). | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/visualui/src/components/EditorLayout.tsx#L123-L127 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | handleEvent | const handleEvent = (e) => {
if (enableClickEventsRef.current) return
e.preventDefault();
e.stopPropagation();
} | // Prevents click events to interact inside editor-layout | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/visualui/src/components/UIEditor.tsx#L287-L291 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | useFlowsComms | function useFlowsComms({ edges, nodeData, nodes, setEdges, setNodesData, deleteNodes, setNodes, createNode, setNodeData, _customComponents, onSaveNodes, flowId, data }) {
if (experimentalComms()) {
const { lastEvent } = useVisualUi(props.contextAtom)
useEffect(() => {
if ... | // flows comms custom hook | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/visualui/src/components/VisualUiFlows.tsx#L36-L199 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | Source.parse | static parse(source: string, metadata = {}): Source {
const project = new Project({
useInMemoryFileSystem: true,
manipulationSettings: { indentationText: IndentationText.Tab },
compilerOptions: {
target: ScriptTarget.Latest,
scriptKind: ScriptK... | // sourceCode -> Ast | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/visualui/src/models/Source.ts#L17-L28 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
Protofy | github_2023 | Protofy-xyz | typescript | Source.data | data(customIdentifier?: () => string | number): any { // Gets craftJS nodes
if (customIdentifier) {
this.identifyElements(customIdentifier)
}
const content = this.getContent();
let craftNodes = this.toCraftNodes(content)
craftNodes = this.addCustomProps(craftNodes) //... | // Ast -> craftNodes | https://github.com/Protofy-xyz/Protofy/blob/636bcc1b2b5089fa7e9835cd531497cdc73ac83f/packages/visualui/src/models/Source.ts#L31-L39 | 636bcc1b2b5089fa7e9835cd531497cdc73ac83f |
wga | github_2023 | blackfyre | typescript | initViewer | function initViewer() {
const elements = document.querySelectorAll("[data-viewer]");
if (elements.length > 0) {
elements.forEach((element) => {
const e = element as HTMLElement;
new Viewer(e, {
toolbar: {
zoomIn: 1,
zoomOut: 1,
oneToOne: 1,
reset: 1,
... | /**
* Initializes the Viewer plugin on all elements with the `data-viewer` attribute.
* @function
* @returns {void}
*/ | https://github.com/blackfyre/wga/blob/79a8556130d2edd109a4a720cfac31036f52a7a5/resources/js/app.ts#L66-L91 | 79a8556130d2edd109a4a720cfac31036f52a7a5 |
wga | github_2023 | blackfyre | typescript | InitEventListeners | function InitEventListeners() {
document.body.addEventListener("notification:toast", function (evt) {
const event = evt as ToastEvent;
if (event.detail.closeDialog) {
wgaInternal.els.dialog?.close();
}
createToast(event.detail.message, event.detail.type);
});
document.body.addEventListener... | /**
* Initializes event listeners for the postcard dialog success and error events, as well as the htmx:load event and the trix-before-initialize event.
* @function
* @name InitEventListeners
* @returns {void}
*/ | https://github.com/blackfyre/wga/blob/79a8556130d2edd109a4a720cfac31036f52a7a5/resources/js/app.ts#L156-L239 | 79a8556130d2edd109a4a720cfac31036f52a7a5 |
wga | github_2023 | blackfyre | typescript | initJumpToTop | function initJumpToTop() {
const jumpToTop = document.querySelector(".jump.back-to-top");
if (jumpToTop) {
jumpToTop.addEventListener("click", () => {
window.scrollTo({ top: 0, behavior: "smooth" });
});
}
} | /**
* Initializes the "Jump to Top" functionality.
* @function
* @name initJumpToTop
* @returns {void}
*/ | https://github.com/blackfyre/wga/blob/79a8556130d2edd109a4a720cfac31036f52a7a5/resources/js/app.ts#L247-L254 | 79a8556130d2edd109a4a720cfac31036f52a7a5 |
datalens-ui | github_2023 | datalens-tech | typescript | resolveEntryByLink | async function resolveEntryByLink({
originalUrl,
ctx,
getEntryMeta,
}: ResolveEntryByLinkComponentArgs): Promise<ResolveEntryByLinkComponentResponse> {
try {
const url = new URL(originalUrl, 'http://stub');
const idOrKeyOrReport =
url.pathname
.replace(/^\/na... | // eslint-disable-next-line complexity | https://github.com/datalens-tech/datalens-ui/blob/c6c62518947d4384167d05e7c686eb880fef00f8/src/server/components/resolve-entry-by-link.ts#L22-L94 | c6c62518947d4384167d05e7c686eb880fef00f8 |
datalens-ui | github_2023 | datalens-tech | typescript | emptyStep | const emptyStep = (name: string) => async (options: {params: StringParams}) => {
const {params} = options;
const timeStart = process.hrtime();
const context = getChartApiContext({
name,
shared,
params,
actionParams: {} as Record<string, string | st... | // Nothing happens here - just for compatibility with the editor | https://github.com/datalens-tech/datalens-ui/blob/c6c62518947d4384167d05e7c686eb880fef00f8/src/server/components/charts-engine/components/processor/control-builder.ts#L24-L41 | c6c62518947d4384167d05e7c686eb880fef00f8 |
datalens-ui | github_2023 | datalens-tech | typescript | DataFetcher.getSourceConfig | static getSourceConfig({
sourcesConfig,
sourcePath,
isEmbed,
}: {
sourcesConfig: ChartsEngine['sources'];
sourcePath: string;
isEmbed?: boolean;
}) {
let sourceName = DataFetcher.getSourceName(sourcePath);
// Temporary hack for embed endpoints
... | /**
* @param {String} chartsEngine
* @param {String} sourcePath requested source
*
* @returns {Object} source configuration
*/ | https://github.com/datalens-tech/datalens-ui/blob/c6c62518947d4384167d05e7c686eb880fef00f8/src/server/components/charts-engine/components/processor/data-fetcher.ts#L370-L420 | c6c62518947d4384167d05e7c686eb880fef00f8 |
datalens-ui | github_2023 | datalens-tech | typescript | DataFetcher.getChartKitSources | static getChartKitSources({
sourcesConfig,
lang = 'en',
}: {
sourcesConfig: ChartsEngine['sources'];
lang: 'en' | 'ru';
}) {
const sources = sourcesConfig;
const chartkitSources: Record<string, ChartkitSource> = {};
Object.keys(sources).forEach((sourceTy... | /**
* @param {String} sourcesConfig
* @param {String} lang target lang
*
* @returns {Object} config for all sources
*/ | https://github.com/datalens-tech/datalens-ui/blob/c6c62518947d4384167d05e7c686eb880fef00f8/src/server/components/charts-engine/components/processor/data-fetcher.ts#L428-L472 | c6c62518947d4384167d05e7c686eb880fef00f8 |
datalens-ui | github_2023 | datalens-tech | typescript | DataFetcher.isStat | static isStat({
sourcesConfig,
sourcePath,
}: {
sourcesConfig: ChartsEngine['sources'];
sourcePath: string;
}) {
return DataFetcher.getSourceConfig({sourcesConfig, sourcePath}) === null;
} | /**
* @param {String} sourcePath requested source
*
* @returns {Boolean} check is source stat or not
*/ | https://github.com/datalens-tech/datalens-ui/blob/c6c62518947d4384167d05e7c686eb880fef00f8/src/server/components/charts-engine/components/processor/data-fetcher.ts#L479-L487 | c6c62518947d4384167d05e7c686eb880fef00f8 |
datalens-ui | github_2023 | datalens-tech | typescript | Processor.process | static async process({
subrequestHeaders,
paramsOverride = {},
widgetConfig = {},
configOverride,
useUnreleasedConfig,
userLang,
userLogin,
userId = null,
iamToken = null,
responseOptions = {},
uiOnly = false,
isEditMode,
... | // eslint-disable-next-line complexity | https://github.com/datalens-tech/datalens-ui/blob/c6c62518947d4384167d05e7c686eb880fef00f8/src/server/components/charts-engine/components/processor/index.ts#L188-L1055 | c6c62518947d4384167d05e7c686eb880fef00f8 |
datalens-ui | github_2023 | datalens-tech | typescript | emptyStep | const emptyStep =
(name: string) => async (options: {params: StringParams; actionParams: StringParams}) => {
const {params, actionParams} = options;
const timeStart = process.hrtime();
const context = getChartApiContext({
name,
shared,
... | // Nothing happens here - just for compatibility with the editor | https://github.com/datalens-tech/datalens-ui/blob/c6c62518947d4384167d05e7c686eb880fef00f8/src/server/components/charts-engine/components/processor/worker-chart-builder.ts#L45-L64 | c6c62518947d4384167d05e7c686eb880fef00f8 |
datalens-ui | github_2023 | datalens-tech | typescript | formatPassedHeaders | function formatPassedHeaders(
headers: Request['headers'],
ctx: AppContext,
extraAllowedHeaders?: string[],
) {
const headersNew: Request['headers'] = {};
const {headersMap} = ctx.config;
const passedHeaders = [
...PASSED_HEADERS,
headersMap.folderId,
headersMap.subjec... | // 100 MB | https://github.com/datalens-tech/datalens-ui/blob/c6c62518947d4384167d05e7c686eb880fef00f8/src/server/components/charts-engine/components/storage/united-storage/provider.ts#L125-L154 | c6c62518947d4384167d05e7c686eb880fef00f8 |
datalens-ui | github_2023 | datalens-tech | typescript | prepareSingleResult | function prepareSingleResult({
resultData,
fields,
notifications,
visualization,
shared,
idToTitle,
idToDataType,
ChartEditor,
datasetsIds,
loadedColorPalettes,
layerChartMeta,
usedColors,
palettes,
features,
}: PrepareSingleResultArgs) {
const isVisualization... | // eslint-disable-next-line complexity | https://github.com/datalens-tech/datalens-ui/blob/c6c62518947d4384167d05e7c686eb880fef00f8/src/server/modes/charts/plugins/datalens/js/js.ts#L389-L719 | c6c62518947d4384167d05e7c686eb880fef00f8 |
datalens-ui | github_2023 | datalens-tech | typescript | prepareGeopolygon | function prepareGeopolygon(options: PrepareFunctionArgs) {
const DEFAULT_COLOR = 'rgb(77, 162, 241)';
const {
colors,
colorsConfig,
tooltips,
tooltipConfig,
placeholders,
resultData: {data, order},
idToTitle,
shared,
idToDataType,
... | // eslint-disable-next-line complexity | https://github.com/datalens-tech/datalens-ui/blob/c6c62518947d4384167d05e7c686eb880fef00f8/src/server/modes/charts/plugins/datalens/preparers/geopolygon.ts#L135-L486 | c6c62518947d4384167d05e7c686eb880fef00f8 |
datalens-ui | github_2023 | datalens-tech | typescript | getHighchartsConfig | function getHighchartsConfig(args: PrepareFunctionArgs & {graphs: any[]}) {
const {
placeholders,
colors,
colorsConfig,
sort,
visualizationId,
shared,
graphs,
idToDataType,
} = args;
// for some reason, the vertical axis for the horizontal bar ... | // eslint-disable-next-line complexity | https://github.com/datalens-tech/datalens-ui/blob/c6c62518947d4384167d05e7c686eb880fef00f8/src/server/modes/charts/plugins/datalens/preparers/bar-y/highcharts.ts#L35-L135 | c6c62518947d4384167d05e7c686eb880fef00f8 |
datalens-ui | github_2023 | datalens-tech | typescript | prepareGeopoint | function prepareGeopoint(options: PrepareFunctionArgs, {isClusteredPoints = false} = {}) {
const {
colors,
colorsConfig,
tooltips,
tooltipConfig,
labels,
placeholders,
resultData: {data, order},
idToTitle,
shared,
idToDataType,
... | // eslint-disable-next-line complexity | https://github.com/datalens-tech/datalens-ui/blob/c6c62518947d4384167d05e7c686eb880fef00f8/src/server/modes/charts/plugins/datalens/preparers/geopoint/index.ts#L114-L478 | c6c62518947d4384167d05e7c686eb880fef00f8 |
datalens-ui | github_2023 | datalens-tech | typescript | prepareLineTime | function prepareLineTime(options: PrepareFunctionArgs) {
const {placeholders, resultData, colors, idToTitle, colorsConfig, shared, ChartEditor} =
options;
const {data, order} = resultData;
const xField = placeholders[0].items[0];
if (!xField) {
return {timeline: []};
}
const ... | // eslint-disable-next-line complexity | https://github.com/datalens-tech/datalens-ui/blob/c6c62518947d4384167d05e7c686eb880fef00f8/src/server/modes/charts/plugins/datalens/preparers/line-time/index.ts#L34-L267 | c6c62518947d4384167d05e7c686eb880fef00f8 |
datalens-ui | github_2023 | datalens-tech | typescript | getHighchartsConfig | function getHighchartsConfig(args: PrepareFunctionArgs & {graphs: any[]}) {
const {
placeholders,
colors,
colorsConfig,
sort,
visualizationId,
shared,
shapes,
graphs,
segments,
idToDataType,
} = args;
const xPlaceholder = placeh... | // eslint-disable-next-line complexity | https://github.com/datalens-tech/datalens-ui/blob/c6c62518947d4384167d05e7c686eb880fef00f8/src/server/modes/charts/plugins/datalens/preparers/line/highcharts.ts#L39-L185 | c6c62518947d4384167d05e7c686eb880fef00f8 |
datalens-ui | github_2023 | datalens-tech | typescript | preparePivotTable | function preparePivotTable({
placeholders,
resultData,
colors,
sort,
colorsConfig,
idToTitle,
idToDataType,
ChartEditor,
}: PrepareFunctionArgs) {
const {data, order} = resultData;
// Fields dragged into "columns"
const c: any[] = placeholders[0].items;
// Types of fiel... | // The function that generates the structure, | https://github.com/datalens-tech/datalens-ui/blob/c6c62518947d4384167d05e7c686eb880fef00f8/src/server/modes/charts/plugins/datalens/preparers/old-pivot-table/old-pivot-table.ts#L39-L1152 | c6c62518947d4384167d05e7c686eb880fef00f8 |
datalens-ui | github_2023 | datalens-tech | typescript | generateHeadRows | function generateHeadRows() {
function generateHeadRowLevel(level: any, accumulated: any): any[] {
const localResult: any[] = [];
accumulated.forEach((accumulatedRow: any) => {
const keyPrefix = accumulatedRow.length
? accumulatedRow
... | // Lowercase header generation function | https://github.com/datalens-tech/datalens-ui/blob/c6c62518947d4384167d05e7c686eb880fef00f8/src/server/modes/charts/plugins/datalens/preparers/old-pivot-table/old-pivot-table.ts#L743-L835 | c6c62518947d4384167d05e7c686eb880fef00f8 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.