n8n 2.23.2 → 2.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/active-workflow-manager.d.ts +8 -4
- package/dist/active-workflow-manager.js +26 -9
- package/dist/active-workflow-manager.js.map +1 -1
- package/dist/auth/auth.service.d.ts +1 -1
- package/dist/auth/auth.service.js +2 -1
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/controllers/ai.controller.js +1 -1
- package/dist/controllers/ai.controller.js.map +1 -1
- package/dist/controllers/api-keys.controller.d.ts +20 -15
- package/dist/controllers/api-keys.controller.js +7 -4
- package/dist/controllers/api-keys.controller.js.map +1 -1
- package/dist/controllers/oauth/oauth1-credential.controller.d.ts +4 -2
- package/dist/controllers/oauth/oauth1-credential.controller.js +15 -5
- package/dist/controllers/oauth/oauth1-credential.controller.js.map +1 -1
- package/dist/controllers/oauth/oauth2-credential.controller.d.ts +4 -2
- package/dist/controllers/oauth/oauth2-credential.controller.js +15 -6
- package/dist/controllers/oauth/oauth2-credential.controller.js.map +1 -1
- package/dist/controllers/project.controller.d.ts +8 -0
- package/dist/controllers/project.controller.js +2 -1
- package/dist/controllers/project.controller.js.map +1 -1
- package/dist/controllers/security-settings.controller.js +18 -1
- package/dist/controllers/security-settings.controller.js.map +1 -1
- package/dist/controllers/telemetry.controller.js +4 -1
- package/dist/controllers/telemetry.controller.js.map +1 -1
- package/dist/credentials/credential-connection-status-provider.interface.d.ts +3 -0
- package/dist/credentials/credential-connection-status-proxy.d.ts +3 -0
- package/dist/credentials/credential-connection-status-proxy.js +10 -0
- package/dist/credentials/credential-connection-status-proxy.js.map +1 -1
- package/dist/credentials/credentials.controller.d.ts +6 -0
- package/dist/credentials/credentials.controller.js +39 -2
- package/dist/credentials/credentials.controller.js.map +1 -1
- package/dist/credentials/credentials.service.d.ts +29 -13
- package/dist/credentials/credentials.service.ee.d.ts +2 -0
- package/dist/credentials/credentials.service.ee.js +3 -0
- package/dist/credentials/credentials.service.ee.js.map +1 -1
- package/dist/credentials/credentials.service.js +27 -6
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/credentials-helper.d.ts +1 -0
- package/dist/credentials-helper.js +14 -4
- package/dist/credentials-helper.js.map +1 -1
- package/dist/errors/credential-missing-id.error.d.ts +4 -0
- package/dist/errors/credential-missing-id.error.js +14 -0
- package/dist/errors/credential-missing-id.error.js.map +1 -0
- package/dist/eventbus/event-message-classes/index.d.ts +2 -2
- package/dist/eventbus/event-message-classes/index.js +3 -0
- package/dist/eventbus/event-message-classes/index.js.map +1 -1
- package/dist/events/maps/relay.event-map.d.ts +54 -2
- package/dist/events/relays/log-streaming.event-relay.d.ts +3 -0
- package/dist/events/relays/log-streaming.event-relay.js +39 -1
- package/dist/events/relays/log-streaming.event-relay.js.map +1 -1
- package/dist/events/relays/telemetry.event-relay.d.ts +6 -0
- package/dist/events/relays/telemetry.event-relay.js +74 -3
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js +6 -5
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
- package/dist/executions/execution-data/db-store.d.ts +1 -0
- package/dist/executions/execution-data/db-store.js +26 -0
- package/dist/executions/execution-data/db-store.js.map +1 -1
- package/dist/executions/execution-data/fs-store.d.ts +2 -0
- package/dist/executions/execution-data/fs-store.js +27 -0
- package/dist/executions/execution-data/fs-store.js.map +1 -1
- package/dist/executions/execution-data/types.d.ts +1 -0
- package/dist/executions/execution-persistence.d.ts +38 -4
- package/dist/executions/execution-persistence.js +127 -2
- package/dist/executions/execution-persistence.js.map +1 -1
- package/dist/expression-observability/expression-observability.provider.d.ts +3 -1
- package/dist/expression-observability/expression-observability.provider.js +48 -46
- package/dist/expression-observability/expression-observability.provider.js.map +1 -1
- package/dist/interfaces.d.ts +3 -1
- package/dist/modules/agents/agent-execution.service.d.ts +4 -2
- package/dist/modules/agents/agent-execution.service.js +3 -3
- package/dist/modules/agents/agent-execution.service.js.map +1 -1
- package/dist/modules/agents/agent-knowledge-command.service.d.ts +40 -0
- package/dist/modules/agents/agent-knowledge-command.service.js +221 -0
- package/dist/modules/agents/agent-knowledge-command.service.js.map +1 -0
- package/dist/modules/agents/agent-knowledge.service.d.ts +42 -0
- package/dist/modules/agents/agent-knowledge.service.js +300 -0
- package/dist/modules/agents/agent-knowledge.service.js.map +1 -0
- package/dist/modules/agents/agent-task.service.d.ts +52 -0
- package/dist/modules/agents/agent-task.service.js +487 -0
- package/dist/modules/agents/agent-task.service.js.map +1 -0
- package/dist/modules/agents/agent-upload.middleware.d.ts +7 -0
- package/dist/modules/agents/agent-upload.middleware.js +62 -0
- package/dist/modules/agents/agent-upload.middleware.js.map +1 -0
- package/dist/modules/agents/agents-tools.service.d.ts +1 -1
- package/dist/modules/agents/agents-tools.service.js +12 -3
- package/dist/modules/agents/agents-tools.service.js.map +1 -1
- package/dist/modules/agents/agents.controller.d.ts +138 -45
- package/dist/modules/agents/agents.controller.js +176 -48
- package/dist/modules/agents/agents.controller.js.map +1 -1
- package/dist/modules/agents/agents.module.d.ts +2 -2
- package/dist/modules/agents/agents.module.js +13 -5
- package/dist/modules/agents/agents.module.js.map +1 -1
- package/dist/modules/agents/agents.service.d.ts +43 -7
- package/dist/modules/agents/agents.service.js +341 -57
- package/dist/modules/agents/agents.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-prompts.d.ts +6 -5
- package/dist/modules/agents/builder/agents-builder-prompts.js +92 -18
- package/dist/modules/agents/builder/agents-builder-prompts.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder-tools.service.d.ts +11 -1
- package/dist/modules/agents/builder/agents-builder-tools.service.js +164 -26
- package/dist/modules/agents/builder/agents-builder-tools.service.js.map +1 -1
- package/dist/modules/agents/builder/agents-builder.service.d.ts +3 -1
- package/dist/modules/agents/builder/agents-builder.service.js +8 -3
- package/dist/modules/agents/builder/agents-builder.service.js.map +1 -1
- package/dist/modules/agents/builder/builder-tool-names.d.ts +3 -0
- package/dist/modules/agents/builder/builder-tool-names.js +3 -0
- package/dist/modules/agents/builder/builder-tool-names.js.map +1 -1
- package/dist/modules/agents/builder/interactive/ask-credential.tool.d.ts +1 -0
- package/dist/modules/agents/builder/interactive/ask-credential.tool.js +25 -4
- package/dist/modules/agents/builder/interactive/ask-credential.tool.js.map +1 -1
- package/dist/modules/agents/builder/interactive/ask-question.tool.js +6 -5
- package/dist/modules/agents/builder/interactive/ask-question.tool.js.map +1 -1
- package/dist/modules/agents/builder/prompts/config-mutation.prompt.js +20 -5
- package/dist/modules/agents/builder/prompts/config-mutation.prompt.js.map +1 -1
- package/dist/modules/agents/builder/prompts/config-rules.prompt.js +23 -4
- package/dist/modules/agents/builder/prompts/config-rules.prompt.js.map +1 -1
- package/dist/modules/agents/builder/prompts/llm-selection.prompt.js +18 -1
- package/dist/modules/agents/builder/prompts/llm-selection.prompt.js.map +1 -1
- package/dist/modules/agents/builder/prompts/memory.prompt.d.ts +1 -1
- package/dist/modules/agents/builder/prompts/memory.prompt.js +5 -3
- package/dist/modules/agents/builder/prompts/memory.prompt.js.map +1 -1
- package/dist/modules/agents/builder/prompts/tools.prompt.d.ts +1 -1
- package/dist/modules/agents/builder/prompts/tools.prompt.js +11 -2
- package/dist/modules/agents/builder/prompts/tools.prompt.js.map +1 -1
- package/dist/modules/agents/builder/search-mcp-servers.tool.d.ts +6 -0
- package/dist/modules/agents/builder/search-mcp-servers.tool.js +85 -0
- package/dist/modules/agents/builder/search-mcp-servers.tool.js.map +1 -0
- package/dist/modules/agents/builder/skill-body-template.d.ts +4 -0
- package/dist/modules/agents/builder/skill-body-template.js +31 -0
- package/dist/modules/agents/builder/skill-body-template.js.map +1 -0
- package/dist/modules/agents/builder/skills/index.js +6 -1
- package/dist/modules/agents/builder/skills/index.js.map +1 -1
- package/dist/modules/agents/builder/skills/integrations.skill.js +39 -18
- package/dist/modules/agents/builder/skills/integrations.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/mcp.skill.d.ts +2 -0
- package/dist/modules/agents/builder/skills/mcp.skill.js +110 -0
- package/dist/modules/agents/builder/skills/mcp.skill.js.map +1 -0
- package/dist/modules/agents/builder/skills/research.skill.js +8 -5
- package/dist/modules/agents/builder/skills/research.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/target-skills.skill.js +41 -13
- package/dist/modules/agents/builder/skills/target-skills.skill.js.map +1 -1
- package/dist/modules/agents/builder/skills/target-tasks.skill.d.ts +2 -0
- package/dist/modules/agents/builder/skills/target-tasks.skill.js +82 -0
- package/dist/modules/agents/builder/skills/target-tasks.skill.js.map +1 -0
- package/dist/modules/agents/builder/task-objective-template.d.ts +3 -0
- package/dist/modules/agents/builder/task-objective-template.js +27 -0
- package/dist/modules/agents/builder/task-objective-template.js.map +1 -0
- package/dist/modules/agents/builder/verify-mcp-server.tool.d.ts +8 -0
- package/dist/modules/agents/builder/verify-mcp-server.tool.js +79 -0
- package/dist/modules/agents/builder/verify-mcp-server.tool.js.map +1 -0
- package/dist/modules/agents/entities/agent-execution-thread.entity.d.ts +4 -0
- package/dist/modules/agents/entities/agent-execution-thread.entity.js +26 -0
- package/dist/modules/agents/entities/agent-execution-thread.entity.js.map +1 -1
- package/dist/modules/agents/entities/agent-file.entity.d.ts +11 -0
- package/dist/modules/agents/entities/agent-file.entity.js +48 -0
- package/dist/modules/agents/entities/agent-file.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-task-run-lock.entity.d.ts +10 -0
- package/dist/modules/agents/entities/agent-task-run-lock.entity.js +54 -0
- package/dist/modules/agents/entities/agent-task-run-lock.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-task-snapshot.entity.d.ts +12 -0
- package/dist/modules/agents/entities/agent-task-snapshot.entity.js +70 -0
- package/dist/modules/agents/entities/agent-task-snapshot.entity.js.map +1 -0
- package/dist/modules/agents/entities/agent-task.entity.d.ts +11 -0
- package/dist/modules/agents/entities/agent-task.entity.js +64 -0
- package/dist/modules/agents/entities/agent-task.entity.js.map +1 -0
- package/dist/modules/agents/execution-recorder.d.ts +1 -0
- package/dist/modules/agents/execution-recorder.js +9 -5
- package/dist/modules/agents/execution-recorder.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-bridge.d.ts +16 -4
- package/dist/modules/agents/integrations/agent-chat-bridge.js +372 -116
- package/dist/modules/agents/integrations/agent-chat-bridge.js.map +1 -1
- package/dist/modules/agents/integrations/agent-chat-integration.d.ts +27 -2
- package/dist/modules/agents/integrations/agent-chat-integration.js +5 -0
- package/dist/modules/agents/integrations/agent-chat-integration.js.map +1 -1
- package/dist/modules/agents/integrations/chat-integration.service.d.ts +15 -6
- package/dist/modules/agents/integrations/chat-integration.service.js +9 -10
- package/dist/modules/agents/integrations/chat-integration.service.js.map +1 -1
- package/dist/modules/agents/integrations/component-mapper.d.ts +14 -0
- package/dist/modules/agents/integrations/component-mapper.js +9 -1
- package/dist/modules/agents/integrations/component-mapper.js.map +1 -1
- package/dist/modules/agents/integrations/integration-action-executor.d.ts +22 -0
- package/dist/modules/agents/integrations/integration-action-executor.js +171 -0
- package/dist/modules/agents/integrations/integration-action-executor.js.map +1 -0
- package/dist/modules/agents/integrations/integration-context-query-executor.d.ts +18 -0
- package/dist/modules/agents/integrations/integration-context-query-executor.js +58 -0
- package/dist/modules/agents/integrations/integration-context-query-executor.js.map +1 -0
- package/dist/modules/agents/integrations/integration-error-codes.d.ts +13 -0
- package/dist/modules/agents/integrations/integration-error-codes.js +16 -0
- package/dist/modules/agents/integrations/integration-error-codes.js.map +1 -0
- package/dist/modules/agents/integrations/integration-helpers.d.ts +21 -0
- package/dist/modules/agents/integrations/integration-helpers.js +72 -0
- package/dist/modules/agents/integrations/integration-helpers.js.map +1 -0
- package/dist/modules/agents/integrations/integration-message-context.service.d.ts +13 -0
- package/dist/modules/agents/integrations/integration-message-context.service.js +129 -0
- package/dist/modules/agents/integrations/integration-message-context.service.js.map +1 -0
- package/dist/modules/agents/integrations/integration-tools.d.ts +205 -0
- package/dist/modules/agents/integrations/integration-tools.js +955 -0
- package/dist/modules/agents/integrations/integration-tools.js.map +1 -0
- package/dist/modules/agents/integrations/integrations-sync.d.ts +1 -1
- package/dist/modules/agents/integrations/integrations-sync.js +1 -29
- package/dist/modules/agents/integrations/integrations-sync.js.map +1 -1
- package/dist/modules/agents/integrations/n8n-memory.d.ts +2 -0
- package/dist/modules/agents/integrations/n8n-memory.js +18 -11
- package/dist/modules/agents/integrations/n8n-memory.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/linear-integration.d.ts +13 -2
- package/dist/modules/agents/integrations/platforms/linear-integration.js +70 -15
- package/dist/modules/agents/integrations/platforms/linear-integration.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/linear-operations.d.ts +18 -0
- package/dist/modules/agents/integrations/platforms/linear-operations.js +679 -0
- package/dist/modules/agents/integrations/platforms/linear-operations.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/slack-integration.d.ts +11 -1
- package/dist/modules/agents/integrations/platforms/slack-integration.js +53 -1
- package/dist/modules/agents/integrations/platforms/slack-integration.js.map +1 -1
- package/dist/modules/agents/integrations/platforms/slack-operations.d.ts +17 -0
- package/dist/modules/agents/integrations/platforms/slack-operations.js +288 -0
- package/dist/modules/agents/integrations/platforms/slack-operations.js.map +1 -0
- package/dist/modules/agents/integrations/platforms/telegram-integration.d.ts +9 -2
- package/dist/modules/agents/integrations/platforms/telegram-integration.js +17 -0
- package/dist/modules/agents/integrations/platforms/telegram-integration.js.map +1 -1
- package/dist/modules/agents/integrations/slack-app-setup.service.js +7 -1
- package/dist/modules/agents/integrations/slack-app-setup.service.js.map +1 -1
- package/dist/modules/agents/json-config/from-json-config.d.ts +4 -2
- package/dist/modules/agents/json-config/from-json-config.js +88 -11
- package/dist/modules/agents/json-config/from-json-config.js.map +1 -1
- package/dist/modules/agents/json-config/mcp-client-factory.d.ts +16 -0
- package/dist/modules/agents/json-config/mcp-client-factory.js +155 -0
- package/dist/modules/agents/json-config/mcp-client-factory.js.map +1 -0
- package/dist/modules/agents/json-config/native-web-search-provider-tools.d.ts +8 -0
- package/dist/modules/agents/json-config/native-web-search-provider-tools.js +59 -0
- package/dist/modules/agents/json-config/native-web-search-provider-tools.js.map +1 -0
- package/dist/modules/agents/json-config/schema-text-serializer.js +12 -2
- package/dist/modules/agents/json-config/schema-text-serializer.js.map +1 -1
- package/dist/modules/agents/repositories/agent-execution-thread.repository.d.ts +1 -1
- package/dist/modules/agents/repositories/agent-execution-thread.repository.js +5 -3
- package/dist/modules/agents/repositories/agent-execution-thread.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-file.repository.d.ts +7 -0
- package/dist/modules/agents/repositories/agent-file.repository.js +35 -0
- package/dist/modules/agents/repositories/agent-file.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-history.repository.d.ts +2 -0
- package/dist/modules/agents/repositories/agent-history.repository.js +18 -0
- package/dist/modules/agents/repositories/agent-history.repository.js.map +1 -1
- package/dist/modules/agents/repositories/agent-task-run-lock.repository.d.ts +12 -0
- package/dist/modules/agents/repositories/agent-task-run-lock.repository.js +72 -0
- package/dist/modules/agents/repositories/agent-task-run-lock.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-task-snapshot.repository.d.ts +11 -0
- package/dist/modules/agents/repositories/agent-task-snapshot.repository.js +45 -0
- package/dist/modules/agents/repositories/agent-task-snapshot.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent-task.repository.d.ts +7 -0
- package/dist/modules/agents/repositories/agent-task.repository.js +32 -0
- package/dist/modules/agents/repositories/agent-task.repository.js.map +1 -0
- package/dist/modules/agents/repositories/agent.repository.js +1 -2
- package/dist/modules/agents/repositories/agent.repository.js.map +1 -1
- package/dist/modules/agents/tools/knowledge/csv-helpers.d.ts +73 -0
- package/dist/modules/agents/tools/knowledge/csv-helpers.js +341 -0
- package/dist/modules/agents/tools/knowledge/csv-helpers.js.map +1 -0
- package/dist/modules/agents/tools/knowledge/csv.operation.d.ts +61 -0
- package/dist/modules/agents/tools/knowledge/csv.operation.js +207 -0
- package/dist/modules/agents/tools/knowledge/csv.operation.js.map +1 -0
- package/dist/modules/agents/tools/knowledge/file-references.d.ts +16 -0
- package/dist/modules/agents/tools/knowledge/file-references.js +35 -0
- package/dist/modules/agents/tools/knowledge/file-references.js.map +1 -0
- package/dist/modules/agents/tools/knowledge/read.operation.d.ts +8 -0
- package/dist/modules/agents/tools/knowledge/read.operation.js +38 -0
- package/dist/modules/agents/tools/knowledge/read.operation.js.map +1 -0
- package/dist/modules/agents/tools/knowledge/schemas.d.ts +1505 -0
- package/dist/modules/agents/tools/knowledge/schemas.js +441 -0
- package/dist/modules/agents/tools/knowledge/schemas.js.map +1 -0
- package/dist/modules/agents/tools/knowledge/search.operation.d.ts +9 -0
- package/dist/modules/agents/tools/knowledge/search.operation.js +332 -0
- package/dist/modules/agents/tools/knowledge/search.operation.js.map +1 -0
- package/dist/modules/agents/tools/knowledge/tool.d.ts +8 -0
- package/dist/modules/agents/tools/knowledge/tool.js +121 -0
- package/dist/modules/agents/tools/knowledge/tool.js.map +1 -0
- package/dist/modules/agents/utils/agent-memory-scope.d.ts +1 -1
- package/dist/modules/agents/utils/agent-memory-scope.js +4 -4
- package/dist/modules/agents/utils/agent-memory-scope.js.map +1 -1
- package/dist/modules/agents/utils/agent-resource-id.d.ts +1 -1
- package/dist/modules/chat-hub/chat-hub.module.d.ts +2 -2
- package/dist/modules/chat-hub/chat-hub.settings.controller.d.ts +4 -4
- package/dist/modules/chat-hub/chat-hub.types.d.ts +5 -5
- package/dist/modules/chat-hub/dto/chat-models-request.dto.d.ts +1 -1
- package/dist/modules/dynamic-credentials.ee/constants.d.ts +1 -1
- package/dist/modules/dynamic-credentials.ee/constants.js +2 -1
- package/dist/modules/dynamic-credentials.ee/constants.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.d.ts +9 -2
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js +45 -14
- package/dist/modules/dynamic-credentials.ee/dynamic-credentials.controller.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.d.ts +4 -0
- package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js +16 -0
- package/dist/modules/dynamic-credentials.ee/services/credential-connection-status.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js +6 -2
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.d.ts +1 -0
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.js +21 -2
- package/dist/modules/instance-ai/eval/eval-mocked-credentials-helper.js.map +1 -1
- package/dist/modules/instance-ai/eval/execution.service.d.ts +4 -1
- package/dist/modules/instance-ai/eval/execution.service.js +118 -24
- package/dist/modules/instance-ai/eval/execution.service.js.map +1 -1
- package/dist/modules/instance-ai/eval/llm-wire-server.d.ts +8 -3
- package/dist/modules/instance-ai/eval/llm-wire-server.js +147 -50
- package/dist/modules/instance-ai/eval/llm-wire-server.js.map +1 -1
- package/dist/modules/instance-ai/eval/mock-handler.js +45 -8
- package/dist/modules/instance-ai/eval/mock-handler.js.map +1 -1
- package/dist/modules/instance-ai/eval/mock-quirks.d.ts +4 -2
- package/dist/modules/instance-ai/eval/mock-quirks.js +83 -4
- package/dist/modules/instance-ai/eval/mock-quirks.js.map +1 -1
- package/dist/modules/instance-ai/eval/openai-envelope.d.ts +8 -0
- package/dist/modules/instance-ai/eval/openai-envelope.js +121 -8
- package/dist/modules/instance-ai/eval/openai-envelope.js.map +1 -1
- package/dist/modules/instance-ai/eval/openai-responses-envelope.d.ts +11 -0
- package/dist/modules/instance-ai/eval/openai-responses-envelope.js +238 -0
- package/dist/modules/instance-ai/eval/openai-responses-envelope.js.map +1 -0
- package/dist/modules/instance-ai/eval/request-binary-redactor.d.ts +1 -0
- package/dist/modules/instance-ai/eval/request-binary-redactor.js +74 -0
- package/dist/modules/instance-ai/eval/request-binary-redactor.js.map +1 -0
- package/dist/modules/instance-ai/eval/workflow-analysis.d.ts +19 -1
- package/dist/modules/instance-ai/eval/workflow-analysis.js +159 -76
- package/dist/modules/instance-ai/eval/workflow-analysis.js.map +1 -1
- package/dist/modules/instance-ai/extract-resolved-node-parameters.d.ts +7 -0
- package/dist/modules/instance-ai/extract-resolved-node-parameters.js +221 -0
- package/dist/modules/instance-ai/extract-resolved-node-parameters.js.map +1 -0
- package/dist/modules/instance-ai/instance-ai-memory.service.d.ts +7 -1
- package/dist/modules/instance-ai/instance-ai-memory.service.js +80 -3
- package/dist/modules/instance-ai/instance-ai-memory.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-settings.service.js +1 -16
- package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +1 -1
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +67 -7
- package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.module.d.ts +1 -1
- package/dist/modules/instance-ai/instance-ai.service.d.ts +24 -1
- package/dist/modules/instance-ai/instance-ai.service.js +400 -26
- package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.d.ts +1 -0
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js +1 -0
- package/dist/modules/instance-ai/liveness/instance-ai-liveness.service.js.map +1 -1
- package/dist/modules/instance-ai/message-parser.d.ts +2 -0
- package/dist/modules/instance-ai/message-parser.js +165 -36
- package/dist/modules/instance-ai/message-parser.js.map +1 -1
- package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.d.ts +2 -0
- package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.js +13 -0
- package/dist/modules/instance-ai/repositories/instance-ai-checkpoint.repository.js.map +1 -1
- package/dist/modules/instance-ai/repositories/instance-ai-pending-confirmation.repository.d.ts +12 -0
- package/dist/modules/instance-ai/repositories/instance-ai-pending-confirmation.repository.js +80 -0
- package/dist/modules/instance-ai/repositories/instance-ai-pending-confirmation.repository.js.map +1 -0
- package/dist/modules/instance-ai/storage/db-snapshot-storage.d.ts +1 -0
- package/dist/modules/instance-ai/storage/db-snapshot-storage.js +23 -0
- package/dist/modules/instance-ai/storage/db-snapshot-storage.js.map +1 -1
- package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.d.ts +10 -4
- package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.js +49 -37
- package/dist/modules/instance-ai/storage/typeorm-agent-checkpoint-store.js.map +1 -1
- package/dist/modules/instance-ai/web-research/index.d.ts +0 -2
- package/dist/modules/instance-ai/web-research/index.js +1 -5
- package/dist/modules/instance-ai/web-research/index.js.map +1 -1
- package/dist/modules/ldap.ee/helpers.ee.js +6 -2
- package/dist/modules/ldap.ee/helpers.ee.js.map +1 -1
- package/dist/modules/mcp/mcp.controller.js +13 -6
- package/dist/modules/mcp/mcp.controller.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +10 -2
- package/dist/modules/mcp/mcp.service.js +39 -6
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/mcp.settings.controller.d.ts +2 -0
- package/dist/modules/mcp/mcp.settings.service.d.ts +2 -0
- package/dist/modules/mcp/mcp.settings.service.js +6 -5
- package/dist/modules/mcp/mcp.settings.service.js.map +1 -1
- package/dist/modules/mcp/mcp.types.d.ts +6 -0
- package/dist/modules/mcp/mcp.types.js +9 -0
- package/dist/modules/mcp/mcp.types.js.map +1 -1
- package/dist/modules/mcp/tools/execute-workflow.tool.d.ts +6 -6
- package/dist/modules/mcp/tools/search-workflows.tool.d.ts +2 -1
- package/dist/modules/mcp/tools/search-workflows.tool.js +12 -4
- package/dist/modules/mcp/tools/search-workflows.tool.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/constants.d.ts +1 -1
- package/dist/modules/mcp/tools/workflow-builder/constants.js +2 -1
- package/dist/modules/mcp/tools/workflow-builder/constants.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js +6 -4
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js.map +1 -1
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.d.ts +67 -6
- package/dist/modules/mcp/tools/workflow-builder/validate-node.tool.d.ts +30 -0
- package/dist/modules/mcp/tools/workflow-builder/validate-node.tool.js +161 -0
- package/dist/modules/mcp/tools/workflow-builder/validate-node.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.d.ts +67 -6
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js +51 -0
- package/dist/modules/mcp/tools/workflow-builder/workflow-operations.js.map +1 -1
- package/dist/modules/mcp-registry/registry/mcp-registry.types.js.map +1 -1
- package/dist/modules/mcp-registry/synthesize-type-def.d.ts +2 -0
- package/dist/modules/mcp-registry/synthesize-type-def.js +35 -0
- package/dist/modules/mcp-registry/synthesize-type-def.js.map +1 -0
- package/dist/modules/n8n-packages/engine/import-pipeline.d.ts +24 -0
- package/dist/modules/n8n-packages/engine/import-pipeline.js +206 -0
- package/dist/modules/n8n-packages/engine/import-pipeline.js.map +1 -0
- package/dist/modules/n8n-packages/entities/credential/credential-requirements.extractor.d.ts +6 -0
- package/dist/modules/n8n-packages/entities/credential/credential-requirements.extractor.js +33 -0
- package/dist/modules/n8n-packages/entities/credential/credential-requirements.extractor.js.map +1 -0
- package/dist/modules/n8n-packages/entities/credential/credential.exporter.d.ts +23 -0
- package/dist/modules/n8n-packages/entities/credential/credential.exporter.js +68 -0
- package/dist/modules/n8n-packages/entities/credential/credential.exporter.js.map +1 -0
- package/dist/modules/n8n-packages/entities/credential/credential.serializer.d.ts +5 -0
- package/dist/modules/n8n-packages/entities/credential/credential.serializer.js +25 -0
- package/dist/modules/n8n-packages/entities/credential/credential.serializer.js.map +1 -0
- package/dist/modules/n8n-packages/entities/credential/credential.types.d.ts +6 -0
- package/dist/modules/n8n-packages/entities/credential/credential.types.js +3 -0
- package/dist/modules/n8n-packages/entities/credential/credential.types.js.map +1 -0
- package/dist/modules/n8n-packages/entities/requirements-extractor.d.ts +4 -0
- package/dist/modules/n8n-packages/entities/requirements-extractor.js +3 -0
- package/dist/modules/n8n-packages/entities/requirements-extractor.js.map +1 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.d.ts +12 -3
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js +11 -20
- package/dist/modules/n8n-packages/entities/workflow/workflow.exporter.js.map +1 -1
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.d.ts +3 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js +10 -0
- package/dist/modules/n8n-packages/entities/workflow/workflow.serializer.js.map +1 -1
- package/dist/modules/n8n-packages/io/package-reader.d.ts +6 -0
- package/dist/modules/n8n-packages/io/package-reader.js +3 -0
- package/dist/modules/n8n-packages/io/package-reader.js.map +1 -0
- package/dist/modules/n8n-packages/io/slug.utils.d.ts +1 -1
- package/dist/modules/n8n-packages/io/slug.utils.js +3 -3
- package/dist/modules/n8n-packages/io/slug.utils.js.map +1 -1
- package/dist/modules/n8n-packages/io/tar/tar-package-reader.d.ts +13 -0
- package/dist/modules/n8n-packages/io/tar/tar-package-reader.js +84 -0
- package/dist/modules/n8n-packages/io/tar/tar-package-reader.js.map +1 -0
- package/dist/modules/n8n-packages/io/unique-filename-allocator.d.ts +7 -0
- package/dist/modules/n8n-packages/io/unique-filename-allocator.js +27 -0
- package/dist/modules/n8n-packages/io/unique-filename-allocator.js.map +1 -0
- package/dist/modules/n8n-packages/n8n-packages.service.d.ts +7 -2
- package/dist/modules/n8n-packages/n8n-packages.service.js +21 -3
- package/dist/modules/n8n-packages/n8n-packages.service.js.map +1 -1
- package/dist/modules/n8n-packages/n8n-packages.types.d.ts +22 -0
- package/dist/modules/n8n-packages/spec/manifest.schema.d.ts +121 -4
- package/dist/modules/n8n-packages/spec/manifest.schema.js +22 -3
- package/dist/modules/n8n-packages/spec/manifest.schema.js.map +1 -1
- package/dist/modules/n8n-packages/spec/requirements.schema.d.ts +51 -0
- package/dist/modules/n8n-packages/spec/requirements.schema.js +14 -0
- package/dist/modules/n8n-packages/spec/requirements.schema.js.map +1 -0
- package/dist/modules/n8n-packages/spec/serialized/credential.schema.d.ts +15 -0
- package/dist/modules/n8n-packages/spec/serialized/credential.schema.js +12 -0
- package/dist/modules/n8n-packages/spec/serialized/credential.schema.js.map +1 -0
- package/dist/modules/n8n-packages/spec/serialized/workflow.schema.d.ts +4 -4
- package/dist/modules/n8n-packages/utils/import-package-upload.d.ts +13 -0
- package/dist/modules/n8n-packages/utils/import-package-upload.js +59 -0
- package/dist/modules/n8n-packages/utils/import-package-upload.js.map +1 -0
- package/dist/modules/otel/execution-level-tracer.js +15 -6
- package/dist/modules/otel/execution-level-tracer.js.map +1 -1
- package/dist/modules/otel/execution-level-tracer.types.d.ts +3 -0
- package/dist/modules/otel/execution-level-tracer.types.js.map +1 -1
- package/dist/modules/otel/otel-lifecycle-handler.d.ts +4 -2
- package/dist/modules/otel/otel-lifecycle-handler.js +69 -4
- package/dist/modules/otel/otel-lifecycle-handler.js.map +1 -1
- package/dist/modules/otel/otel.config.d.ts +1 -0
- package/dist/modules/otel/otel.config.js +5 -0
- package/dist/modules/otel/otel.config.js.map +1 -1
- package/dist/modules/otel/otel.constants.d.ts +2 -0
- package/dist/modules/otel/otel.constants.js +2 -0
- package/dist/modules/otel/otel.constants.js.map +1 -1
- package/dist/modules/redaction/instance-redaction-enforcement.service.d.ts +4 -0
- package/dist/modules/redaction/instance-redaction-enforcement.service.js +8 -0
- package/dist/modules/redaction/instance-redaction-enforcement.service.js.map +1 -1
- package/dist/modules/redaction/redaction-context-hook.d.ts +9 -0
- package/dist/modules/redaction/redaction-context-hook.js +57 -0
- package/dist/modules/redaction/redaction-context-hook.js.map +1 -0
- package/dist/modules/redaction/redaction.module.js +1 -0
- package/dist/modules/redaction/redaction.module.js.map +1 -1
- package/dist/modules/source-control.ee/constants.d.ts +1 -0
- package/dist/modules/source-control.ee/constants.js +2 -1
- package/dist/modules/source-control.ee/constants.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-status.service.ee.js +5 -0
- package/dist/modules/source-control.ee/source-control-status.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.controller.ee.d.ts +4 -2
- package/dist/modules/source-control.ee/source-control.controller.ee.js +32 -5
- package/dist/modules/source-control.ee/source-control.controller.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.service.ee.js +2 -0
- package/dist/modules/source-control.ee/source-control.service.ee.js.map +1 -1
- package/dist/modules/workflow-builder/workflow-builder-session.repository.js +2 -1
- package/dist/modules/workflow-builder/workflow-builder-session.repository.js.map +1 -1
- package/dist/node-catalog/node-catalog.service.d.ts +2 -0
- package/dist/node-catalog/node-catalog.service.js +38 -2
- package/dist/node-catalog/node-catalog.service.js.map +1 -1
- package/dist/oauth/oauth-browser-binding.service.d.ts +18 -0
- package/dist/oauth/oauth-browser-binding.service.js +68 -0
- package/dist/oauth/oauth-browser-binding.service.js.map +1 -0
- package/dist/oauth/oauth.service.d.ts +10 -4
- package/dist/oauth/oauth.service.js +87 -4
- package/dist/oauth/oauth.service.js.map +1 -1
- package/dist/oauth/types.d.ts +1 -0
- package/dist/oauth/types.js.map +1 -1
- package/dist/public-api/index.js +5 -1
- package/dist/public-api/index.js.map +1 -1
- package/dist/public-api/types.d.ts +6 -0
- package/dist/public-api/v1/handlers/credentials/credentials.service.js +1 -0
- package/dist/public-api/v1/handlers/credentials/credentials.service.js.map +1 -1
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.d.ts +5 -0
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js +22 -0
- package/dist/public-api/v1/handlers/n8n-packages/n8n-packages.handler.js.map +1 -1
- package/dist/public-api/v1/openapi.yml +207 -59
- package/dist/requests.d.ts +4 -0
- package/dist/scaling/constants.d.ts +2 -2
- package/dist/scaling/pubsub/pubsub.event-map.d.ts +5 -2
- package/dist/scaling/pubsub/pubsub.types.d.ts +2 -1
- package/dist/services/ai-workflow-builder.service.d.ts +6 -3
- package/dist/services/ai-workflow-builder.service.js +13 -5
- package/dist/services/ai-workflow-builder.service.js.map +1 -1
- package/dist/services/api-key-auth.strategy.d.ts +4 -1
- package/dist/services/api-key-auth.strategy.js +18 -2
- package/dist/services/api-key-auth.strategy.js.map +1 -1
- package/dist/services/ownership.service.d.ts +1 -0
- package/dist/services/ownership.service.js +7 -0
- package/dist/services/ownership.service.js.map +1 -1
- package/dist/services/project.service.ee.d.ts +6 -2
- package/dist/services/project.service.ee.js +30 -8
- package/dist/services/project.service.ee.js.map +1 -1
- package/dist/services/public-api-key.service.d.ts +21 -14
- package/dist/services/public-api-key.service.js +14 -9
- package/dist/services/public-api-key.service.js.map +1 -1
- package/dist/telemetry/index.d.ts +6 -9
- package/dist/telemetry/index.js +23 -9
- package/dist/telemetry/index.js.map +1 -1
- package/dist/webhooks/constants.js +5 -1
- package/dist/webhooks/constants.js.map +1 -1
- package/dist/webhooks/live-webhooks.d.ts +8 -1
- package/dist/webhooks/live-webhooks.js +37 -22
- package/dist/webhooks/live-webhooks.js.map +1 -1
- package/dist/webhooks/waiting-forms.js +8 -1
- package/dist/webhooks/waiting-forms.js.map +1 -1
- package/dist/webhooks/webhook-helpers.d.ts +1 -1
- package/dist/webhooks/webhook-helpers.js +20 -10
- package/dist/webhooks/webhook-helpers.js.map +1 -1
- package/dist/webhooks/webhook-request-handler.js +1 -1
- package/dist/webhooks/webhook-request-handler.js.map +1 -1
- package/dist/workflow-helpers.d.ts +6 -1
- package/dist/workflow-helpers.js +9 -1
- package/dist/workflow-helpers.js.map +1 -1
- package/dist/workflows/workflow-creation.service.d.ts +4 -1
- package/dist/workflows/workflow-creation.service.js +12 -3
- package/dist/workflows/workflow-creation.service.js.map +1 -1
- package/dist/workflows/workflow-execution.service.js +2 -0
- package/dist/workflows/workflow-execution.service.js.map +1 -1
- package/dist/workflows/workflow-finder.service.d.ts +1 -0
- package/dist/workflows/workflow-published-data.service.d.ts +11 -0
- package/dist/workflows/workflow-published-data.service.js +39 -0
- package/dist/workflows/workflow-published-data.service.js.map +1 -0
- package/dist/workflows/workflow-validation.service.d.ts +5 -1
- package/dist/workflows/workflow-validation.service.js +55 -2
- package/dist/workflows/workflow-validation.service.js.map +1 -1
- package/dist/workflows/workflow.service.js +4 -0
- package/dist/workflows/workflow.service.js.map +1 -1
- package/dist/workflows/workflows.controller.d.ts +8 -0
- package/package.json +45 -37
- package/templates/form-trigger-completion.handlebars +12 -1
- package/dist/modules/agents/integrations/agent-schedule.service.d.ts +0 -30
- package/dist/modules/agents/integrations/agent-schedule.service.js +0 -331
- package/dist/modules/agents/integrations/agent-schedule.service.js.map +0 -1
- package/dist/modules/instance-ai/web-research/brave-search.d.ts +0 -10
- package/dist/modules/instance-ai/web-research/brave-search.js +0 -44
- package/dist/modules/instance-ai/web-research/brave-search.js.map +0 -1
- package/dist/modules/instance-ai/web-research/searxng-search.d.ts +0 -6
- package/dist/modules/instance-ai/web-research/searxng-search.js +0 -39
- package/dist/modules/instance-ai/web-research/searxng-search.js.map +0 -1
|
@@ -0,0 +1,679 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeLinearContextQuery = executeLinearContextQuery;
|
|
4
|
+
exports.executeLinearAction = executeLinearAction;
|
|
5
|
+
exports.normalizeLinearIssue = normalizeLinearIssue;
|
|
6
|
+
exports.normalizeLinearComment = normalizeLinearComment;
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
const integration_error_codes_1 = require("../integration-error-codes");
|
|
9
|
+
const integration_helpers_1 = require("../integration-helpers");
|
|
10
|
+
const PLATFORM = 'linear';
|
|
11
|
+
const getUserSchema = zod_1.z.object({ userId: zod_1.z.string().min(1) });
|
|
12
|
+
const searchUsersSchema = zod_1.z
|
|
13
|
+
.object({
|
|
14
|
+
query: zod_1.z.string().min(1).optional(),
|
|
15
|
+
email: zod_1.z.string().min(1).optional(),
|
|
16
|
+
limit: zod_1.z.number().int().min(1).max(50).default(10),
|
|
17
|
+
cursor: zod_1.z.string().min(1).optional(),
|
|
18
|
+
includeBots: zod_1.z.boolean().default(false),
|
|
19
|
+
includeDeleted: zod_1.z.boolean().default(false),
|
|
20
|
+
})
|
|
21
|
+
.refine((input) => input.query !== undefined || input.email !== undefined, {
|
|
22
|
+
message: 'Provide query or email.',
|
|
23
|
+
});
|
|
24
|
+
const getIssueSchema = zod_1.z.object({
|
|
25
|
+
issueId: zod_1.z.string().min(1),
|
|
26
|
+
includeComments: zod_1.z.boolean().default(false),
|
|
27
|
+
commentsLimit: zod_1.z.number().int().min(1).max(20).default(10),
|
|
28
|
+
});
|
|
29
|
+
const searchIssuesSchema = zod_1.z.object({
|
|
30
|
+
query: zod_1.z.string().min(1),
|
|
31
|
+
limit: zod_1.z.number().int().min(1).max(50).default(10),
|
|
32
|
+
cursor: zod_1.z.string().min(1).optional(),
|
|
33
|
+
teamId: zod_1.z.string().min(1).optional(),
|
|
34
|
+
includeArchived: zod_1.z.boolean().default(false),
|
|
35
|
+
});
|
|
36
|
+
const getTeamSchema = zod_1.z.object({
|
|
37
|
+
teamId: zod_1.z.string().min(1),
|
|
38
|
+
});
|
|
39
|
+
const searchTeamsSchema = zod_1.z.object({
|
|
40
|
+
query: zod_1.z.string().min(1).optional(),
|
|
41
|
+
limit: zod_1.z.number().int().min(1).max(50).default(10),
|
|
42
|
+
cursor: zod_1.z.string().min(1).optional(),
|
|
43
|
+
includeArchived: zod_1.z.boolean().default(false),
|
|
44
|
+
});
|
|
45
|
+
const getProjectSchema = zod_1.z.object({
|
|
46
|
+
projectId: zod_1.z.string().min(1),
|
|
47
|
+
});
|
|
48
|
+
const searchProjectsSchema = zod_1.z.object({
|
|
49
|
+
query: zod_1.z.string().min(1).optional(),
|
|
50
|
+
limit: zod_1.z.number().int().min(1).max(50).default(10),
|
|
51
|
+
cursor: zod_1.z.string().min(1).optional(),
|
|
52
|
+
teamId: zod_1.z.string().min(1).optional(),
|
|
53
|
+
includeArchived: zod_1.z.boolean().default(false),
|
|
54
|
+
});
|
|
55
|
+
const searchLabelsSchema = zod_1.z.object({
|
|
56
|
+
query: zod_1.z.string().min(1).optional(),
|
|
57
|
+
limit: zod_1.z.number().int().min(1).max(50).default(10),
|
|
58
|
+
cursor: zod_1.z.string().min(1).optional(),
|
|
59
|
+
teamId: zod_1.z.string().min(1).optional(),
|
|
60
|
+
});
|
|
61
|
+
const searchIssueStatesSchema = zod_1.z.object({
|
|
62
|
+
query: zod_1.z.string().min(1).optional(),
|
|
63
|
+
limit: zod_1.z.number().int().min(1).max(50).default(10),
|
|
64
|
+
cursor: zod_1.z.string().min(1).optional(),
|
|
65
|
+
teamId: zod_1.z.string().min(1).optional(),
|
|
66
|
+
type: zod_1.z.enum(['backlog', 'unstarted', 'started', 'completed', 'canceled']).optional(),
|
|
67
|
+
});
|
|
68
|
+
const createIssueSchema = zod_1.z.object({
|
|
69
|
+
teamId: zod_1.z.string().min(1),
|
|
70
|
+
title: zod_1.z.string().min(1),
|
|
71
|
+
description: zod_1.z.string().min(1).optional(),
|
|
72
|
+
assigneeId: zod_1.z.string().min(1).optional(),
|
|
73
|
+
projectId: zod_1.z.string().min(1).optional(),
|
|
74
|
+
labelIds: zod_1.z.array(zod_1.z.string().min(1)).optional(),
|
|
75
|
+
priority: zod_1.z.number().int().optional(),
|
|
76
|
+
stateId: zod_1.z.string().min(1).optional(),
|
|
77
|
+
parentId: zod_1.z.string().min(1).optional(),
|
|
78
|
+
});
|
|
79
|
+
const nullableLinearIdSchema = zod_1.z.string().min(1).nullable();
|
|
80
|
+
const updateIssueSchema = zod_1.z
|
|
81
|
+
.object({
|
|
82
|
+
issueId: zod_1.z.string().min(1),
|
|
83
|
+
teamId: nullableLinearIdSchema.optional(),
|
|
84
|
+
title: zod_1.z.string().min(1).optional(),
|
|
85
|
+
description: zod_1.z.string().min(1).nullable().optional(),
|
|
86
|
+
assigneeId: nullableLinearIdSchema.optional(),
|
|
87
|
+
projectId: nullableLinearIdSchema.optional(),
|
|
88
|
+
labelIds: zod_1.z.array(zod_1.z.string().min(1)).optional(),
|
|
89
|
+
priority: zod_1.z.number().int().nullable().optional(),
|
|
90
|
+
stateId: nullableLinearIdSchema.optional(),
|
|
91
|
+
parentId: nullableLinearIdSchema.optional(),
|
|
92
|
+
})
|
|
93
|
+
.refine(hasUpdateIssueField, {
|
|
94
|
+
message: 'Provide at least one issue field to update.',
|
|
95
|
+
});
|
|
96
|
+
const createCommentSchema = zod_1.z.object({
|
|
97
|
+
issueId: zod_1.z.string().min(1),
|
|
98
|
+
body: zod_1.z.string().min(1),
|
|
99
|
+
parentCommentId: zod_1.z.string().min(1).optional(),
|
|
100
|
+
});
|
|
101
|
+
async function executeLinearContextQuery(params) {
|
|
102
|
+
const adapter = getLinearAdapter(params.chat);
|
|
103
|
+
if (!adapter)
|
|
104
|
+
return (0, integration_helpers_1.unsupportedQuery)(PLATFORM, params.query);
|
|
105
|
+
if (params.query === 'get_user') {
|
|
106
|
+
return await getLinearUser(adapter, getUserSchema.parse(params.input));
|
|
107
|
+
}
|
|
108
|
+
if (params.query === 'search_users') {
|
|
109
|
+
return await searchLinearUsers(adapter, searchUsersSchema.parse(params.input));
|
|
110
|
+
}
|
|
111
|
+
if (params.query === 'get_team') {
|
|
112
|
+
return await getLinearTeam(adapter, getTeamSchema.parse(params.input));
|
|
113
|
+
}
|
|
114
|
+
if (params.query === 'search_teams') {
|
|
115
|
+
return await searchLinearTeams(adapter, searchTeamsSchema.parse(params.input));
|
|
116
|
+
}
|
|
117
|
+
if (params.query === 'get_project') {
|
|
118
|
+
return await getLinearProject(adapter, getProjectSchema.parse(params.input));
|
|
119
|
+
}
|
|
120
|
+
if (params.query === 'search_projects') {
|
|
121
|
+
return await searchLinearProjects(adapter, searchProjectsSchema.parse(params.input));
|
|
122
|
+
}
|
|
123
|
+
if (params.query === 'search_labels') {
|
|
124
|
+
return await searchLinearLabels(adapter, searchLabelsSchema.parse(params.input));
|
|
125
|
+
}
|
|
126
|
+
if (params.query === 'search_issue_states') {
|
|
127
|
+
return await searchLinearIssueStates(adapter, searchIssueStatesSchema.parse(params.input));
|
|
128
|
+
}
|
|
129
|
+
if (params.query === 'get_issue') {
|
|
130
|
+
return await getLinearIssue(adapter, getIssueSchema.parse(params.input));
|
|
131
|
+
}
|
|
132
|
+
if (params.query === 'search_issues') {
|
|
133
|
+
return await searchLinearIssues(adapter, searchIssuesSchema.parse(params.input));
|
|
134
|
+
}
|
|
135
|
+
return (0, integration_helpers_1.unsupportedQuery)(PLATFORM, params.query);
|
|
136
|
+
}
|
|
137
|
+
async function executeLinearAction(params) {
|
|
138
|
+
if (params.action === 'create_issue') {
|
|
139
|
+
return await createLinearIssue(params.chat, params.descriptor, createIssueSchema.parse(params.input));
|
|
140
|
+
}
|
|
141
|
+
if (params.action === 'update_issue') {
|
|
142
|
+
return await updateLinearIssue(params.chat, params.descriptor, updateIssueSchema.parse(params.input));
|
|
143
|
+
}
|
|
144
|
+
if (params.action === 'create_comment') {
|
|
145
|
+
return await createLinearComment(params.chat, params.descriptor, createCommentSchema.parse(params.input));
|
|
146
|
+
}
|
|
147
|
+
return undefined;
|
|
148
|
+
}
|
|
149
|
+
async function getLinearUser(adapter, input) {
|
|
150
|
+
if (!hasMethod(adapter.client, 'user')) {
|
|
151
|
+
return (0, integration_helpers_1.unsupportedQuery)(PLATFORM, 'get_user');
|
|
152
|
+
}
|
|
153
|
+
const user = await adapter.client.user(input.userId);
|
|
154
|
+
return { ok: true, user: normalizeLinearUser(user) ?? null };
|
|
155
|
+
}
|
|
156
|
+
async function searchLinearUsers(adapter, input) {
|
|
157
|
+
if (!hasMethod(adapter.client, 'users')) {
|
|
158
|
+
return (0, integration_helpers_1.unsupportedQuery)(PLATFORM, 'search_users');
|
|
159
|
+
}
|
|
160
|
+
const response = await adapter.client.users({
|
|
161
|
+
filter: buildLinearUserSearchFilter(input),
|
|
162
|
+
first: input.limit,
|
|
163
|
+
...(input.cursor ? { after: input.cursor } : {}),
|
|
164
|
+
includeArchived: input.includeDeleted,
|
|
165
|
+
includeDisabled: input.includeDeleted,
|
|
166
|
+
});
|
|
167
|
+
const users = linearNodes(response).map(normalizeLinearUser).filter(integration_helpers_1.isDefined);
|
|
168
|
+
const nextCursor = extractLinearNextCursor(response);
|
|
169
|
+
return {
|
|
170
|
+
ok: true,
|
|
171
|
+
users,
|
|
172
|
+
resultCount: users.length,
|
|
173
|
+
...(nextCursor ? { nextCursor } : {}),
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
async function getLinearTeam(adapter, input) {
|
|
177
|
+
if (!hasMethod(adapter.client, 'team')) {
|
|
178
|
+
return (0, integration_helpers_1.unsupportedQuery)(PLATFORM, 'get_team');
|
|
179
|
+
}
|
|
180
|
+
const team = await adapter.client.team(input.teamId);
|
|
181
|
+
return { ok: true, team: normalizeLinearTeam(team) ?? null };
|
|
182
|
+
}
|
|
183
|
+
async function searchLinearTeams(adapter, input) {
|
|
184
|
+
if (!hasMethod(adapter.client, 'teams')) {
|
|
185
|
+
return (0, integration_helpers_1.unsupportedQuery)(PLATFORM, 'search_teams');
|
|
186
|
+
}
|
|
187
|
+
const response = await adapter.client.teams(buildLinearConnectionOptions(input, { includeArchived: true }));
|
|
188
|
+
const teams = filterLinearRecords(linearNodes(response).map(normalizeLinearTeam).filter(integration_helpers_1.isDefined), input.query, ['teamId', 'key', 'name', 'description', 'url']);
|
|
189
|
+
return linearSearchResult('teams', teams, response);
|
|
190
|
+
}
|
|
191
|
+
async function getLinearProject(adapter, input) {
|
|
192
|
+
if (!hasMethod(adapter.client, 'project')) {
|
|
193
|
+
return (0, integration_helpers_1.unsupportedQuery)(PLATFORM, 'get_project');
|
|
194
|
+
}
|
|
195
|
+
const project = await adapter.client.project(input.projectId);
|
|
196
|
+
return { ok: true, project: normalizeLinearProject(project) ?? null };
|
|
197
|
+
}
|
|
198
|
+
async function searchLinearProjects(adapter, input) {
|
|
199
|
+
const options = buildLinearConnectionOptions(input, { includeArchived: true });
|
|
200
|
+
const response = input.teamId
|
|
201
|
+
? await callLinearTeamConnection(adapter, input.teamId, ['projects'], options)
|
|
202
|
+
: await callLinearProjectSearch(adapter, input, options);
|
|
203
|
+
if (!response)
|
|
204
|
+
return (0, integration_helpers_1.unsupportedQuery)(PLATFORM, 'search_projects');
|
|
205
|
+
const projects = filterLinearRecords(linearNodes(response).map(normalizeLinearProject).filter(integration_helpers_1.isDefined), input.query, ['projectId', 'name', 'description', 'url', 'state']);
|
|
206
|
+
return linearSearchResult('projects', projects, response);
|
|
207
|
+
}
|
|
208
|
+
async function searchLinearLabels(adapter, input) {
|
|
209
|
+
const options = buildLinearConnectionOptions(input);
|
|
210
|
+
const response = input.teamId
|
|
211
|
+
? await callLinearTeamConnection(adapter, input.teamId, ['labels'], options)
|
|
212
|
+
: await callLinearIssueLabels(adapter, options);
|
|
213
|
+
if (!response)
|
|
214
|
+
return (0, integration_helpers_1.unsupportedQuery)(PLATFORM, 'search_labels');
|
|
215
|
+
const labels = filterLinearRecords(linearNodes(response).map(normalizeLinearLabel).filter(integration_helpers_1.isDefined), input.query, ['labelId', 'name', 'description', 'color']);
|
|
216
|
+
return linearSearchResult('labels', labels, response);
|
|
217
|
+
}
|
|
218
|
+
async function searchLinearIssueStates(adapter, input) {
|
|
219
|
+
const options = buildLinearConnectionOptions(input);
|
|
220
|
+
const response = input.teamId
|
|
221
|
+
? await callLinearTeamConnection(adapter, input.teamId, ['states', 'workflowStates'], options)
|
|
222
|
+
: await callLinearWorkflowStates(adapter, options);
|
|
223
|
+
if (!response)
|
|
224
|
+
return (0, integration_helpers_1.unsupportedQuery)(PLATFORM, 'search_issue_states');
|
|
225
|
+
const states = filterLinearIssueStates(linearNodes(response).map(normalizeLinearWorkflowState).filter(integration_helpers_1.isDefined), input);
|
|
226
|
+
return linearSearchResult('states', states, response);
|
|
227
|
+
}
|
|
228
|
+
async function getLinearIssue(adapter, input) {
|
|
229
|
+
if (!hasMethod(adapter.client, 'issue')) {
|
|
230
|
+
return (0, integration_helpers_1.unsupportedQuery)(PLATFORM, 'get_issue');
|
|
231
|
+
}
|
|
232
|
+
const issue = await adapter.client.issue(input.issueId);
|
|
233
|
+
if (!issue)
|
|
234
|
+
return { ok: true, issue: null };
|
|
235
|
+
return {
|
|
236
|
+
ok: true,
|
|
237
|
+
issue: await normalizeLinearIssue(issue, {
|
|
238
|
+
includeComments: input.includeComments,
|
|
239
|
+
commentsLimit: input.commentsLimit,
|
|
240
|
+
}),
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
async function searchLinearIssues(adapter, input) {
|
|
244
|
+
if (!hasMethod(adapter.client, 'searchIssues')) {
|
|
245
|
+
return (0, integration_helpers_1.unsupportedQuery)(PLATFORM, 'search_issues');
|
|
246
|
+
}
|
|
247
|
+
const response = await adapter.client.searchIssues(input.query, {
|
|
248
|
+
first: input.limit,
|
|
249
|
+
...(input.cursor ? { after: input.cursor } : {}),
|
|
250
|
+
...(input.teamId ? { teamId: input.teamId } : {}),
|
|
251
|
+
includeArchived: input.includeArchived,
|
|
252
|
+
});
|
|
253
|
+
const issues = linearNodes(response).map(summarizeLinearIssue);
|
|
254
|
+
const totalCount = (0, integration_helpers_1.numberProperty)(response, 'totalCount');
|
|
255
|
+
const nextCursor = extractLinearNextCursor(response);
|
|
256
|
+
return {
|
|
257
|
+
ok: true,
|
|
258
|
+
issues,
|
|
259
|
+
resultCount: issues.length,
|
|
260
|
+
...(totalCount !== undefined ? { totalCount } : {}),
|
|
261
|
+
...(nextCursor ? { nextCursor } : {}),
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
function extractLinearNextCursor(response) {
|
|
265
|
+
if (!(0, integration_helpers_1.isRecord)(response))
|
|
266
|
+
return undefined;
|
|
267
|
+
const pageInfo = response.pageInfo;
|
|
268
|
+
if (!(0, integration_helpers_1.isRecord)(pageInfo))
|
|
269
|
+
return undefined;
|
|
270
|
+
if (pageInfo.hasNextPage !== true)
|
|
271
|
+
return undefined;
|
|
272
|
+
return (0, integration_helpers_1.stringProperty)(pageInfo, 'endCursor');
|
|
273
|
+
}
|
|
274
|
+
function buildLinearConnectionOptions(input, options = {}) {
|
|
275
|
+
return (0, integration_helpers_1.removeUndefinedValues)({
|
|
276
|
+
first: input.limit,
|
|
277
|
+
...(input.cursor ? { after: input.cursor } : {}),
|
|
278
|
+
...(options.includeArchived ? { includeArchived: input.includeArchived ?? false } : {}),
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
async function callLinearProjectSearch(adapter, input, options) {
|
|
282
|
+
if (input.query && hasMethod(adapter.client, 'searchProjects')) {
|
|
283
|
+
return await adapter.client.searchProjects(input.query, options);
|
|
284
|
+
}
|
|
285
|
+
if (hasMethod(adapter.client, 'projects')) {
|
|
286
|
+
return await adapter.client.projects(options);
|
|
287
|
+
}
|
|
288
|
+
return undefined;
|
|
289
|
+
}
|
|
290
|
+
async function callLinearIssueLabels(adapter, options) {
|
|
291
|
+
if (!hasMethod(adapter.client, 'issueLabels'))
|
|
292
|
+
return undefined;
|
|
293
|
+
return await adapter.client.issueLabels(options);
|
|
294
|
+
}
|
|
295
|
+
async function callLinearWorkflowStates(adapter, options) {
|
|
296
|
+
if (!hasMethod(adapter.client, 'workflowStates'))
|
|
297
|
+
return undefined;
|
|
298
|
+
return await adapter.client.workflowStates(options);
|
|
299
|
+
}
|
|
300
|
+
async function callLinearTeamConnection(adapter, teamId, keys, options) {
|
|
301
|
+
if (!hasMethod(adapter.client, 'team'))
|
|
302
|
+
return undefined;
|
|
303
|
+
const team = await adapter.client.team(teamId);
|
|
304
|
+
if (!(0, integration_helpers_1.isRecord)(team))
|
|
305
|
+
return undefined;
|
|
306
|
+
for (const key of keys) {
|
|
307
|
+
const response = await callLinearConnection(team, key, options);
|
|
308
|
+
if (response !== undefined)
|
|
309
|
+
return response;
|
|
310
|
+
}
|
|
311
|
+
return undefined;
|
|
312
|
+
}
|
|
313
|
+
function linearSearchResult(key, records, response) {
|
|
314
|
+
const nextCursor = extractLinearNextCursor(response);
|
|
315
|
+
const totalCount = (0, integration_helpers_1.numberProperty)(response, 'totalCount');
|
|
316
|
+
return {
|
|
317
|
+
ok: true,
|
|
318
|
+
[key]: records,
|
|
319
|
+
resultCount: records.length,
|
|
320
|
+
...(totalCount !== undefined ? { totalCount } : {}),
|
|
321
|
+
...(nextCursor ? { nextCursor } : {}),
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
function filterLinearRecords(records, query, keys) {
|
|
325
|
+
const term = query?.trim().toLowerCase();
|
|
326
|
+
if (!term)
|
|
327
|
+
return records;
|
|
328
|
+
return records.filter((record) => keys.some((key) => {
|
|
329
|
+
const value = (0, integration_helpers_1.stringProperty)(record, key);
|
|
330
|
+
return value !== undefined && value.toLowerCase().includes(term);
|
|
331
|
+
}));
|
|
332
|
+
}
|
|
333
|
+
function filterLinearIssueStates(states, input) {
|
|
334
|
+
const queryFilteredStates = filterLinearRecords(states, input.query, [
|
|
335
|
+
'stateId',
|
|
336
|
+
'name',
|
|
337
|
+
'type',
|
|
338
|
+
'color',
|
|
339
|
+
]);
|
|
340
|
+
if (!input.type)
|
|
341
|
+
return queryFilteredStates;
|
|
342
|
+
return queryFilteredStates.filter((state) => (0, integration_helpers_1.stringProperty)(state, 'type') === input.type);
|
|
343
|
+
}
|
|
344
|
+
async function createLinearIssue(chat, descriptor, input) {
|
|
345
|
+
const adapter = getLinearAdapter(chat);
|
|
346
|
+
if (!adapter || !hasMethod(adapter.client, 'createIssue')) {
|
|
347
|
+
return (0, integration_helpers_1.unsupportedAction)(PLATFORM, 'create_issue');
|
|
348
|
+
}
|
|
349
|
+
const payload = await adapter.client.createIssue((0, integration_helpers_1.removeUndefinedValues)({ ...input }));
|
|
350
|
+
const rawIssue = await awaitableProperty(payload, 'issue');
|
|
351
|
+
const normalizedIssue = await normalizeLinearIssue(rawIssue ?? payload);
|
|
352
|
+
const issueId = (0, integration_helpers_1.stringProperty)(normalizedIssue, 'issueId') ??
|
|
353
|
+
(0, integration_helpers_1.stringProperty)(payload, 'issueId') ??
|
|
354
|
+
(0, integration_helpers_1.stringProperty)(normalizedIssue, 'identifier');
|
|
355
|
+
if (!issueId) {
|
|
356
|
+
return (0, integration_helpers_1.integrationError)(integration_error_codes_1.INTEGRATION_ERROR_CODES.ACTION_FAILED, 'Linear did not return an issue ID for the created issue.');
|
|
357
|
+
}
|
|
358
|
+
return {
|
|
359
|
+
ok: true,
|
|
360
|
+
issue: normalizedIssue,
|
|
361
|
+
messageContext: {
|
|
362
|
+
integrationConnectionId: descriptor.integrationConnectionId,
|
|
363
|
+
platform: descriptor.integration.type,
|
|
364
|
+
target: { type: 'thread', threadId: `linear:${issueId}` },
|
|
365
|
+
subject: buildLinearIssueSubject(normalizedIssue, issueId),
|
|
366
|
+
updatedAt: new Date().toISOString(),
|
|
367
|
+
},
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
async function updateLinearIssue(chat, descriptor, input) {
|
|
371
|
+
const adapter = getLinearAdapter(chat);
|
|
372
|
+
if (!adapter || !hasMethod(adapter.client, 'updateIssue')) {
|
|
373
|
+
return (0, integration_helpers_1.unsupportedAction)(PLATFORM, 'update_issue');
|
|
374
|
+
}
|
|
375
|
+
const payload = await adapter.client.updateIssue(input.issueId, buildLinearIssueUpdatePayload(input));
|
|
376
|
+
const rawIssue = await awaitableProperty(payload, 'issue');
|
|
377
|
+
const normalizedIssue = await normalizeLinearIssue(rawIssue ?? payload);
|
|
378
|
+
const issueId = (0, integration_helpers_1.stringProperty)(normalizedIssue, 'issueId') ?? input.issueId;
|
|
379
|
+
return {
|
|
380
|
+
ok: true,
|
|
381
|
+
issue: normalizedIssue,
|
|
382
|
+
messageContext: {
|
|
383
|
+
integrationConnectionId: descriptor.integrationConnectionId,
|
|
384
|
+
platform: descriptor.integration.type,
|
|
385
|
+
target: { type: 'thread', threadId: `linear:${issueId}` },
|
|
386
|
+
subject: buildLinearIssueSubject(normalizedIssue, issueId),
|
|
387
|
+
updatedAt: new Date().toISOString(),
|
|
388
|
+
},
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
async function createLinearComment(chat, descriptor, input) {
|
|
392
|
+
const adapter = getLinearAdapter(chat);
|
|
393
|
+
if (!adapter || !hasMethod(adapter.client, 'createComment')) {
|
|
394
|
+
return (0, integration_helpers_1.unsupportedAction)(PLATFORM, 'create_comment');
|
|
395
|
+
}
|
|
396
|
+
const payload = await adapter.client.createComment((0, integration_helpers_1.removeUndefinedValues)({
|
|
397
|
+
issueId: input.issueId,
|
|
398
|
+
body: input.body,
|
|
399
|
+
parentId: input.parentCommentId,
|
|
400
|
+
}));
|
|
401
|
+
const rawComment = await awaitableProperty(payload, 'comment');
|
|
402
|
+
const normalizedComment = await normalizeLinearComment(rawComment ?? payload);
|
|
403
|
+
const commentId = (0, integration_helpers_1.stringProperty)(normalizedComment, 'commentId') ?? (0, integration_helpers_1.stringProperty)(payload, 'commentId');
|
|
404
|
+
return {
|
|
405
|
+
ok: true,
|
|
406
|
+
comment: normalizedComment,
|
|
407
|
+
messageContext: {
|
|
408
|
+
integrationConnectionId: descriptor.integrationConnectionId,
|
|
409
|
+
platform: descriptor.integration.type,
|
|
410
|
+
target: {
|
|
411
|
+
type: 'thread',
|
|
412
|
+
threadId: input.parentCommentId
|
|
413
|
+
? `linear:${input.issueId}:c:${input.parentCommentId}`
|
|
414
|
+
: `linear:${input.issueId}`,
|
|
415
|
+
},
|
|
416
|
+
...(commentId ? { messageId: commentId } : {}),
|
|
417
|
+
subject: { type: 'issue', id: input.issueId },
|
|
418
|
+
updatedAt: new Date().toISOString(),
|
|
419
|
+
},
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
function buildLinearIssueUpdatePayload(input) {
|
|
423
|
+
return (0, integration_helpers_1.removeUndefinedValues)({
|
|
424
|
+
teamId: input.teamId,
|
|
425
|
+
title: input.title,
|
|
426
|
+
description: input.description,
|
|
427
|
+
assigneeId: input.assigneeId,
|
|
428
|
+
projectId: input.projectId,
|
|
429
|
+
labelIds: input.labelIds,
|
|
430
|
+
priority: input.priority,
|
|
431
|
+
stateId: input.stateId,
|
|
432
|
+
parentId: input.parentId,
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
function getLinearAdapter(chat) {
|
|
436
|
+
const adapter = chat.getAdapter('linear');
|
|
437
|
+
if (!(0, integration_helpers_1.isRecord)(adapter) || !(0, integration_helpers_1.isRecord)(adapter.client))
|
|
438
|
+
return undefined;
|
|
439
|
+
return { client: adapter.client };
|
|
440
|
+
}
|
|
441
|
+
function hasMethod(client, key) {
|
|
442
|
+
return typeof client[key] === 'function';
|
|
443
|
+
}
|
|
444
|
+
function buildLinearUserSearchFilter(input) {
|
|
445
|
+
const term = buildLinearUserSearchTermFilter(input);
|
|
446
|
+
if (input.includeBots)
|
|
447
|
+
return term;
|
|
448
|
+
return { and: [term, { app: { eq: false } }] };
|
|
449
|
+
}
|
|
450
|
+
function buildLinearUserSearchTermFilter(input) {
|
|
451
|
+
if (input.email) {
|
|
452
|
+
return { email: { eqIgnoreCase: input.email.trim() } };
|
|
453
|
+
}
|
|
454
|
+
const query = input.query?.trim() ?? '';
|
|
455
|
+
return {
|
|
456
|
+
or: [
|
|
457
|
+
{ name: { containsIgnoreCase: query } },
|
|
458
|
+
{ displayName: { containsIgnoreCase: query } },
|
|
459
|
+
{ email: { containsIgnoreCase: query } },
|
|
460
|
+
],
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
function hasUpdateIssueField(input) {
|
|
464
|
+
return (input.teamId !== undefined ||
|
|
465
|
+
input.title !== undefined ||
|
|
466
|
+
input.description !== undefined ||
|
|
467
|
+
input.assigneeId !== undefined ||
|
|
468
|
+
input.projectId !== undefined ||
|
|
469
|
+
input.labelIds !== undefined ||
|
|
470
|
+
input.priority !== undefined ||
|
|
471
|
+
input.stateId !== undefined ||
|
|
472
|
+
input.parentId !== undefined);
|
|
473
|
+
}
|
|
474
|
+
async function normalizeLinearIssue(value, options = {}) {
|
|
475
|
+
const issue = (0, integration_helpers_1.isRecord)(value) ? value : {};
|
|
476
|
+
const [state, assignee, creator, team, project, labelsConnection] = await Promise.all([
|
|
477
|
+
awaitableProperty(issue, 'state'),
|
|
478
|
+
awaitableProperty(issue, 'assignee'),
|
|
479
|
+
awaitableProperty(issue, 'creator'),
|
|
480
|
+
awaitableProperty(issue, 'team'),
|
|
481
|
+
awaitableProperty(issue, 'project'),
|
|
482
|
+
callLinearConnection(issue, 'labels', { first: 50 }),
|
|
483
|
+
]);
|
|
484
|
+
const priority = normalizeLinearPriority(issue);
|
|
485
|
+
const comments = options.includeComments
|
|
486
|
+
? await normalizeLinearComments(issue, options.commentsLimit ?? 10)
|
|
487
|
+
: undefined;
|
|
488
|
+
return (0, integration_helpers_1.removeUndefinedValues)({
|
|
489
|
+
issueId: (0, integration_helpers_1.stringProperty)(issue, 'id'),
|
|
490
|
+
identifier: (0, integration_helpers_1.stringProperty)(issue, 'identifier'),
|
|
491
|
+
title: (0, integration_helpers_1.stringProperty)(issue, 'title'),
|
|
492
|
+
description: (0, integration_helpers_1.stringProperty)(issue, 'description'),
|
|
493
|
+
url: (0, integration_helpers_1.stringProperty)(issue, 'url'),
|
|
494
|
+
priority,
|
|
495
|
+
state: normalizeLinearState(state),
|
|
496
|
+
assignee: normalizeLinearUser(assignee),
|
|
497
|
+
creator: normalizeLinearUser(creator),
|
|
498
|
+
team: normalizeLinearTeam(team),
|
|
499
|
+
project: normalizeLinearProject(project),
|
|
500
|
+
labels: linearNodes(labelsConnection).map(normalizeLinearLabel).filter(integration_helpers_1.isDefined),
|
|
501
|
+
createdAt: (0, integration_helpers_1.isoDateProperty)(issue, 'createdAt'),
|
|
502
|
+
updatedAt: (0, integration_helpers_1.isoDateProperty)(issue, 'updatedAt'),
|
|
503
|
+
...(comments ? { comments } : {}),
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
function summarizeLinearIssue(value) {
|
|
507
|
+
const issue = (0, integration_helpers_1.isRecord)(value) ? value : {};
|
|
508
|
+
return (0, integration_helpers_1.removeUndefinedValues)({
|
|
509
|
+
issueId: (0, integration_helpers_1.stringProperty)(issue, 'id'),
|
|
510
|
+
identifier: (0, integration_helpers_1.stringProperty)(issue, 'identifier'),
|
|
511
|
+
title: (0, integration_helpers_1.stringProperty)(issue, 'title'),
|
|
512
|
+
url: (0, integration_helpers_1.stringProperty)(issue, 'url'),
|
|
513
|
+
priority: normalizeLinearPriority(issue),
|
|
514
|
+
createdAt: (0, integration_helpers_1.isoDateProperty)(issue, 'createdAt'),
|
|
515
|
+
updatedAt: (0, integration_helpers_1.isoDateProperty)(issue, 'updatedAt'),
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
async function normalizeLinearComments(issue, commentsLimit) {
|
|
519
|
+
const commentsConnection = await callLinearConnection(issue, 'comments', {
|
|
520
|
+
first: commentsLimit,
|
|
521
|
+
});
|
|
522
|
+
if (!commentsConnection)
|
|
523
|
+
return undefined;
|
|
524
|
+
return await Promise.all(linearNodes(commentsConnection).map(async (comment) => await normalizeLinearComment(comment)));
|
|
525
|
+
}
|
|
526
|
+
async function normalizeLinearComment(value) {
|
|
527
|
+
const comment = (0, integration_helpers_1.isRecord)(value) ? value : {};
|
|
528
|
+
const author = await awaitableProperty(comment, 'user');
|
|
529
|
+
return (0, integration_helpers_1.removeUndefinedValues)({
|
|
530
|
+
commentId: (0, integration_helpers_1.stringProperty)(comment, 'id'),
|
|
531
|
+
body: (0, integration_helpers_1.stringProperty)(comment, 'body'),
|
|
532
|
+
url: (0, integration_helpers_1.stringProperty)(comment, 'url'),
|
|
533
|
+
createdAt: (0, integration_helpers_1.isoDateProperty)(comment, 'createdAt'),
|
|
534
|
+
updatedAt: (0, integration_helpers_1.isoDateProperty)(comment, 'updatedAt'),
|
|
535
|
+
author: normalizeLinearUser(author),
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
function normalizeLinearUser(value) {
|
|
539
|
+
if (!(0, integration_helpers_1.isRecord)(value))
|
|
540
|
+
return undefined;
|
|
541
|
+
const userId = (0, integration_helpers_1.stringProperty)(value, 'id');
|
|
542
|
+
if (!userId)
|
|
543
|
+
return undefined;
|
|
544
|
+
return (0, integration_helpers_1.removeUndefinedValues)({
|
|
545
|
+
userId,
|
|
546
|
+
name: (0, integration_helpers_1.stringProperty)(value, 'name') ?? userId,
|
|
547
|
+
displayName: (0, integration_helpers_1.stringProperty)(value, 'displayName'),
|
|
548
|
+
email: (0, integration_helpers_1.stringProperty)(value, 'email'),
|
|
549
|
+
avatarUrl: (0, integration_helpers_1.stringProperty)(value, 'avatarUrl'),
|
|
550
|
+
active: (0, integration_helpers_1.booleanProperty)(value, 'active'),
|
|
551
|
+
isBot: (0, integration_helpers_1.booleanProperty)(value, 'app') ?? false,
|
|
552
|
+
isAssignable: (0, integration_helpers_1.booleanProperty)(value, 'isAssignable'),
|
|
553
|
+
isMentionable: (0, integration_helpers_1.booleanProperty)(value, 'isMentionable'),
|
|
554
|
+
url: (0, integration_helpers_1.stringProperty)(value, 'url'),
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
function normalizeLinearState(value) {
|
|
558
|
+
if (!(0, integration_helpers_1.isRecord)(value))
|
|
559
|
+
return undefined;
|
|
560
|
+
return (0, integration_helpers_1.removeUndefinedValues)({
|
|
561
|
+
id: (0, integration_helpers_1.stringProperty)(value, 'id'),
|
|
562
|
+
name: (0, integration_helpers_1.stringProperty)(value, 'name'),
|
|
563
|
+
type: (0, integration_helpers_1.stringProperty)(value, 'type'),
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
function normalizeLinearTeam(value) {
|
|
567
|
+
if (!(0, integration_helpers_1.isRecord)(value))
|
|
568
|
+
return undefined;
|
|
569
|
+
return (0, integration_helpers_1.removeUndefinedValues)({
|
|
570
|
+
teamId: (0, integration_helpers_1.stringProperty)(value, 'id'),
|
|
571
|
+
key: (0, integration_helpers_1.stringProperty)(value, 'key'),
|
|
572
|
+
name: (0, integration_helpers_1.stringProperty)(value, 'name'),
|
|
573
|
+
description: (0, integration_helpers_1.stringProperty)(value, 'description'),
|
|
574
|
+
url: (0, integration_helpers_1.stringProperty)(value, 'url'),
|
|
575
|
+
isPrivate: (0, integration_helpers_1.booleanProperty)(value, 'private'),
|
|
576
|
+
isArchived: (0, integration_helpers_1.booleanProperty)(value, 'archived') ??
|
|
577
|
+
((0, integration_helpers_1.stringProperty)(value, 'archivedAt') ? true : undefined),
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
function normalizeLinearProject(value) {
|
|
581
|
+
if (!(0, integration_helpers_1.isRecord)(value))
|
|
582
|
+
return undefined;
|
|
583
|
+
return (0, integration_helpers_1.removeUndefinedValues)({
|
|
584
|
+
projectId: (0, integration_helpers_1.stringProperty)(value, 'id'),
|
|
585
|
+
name: (0, integration_helpers_1.stringProperty)(value, 'name'),
|
|
586
|
+
description: (0, integration_helpers_1.stringProperty)(value, 'description'),
|
|
587
|
+
url: (0, integration_helpers_1.stringProperty)(value, 'url'),
|
|
588
|
+
state: (0, integration_helpers_1.stringProperty)(value, 'state'),
|
|
589
|
+
color: (0, integration_helpers_1.stringProperty)(value, 'color'),
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
function normalizeLinearLabel(value) {
|
|
593
|
+
if (!(0, integration_helpers_1.isRecord)(value))
|
|
594
|
+
return undefined;
|
|
595
|
+
const labelId = (0, integration_helpers_1.stringProperty)(value, 'id');
|
|
596
|
+
const name = (0, integration_helpers_1.stringProperty)(value, 'name');
|
|
597
|
+
if (!labelId || !name)
|
|
598
|
+
return undefined;
|
|
599
|
+
return (0, integration_helpers_1.removeUndefinedValues)({
|
|
600
|
+
labelId,
|
|
601
|
+
name,
|
|
602
|
+
color: (0, integration_helpers_1.stringProperty)(value, 'color'),
|
|
603
|
+
description: (0, integration_helpers_1.stringProperty)(value, 'description'),
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
function normalizeLinearWorkflowState(value) {
|
|
607
|
+
if (!(0, integration_helpers_1.isRecord)(value))
|
|
608
|
+
return undefined;
|
|
609
|
+
const stateId = (0, integration_helpers_1.stringProperty)(value, 'id');
|
|
610
|
+
if (!stateId)
|
|
611
|
+
return undefined;
|
|
612
|
+
return (0, integration_helpers_1.removeUndefinedValues)({
|
|
613
|
+
stateId,
|
|
614
|
+
name: (0, integration_helpers_1.stringProperty)(value, 'name'),
|
|
615
|
+
type: (0, integration_helpers_1.stringProperty)(value, 'type'),
|
|
616
|
+
color: (0, integration_helpers_1.stringProperty)(value, 'color'),
|
|
617
|
+
position: (0, integration_helpers_1.numberProperty)(value, 'position'),
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
function normalizeLinearPriority(issue) {
|
|
621
|
+
const value = (0, integration_helpers_1.numberProperty)(issue, 'priority');
|
|
622
|
+
const label = (0, integration_helpers_1.stringProperty)(issue, 'priorityLabel');
|
|
623
|
+
if (value === undefined && !label)
|
|
624
|
+
return undefined;
|
|
625
|
+
return (0, integration_helpers_1.removeUndefinedValues)({ value, label });
|
|
626
|
+
}
|
|
627
|
+
function buildLinearIssueSubject(issue, fallbackIssueId) {
|
|
628
|
+
const identifier = (0, integration_helpers_1.stringProperty)(issue, 'identifier');
|
|
629
|
+
const title = (0, integration_helpers_1.stringProperty)(issue, 'title');
|
|
630
|
+
const description = (0, integration_helpers_1.stringProperty)(issue, 'description');
|
|
631
|
+
const url = (0, integration_helpers_1.stringProperty)(issue, 'url');
|
|
632
|
+
const status = (0, integration_helpers_1.stringProperty)((0, integration_helpers_1.isRecord)(issue.state) ? issue.state : undefined, 'name');
|
|
633
|
+
const labels = linearLabelNames(issue);
|
|
634
|
+
const assignee = linearSubjectPerson(issue.assignee);
|
|
635
|
+
return {
|
|
636
|
+
type: 'issue',
|
|
637
|
+
id: identifier ?? fallbackIssueId,
|
|
638
|
+
...(title ? { title } : {}),
|
|
639
|
+
...(description ? { description } : {}),
|
|
640
|
+
...(url ? { url } : {}),
|
|
641
|
+
...(status ? { status } : {}),
|
|
642
|
+
...(labels.length > 0 ? { labels } : {}),
|
|
643
|
+
...(assignee ? { assignee } : {}),
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
function linearLabelNames(issue) {
|
|
647
|
+
const labels = issue.labels;
|
|
648
|
+
if (!Array.isArray(labels))
|
|
649
|
+
return [];
|
|
650
|
+
return labels
|
|
651
|
+
.map((label) => (0, integration_helpers_1.stringProperty)(label, 'name'))
|
|
652
|
+
.filter((label) => label !== undefined);
|
|
653
|
+
}
|
|
654
|
+
function linearSubjectPerson(value) {
|
|
655
|
+
if (!(0, integration_helpers_1.isRecord)(value))
|
|
656
|
+
return undefined;
|
|
657
|
+
const id = (0, integration_helpers_1.stringProperty)(value, 'userId') ?? (0, integration_helpers_1.stringProperty)(value, 'id');
|
|
658
|
+
const name = (0, integration_helpers_1.stringProperty)(value, 'name') ?? (0, integration_helpers_1.stringProperty)(value, 'displayName');
|
|
659
|
+
if (!id || !name)
|
|
660
|
+
return undefined;
|
|
661
|
+
return { id, name };
|
|
662
|
+
}
|
|
663
|
+
async function awaitableProperty(value, key) {
|
|
664
|
+
if (!(0, integration_helpers_1.isRecord)(value))
|
|
665
|
+
return undefined;
|
|
666
|
+
return await Promise.resolve(value[key]);
|
|
667
|
+
}
|
|
668
|
+
async function callLinearConnection(record, key, options) {
|
|
669
|
+
const fn = record[key];
|
|
670
|
+
if (typeof fn !== 'function')
|
|
671
|
+
return undefined;
|
|
672
|
+
return await fn.call(record, options);
|
|
673
|
+
}
|
|
674
|
+
function linearNodes(value) {
|
|
675
|
+
if (!(0, integration_helpers_1.isRecord)(value) || !Array.isArray(value.nodes))
|
|
676
|
+
return [];
|
|
677
|
+
return value.nodes;
|
|
678
|
+
}
|
|
679
|
+
//# sourceMappingURL=linear-operations.js.map
|