import z from "zod"; import { ServiceClient } from "../../service-client"; import { DecideCollectionAutomationApprovalSchema, ListCollectionAutomationExecutionsSchema, } from "./schema"; import type { TCollectionAutomationExecutionPage, } from "./types"; import { CreateDataModelAgentFlowSchema, DeleteDataModelAgentFlowSchema, ListDataModelAgentFlowsSchema, UpdateDataModelAgentFlowSchema, } from "./schema"; import type { TDataModelAgentFlow, TDataModelAgentFlowPage, } from "./types"; import { AggregateRecordsSchema, ArchiveCollectionSchema, BulkCreateRecordsSchema, BulkDeleteRecordsSchema, BulkUpdateRecordsSchema, ChangeAgentflowProjectSchema, CheckRecordPermissionSchema, ClearWorkerNotebookMessagesSchema, BuildWorkerNotebookContextSchema, ConnectTrelloImportCredentialSchema, CountRecordsSchema, CreateAgentFlowFolderSchema, CreateAgentFlowSchema, CreateAssistantChannelSchema, CreateAssistantConstraintSchema, CreateAssistantDatasourceSchema, CreateAssistantInstructionSchema, CreateAssistantSchema, CreateAssistantSkillSchema, CreateChannelSchema, CreateCollectionAutomationRuleSchema, CreateCollectionButtonSchema, CreateCollectionFieldSchema, CreateCollectionRelationSchema, CreateCollectionSchema, CreateCollectionViewSchema, CreateCommandSchema, CreateCompetencySchema, CreateConstraintSchema, CreateDataModelSchema, CreateDatasourceSchema, CreateDomainTopicSchema, CreateDriveFolderSchema, CreateDriveRootFolderSchema, CreateDriveRootSchema, CreateEmploidSchema, CreateExtensionSchema, CreateInputSchema, CreateInstructionSchema, CreateJobDefinitionSchema, CreateKnowledgeSchema, CreateOccupationSchema, CreateRecordSchema, CreateScopeSchema, CreateSkillSchema, CreateStreamIdSchema, CreateTaskTemplateSchema, CreateTeamSchema, CreateTopicSchema, CreateWikiAiCommandSchema, CreateWikiCommentSchema, CreateWikiPageSchema, CreateWikiReferenceSchema, CreateWikiRevisionSchema, CreateWorkerNotebookFileSourceSchema, CreateWorkerNotebookNoteSchema, CreateWorkerNotebookSchema, CreateWorkerNotebookSourceSchema, CreateWorkerNotebookStudioOutputSchema, DiscoverWorkerNotebookSourcesSchema, ImportWorkerNotebookSourcesSchema, CreateWorkerSchema, CreateWorkerTopicSchema, DeleteAgentFlowFolderSchema, DeleteAgentFlowSchema, DeleteAssistantChannelSchema, DeleteAssistantDatasourceSchema, DeleteAssistantSchema, DeleteChannelSchema, DeleteChatByIdSchema, DeleteCollectionAutomationRuleSchema, DeleteCollectionButtonSchema, DeleteCollectionFieldSchema, DeleteCollectionRelationSchema, DeleteCollectionViewSchema, DeleteCommandSchema, DeleteCompetencySchema, DeleteConstraintSchema, DeleteDataModelSchema, DeleteDatasourceSchema, DeleteDocumentsByIdAfterTimestampSchema, DeleteDomainTopicSchema, DeleteDriveItemSchema, DeleteDriveRootItemSchema, DeleteDriveRootSchema, DeleteEmploidSchema, DeleteExtensionSchema, DeleteInputSchema, DeleteInstructionSchema, DeleteJobDefinitionSchema, DeleteKnowledgeSchema, DeleteMessagesByChatIdAfterTimestampSchema, DeleteOccupationSchema, DeleteRecordSchema, DeleteScopeSchema, DeleteSkillSchema, DeleteTaskTemplateSchema, DeleteTeamSchema, DeleteTopicSchema, DeleteWikiCommentSchema, DeleteWikiPageSchema, DeleteWikiReferenceSchema, DeleteWorkerNotebookNoteSchema, DeleteWorkerNotebookSchema, DeleteWorkerNotebookSourceSchema, DeleteWorkerNotebookStudioOutputSchema, DeleteWorkerSchema, DeleteWorkerTopicSchema, DistinctFieldValuesSchema, DuplicateAgentFlowSchema, DuplicateRecordSchema, EnhanceTopicSchema, EnsureAirtableImportCredentialSchema, EnsureDriveProviderCredentialSchema, EnsureGmailImportCredentialSchema, EnsureGithubImportCredentialSchema, EnsureJiraImportCredentialSchema, EnsureLinearImportCredentialSchema, EnsureNotionImportCredentialSchema, EnsureTrelloImportCredentialSchema, ExecuteCollectionAiFieldSchema, ExecuteCollectionButtonSchema, ExportDataModelSchema, GetChatByIdSchema, GetChatsByUserIdSchema, GetCollectionByIdSchema, GetCollectionSchemaSchema, GetDataModelByIdSchema, GetDocumentByIdSchema, GetDocumentsByIdSchema, GetDriveDeleteImpactSchema, GetDriveRootDeleteImpactSchema, GetLatestWikiRevisionSchema, GetMarketStoreItemSchema, GetMessageByIdSchema, GetMessageCountByUserIdSchema, GetMessagesByChatIdSchema, GetPrivateAgentFlowFolderSchema, GetRecordByIdSchema, GetRecordRelationsSchema, GetScopeByTypeSchema, GetStreamIdsByChatIdSchema, GetSuggestionsByDocumentIdSchema, GetVotesByChatIdSchema, GetWikiAiSettingsSchema, GetWikiPageByIdSchema, GetWikiPageBySlugSchema, GetWikiReferenceByIdSchema, GetWikiRevisionByIdSchema, GetWikiTreeSchema, GetWorkerNotebookSchema, GrantRecordPermissionSchema, GroupRecordsSchema, HardDeleteDataModelSchema, ListAgentFlowFoldersSchema, ListAgentFlowsSchema, ListAirtableImportSourcesSchema, ListAssistantChannelsSchema, ListAssistantConstraintsSchema, ListAssistantDatasourcesSchema, ListAssistantInstructionsSchema, ListAssistantSkillsSchema, ListAssistantsSchema, ListChannelsSchema, ListChatHistorySchema, ListCollectionAutomationRulesSchema, ListCollectionButtonsSchema, ListCollectionRelationsSchema, ListCollectionsSchema, ListCollectionViewsSchema, ListCommandsSchema, ListCompetenciesSchema, ListConstraintsSchema, ListDataModelsSchema, ListDatasourcesSchema, ListDomainTopicsSchema, ListDriveItemsSchema, ListDriveProviderFoldersSchema, ListDriveRootItemsSchema, ListDriveRootsSchema, ListDriveRootTreeSchema, ListDriveTreeSchema, ListEmploidsPaginatedSchema, ListEmploidsSchema, ListExtensionsSchema, ListGmailImportSourcesSchema, ListGoogleMeetCalendarsSchema, ListGithubImportSourcesSchema, ListInputSchema, ListInstructionsSchema, ListJiraImportSourcesSchema, ListJobDefinitionSchema, ListKnowledgesSchema, ListLinearImportSourcesSchema, ListMarketStoreItemsSchema, ListNotionImportSourcesSchema, ListOccupationsSchema, ListRecordPermissionsSchema, ListRecordsSchema, ListRelationCandidatesSchema, ListScopesSchema, ListSkillsSchema, ListTaskTemplatesSchema, ListTeamsSchema, ListTopicsSchema, ListTrelloImportSourcesSchema, ListWikiAiCommandsSchema, ListWikiCommentsSchema, ListWikiPagesSchema, ListWikiReferencesSchema, ListWorkerNotebooksSchema, ListWorkersSchema, ListWorkerTopicsSchema, MoveDriveItemSchema, MoveDriveRootItemSchema, MoveWikiPageSchema, PrepareDriveUploadSchema, PreviewAirtableImportSchema, PreviewCsvImportSchema, PreviewGmailImportSchema, PreviewGithubImportSchema, PreviewJiraImportSchema, PreviewLinearImportSchema, PreviewNotionImportSchema, PreviewTrelloImportSchema, PreviewValidationErrorsSchema, PublishDomainSchema, PublishEmploidSchema, PublishWorkerToMarketStoreSchema, PurgeCollectionSchema, QueryRecordsSchema, ReadDriveRootFileContentSchema, ReadDriveRootFileTextSchema, RenameDriveItemSchema, RenameDriveRootItemSchema, ReorderCollectionFieldsSchema, ResolveDriveDownloadSchema, ResolveDriveRootDownloadSchema, ResolveScopeFileViewSchema, ResolveWikiFileViewSchema, RestoreDataModelSchema, RestoreRecordSchema, RestoreWikiPageSchema, RevokeRecordPermissionSchema, RunAirtableImportSchema, RunCsvImportSchema, RunGmailImportSchema, RunGithubImportSchema, RunJiraImportSchema, RunLinearImportSchema, RunNotionImportSchema, RunTrelloImportSchema, RunWikiAiCommandSchema, SaveChatSchema, SaveDocumentSchema, SaveMessagesSchema, SaveSuggestionsSchema, SearchDriveItemsSchema, SearchDriveRootItemsSchema, SearchRecordsSchema, SendWorkerNotebookMessageSchema, SetWikiAiSettingsSchema, SetWikiPageUserStateSchema, TestGoogleMeetCredentialSchema, UpdateAgentFlowFolderSchema, UpdateAgentFlowSchema, UpdateAssistantChannelSchema, UpdateAssistantDatasourceSchema, UpdateAssistantSchema, UpdateAssistantSkillSchema, UpdateChannelSchema, UpdateChatLastContextByIdSchema, UpdateChatVisiblityByIdSchema, UpdateCollectionAutomationRuleSchema, UpdateCollectionButtonSchema, UpdateCollectionFieldSchema, UpdateCollectionRelationSchema, UpdateCollectionSchema, UpdateCollectionViewSchema, UpdateCommandSchema, UpdateCompetencySchema, UpdateConstraintSchema, UpdateDataModelSchema, UpdateDatasourceSchema, UpdateDomainTopicSchema, UpdateEmploidSchema, UpdateExtensionSchema, UpdateInputSchema, UpdateInstructionSchema, UpdateJobDefinitionSchema, UpdateKnowledgeSchema, UpdateOccupationSchema, UpdateRecordSchema, UpdateScopeSchema, UpdateSkillSchema, UpdateTaskTemplateSchema, UpdateTeamSchema, UpdateTopicSchema, UpdateWikiCommentSchema, UpdateWikiPageSchema, UpdateWikiReferenceSchema, UpdateWorkerNotebookSchema, UpdateWorkerNotebookSourceSchema, UpdateWorkerNotebookStudioOutputSchema, UpdateWorkerSchema, UpdateWorkerTopicSchema, UploadCollectionFileSchema, UploadDriveRootFilesSchema, UploadEditorFileSchema, UpsertRecordSchema, ValidateRecordSchema, VoteMessageSchema } from "./schema"; import { GetGoogleMeetBrowserBotAvailabilitySchema, ListGoogleMeetEmailApprovalsSchema, ResolveCollectionFileViewSchema, ResolveGoogleMeetEmailApprovalSchema } from "./schema"; import { TAgentFlow, TAgentFlowFolder, TAssistant, TAssistantChannel, TAssistantConstraint, TAssistantDatasource, TAssistantInstruction, TAssistantSkill, TChannel, TChat, TCollectionAutomationRule, TCollectionButton, TCollectionRelation, TCollectionView, TCommand, TCompetency, TConstraint, TDatasource, TDeleteAgentFlowResult, TDocument, TDomainTopic, TDriveDeleteImpact, TDriveFileContent, TDriveFileTextContent, TDriveItem, TDriveProviderFolder, TDriveRoot, TDriveRootProvider, TDriveTreeNode, TEmploid, TEnhanceTopic, TExtension, TGoogleMeetCalendarSources, TGoogleMeetCredentialTest, TInput, TInstruction, TJobDefinition, TKnowledge, TMarketStoreItem, TOccupation, TPaginatedEmploidsResult, TPreparedDriveUpload, TPublishEmploid, TPublishWorkerToMarketStore, TRelationRecordOption, TScope, TSkill, TStreamId, TTaskTemplate, TTeam, TTopic, TUploadedFile, TWikiAiCommand, TWikiAiRunResult, TWikiAiSetting, TWikiComment, TWikiCommentPagination, TWikiFileViewResolution, TWikiReference, TWikiReferenceListResponse, TWorker, TWorkerNotebook, TWorkerNotebookClearMessagesResult, TWorkerNotebookContextResult, TWorkerNotebookMessage, TWorkerNotebookNote, TWorkerNotebookSendMessageResult, TWorkerNotebookSource, TWorkerNotebookSourceDiscoveryResult, TWorkerNotebookStudioOutput, TWorkerTopic } from "./types"; import type { TGoogleMeetBrowserBotAvailability, TGoogleMeetEmailApproval, TKnowledgeTreeExportPayload, TKnowledgeTreeImportResult } from "./types"; import { ListWorkerWhatsAppMessagesSchema, SendWorkerWhatsAppMessageSchema, TestWorkerWhatsAppChannelSchema } from "./schema"; import type { TWorkerChannelMessage, TWorkerWhatsAppHealth, TWorkerWhatsAppMessageHistory } from "./types"; import { ListSlackConversationsSchema, ListWorkerSlackMessagesSchema, SendWorkerSlackMessageSchema, TestWorkerSlackChannelSchema } from './schema' import type { TSlackConversationList, TWorkerSlackHealth, TWorkerSlackMessageHistory } from './types' import { ListDiscordGuildChannelsSchema, ListDiscordGuildsSchema, ListWorkerDiscordMessagesSchema, SendWorkerDiscordMessageSchema, TestWorkerDiscordChannelSchema } from './schema' import type { TDiscordGuildChannelList, TDiscordGuildList, TWorkerDiscordHealth, TWorkerDiscordMessageHistory } from './types' import { ImportDataModelSchema } from "./schema"; import { ApplyCollectionAppGenerationSchema, GetCollectionAppGenerationPlanSchema, GetCollectionAppGenerationRunSchema, ListCollectionAppGenerationPlansSchema, ListCollectionAppGenerationRunsSchema, PreviewCollectionAppGenerationSchema, RollbackCollectionAppGenerationSchema, ResumeCollectionAppGenerationRunSchema, } from "./schema"; import type { TCollectionAppGenerationPlan, TCollectionAppGenerationPlanPage, TCollectionAppGenerationRun, TCollectionAppGenerationRunPage, } from "./types"; import { CreateWikiSpaceSchema, DeleteWikiSpaceSchema, GetPrivateWikiSpaceSchema, ListWikiSpacesSchema, UpdateWikiSpaceSchema, } from "./schema"; import type { TWikiSpace } from "./types"; import { CreateWorkerBackgroundJobSchema, ClearWorkerBackgroundJobExecutionsSchema, ListWorkerBackgroundJobExecutionsSchema, ListWorkerBackgroundJobsSchema, UpdateWorkerBackgroundJobSchema, } from "./schema"; import type { TWorkerBackgroundJob, TWorkerBackgroundJobExecutionPage, TClearWorkerBackgroundJobExecutionsResult, } from "./types"; import type { TBulkUpdateRecordsResult, TCollection, TCollectionRecordPage, TGrantRecordPermissionResult, TRecordPermissionListResult, TReorderCollectionFieldsResult, TRevokeRecordPermissionResult, } from "./types"; import { DeleteCollectionViewPreferenceSchema, UpsertCollectionViewPreferenceSchema, } from "./schema"; import type { TCollectionViewPreferenceResult } from "./types"; import { DeleteCollectionAccessPolicySchema, ListCollectionAccessTeamMembersSchema, ListCollectionAccessPoliciesSchema, PreviewCollectionAccessPolicySchema, SetCollectionAccessTeamMembersSchema, UpsertCollectionAccessPolicySchema, } from "./schema"; import type { TCollectionAccessPolicy, TCollectionAccessPolicyPreview, TCollectionAccessTeamMember, TSetCollectionAccessTeamMembersResult, } from "./types"; import { DeleteCollectionFormSchema, ListCollectionFormsSchema, PublishCollectionFormSchema, ResolveCollectionFormSchema, RevokeCollectionFormSchema, SubmitCollectionFormSchema, UpsertCollectionFormSchema, } from "./schema"; import type { TCollectionForm, TCollectionFormPublishResult, TCollectionFormSubmissionResult, TResolvedInternalCollectionForm, } from "./types"; import { DeleteCollectionDashboardSchema, DeleteCollectionReportSchema, EvaluateCollectionDashboardSchema, EvaluateCollectionReportSchema, ListCollectionDashboardsSchema, ListCollectionReportsSchema, UpsertCollectionDashboardSchema, UpsertCollectionReportSchema, } from "./schema"; import type { TCollectionDashboard, TCollectionDashboardEvaluation, TCollectionDashboardPage, TCollectionReport, TCollectionReportEvaluation, TCollectionReportPage, } from "./types"; import { CreateCollectionCommentSchema, DeleteCollectionCommentSchema, ListCollectionCommentsSchema, ListCollectionNotificationsSchema, ListCollectionRecordActivitySchema, ListCollectionRecordCollaboratorsSchema, MarkCollectionNotificationsReadSchema, SetCollectionRecordCollaboratorsSchema, UpdateCollectionCommentSchema, } from "./schema"; import type { TCollectionComment, TCollectionCommentPage, TCollectionNotificationPage, TCollectionRecordActivityPage, TCollectionRecordCollaborators, } from "./types"; export class EmploidService extends ServiceClient { protected getServiceName(): string { return 'com.appconda.service.emploid'; } private isHttpUrl(value: string): boolean { return /^https?:\/\//i.test(value); } private normalizeStoragePath(pathLike: string): string { const normalized = String(pathLike || "").trim(); if (!normalized) { return ""; } if (this.isHttpUrl(normalized)) { return normalized; } return normalized.startsWith("/") ? normalized : `/${normalized}`; } private resolveEnvEndpoint(): string { const envCandidates = [ typeof process !== "undefined" ? process?.env?.APPCONDA_ENDPOINT : "", typeof process !== "undefined" ? process?.env?.NEXT_PUBLIC_APPCONDA_ENDPOINT : "", typeof process !== "undefined" ? process?.env?._APP_APPCONDA_ENDPOINT : "", ]; for (const candidate of envCandidates) { const normalized = String(candidate || "").trim().replace(/\/+$/, ""); if (this.isHttpUrl(normalized)) { return normalized; } } return ""; } private resolveStorageViewUrl(storagePath: string): string { const normalizedPath = this.normalizeStoragePath(storagePath); if (!normalizedPath) { return ""; } if (this.isHttpUrl(normalizedPath)) { return normalizedPath; } const endpoint = String(this.client.config.endpoint || "").trim().replace(/\/+$/, ""); if (this.isHttpUrl(endpoint)) { return `${endpoint}${normalizedPath}`; } if (typeof window !== "undefined") { const protocol = window?.location?.protocol || ""; if (protocol && protocol !== "file:") { const origin = String(window?.location?.origin || "").replace(/\/+$/, ""); if (origin) { const normalizedEndpoint = endpoint ? (endpoint.startsWith("/") ? endpoint : `/${endpoint}`) : ""; return `${origin}${normalizedEndpoint}${normalizedPath}`; } } } const envEndpoint = this.resolveEnvEndpoint(); if (envEndpoint) { return `${envEndpoint}${normalizedPath}`; } return normalizedPath; } public async CreateEmploid(payload: z.infer): Promise { return await this.actionCall('emploid', 'CreateEmploid', payload); } public async UpdateEmploid(payload: z.infer): Promise { return await this.actionCall('emploid', 'UpdateEmploid', payload); } public async DeleteEmploid(payload: z.infer): Promise { return await this.actionCall('emploid', 'DeleteEmploid', payload); } public async PublishEmploid(payload: z.infer): Promise { return await this.actionCall('emploid', 'PublishEmploid', payload); } public async ListEmploids(payload: z.infer): Promise { return await this.actionCall('emploid', 'ListEmploids', payload); } public async ListEmploidsPaginated(payload: z.infer): Promise { return await this.actionCall('emploid', 'ListEmploidsPaginated', payload); } public async CreateInstruction(payload: z.infer): Promise { return await this.actionCall('emploid', 'CreateInstruction', payload); } public async ListInstructions(payload: z.infer): Promise { return await this.actionCall('emploid', 'ListInstructions', payload); } public async UpdateInstruction(payload: z.infer): Promise { return await this.actionCall('emploid', 'UpdateInstruction', payload); } public async DeleteInstruction(payload: z.infer): Promise { return await this.actionCall('emploid', 'DeleteInstruction', payload); } public async CreateConstraint(payload: z.infer): Promise { return await this.actionCall('emploid', 'CreateConstraint', payload); } public async ListConstraints(payload: z.infer): Promise { return await this.actionCall('emploid', 'ListConstraints', payload); } public async UpdateConstraint(payload: z.infer): Promise { return await this.actionCall('emploid', 'UpdateConstraint', payload); } public async DeleteConstraint(payload: z.infer): Promise { return await this.actionCall('emploid', 'DeleteConstraint', payload); } public async ListScopes(payload: z.infer): Promise { return await this.actionCall('emploid', 'ListScopes', payload); } public async GetScopeByType(payload: z.infer): Promise { return await this.actionCall('emploid', 'GetScopeByType', payload); } public async CreateScope(payload: z.infer): Promise { return await this.actionCall('emploid', 'CreateScope', payload); } public async CreateWorkerBackgroundJob(payload: z.infer): Promise { return await this.actionCall('emploid', 'CreateWorkerBackgroundJob', payload); } public async ListWorkerBackgroundJobs(payload: z.infer): Promise { return await this.actionCall('emploid', 'ListWorkerBackgroundJobs', payload); } public async UpdateWorkerBackgroundJob(payload: z.infer): Promise { return await this.actionCall('emploid', 'UpdateWorkerBackgroundJob', payload); } public async ListWorkerBackgroundJobExecutions(payload: z.infer): Promise { return await this.actionCall('emploid', 'ListWorkerBackgroundJobExecutions', payload); } public async ClearWorkerBackgroundJobExecutions(payload: z.infer): Promise { return await this.actionCall('emploid', 'ClearWorkerBackgroundJobExecutions', payload); } public async UpdateScope(payload: z.infer): Promise { return await this.actionCall('emploid', 'UpdateScope', payload); } public async DeleteScope(payload: z.infer): Promise { return await this.actionCall('emploid', 'DeleteScope', payload); } public async ExportKnowledgeTree(payload: { tenantId: string; workerId: string }): Promise { return await this.actionCall('emploid', 'ExportKnowledgeTree', payload); } public async ImportKnowledgeTree(payload: { tenantId: string; workerId: string; importData: unknown }): Promise { return await this.actionCall('emploid', 'ImportKnowledgeTree', payload); } public async UploadScopeFile( payload: z.infer ): Promise { const result = await this.actionCall("scope", "UploadFile", payload); const storagePath = this.normalizeStoragePath(String(result?.path || result?.filePath || result?.url || "")); const resolvedUrl = this.resolveStorageViewUrl(storagePath); return { ...result, fileId: String(result?.fileId || result?.id || payload.attachmentId || ""), path: storagePath, filePath: resolvedUrl || storagePath, url: resolvedUrl || storagePath, }; } public async ResolveScopeFileView( payload: z.infer ): Promise { const result = await this.actionCall("scope", "ResolveScopeFileView", payload); const storagePath = this.normalizeStoragePath(String(result?.path || result?.filePath || result?.url || "")); const resolvedUrl = this.resolveStorageViewUrl(storagePath); return { ...result, fileId: String(result?.fileId || payload.fileId || ""), path: storagePath, filePath: resolvedUrl || storagePath, url: resolvedUrl || storagePath, }; } public async CreateOccupation(payload: z.infer): Promise { return await this.actionCall('occupation', 'CreateOccupation', payload); } public async UpdateOccupation(payload: z.infer): Promise { return await this.actionCall('occupation', 'UpdateOccupation', payload); } public async DeleteOccupation(payload: z.infer): Promise { return await this.actionCall('occupation', 'DeleteOccupation', payload); } public async ListOccupations(payload: z.infer): Promise { return await this.actionCall('occupation', 'ListOccupations', payload); } public async PublishDomain(payload: z.infer): Promise { return await this.actionCall('occupation', 'PublishDomain', payload); } public async CreateDomainTopic(payload: z.infer): Promise { return await this.actionCall('occupation', 'CreateDomainTopic', payload); } public async UpdateDomainTopic(payload: z.infer): Promise { return await this.actionCall('occupation', 'UpdateDomainTopic', payload); } public async DeleteDomainTopic(payload: z.infer): Promise { return await this.actionCall('occupation', 'DeleteDomainTopic', payload); } public async ListDomainTopics(payload: z.infer): Promise { return await this.actionCall('occupation', 'ListDomainTopics', payload); } public async CreateJobDefinition(payload: z.infer): Promise { return await this.actionCall('emploid', 'CreateJobDefinition', payload); } public async UpdateJobDefinition(payload: z.infer): Promise { return await this.actionCall('emploid', 'UpdateJobDefinition', payload); } public async DeleteJobDefinition(payload: z.infer): Promise { return await this.actionCall('emploid', 'DeleteJobDefinition', payload); } public async ListJobDefinitions(payload: z.infer): Promise { return await this.actionCall('emploid', 'ListJobDefinitions', payload); } public async CreateCompetency(payload: z.infer): Promise { return await this.actionCall('emploid', 'CreateCompetency', payload); } public async UpdateCompetency(payload: z.infer): Promise { return await this.actionCall('emploid', 'UpdateCompetency', payload); } public async DeleteCompetency(payload: z.infer): Promise { return await this.actionCall('emploid', 'DeleteCompetency', payload); } public async ListCompetencies(payload: z.infer): Promise { return await this.actionCall('emploid', 'ListCompetencies', payload); } public async CreateTaskTemplate(payload: z.infer): Promise { return await this.actionCall('emploid', 'CreateTaskTemplate', payload); } public async UpdateTaskTemplate(payload: z.infer): Promise { return await this.actionCall('emploid', 'UpdateTaskTemplate', payload); } public async DeleteTaskTemplate(payload: z.infer): Promise { return await this.actionCall('emploid', 'DeleteTaskTemplate', payload); } public async ListTaskTemplates(payload: z.infer): Promise { return await this.actionCall('emploid', 'ListTaskTemplates', payload); } public async CreateAgentFlow(payload: z.infer): Promise { return await this.actionCall('agent-flow', 'CreateAgentFlow', payload); } public async DeleteAgentFlow(payload: z.infer): Promise { return await this.actionCall('agent-flow', 'DeleteAgentFlow', payload); } public async DuplicateAgentFlow(payload: z.infer): Promise { return await this.actionCall('agent-flow', 'DuplicateAgentFlow', payload); } public async ChangeAgentflowProject(payload: z.infer): Promise { return await this.actionCall('agent-flow', 'ChangeAgentflowProject', payload); } public async UpdateAgentFlow(payload: z.infer): Promise { return await this.actionCall('agent-flow', 'UpdateAgentFlow', payload); } public async ListAgentFlows(payload: z.infer): Promise { return await this.actionCall('agent-flow', 'ListAgentFlows', payload); } public async CreateDataModelAgentFlow(payload: z.infer): Promise { return await this.actionCall('agent-flow', 'CreateDataModelAgentFlow', payload); } public async ListDataModelAgentFlows(payload: z.infer): Promise { return await this.actionCall('agent-flow', 'ListDataModelAgentFlows', payload); } public async UpdateDataModelAgentFlow(payload: z.infer): Promise { return await this.actionCall('agent-flow', 'UpdateDataModelAgentFlow', payload); } public async DeleteDataModelAgentFlow(payload: z.infer): Promise { return await this.actionCall('agent-flow', 'DeleteDataModelAgentFlow', payload); } public async CreateAgentFlowFolder(payload: z.infer): Promise { return await this.actionCall('agent-flow', 'CreateAgentFlowFolder', payload); } public async UpdateAgentFlowFolder(payload: z.infer): Promise { return await this.actionCall('agent-flow', 'UpdateAgentFlowFolder', payload); } public async DeleteAgentFlowFolder(payload: z.infer): Promise { return await this.actionCall('agent-flow', 'DeleteAgentFlowFolder', payload); } public async ListAgentFlowFolders(payload: z.infer): Promise { return await this.actionCall('agent-flow', 'ListAgentFlowFolders', payload); } public async GetPrivateAgentFlowFolder(payload: z.infer): Promise { return await this.actionCall('agent-flow', 'GetPrivateAgentFlowFolder', payload); } public async CreateWorkforceFlow(payload: { tenantId: string; name: string; description?: string | null }) { return await this.actionCall('workforce-flow', 'CreateWorkforceFlow', payload); } public async UpdateWorkforceFlow(payload: { id: string; name?: string | null; description?: string | null; flowData?: unknown }) { return await this.actionCall('workforce-flow', 'UpdateWorkforceFlow', payload); } public async DeleteWorkforceFlow(payload: { id: string }) { return await this.actionCall('workforce-flow', 'DeleteWorkforceFlow', payload); } public async ListWorkforceFlows(payload: { tenantId: string }) { return await this.actionCall('workforce-flow', 'ListWorkforceFlows', payload); } public async ExecuteWorkforceFlow(payload: { id: string; input?: unknown; flowData?: unknown }) { return await this.actionCall('workforce-flow', 'ExecuteWorkforceFlow', payload); } public async ListWorkforceAvailableTools(payload?: Record) { return await this.actionCall('workforce-flow', 'ListWorkforceAvailableTools', payload ?? {}); } public async ListWorkforceKnowledgeSources(payload: { tenantId: string }) { return await this.actionCall('workforce-flow', 'ListWorkforceKnowledgeSources', payload); } public async ListDriveItems( payload: z.infer ): Promise<{ currentFolder: TDriveItem; items: TDriveItem[] }> { return await this.actionCall("drive", "ListDriveItems", payload); } public async ListDriveTree( payload: z.infer ): Promise { return await this.actionCall("drive", "ListDriveTree", payload); } public async SearchDriveItems( payload: z.infer ): Promise { return await this.actionCall("drive", "SearchDriveItems", payload); } public async CreateDriveFolder( payload: z.infer ): Promise { return await this.actionCall("drive", "CreateDriveFolder", payload); } public async PrepareDriveUpload( payload: z.infer ): Promise { return await this.actionCall("drive", "PrepareDriveUpload", payload); } public async RenameDriveItem( payload: z.infer ): Promise { return await this.actionCall("drive", "RenameDriveItem", payload); } public async MoveDriveItem( payload: z.infer ): Promise { return await this.actionCall("drive", "MoveDriveItem", payload); } public async GetDriveDeleteImpact( payload: z.infer ): Promise { return await this.actionCall("drive", "GetDriveDeleteImpact", payload); } public async DeleteDriveItem( payload: z.infer ): Promise<{ id: string; deleted: boolean; totalItems: number }> { return await this.actionCall("drive", "DeleteDriveItem", payload); } public async ResolveDriveDownload( payload: z.infer ): Promise { const result = await this.actionCall("drive", "ResolveDriveDownload", payload); const storagePath = this.normalizeStoragePath(String(result?.path || result?.filePath || result?.url || "")); const resolvedUrl = this.resolveStorageViewUrl(storagePath); return { ...result, fileId: String(result?.itemId || payload.itemId || ""), path: storagePath, filePath: resolvedUrl || storagePath, url: resolvedUrl || storagePath, }; } public async ListDriveRoots( payload: z.infer ): Promise { return await this.actionCall("drive", "ListDriveRoots", payload); } public async EnsureDriveProviderCredential( payload: z.infer ): Promise<{ credentialId: string; connected: boolean; provider: TDriveRootProvider }> { return await this.actionCall("drive", "EnsureDriveProviderCredential", payload); } public async ListDriveProviderFolders( payload: z.infer ): Promise<{ credentialId: string; connected: boolean; currentFolder: TDriveProviderFolder; folders: TDriveProviderFolder[]; }> { return await this.actionCall("drive", "ListDriveProviderFolders", payload); } public async CreateDriveRoot( payload: z.infer ): Promise { return await this.actionCall("drive", "CreateDriveRoot", payload); } public async DeleteDriveRoot( payload: z.infer ): Promise<{ id: string; deleted: boolean }> { return await this.actionCall("drive", "DeleteDriveRoot", payload); } public async ListDriveRootItems( payload: z.infer ): Promise<{ currentFolder: TDriveItem; items: TDriveItem[] }> { return await this.actionCall("drive", "ListDriveRootItems", payload); } public async ListDriveRootTree( payload: z.infer ): Promise { return await this.actionCall("drive", "ListDriveRootTree", payload); } public async SearchDriveRootItems( payload: z.infer ): Promise { return await this.actionCall("drive", "SearchDriveRootItems", payload); } public async CreateDriveRootFolder( payload: z.infer ): Promise { return await this.actionCall("drive", "CreateDriveRootFolder", payload); } public async UploadDriveRootFiles( payload: z.infer ): Promise { return await this.actionCall("drive", "UploadDriveRootFiles", payload); } public async RenameDriveRootItem( payload: z.infer ): Promise { return await this.actionCall("drive", "RenameDriveRootItem", payload); } public async MoveDriveRootItem( payload: z.infer ): Promise { return await this.actionCall("drive", "MoveDriveRootItem", payload); } public async GetDriveRootDeleteImpact( payload: z.infer ): Promise { return await this.actionCall("drive", "GetDriveRootDeleteImpact", payload); } public async DeleteDriveRootItem( payload: z.infer ): Promise<{ id: string; deleted: boolean; totalItems: number }> { return await this.actionCall("drive", "DeleteDriveRootItem", payload); } public async ReadDriveRootFileContent( payload: z.infer ): Promise { return await this.actionCall("drive", "ReadDriveRootFileContent", payload); } public async ReadDriveRootFileText( payload: z.infer ): Promise { return await this.actionCall("drive", "ReadDriveRootFileText", payload); } public async ResolveDriveRootDownload( payload: z.infer ): Promise { const result = await this.actionCall("drive", "ResolveDriveRootDownload", payload); const rawUrl = String(result?.url || ""); const normalizedUrl = rawUrl.startsWith("data:") ? rawUrl : this.normalizeStoragePath(rawUrl); const resolvedUrl = rawUrl.startsWith("data:") ? rawUrl : (this.resolveStorageViewUrl(normalizedUrl) || normalizedUrl); return { ...result, fileId: String(result?.itemId || payload.itemId || ""), path: normalizedUrl, filePath: resolvedUrl || normalizedUrl, url: resolvedUrl || normalizedUrl, }; } public async CreateExtension(payload: z.infer): Promise { return await this.actionCall('extension', 'CreateExtension', payload); } public async UpdateExtension(payload: z.infer): Promise { return await this.actionCall('extension', 'UpdateExtension', payload); } public async DeleteExtension(payload: z.infer): Promise { return await this.actionCall('extension', 'DeleteExtension', payload); } public async ListExtensions(payload: z.infer): Promise { return await this.actionCall('extension', 'ListExtensions', payload); } // -----------------Assistant----------------- public async CreateAssistant(payload: z.infer): Promise { return await this.actionCall('assistant', 'CreateAssistant', payload); } public async UpdateAssistant(payload: z.infer): Promise { return await this.actionCall('assistant', 'UpdateAssistant', payload); } public async DeleteAssistant(payload: z.infer): Promise { return await this.actionCall('assistant', 'DeleteAssistant', payload); } public async ListAssistants(payload: z.infer): Promise { return await this.actionCall('assistant', 'ListAssistants', payload); } public async CreateAssistantInstruction(payload: z.infer): Promise { return await this.actionCall('assistant', 'CreateAssistantInstruction', payload); } public async ListAssistantInstructions(payload: z.infer): Promise { return await this.actionCall('assistant', 'ListAssistantInstructions', payload); } public async CreateAssistantConstraint(payload: z.infer): Promise { return await this.actionCall('assistant', 'CreateAssistantConstraint', payload); } public async ListAssistantConstraints(payload: z.infer): Promise { return await this.actionCall('assistant', 'ListAssistantConstraints', payload); } public async CreateAssistantDatasource(payload: z.infer): Promise { return await this.actionCall('assistant', 'CreateAssistantDatasource', payload); } public async UpdateAssistantDatasource(payload: z.infer): Promise { return await this.actionCall('assistant', 'UpdateAssistantDatasource', payload); } public async DeleteAssistantDatasource(payload: z.infer): Promise { return await this.actionCall('assistant', 'DeleteAssistantDatasource', payload); } public async ListAssistantDatasources(payload: z.infer): Promise { return await this.actionCall('assistant', 'ListAssistantDatasources', payload); } public async CreateAssistantSkill(payload: z.infer): Promise { return await this.actionCall('assistant', 'CreateAssistantSkill', payload); } public async UpdateAssistantSkill(payload: z.infer): Promise { return await this.actionCall('assistant', 'UpdateAssistantSkill', payload); } //@ts-ignore public async DeleteAssistantSkill(payload: z.infer): Promise { return await this.actionCall('assistant', 'DeleteAssistantSkill', payload); } public async ListAssistantSkills(payload: z.infer): Promise { return await this.actionCall('assistant', 'ListAssistantSkills', payload); } public async CreateAssistantChannel(payload: z.infer): Promise { return await this.actionCall('assistant', 'CreateAssistantChannel', payload); } public async UpdateAssistantChannel(payload: z.infer): Promise { return await this.actionCall('assistant', 'UpdateAssistantChannel', payload); } public async DeleteAssistantChannel(payload: z.infer): Promise { return await this.actionCall('assistant', 'DeleteAssistantChannel', payload); } public async ListAssistantChannels(payload: z.infer): Promise { return await this.actionCall('assistant', 'ListAssistantChannels', payload); } //--------------------------------------- //-----------------Datasources-------------- public async CreateDatasource(payload: z.infer): Promise { return await this.actionCall('data-source', 'CreateDatasource', payload); } public async UpdateDatasource(payload: z.infer): Promise { return await this.actionCall('data-source', 'UpdateDatasource', payload); } public async DeleteDatasource(payload: z.infer): Promise { return await this.actionCall('data-ource', 'DeleteDatasource', payload); } public async ListDatasources(payload: z.infer): Promise { return await this.actionCall('data-source', 'ListDatasources', payload); } //----------------------------------------- //-----------------------Skills---------------- public async CreateSkill(payload: z.infer): Promise { return await this.actionCall('skill', 'CreateSkill', payload); } public async ListSkills(payload: z.infer): Promise { return await this.actionCall('skill', 'ListSkills', payload); } public async UpdateSkill(payload: z.infer): Promise { return await this.actionCall('skill', 'UpdateSkill', payload); } public async DeleteSkill(payload: z.infer): Promise { return await this.actionCall('skill', 'DeleteSkill', payload); } //-------------------------------------------- //-----------------------Channels---------------- public async CreateChannel(payload: z.infer): Promise { return await this.actionCall('channel', 'CreateChannel', payload); } public async ListChannels(payload: z.infer): Promise { return await this.actionCall('channel', 'ListChannels', payload); } public async UpdateChannel(payload: z.infer): Promise { return await this.actionCall('channel', 'UpdateChannel', payload); } public async DeleteChannel(payload: z.infer): Promise { return await this.actionCall('channel', 'DeleteChannel', payload); } public async SendWorkerWhatsAppMessage(payload: z.infer): Promise { return await this.actionCall('channel', 'SendWorkerWhatsAppMessage', payload); } public async TestWorkerWhatsAppChannel(payload: z.infer): Promise<{ health?: TWorkerWhatsAppHealth; [key: string]: unknown }> { return await this.actionCall('channel', 'TestWorkerWhatsAppChannel', payload); } public async ListWorkerWhatsAppMessages(payload: z.infer): Promise { return await this.actionCall('channel', 'ListWorkerWhatsAppMessages', payload); } public async SendWorkerSlackMessage(payload: z.infer): Promise { return await this.actionCall('channel', 'SendWorkerSlackMessage', payload); } public async TestWorkerSlackChannel(payload: z.infer): Promise<{ health?: TWorkerSlackHealth; [key: string]: unknown }> { return await this.actionCall('channel', 'TestWorkerSlackChannel', payload); } public async ListSlackConversations(payload: z.infer): Promise { return await this.actionCall('channel', 'ListSlackConversations', payload); } public async ListWorkerSlackMessages(payload: z.infer): Promise { return await this.actionCall('channel', 'ListWorkerSlackMessages', payload); } public async SendWorkerDiscordMessage(payload: z.infer): Promise { return await this.actionCall('channel', 'SendWorkerDiscordMessage', payload); } public async TestWorkerDiscordChannel(payload: z.infer): Promise<{ health?: TWorkerDiscordHealth; [key: string]: unknown }> { return await this.actionCall('channel', 'TestWorkerDiscordChannel', payload); } public async ListDiscordGuilds(payload: z.infer): Promise { return await this.actionCall('channel', 'ListDiscordGuilds', payload); } public async ListDiscordGuildChannels(payload: z.infer): Promise { return await this.actionCall('channel', 'ListDiscordGuildChannels', payload); } public async ListWorkerDiscordMessages(payload: z.infer): Promise { return await this.actionCall('channel', 'ListWorkerDiscordMessages', payload); } public async ListGoogleMeetCalendars(payload: z.infer): Promise { return await this.actionCall('channel', 'ListGoogleMeetCalendars', payload); } public async GetGoogleMeetBrowserBotAvailability(payload: z.infer): Promise { return await this.actionCall('channel', 'GetGoogleMeetBrowserBotAvailability', payload); } public async ListGoogleMeetEmailApprovals(payload: z.infer): Promise { return await this.actionCall('channel', 'ListGoogleMeetEmailApprovals', payload); } public async ResolveGoogleMeetEmailApproval(payload: z.infer): Promise { return await this.actionCall('channel', 'ResolveGoogleMeetEmailApproval', payload); } public async TestGoogleMeetCredential(payload: z.infer): Promise { return await this.actionCall('channel', 'TestGoogleMeetCredential', payload); } //-------------------------------------------- //-----------------------Knowledge---------------- public async CreateKnowledge(payload: z.infer): Promise { return await this.actionCall('knowledge', 'CreateKnowledge', payload); } public async ListKnowledges(payload: z.infer): Promise { return await this.actionCall('knowledge', 'ListKnowledges', payload); } public async UpdateKnowledge(payload: z.infer): Promise { return await this.actionCall('knowledge', 'UpdateKnowledge', payload); } public async DeleteKnowledge(payload: z.infer): Promise { return await this.actionCall('knowledge', 'DeleteKnowledge', payload); } //----------------WORKER---------------------------- public async CreateWorker(payload: z.infer): Promise { return await this.actionCall('worker', 'CreateWorker', payload); } public async UpdateWorker(payload: z.infer): Promise { return await this.actionCall('worker', 'UpdateWorker', payload); } public async DeleteWorker(payload: z.infer): Promise { return await this.actionCall('worker', 'DeleteWorker', payload); } public async PublishWorkerToMarketStore(payload: z.infer): Promise { return await this.actionCall('market-store', 'PublishWorkerToMarketStore', payload); } public async ListWorkers(payload: z.infer): Promise { return await this.actionCall('worker', 'ListWorkers', payload); } public async CreateWorkerTopic(payload: z.infer): Promise { return await this.actionCall('worker', 'CreateWorkerTopic', payload); } public async UpdateWorkerTopic(payload: z.infer): Promise { return await this.actionCall('worker', 'UpdateWorkerTopic', payload); } public async DeleteWorkerTopic(payload: z.infer): Promise { return await this.actionCall('worker', 'DeleteWorkerTopic', payload); } public async ListWorkerTopics(payload: z.infer): Promise { return await this.actionCall('worker', 'ListWorkerTopics', payload); } public async CreateWorkerNotebook(payload: z.infer): Promise { return await this.actionCall('worker-notebook', 'CreateWorkerNotebook', payload); } public async ListWorkerNotebooks(payload: z.infer): Promise { return await this.actionCall('worker-notebook', 'ListWorkerNotebooks', payload); } public async GetWorkerNotebook(payload: z.infer): Promise { return await this.actionCall('worker-notebook', 'GetWorkerNotebook', payload); } public async BuildWorkerNotebookContext(payload: z.infer): Promise { return await this.actionCall('worker-notebook', 'BuildWorkerNotebookContext', payload); } public async UpdateWorkerNotebook(payload: z.infer): Promise { return await this.actionCall('worker-notebook', 'UpdateWorkerNotebook', payload); } public async DeleteWorkerNotebook(payload: z.infer): Promise { return await this.actionCall('worker-notebook', 'DeleteWorkerNotebook', payload); } public async CreateWorkerNotebookSource(payload: z.infer): Promise { return await this.actionCall('worker-notebook', 'CreateWorkerNotebookSource', payload); } public async CreateWorkerNotebookFileSource(payload: z.infer): Promise { return await this.actionCall('worker-notebook', 'CreateWorkerNotebookFileSource', payload); } public async DiscoverWorkerNotebookSources(payload: z.infer): Promise { return await this.actionCall('worker-notebook', 'DiscoverWorkerNotebookSources', payload); } public async ImportWorkerNotebookSources(payload: z.infer): Promise { return await this.actionCall('worker-notebook', 'ImportWorkerNotebookSources', payload); } public async UpdateWorkerNotebookSource(payload: z.infer): Promise { return await this.actionCall('worker-notebook', 'UpdateWorkerNotebookSource', payload); } public async DeleteWorkerNotebookSource(payload: z.infer): Promise { return await this.actionCall('worker-notebook', 'DeleteWorkerNotebookSource', payload); } public async SendWorkerNotebookMessage(payload: z.infer): Promise { return await this.actionCall('worker-notebook', 'SendWorkerNotebookMessage', payload); } public async ClearWorkerNotebookMessages(payload: z.infer): Promise { return await this.actionCall('worker-notebook', 'ClearWorkerNotebookMessages', payload); } public async CreateWorkerNotebookNote(payload: z.infer): Promise { return await this.actionCall('worker-notebook', 'CreateWorkerNotebookNote', payload); } public async DeleteWorkerNotebookNote(payload: z.infer): Promise { return await this.actionCall('worker-notebook', 'DeleteWorkerNotebookNote', payload); } public async CreateWorkerNotebookStudioOutput(payload: z.infer): Promise { return await this.actionCall('worker-notebook', 'CreateWorkerNotebookStudioOutput', payload); } public async UpdateWorkerNotebookStudioOutput(payload: z.infer): Promise { return await this.actionCall('worker-notebook', 'UpdateWorkerNotebookStudioOutput', payload); } public async DeleteWorkerNotebookStudioOutput(payload: z.infer): Promise { return await this.actionCall('worker-notebook', 'DeleteWorkerNotebookStudioOutput', payload); } public async ListMarketStoreItems(payload: z.infer): Promise { return await this.actionCall('market-store', 'ListMarketStoreItems', payload); } public async GetMarketStoreItem(payload: z.infer): Promise { return await this.actionCall('market-store', 'GetMarketStoreItem', payload); } //-------------------------------------------- //--------------------Topics------------------- public async CreateTopic(payload: z.infer): Promise { return await this.actionCall('topic', 'CreateTopic', payload); } public async UpdateTopic(payload: z.infer): Promise { return await this.actionCall('topic', 'UpdateTopic', payload); } public async DeleteTopic(payload: z.infer): Promise { return await this.actionCall('topic', 'DeleteTopic', payload); } public async ListTopics(payload: z.infer): Promise { return await this.actionCall('topic', 'ListTopics', payload); } public async EnhanceTopic(payload: z.infer): Promise { return await this.actionCall('topic', 'EnhanceTopic', payload); } //--------------------------------------------- public async CreateInput(payload: z.infer): Promise { return await this.actionCall('input-output', 'CreateInput', payload); } public async UpdateInput(payload: z.infer): Promise { return await this.actionCall('input-output', 'UpdateInput', payload); } public async DeleteInput(payload: z.infer): Promise { return await this.actionCall('input-output', 'DeleteInput', payload); } public async ListInputs(payload: z.infer): Promise { return await this.actionCall('input-output', 'ListInputs', payload); } public async CreateTeam(payload: z.infer): Promise { return await this.actionCall('team', 'CreateTeam', payload); } public async ListTeams(payload: z.infer): Promise { return await this.actionCall('team', 'ListTeams', payload); } public async UpdateTeam(payload: z.infer): Promise { return await this.actionCall('team', 'UpdateTeam', payload); } public async DeleteTeam(payload: z.infer): Promise { return await this.actionCall('team', 'DeleteTeam', payload); } public async SaveChat(payload: z.infer): Promise { return await this.actionCall('chat', 'SaveChat', payload); } public async DeleteChatById(payload: z.infer): Promise { return await this.actionCall('chat', 'DeleteChatById', payload); } public async GetChatById(payload: z.infer): Promise { return await this.actionCall('chat', 'GetChatById', payload); } public async GetChatsByUserId(payload: z.infer): Promise { return await this.actionCall('chat', 'GetChatsByUserId', payload); } public async SaveMessages(payload: z.infer): Promise { return await this.actionCall('chat', 'SaveMessages', payload); } public async GetMessagesByChatId(payload: z.infer): Promise { return await this.actionCall('chat', 'GetMessagesByChatId', payload); } public async GetMessageById(payload: z.infer): Promise { return await this.actionCall('chat', 'GetMessageById', payload); } public async VoteMessage(payload: z.infer): Promise { return await this.actionCall('chat', 'VoteMessage', payload); } public async GetVotesByChatId(payload: z.infer): Promise { return await this.actionCall('chat', 'GetVotesByChatId', payload); } public async DeleteDocumentsByIdAfterTimestamp(payload: z.infer): Promise { return await this.actionCall('chat', 'DeleteDocumentsByIdAfterTimestamp', payload); } public async SaveSuggestions(payload: z.infer): Promise { return await this.actionCall('chat', 'SaveSuggestions', payload); } public async GetSuggestionsByDocumentId(payload: z.infer): Promise { return await this.actionCall('chat', 'GetSuggestionsByDocumentId', payload); } public async DeleteMessagesByChatIdAfterTimestamp(payload: z.infer): Promise { return await this.actionCall('chat', 'DeleteMessagesByChatIdAfterTimestamp', payload); } public async UpdateChatVisiblityById(payload: z.infer): Promise { return await this.actionCall('chat', 'UpdateChatVisiblityById', payload); } public async UpdateChatLastContextById(payload: z.infer): Promise { return await this.actionCall('chat', 'UpdateChatLastContextById', payload); } public async GetMessageCountByUserId(payload: z.infer): Promise { return await this.actionCall('chat', 'GetMessageCountByUserId', payload); } public async CreateStreamId(payload: z.infer): Promise { return await this.actionCall('chat', 'CreateStreamId', payload); } public async GetStreamIdsByChatId(payload: z.infer): Promise { return await this.actionCall('chat', 'GetStreamIdsByChatId', payload); } public async SaveDocument(payload: z.infer): Promise { return await this.actionCall('chat', 'SaveDocument', payload); } public async GetDocumentById(payload: z.infer): Promise { return await this.actionCall('chat', 'GetDocumentById', payload); } public async GetDocumentsById(payload: z.infer): Promise { return await this.actionCall('chat', 'GetDocumentsById', payload); } public async CreateCommand(payload: z.infer): Promise { /* debugger if ( typeof payload.inputs === 'object' ) { payload.inputs = JSON.stringify(payload.inputs) as any; } */ return await this.actionCall('command', 'CreateCommand', payload); } public async ListCommands(payload: z.infer): Promise { return await this.actionCall('command', 'ListCommands', payload); } public async UpdateCommand(payload: z.infer): Promise { return await this.actionCall('command', 'UpdateCommand', payload); } public async DeleteCommand(payload: z.infer): Promise { return await this.actionCall('command', 'DeleteCommand', payload); } //------------------Collections------------------- public async CreateDataModel( payload: z.infer ): Promise { return await this.actionCall( "collection", "CreateDataModel", payload ); } public async UpdateDataModel( payload: z.infer ): Promise { return await this.actionCall( "collection", "UpdateDataModel", payload ); } public async DeleteDataModel( payload: z.infer ): Promise { return await this.actionCall( "collection", "DeleteDataModel", payload ); } public async GetDataModelById( payload: z.infer ): Promise { return await this.actionCall( "collection", "GetDataModelById", payload ); } public async ExportDataModel( payload: z.infer ): Promise { return await this.actionCall( "collection", "ExportDataModel", payload ); } public async ImportDataModel( payload: z.infer ): Promise { return await this.actionCall( "collection", "ImportDataModel", payload ); } public async ListDataModels( payload: z.infer ): Promise { return await this.actionCall( "collection", "ListDataModels", payload ); } public async RestoreDataModel( payload: z.infer ): Promise { return await this.actionCall( "collection", "RestoreDataModel", payload ); } public async HardDeleteDataModel( payload: z.infer ): Promise { return await this.actionCall( "collection", "HardDeleteDataModel", payload ); } public async CreateCollection( payload: z.infer ): Promise { return await this.actionCall( "collection", "CreateCollection", payload ); } public async PreviewCollectionAppGeneration( payload: z.infer ): Promise { return await this.actionCall("collection", "PreviewCollectionAppGeneration", payload); } public async ApplyCollectionAppGeneration( payload: z.infer ): Promise { return await this.actionCall("collection", "ApplyCollectionAppGeneration", payload); } public async RollbackCollectionAppGeneration( payload: z.infer ): Promise { return await this.actionCall("collection", "RollbackCollectionAppGeneration", payload); } public async ResumeCollectionAppGenerationRun( payload: z.infer ): Promise { return await this.actionCall("collection", "ResumeCollectionAppGenerationRun", payload); } public async GetCollectionAppGenerationPlan( payload: z.infer ): Promise { return await this.actionCall("collection", "GetCollectionAppGenerationPlan", payload); } public async ListCollectionAppGenerationPlans( payload: z.infer ): Promise { return await this.actionCall("collection", "ListCollectionAppGenerationPlans", payload); } public async GetCollectionAppGenerationRun( payload: z.infer ): Promise { return await this.actionCall("collection", "GetCollectionAppGenerationRun", payload); } public async ListCollectionAppGenerationRuns( payload: z.infer ): Promise { return await this.actionCall("collection", "ListCollectionAppGenerationRuns", payload); } public async UpdateCollection( payload: z.infer ): Promise { return await this.actionCall( "collection", "UpdateCollection", payload ); } public async ArchiveCollection( payload: z.infer ): Promise { return await this.actionCall( "collection", "ArchiveCollection", payload ); } public async PurgeCollection( payload: z.infer ): Promise { return await this.actionCall( "collection", "PurgeCollection", payload ); } public async ListCollections( payload: z.infer ): Promise { return await this.actionCall( "collection", "ListCollections", payload ); } public async GetCollectionById( payload: z.infer ): Promise { return await this.actionCall( "collection", "GetCollectionById", payload ); } public async CreateRecord( payload: z.infer ): Promise { return await this.actionCall( "collection", "CreateRecord", payload ); } public async UploadCollectionFile( payload: z.infer ): Promise { const result = await this.actionCall("collection", "UploadCollectionFile", payload); const storagePath = this.normalizeStoragePath(String(result?.path || result?.filePath || result?.url || "")); const resolvedUrl = this.resolveStorageViewUrl(storagePath); return { ...result, fileId: String(result?.itemId || result?.fileId || result?.id || payload.itemId || ""), path: storagePath, filePath: resolvedUrl || storagePath, url: resolvedUrl || storagePath, }; } public async ResolveCollectionFileView( payload: z.infer ): Promise { const result = await this.actionCall("collection", "ResolveCollectionFileView", payload); const storagePath = this.normalizeStoragePath(String(result?.path || result?.filePath || result?.url || "")); const resolvedUrl = this.resolveStorageViewUrl(storagePath); return { ...result, fileId: String(result?.fileId || result?.itemId || payload.itemId || ""), path: storagePath, filePath: resolvedUrl || storagePath, url: resolvedUrl || storagePath, }; } public async GetRecordById( payload: z.infer ): Promise { return await this.actionCall( "collection", "GetRecordById", payload ); } public async ListRecords( payload: z.infer ): Promise<{ total: number; records: any[]; }> { return await this.actionCall( "collection", "ListRecords", payload ); } public async UpdateRecord( payload: z.infer ): Promise { return await this.actionCall( "collection", "UpdateRecord", payload ); } public async DeleteRecord( payload: z.infer ): Promise { return await this.actionCall( "collection", "DeleteRecord", payload ); } public async RestoreRecord( payload: z.infer ): Promise { return await this.actionCall( "collection", "RestoreRecord", payload ); } public async UpsertRecord( payload: z.infer ): Promise { return await this.actionCall( "collection", "UpsertRecord", payload ); } public async BulkCreateRecords( payload: z.infer ): Promise { return await this.actionCall( "collection", "BulkCreateRecords", payload ); } public async EnsureAirtableImportCredential( payload: z.infer ): Promise { return await this.actionCall( "collection", "EnsureAirtableImportCredential", payload ); } public async ListAirtableImportSources( payload: z.infer ): Promise { return await this.actionCall( "collection", "ListAirtableImportSources", payload ); } public async PreviewAirtableImport( payload: z.infer ): Promise { return await this.actionCall( "collection", "PreviewAirtableImport", payload ); } public async RunAirtableImport( payload: z.infer ): Promise { return await this.actionCall( "collection", "RunAirtableImport", payload ); } public async EnsureLinearImportCredential( payload: z.infer ): Promise { return await this.actionCall( "collection", "EnsureLinearImportCredential", payload ); } public async ListLinearImportSources( payload: z.infer ): Promise { return await this.actionCall( "collection", "ListLinearImportSources", payload ); } public async PreviewLinearImport( payload: z.infer ): Promise { return await this.actionCall( "collection", "PreviewLinearImport", payload ); } public async RunLinearImport( payload: z.infer ): Promise { return await this.actionCall( "collection", "RunLinearImport", payload ); } public async EnsureGmailImportCredential( payload: z.infer ): Promise { return await this.actionCall( "collection", "EnsureGmailImportCredential", payload ); } public async EnsureGithubImportCredential( payload: z.infer ): Promise { return await this.actionCall( "collection", "EnsureGithubImportCredential", payload ); } public async ListGmailImportSources( payload: z.infer ): Promise { return await this.actionCall( "collection", "ListGmailImportSources", payload ); } public async ListGithubImportSources( payload: z.infer ): Promise { return await this.actionCall( "collection", "ListGithubImportSources", payload ); } public async PreviewGmailImport( payload: z.infer ): Promise { return await this.actionCall( "collection", "PreviewGmailImport", payload ); } public async PreviewCsvImport( payload: z.infer ): Promise { return await this.actionCall( "collection", "PreviewCsvImport", payload ); } public async PreviewGithubImport( payload: z.infer ): Promise { return await this.actionCall( "collection", "PreviewGithubImport", payload ); } public async RunGmailImport( payload: z.infer ): Promise { return await this.actionCall( "collection", "RunGmailImport", payload ); } public async RunCsvImport( payload: z.infer ): Promise { return await this.actionCall( "collection", "RunCsvImport", payload ); } public async RunGithubImport( payload: z.infer ): Promise { return await this.actionCall( "collection", "RunGithubImport", payload ); } public async EnsureNotionImportCredential( payload: z.infer ): Promise { return await this.actionCall( "collection", "EnsureNotionImportCredential", payload ); } public async ListNotionImportSources( payload: z.infer ): Promise { return await this.actionCall( "collection", "ListNotionImportSources", payload ); } public async PreviewNotionImport( payload: z.infer ): Promise { return await this.actionCall( "collection", "PreviewNotionImport", payload ); } public async RunNotionImport( payload: z.infer ): Promise { return await this.actionCall( "collection", "RunNotionImport", payload ); } public async EnsureJiraImportCredential( payload: z.infer ): Promise { return await this.actionCall( "collection", "EnsureJiraImportCredential", payload ); } public async ListJiraImportSources( payload: z.infer ): Promise { return await this.actionCall( "collection", "ListJiraImportSources", payload ); } public async PreviewJiraImport( payload: z.infer ): Promise { return await this.actionCall( "collection", "PreviewJiraImport", payload ); } public async RunJiraImport( payload: z.infer ): Promise { return await this.actionCall( "collection", "RunJiraImport", payload ); } public async EnsureTrelloImportCredential( payload: z.infer ): Promise { return await this.actionCall( "collection", "EnsureTrelloImportCredential", payload ); } public async ConnectTrelloImportCredential( payload: z.infer ): Promise { return await this.actionCall( "collection", "ConnectTrelloImportCredential", payload ); } public async ListTrelloImportSources( payload: z.infer ): Promise { return await this.actionCall( "collection", "ListTrelloImportSources", payload ); } public async PreviewTrelloImport( payload: z.infer ): Promise { return await this.actionCall( "collection", "PreviewTrelloImport", payload ); } public async RunTrelloImport( payload: z.infer ): Promise { return await this.actionCall( "collection", "RunTrelloImport", payload ); } public async BulkUpdateRecords( payload: z.infer ): Promise { return await this.actionCall( "collection", "BulkUpdateRecords", payload ); } public async BulkDeleteRecords( payload: z.infer ): Promise { return await this.actionCall( "collection", "BulkDeleteRecords", payload ); } public async DuplicateRecord( payload: z.infer ): Promise { return await this.actionCall( "collection", "DuplicateRecord", payload ); } public async QueryRecords( payload: z.infer ): Promise { return await this.actionCall( "collection", "QueryRecords", payload ); } public async SearchRecords( payload: z.infer ): Promise { return await this.actionCall( "collection", "SearchRecords", payload ); } public async CountRecords( payload: z.infer ): Promise { return await this.actionCall( "collection", "CountRecords", payload ); } public async GroupRecords( payload: z.infer ): Promise { return await this.actionCall( "collection", "GroupRecords", payload ); } public async AggregateRecords( payload: z.infer ): Promise { return await this.actionCall( "collection", "AggregateRecords", payload ); } public async DistinctFieldValues( payload: z.infer ): Promise { return await this.actionCall( "collection", "DistinctFieldValues", payload ); } public async CreateCollectionField( payload: z.infer ): Promise { return await this.actionCall( "collection", "CreateCollectionField", payload ); } public async UpdateCollectionField( payload: z.infer ): Promise { return await this.actionCall( "collection", "UpdateCollectionField", payload ); } public async DeleteCollectionField( payload: z.infer ): Promise { return await this.actionCall( "collection", "DeleteCollectionField", payload ); } public async ListCollectionAutomationRules( payload: z.infer ): Promise { return await this.actionCall( "collection", "ListCollectionAutomationRules", payload ); } public async CreateCollectionAutomationRule( payload: z.infer ): Promise { return await this.actionCall( "collection", "CreateCollectionAutomationRule", payload ); } public async UpdateCollectionAutomationRule( payload: z.infer ): Promise { return await this.actionCall( "collection", "UpdateCollectionAutomationRule", payload ); } public async DeleteCollectionAutomationRule( payload: z.infer ): Promise { return await this.actionCall( "collection", "DeleteCollectionAutomationRule", payload ); } public async ListCollectionAutomationExecutions( payload: z.infer ): Promise { return await this.actionCall( "collection", "ListCollectionAutomationExecutions", payload ); } public async DecideCollectionAutomationApproval( payload: z.infer ): Promise<{ id: string; status: "approved" | "rejected"; executionId: string }> { return await this.actionCall( "collection", "DecideCollectionAutomationApproval", payload ); } public async ListCollectionViews( payload: z.infer ): Promise { return await this.actionCall( "collection", "ListCollectionViews", payload ); } public async CreateCollectionView( payload: z.infer ): Promise { return await this.actionCall( "collection", "CreateCollectionView", payload ); } public async UpdateCollectionView( payload: z.infer ): Promise { return await this.actionCall( "collection", "UpdateCollectionView", payload ); } public async DeleteCollectionView( payload: z.infer ): Promise { return await this.actionCall( "collection", "DeleteCollectionView", payload ); } public async UpsertCollectionViewPreference( payload: z.infer ): Promise { return await this.actionCall( "collection", "UpsertCollectionViewPreference", payload ); } public async DeleteCollectionViewPreference( payload: z.infer ): Promise<{ success: boolean; viewId: string; userId: string }> { return await this.actionCall( "collection", "DeleteCollectionViewPreference", payload ); } public async ListCollectionButtons( payload: z.infer ): Promise { return await this.actionCall( "collection", "ListCollectionButtons", payload ); } public async CreateCollectionButton( payload: z.infer ): Promise { return await this.actionCall( "collection", "CreateCollectionButton", payload ); } public async UpdateCollectionButton( payload: z.infer ): Promise { return await this.actionCall( "collection", "UpdateCollectionButton", payload ); } public async DeleteCollectionButton( payload: z.infer ): Promise { return await this.actionCall( "collection", "DeleteCollectionButton", payload ); } public async ExecuteCollectionButton( payload: z.infer ): Promise { return await this.actionCall( "collection", "ExecuteCollectionButton", payload ); } public async ExecuteCollectionAiField( payload: z.infer ): Promise { return await this.actionCall( "collection", "ExecuteCollectionAiField", payload ); } public async ListCollectionRelations( payload: z.infer ): Promise { return await this.actionCall( "collection", "ListCollectionRelations", payload ); } public async CreateCollectionRelation( payload: z.infer ): Promise { return await this.actionCall( "collection", "CreateCollectionRelation", payload ); } public async UpdateCollectionRelation( payload: z.infer ): Promise { return await this.actionCall( "collection", "UpdateCollectionRelation", payload ); } public async DeleteCollectionRelation( payload: z.infer ): Promise { return await this.actionCall( "collection", "DeleteCollectionRelation", payload ); } public async ListRelationCandidates( payload: z.infer ): Promise<{ fieldId: string; items: TRelationRecordOption[] }> { return await this.actionCall( "collection", "ListRelationCandidates", payload ); } public async GetRecordRelations( payload: z.infer ): Promise<{ recordId: string; values: Record; }> { return await this.actionCall( "collection", "GetRecordRelations", payload ); } public async ReorderCollectionFields( payload: z.infer ): Promise { return await this.actionCall( "collection", "ReorderCollectionFields", payload ); } public async GetCollectionSchema( payload: z.infer ): Promise { return await this.actionCall( "collection", "GetCollectionSchema", payload ); } public async ValidateRecord( payload: z.infer ): Promise { return await this.actionCall( "collection", "ValidateRecord", payload ); } public async PreviewValidationErrors( payload: z.infer ): Promise { return await this.actionCall( "collection", "PreviewValidationErrors", payload ); } public async ListCollectionForms( payload: z.infer ): Promise { return await this.actionCall("collection", "ListCollectionForms", payload); } public async UpsertCollectionForm( payload: z.infer ): Promise { return await this.actionCall("collection", "UpsertCollectionForm", payload); } public async ResolveCollectionForm( payload: z.infer ): Promise { return await this.actionCall("collection", "ResolveCollectionForm", payload); } public async SubmitCollectionForm( payload: z.infer ): Promise { return await this.actionCall("collection", "SubmitCollectionForm", payload); } public async PublishCollectionForm( payload: z.infer ): Promise { return await this.actionCall("collection", "PublishCollectionForm", payload); } public async RevokeCollectionForm( payload: z.infer ): Promise { return await this.actionCall("collection", "RevokeCollectionForm", payload); } public async DeleteCollectionForm( payload: z.infer ): Promise<{ success: true; formId: string }> { return await this.actionCall("collection", "DeleteCollectionForm", payload); } public async ListCollectionReports( payload: z.infer ): Promise { return await this.actionCall("collection", "ListCollectionReports", payload); } public async UpsertCollectionReport( payload: z.infer ): Promise { return await this.actionCall("collection", "UpsertCollectionReport", payload); } public async DeleteCollectionReport( payload: z.infer ): Promise<{ id: string; archived: true; archivedAt: string | Date }> { return await this.actionCall("collection", "DeleteCollectionReport", payload); } public async EvaluateCollectionReport( payload: z.infer ): Promise { return await this.actionCall("collection", "EvaluateCollectionReport", payload); } public async ListCollectionDashboards( payload: z.infer ): Promise { return await this.actionCall("collection", "ListCollectionDashboards", payload); } public async UpsertCollectionDashboard( payload: z.infer ): Promise { return await this.actionCall("collection", "UpsertCollectionDashboard", payload); } public async DeleteCollectionDashboard( payload: z.infer ): Promise<{ id: string; archived: true; archivedAt: string | Date }> { return await this.actionCall("collection", "DeleteCollectionDashboard", payload); } public async EvaluateCollectionDashboard( payload: z.infer ): Promise { return await this.actionCall("collection", "EvaluateCollectionDashboard", payload); } public async ListCollectionAccessPolicies( payload: z.infer ): Promise { return await this.actionCall( "collection", "ListCollectionAccessPolicies", payload ); } public async UpsertCollectionAccessPolicy( payload: z.infer ): Promise { return await this.actionCall( "collection", "UpsertCollectionAccessPolicy", payload ); } public async DeleteCollectionAccessPolicy( payload: z.infer ): Promise<{ success: true; policyId: string; deletedBy: string }> { return await this.actionCall( "collection", "DeleteCollectionAccessPolicy", payload ); } public async ListCollectionAccessTeamMembers( payload: z.infer ): Promise { return await this.actionCall("collection", "ListCollectionAccessTeamMembers", payload); } public async SetCollectionAccessTeamMembers( payload: z.infer ): Promise { return await this.actionCall("collection", "SetCollectionAccessTeamMembers", payload); } public async PreviewCollectionAccessPolicy( payload: z.infer ): Promise { return await this.actionCall( "collection", "PreviewCollectionAccessPolicy", payload ); } public async CreateCollectionComment( payload: z.infer ): Promise { return await this.actionCall("collection", "CreateCollectionComment", payload); } public async UpdateCollectionComment( payload: z.infer ): Promise { return await this.actionCall("collection", "UpdateCollectionComment", payload); } public async DeleteCollectionComment( payload: z.infer ): Promise<{ id: string; deletedAt: string | Date }> { return await this.actionCall("collection", "DeleteCollectionComment", payload); } public async ListCollectionComments( payload: z.infer ): Promise { return await this.actionCall("collection", "ListCollectionComments", payload); } public async ListCollectionRecordActivity( payload: z.infer ): Promise { return await this.actionCall("collection", "ListCollectionRecordActivity", payload); } public async ListCollectionRecordCollaborators( payload: z.infer ): Promise { return await this.actionCall("collection", "ListCollectionRecordCollaborators", payload); } public async SetCollectionRecordCollaborators( payload: z.infer ): Promise { return await this.actionCall("collection", "SetCollectionRecordCollaborators", payload); } public async ListCollectionNotifications( payload: z.infer ): Promise { return await this.actionCall("collection", "ListCollectionNotifications", payload); } public async MarkCollectionNotificationsRead( payload: z.infer ): Promise<{ updatedCount: number; notificationIds: string[] }> { return await this.actionCall("collection", "MarkCollectionNotificationsRead", payload); } public async CheckRecordPermission( payload: z.infer ): Promise { return await this.actionCall( "collection", "CheckRecordPermission", payload ); } public async ListRecordPermissions( payload: z.infer ): Promise { return await this.actionCall( "collection", "ListRecordPermissions", payload ); } public async GrantRecordPermission( payload: z.infer ): Promise { return await this.actionCall( "collection", "GrantRecordPermission", payload ); } public async RevokeRecordPermission( payload: z.infer ): Promise { return await this.actionCall( "collection", "RevokeRecordPermission", payload ); } //---wiki-------- public async CreateWikiPage( payload: z.infer ): Promise { return await this.actionCall( "wiki", "CreateWikiPage", payload ); } public async UpdateWikiPage( payload: z.infer ): Promise { return await this.actionCall("wiki", "UpdateWikiPage", { ...payload, ...(typeof payload.fullPageWidth === "boolean" ? { fullPageWidth: String(payload.fullPageWidth) } : {}), }); } public async DeleteWikiPage( payload: z.infer ): Promise { return await this.actionCall("wiki", "DeleteWikiPage", payload); } public async MoveWikiPage( payload: z.infer ): Promise { return await this.actionCall("wiki", "MoveWikiPage", payload); } public async ListWikiPages( payload: z.infer ): Promise { return await this.actionCall("wiki", "ListWikiPages", payload); } public async ListWikiSpaces( payload: z.infer ): Promise { return await this.actionCall("wiki", "ListWikiSpaces", payload); } public async CreateWikiSpace( payload: z.infer ): Promise { return await this.actionCall("wiki", "CreateWikiSpace", payload); } public async UpdateWikiSpace( payload: z.infer ): Promise { return await this.actionCall("wiki", "UpdateWikiSpace", payload); } public async DeleteWikiSpace( payload: z.infer ): Promise<{ deleted: boolean; id: string }> { return await this.actionCall("wiki", "DeleteWikiSpace", payload); } public async GetPrivateWikiSpace( payload: z.infer ): Promise { return await this.actionCall("wiki", "GetPrivateWikiSpace", payload); } public async GetWikiAiSettings( payload: z.infer ): Promise { return await this.actionCall("wiki", "GetWikiAiSettings", payload); } public async SetWikiAiSettings( payload: z.infer ): Promise { return await this.actionCall("wiki", "SetWikiAiSettings", payload); } public async ListWikiAiCommands( payload: z.infer ): Promise { return await this.actionCall("wiki", "ListWikiAiCommands", payload); } public async CreateWikiAiCommand( payload: z.infer ): Promise { return await this.actionCall("wiki", "CreateWikiAiCommand", payload); } public async RunWikiAiCommand( payload: z.infer ): Promise { return await this.actionCall("wiki", "RunWikiAiCommand", payload); } public async SetWikiPageUserState( payload: z.infer ): Promise { return await this.actionCall("wiki", "SetWikiPageUserState", { pageId: payload.pageId, ...(typeof payload.userId === "string" && payload.userId.trim() ? { userId: payload.userId.trim() } : {}), ...(typeof payload.isFavorite === "boolean" ? { isFavorite: String(payload.isFavorite) } : {}), ...(typeof payload.isWatching === "boolean" ? { isWatching: String(payload.isWatching) } : {}), }); } public async UploadWikiFile( payload: z.infer ): Promise { return await this.actionCall("wiki", "UploadFile", payload); } public async ResolveWikiFileView( payload: z.infer ): Promise { const result = await this.actionCall("wiki", "ResolveWikiFileView", payload); const storagePath = this.normalizeStoragePath(String(result?.path || result?.filePath || result?.url || "")); const resolvedUrl = this.resolveStorageViewUrl(storagePath); return { ...result, fileId: String(result?.fileId || payload.fileId || ""), path: storagePath, filePath: resolvedUrl || storagePath, url: resolvedUrl || storagePath, }; } public async CreateWikiComment( payload: z.infer ): Promise { return await this.actionCall("wiki", "CreateWikiComment", payload); } public async UpdateWikiComment( payload: z.infer ): Promise { const normalizedPayload = { ...payload, ...(typeof payload.resolved === "boolean" ? { resolved: payload.resolved ? "true" : "false" } : {}), } as any; return await this.actionCall("wiki", "UpdateWikiComment", normalizedPayload); } public async DeleteWikiComment( payload: z.infer ): Promise<{ id: string; deletedAt: string }> { return await this.actionCall("wiki", "DeleteWikiComment", payload); } public async ListWikiComments( payload: z.infer ): Promise { return await this.actionCall("wiki", "ListWikiComments", payload); } public async CreateWikiReference( payload: z.infer ): Promise { return await this.actionCall("wiki", "CreateWikiReference", payload); } public async UpdateWikiReference( payload: z.infer ): Promise { return await this.actionCall("wiki", "UpdateWikiReference", payload); } public async GetWikiReferenceById( payload: z.infer ): Promise { return await this.actionCall("wiki", "GetWikiReferenceById", payload); } public async ListWikiReferences( payload: z.infer ): Promise { return await this.actionCall("wiki", "ListWikiReferences", { ...payload, ...(typeof payload.limit === "number" ? { limit: String(payload.limit) } : {}), ...(typeof payload.offset === "number" ? { offset: String(payload.offset) } : {}), }); } public async DeleteWikiReference( payload: z.infer ): Promise<{ id: string; deletedAt: string }> { return await this.actionCall("wiki", "DeleteWikiReference", payload); } public async RestoreWikiPage( payload: z.infer ): Promise { return await this.actionCall("wiki", "RestoreWikiPage", payload); } public async GetWikiPageById( payload: z.infer ): Promise { return await this.actionCall("wiki", "GetWikiPageById", payload); } public async GetWikiPageBySlug( payload: z.infer ): Promise { return await this.actionCall("wiki", "GetWikiPageBySlug", payload); } public async GetWikiTree( payload: z.infer ): Promise { return await this.actionCall("wiki", "GetWikiTree", payload); } /* ------------------------------------------------------------------ * Wiki Revision * ------------------------------------------------------------------ */ public async CreateWikiRevision( payload: z.infer ): Promise { return await this.actionCall("wiki", "CreateWikiRevision", payload); } public async GetLatestWikiRevision( payload: z.infer ): Promise { return await this.actionCall("wiki", "GetLatestWikiRevision", payload); } public async GetWikiRevisionById( payload: z.infer ): Promise { return await this.actionCall("wiki", "GetWikiRevisionById", payload); } public async ListChatHistory( payload: z.infer ): Promise { return await this.httpGet("/chat/history", payload); } }