n8n 2.16.0 → 2.17.0
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/README.md +1 -1
- package/dist/active-workflow-manager.d.ts +3 -1
- package/dist/active-workflow-manager.js +37 -4
- package/dist/active-workflow-manager.js.map +1 -1
- package/dist/auth/auth.service.d.ts +5 -2
- package/dist/auth/auth.service.js +10 -6
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/commands/base-command.js +8 -2
- package/dist/commands/base-command.js.map +1 -1
- package/dist/commands/start.d.ts +1 -0
- package/dist/commands/start.js +7 -0
- package/dist/commands/start.js.map +1 -1
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +5 -1
- package/dist/constants.js.map +1 -1
- package/dist/controllers/ai.controller.d.ts +11 -2
- package/dist/controllers/ai.controller.js +54 -2
- package/dist/controllers/ai.controller.js.map +1 -1
- package/dist/controllers/auth.controller.js +1 -1
- package/dist/controllers/auth.controller.js.map +1 -1
- package/dist/controllers/e2e.controller.js +3 -0
- package/dist/controllers/e2e.controller.js.map +1 -1
- package/dist/controllers/me.controller.d.ts +1 -0
- package/dist/controllers/me.controller.js +12 -0
- package/dist/controllers/me.controller.js.map +1 -1
- package/dist/controllers/project.controller.d.ts +3 -1
- package/dist/controllers/project.controller.js +9 -2
- package/dist/controllers/project.controller.js.map +1 -1
- package/dist/controllers/role.controller.d.ts +6 -4
- package/dist/controllers/role.controller.js +28 -8
- package/dist/controllers/role.controller.js.map +1 -1
- package/dist/controllers/users.controller.d.ts +4 -1
- package/dist/controllers/users.controller.js +8 -2
- package/dist/controllers/users.controller.js.map +1 -1
- package/dist/credentials/credentials.controller.js +3 -0
- package/dist/credentials/credentials.controller.js.map +1 -1
- package/dist/credentials/credentials.service.d.ts +3 -2
- package/dist/credentials/credentials.service.js +21 -10
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/credentials/validation.js +2 -2
- package/dist/credentials/validation.js.map +1 -1
- package/dist/credentials-helper.d.ts +3 -1
- package/dist/credentials-helper.js +14 -2
- package/dist/credentials-helper.js.map +1 -1
- package/dist/eventbus/event-message-classes/index.d.ts +2 -2
- package/dist/eventbus/event-message-classes/index.js +7 -0
- package/dist/eventbus/event-message-classes/index.js.map +1 -1
- package/dist/events/maps/relay.event-map.d.ts +92 -0
- package/dist/events/relays/log-streaming.event-relay.d.ts +7 -0
- package/dist/events/relays/log-streaming.event-relay.js +87 -2
- package/dist/events/relays/log-streaming.event-relay.js.map +1 -1
- package/dist/events/relays/telemetry.event-relay.d.ts +5 -0
- package/dist/events/relays/telemetry.event-relay.js +58 -5
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/execution-lifecycle/execution-lifecycle-hooks.d.ts +1 -1
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js +22 -9
- package/dist/execution-lifecycle/execution-lifecycle-hooks.js.map +1 -1
- package/dist/instance-settings-loader/instance-settings-loader.service.d.ts +9 -0
- package/dist/instance-settings-loader/instance-settings-loader.service.js +36 -0
- package/dist/instance-settings-loader/instance-settings-loader.service.js.map +1 -0
- package/dist/instance-settings-loader/loaders/owner.instance-settings-loader.d.ts +10 -0
- package/dist/instance-settings-loader/loaders/owner.instance-settings-loader.js +72 -0
- package/dist/instance-settings-loader/loaders/owner.instance-settings-loader.js.map +1 -0
- package/dist/modules/chat-hub/stream-capturer.js +3 -0
- package/dist/modules/chat-hub/stream-capturer.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/oauth2-introspection-identifier.d.ts +2 -2
- package/dist/modules/external-secrets.ee/external-secrets-settings.controller.ee.d.ts +5 -2
- package/dist/modules/external-secrets.ee/external-secrets-settings.controller.ee.js +10 -3
- package/dist/modules/external-secrets.ee/external-secrets-settings.controller.ee.js.map +1 -1
- package/dist/modules/external-secrets.ee/secrets-providers-connections.controller.ee.js +5 -5
- package/dist/modules/external-secrets.ee/secrets-providers-connections.controller.ee.js.map +1 -1
- package/dist/modules/external-secrets.ee/secrets-providers-connections.service.ee.d.ts +6 -6
- package/dist/modules/external-secrets.ee/secrets-providers-connections.service.ee.js +14 -9
- package/dist/modules/external-secrets.ee/secrets-providers-connections.service.ee.js.map +1 -1
- package/dist/modules/external-secrets.ee/secrets-providers-project.controller.ee.js +3 -3
- package/dist/modules/external-secrets.ee/secrets-providers-project.controller.ee.js.map +1 -1
- package/dist/modules/instance-ai/eval/api-docs.d.ts +1 -0
- package/dist/modules/instance-ai/eval/api-docs.js +78 -0
- package/dist/modules/instance-ai/eval/api-docs.js.map +1 -0
- package/dist/modules/instance-ai/eval/execution.service.d.ts +25 -0
- package/dist/modules/instance-ai/eval/execution.service.js +291 -0
- package/dist/modules/instance-ai/eval/execution.service.js.map +1 -0
- package/dist/modules/instance-ai/eval/mock-handler.d.ts +9 -0
- package/dist/modules/instance-ai/eval/mock-handler.js +264 -0
- package/dist/modules/instance-ai/eval/mock-handler.js.map +1 -0
- package/dist/modules/instance-ai/eval/node-config.d.ts +2 -0
- package/dist/modules/instance-ai/eval/node-config.js +15 -0
- package/dist/modules/instance-ai/eval/node-config.js.map +1 -0
- package/dist/modules/instance-ai/eval/pin-data-generator.d.ts +12 -0
- package/dist/modules/instance-ai/eval/pin-data-generator.js +301 -0
- package/dist/modules/instance-ai/eval/pin-data-generator.js.map +1 -0
- package/dist/modules/instance-ai/eval/request-sanitizer.d.ts +3 -0
- package/dist/modules/instance-ai/eval/request-sanitizer.js +50 -0
- package/dist/modules/instance-ai/eval/request-sanitizer.js.map +1 -0
- package/dist/modules/instance-ai/eval/workflow-analysis.d.ts +16 -0
- package/dist/modules/instance-ai/eval/workflow-analysis.js +217 -0
- package/dist/modules/instance-ai/eval/workflow-analysis.js.map +1 -0
- package/dist/modules/instance-ai/filesystem/index.d.ts +0 -1
- package/dist/modules/instance-ai/filesystem/index.js +1 -3
- package/dist/modules/instance-ai/filesystem/index.js.map +1 -1
- package/dist/modules/instance-ai/filesystem/local-gateway.js +1 -1
- package/dist/modules/instance-ai/instance-ai-memory.service.d.ts +11 -7
- package/dist/modules/instance-ai/instance-ai-memory.service.js +21 -41
- package/dist/modules/instance-ai/instance-ai-memory.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai-settings.service.d.ts +4 -0
- package/dist/modules/instance-ai/instance-ai-settings.service.js +26 -6
- package/dist/modules/instance-ai/instance-ai-settings.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.adapter.service.d.ts +8 -3
- package/dist/modules/instance-ai/instance-ai.adapter.service.js +189 -35
- package/dist/modules/instance-ai/instance-ai.adapter.service.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.controller.d.ts +10 -11
- package/dist/modules/instance-ai/instance-ai.controller.js +101 -44
- package/dist/modules/instance-ai/instance-ai.controller.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.module.d.ts +1 -2
- package/dist/modules/instance-ai/instance-ai.module.js +4 -5
- package/dist/modules/instance-ai/instance-ai.module.js.map +1 -1
- package/dist/modules/instance-ai/instance-ai.service.d.ts +9 -8
- package/dist/modules/instance-ai/instance-ai.service.js +189 -61
- package/dist/modules/instance-ai/instance-ai.service.js.map +1 -1
- package/dist/modules/instance-ai/internal-messages.js +1 -1
- package/dist/modules/instance-ai/internal-messages.js.map +1 -1
- package/dist/modules/instance-ai/proxy-token-manager.d.ts +15 -0
- package/dist/modules/instance-ai/proxy-token-manager.js +64 -0
- package/dist/modules/instance-ai/proxy-token-manager.js.map +1 -0
- package/dist/modules/instance-ai/snapshot-pruning.service.d.ts +4 -1
- package/dist/modules/instance-ai/snapshot-pruning.service.js +18 -6
- package/dist/modules/instance-ai/snapshot-pruning.service.js.map +1 -1
- package/dist/modules/instance-ai/storage/db-snapshot-storage.d.ts +4 -0
- package/dist/modules/instance-ai/storage/db-snapshot-storage.js +25 -0
- package/dist/modules/instance-ai/storage/db-snapshot-storage.js.map +1 -1
- package/dist/modules/instance-ai/storage/typeorm-memory-storage.js +1 -1
- package/dist/modules/instance-ai/storage/typeorm-memory-storage.js.map +1 -1
- package/dist/modules/instance-ai/web-research/brave-search.d.ts +1 -1
- package/dist/modules/instance-ai/web-research/brave-search.js +2 -1
- package/dist/modules/instance-ai/web-research/brave-search.js.map +1 -1
- package/dist/modules/instance-version-history/database/entities/instance-version-history.entity.d.ts +7 -0
- package/dist/modules/instance-version-history/database/entities/instance-version-history.entity.js +37 -0
- package/dist/modules/instance-version-history/database/entities/instance-version-history.entity.js.map +1 -0
- package/dist/modules/instance-version-history/database/repositories/instance-version-history.repository.d.ts +5 -0
- package/dist/modules/instance-version-history/database/repositories/instance-version-history.repository.js +26 -0
- package/dist/modules/instance-version-history/database/repositories/instance-version-history.repository.js.map +1 -0
- package/dist/modules/instance-version-history/instance-version-history.controller.d.ts +26 -0
- package/dist/modules/instance-version-history/instance-version-history.controller.js +85 -0
- package/dist/modules/instance-version-history/instance-version-history.controller.js.map +1 -0
- package/dist/modules/instance-version-history/instance-version-history.module.d.ts +5 -0
- package/dist/modules/instance-version-history/instance-version-history.module.js +60 -0
- package/dist/modules/instance-version-history/instance-version-history.module.js.map +1 -0
- package/dist/modules/instance-version-history/instance-version-history.service.d.ts +18 -0
- package/dist/modules/instance-version-history/instance-version-history.service.js +120 -0
- package/dist/modules/instance-version-history/instance-version-history.service.js.map +1 -0
- package/dist/modules/instance-version-history/instance-version-history.types.d.ts +12 -0
- package/dist/modules/instance-version-history/instance-version-history.types.js +27 -0
- package/dist/modules/instance-version-history/instance-version-history.types.js.map +1 -0
- package/dist/modules/provisioning.ee/provisioning.service.ee.d.ts +5 -2
- package/dist/modules/provisioning.ee/provisioning.service.ee.js +55 -11
- package/dist/modules/provisioning.ee/provisioning.service.ee.js.map +1 -1
- package/dist/modules/provisioning.ee/role-mapping-rule.controller.ee.d.ts +7 -5
- package/dist/modules/provisioning.ee/role-mapping-rule.controller.ee.js +40 -10
- package/dist/modules/provisioning.ee/role-mapping-rule.controller.ee.js.map +1 -1
- package/dist/modules/provisioning.ee/role-mapping-rule.service.ee.d.ts +3 -1
- package/dist/modules/provisioning.ee/role-mapping-rule.service.ee.js +1 -0
- package/dist/modules/provisioning.ee/role-mapping-rule.service.ee.js.map +1 -1
- package/dist/modules/provisioning.ee/role-resolver-types.d.ts +14 -2
- package/dist/modules/provisioning.ee/role-resolver.service.ee.js +16 -6
- package/dist/modules/provisioning.ee/role-resolver.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-context.factory.d.ts +12 -0
- package/dist/modules/source-control.ee/source-control-context.factory.js +112 -0
- package/dist/modules/source-control.ee/source-control-context.factory.js.map +1 -0
- package/dist/modules/source-control.ee/source-control-export.service.ee.d.ts +2 -2
- package/dist/modules/source-control.ee/source-control-export.service.ee.js +9 -11
- package/dist/modules/source-control.ee/source-control-export.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-git.service.ee.js +3 -3
- package/dist/modules/source-control.ee/source-control-git.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-import.service.ee.d.ts +6 -4
- package/dist/modules/source-control.ee/source-control-import.service.ee.js +29 -85
- package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-scoped.service.d.ts +4 -4
- package/dist/modules/source-control.ee/source-control-scoped.service.js +9 -40
- package/dist/modules/source-control.ee/source-control-scoped.service.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-status.service.ee.d.ts +3 -1
- package/dist/modules/source-control.ee/source-control-status.service.ee.js +99 -59
- package/dist/modules/source-control.ee/source-control-status.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control.service.ee.d.ts +3 -1
- package/dist/modules/source-control.ee/source-control.service.ee.js +6 -4
- package/dist/modules/source-control.ee/source-control.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/types/source-control-context.d.ts +12 -4
- package/dist/modules/source-control.ee/types/source-control-context.js +32 -6
- package/dist/modules/source-control.ee/types/source-control-context.js.map +1 -1
- package/dist/modules/sso-saml/saml.controller.ee.d.ts +2 -3
- package/dist/modules/sso-saml/saml.controller.ee.js +3 -15
- package/dist/modules/sso-saml/saml.controller.ee.js.map +1 -1
- package/dist/modules/token-exchange/controllers/embed-auth.controller.d.ts +5 -1
- package/dist/modules/token-exchange/controllers/embed-auth.controller.js +50 -11
- package/dist/modules/token-exchange/controllers/embed-auth.controller.js.map +1 -1
- package/dist/modules/token-exchange/{token-exchange.controller.d.ts → controllers/token-exchange.controller.d.ts} +1 -1
- package/dist/modules/token-exchange/{token-exchange.controller.js → controllers/token-exchange.controller.js} +50 -5
- package/dist/modules/token-exchange/controllers/token-exchange.controller.js.map +1 -0
- package/dist/modules/token-exchange/database/entities/trusted-key-source.entity.d.ts +10 -0
- package/dist/modules/token-exchange/database/entities/trusted-key-source.entity.js +45 -0
- package/dist/modules/token-exchange/database/entities/trusted-key-source.entity.js.map +1 -0
- package/dist/modules/token-exchange/database/entities/trusted-key.entity.d.ts +9 -0
- package/dist/modules/token-exchange/database/entities/trusted-key.entity.js +43 -0
- package/dist/modules/token-exchange/database/entities/trusted-key.entity.js.map +1 -0
- package/dist/modules/token-exchange/database/repositories/trusted-key-source.repository.d.ts +5 -0
- package/dist/modules/token-exchange/database/repositories/trusted-key-source.repository.js +26 -0
- package/dist/modules/token-exchange/database/repositories/trusted-key-source.repository.js.map +1 -0
- package/dist/modules/token-exchange/database/repositories/trusted-key.repository.d.ts +7 -0
- package/dist/modules/token-exchange/database/repositories/trusted-key.repository.js +32 -0
- package/dist/modules/token-exchange/database/repositories/trusted-key.repository.js.map +1 -0
- package/dist/modules/token-exchange/services/identity-resolution.service.d.ts +20 -2
- package/dist/modules/token-exchange/services/identity-resolution.service.js +178 -4
- package/dist/modules/token-exchange/services/identity-resolution.service.js.map +1 -1
- package/dist/modules/token-exchange/services/jti-cleanup.service.js +1 -1
- package/dist/modules/token-exchange/services/jti-cleanup.service.js.map +1 -1
- package/dist/modules/token-exchange/services/jwks-resolver.d.ts +30 -0
- package/dist/modules/token-exchange/services/jwks-resolver.js +190 -0
- package/dist/modules/token-exchange/services/jwks-resolver.js.map +1 -0
- package/dist/modules/token-exchange/services/scoped-jwt.strategy.d.ts +12 -0
- package/dist/modules/token-exchange/services/scoped-jwt.strategy.js +92 -0
- package/dist/modules/token-exchange/services/scoped-jwt.strategy.js.map +1 -0
- package/dist/modules/token-exchange/services/token-exchange.service.d.ts +18 -4
- package/dist/modules/token-exchange/services/token-exchange.service.js +65 -6
- package/dist/modules/token-exchange/services/token-exchange.service.js.map +1 -1
- package/dist/modules/token-exchange/services/trusted-key.service.d.ts +40 -6
- package/dist/modules/token-exchange/services/trusted-key.service.js +374 -32
- package/dist/modules/token-exchange/services/trusted-key.service.js.map +1 -1
- package/dist/modules/token-exchange/token-exchange.config.d.ts +4 -0
- package/dist/modules/token-exchange/token-exchange.config.js +20 -0
- package/dist/modules/token-exchange/token-exchange.config.js.map +1 -1
- package/dist/modules/token-exchange/token-exchange.module.js +7 -2
- package/dist/modules/token-exchange/token-exchange.module.js.map +1 -1
- package/dist/modules/token-exchange/token-exchange.schemas.d.ts +35 -5
- package/dist/modules/token-exchange/token-exchange.schemas.js +16 -7
- package/dist/modules/token-exchange/token-exchange.schemas.js.map +1 -1
- package/dist/modules/token-exchange/token-exchange.types.d.ts +5 -2
- package/dist/modules/token-exchange/token-exchange.types.js +2 -0
- package/dist/modules/token-exchange/token-exchange.types.js.map +1 -1
- package/dist/oauth/oauth.service.d.ts +1 -0
- package/dist/oauth/oauth.service.js +39 -2
- package/dist/oauth/oauth.service.js.map +1 -1
- package/dist/public-api/index.js +32 -4
- package/dist/public-api/index.js.map +1 -1
- package/dist/public-api/types.d.ts +11 -1
- package/dist/public-api/v1/handlers/community-packages/community-packages.handler.d.ts +1 -0
- package/dist/public-api/v1/handlers/community-packages/community-packages.handler.js +5 -5
- package/dist/public-api/v1/handlers/community-packages/community-packages.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js +7 -12
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/credentials/credentials.service.d.ts +3 -4
- package/dist/public-api/v1/handlers/credentials/credentials.service.js +21 -33
- package/dist/public-api/v1/handlers/credentials/credentials.service.js.map +1 -1
- package/dist/public-api/v1/handlers/data-tables/data-tables.handler.js +5 -5
- package/dist/public-api/v1/handlers/data-tables/data-tables.rows.handler.js +5 -5
- package/dist/public-api/v1/handlers/executions/executions.handler.js +8 -8
- package/dist/public-api/v1/handlers/insights/insights.handler.d.ts +6 -0
- package/dist/public-api/v1/handlers/insights/insights.handler.js +57 -0
- package/dist/public-api/v1/handlers/insights/insights.handler.js.map +1 -0
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js +14 -35
- package/dist/public-api/v1/handlers/workflows/workflows.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/workflows/workflows.service.d.ts +6 -4
- package/dist/public-api/v1/handlers/workflows/workflows.service.js +7 -15
- package/dist/public-api/v1/handlers/workflows/workflows.service.js.map +1 -1
- package/dist/public-api/v1/openapi.yml +322 -7
- package/dist/public-api/v1/shared/middlewares/global.middleware.d.ts +1 -1
- package/dist/public-api/v1/shared/middlewares/global.middleware.js +19 -8
- package/dist/public-api/v1/shared/middlewares/global.middleware.js.map +1 -1
- package/dist/security-audit/risk-reporters/credentials-risk-reporter.d.ts +2 -3
- package/dist/security-audit/risk-reporters/credentials-risk-reporter.js +2 -5
- package/dist/security-audit/risk-reporters/credentials-risk-reporter.js.map +1 -1
- package/dist/services/ai-gateway.service.d.ts +44 -0
- package/dist/services/ai-gateway.service.js +228 -0
- package/dist/services/ai-gateway.service.js.map +1 -0
- package/dist/services/api-key-auth.strategy.d.ts +10 -0
- package/dist/services/api-key-auth.strategy.js +71 -0
- package/dist/services/api-key-auth.strategy.js.map +1 -0
- package/dist/services/frontend.service.js +7 -0
- package/dist/services/frontend.service.js.map +1 -1
- package/dist/services/import.service.d.ts +1 -0
- package/dist/services/import.service.js +25 -2
- package/dist/services/import.service.js.map +1 -1
- package/dist/services/ownership.service.d.ts +4 -1
- package/dist/services/ownership.service.js +11 -5
- package/dist/services/ownership.service.js.map +1 -1
- package/dist/services/project.service.ee.js +1 -1
- package/dist/services/project.service.ee.js.map +1 -1
- package/dist/services/pruning/workflow-history-compaction.service.js +4 -4
- package/dist/services/pruning/workflow-history-compaction.service.js.map +1 -1
- package/dist/services/public-api-key.service.d.ts +6 -13
- package/dist/services/public-api-key.service.js +12 -80
- package/dist/services/public-api-key.service.js.map +1 -1
- package/dist/services/user.service.js +6 -0
- package/dist/services/user.service.js.map +1 -1
- package/dist/utils/validate-redirect-url.d.ts +1 -0
- package/dist/utils/validate-redirect-url.js +17 -0
- package/dist/utils/validate-redirect-url.js.map +1 -0
- package/dist/webhooks/webhook-form-data.js +6 -2
- package/dist/webhooks/webhook-form-data.js.map +1 -1
- package/dist/webhooks/webhook.service.js +19 -4
- package/dist/webhooks/webhook.service.js.map +1 -1
- package/dist/workflow-execute-additional-data.js +2 -0
- package/dist/workflow-execute-additional-data.js.map +1 -1
- package/dist/workflow-helpers.d.ts +1 -0
- package/dist/workflow-helpers.js +21 -0
- package/dist/workflow-helpers.js.map +1 -1
- package/dist/workflow-runner.js +25 -1
- package/dist/workflow-runner.js.map +1 -1
- package/dist/workflows/workflow-creation.service.d.ts +8 -5
- package/dist/workflows/workflow-creation.service.js +36 -17
- package/dist/workflows/workflow-creation.service.js.map +1 -1
- package/dist/workflows/workflow.service.ee.js +4 -1
- package/dist/workflows/workflow.service.ee.js.map +1 -1
- package/dist/workflows/workflow.service.js +4 -1
- package/dist/workflows/workflow.service.js.map +1 -1
- package/dist/workflows/workflows.controller.d.ts +2 -2
- package/package.json +25 -26
- package/dist/modules/instance-ai/filesystem/local-fs-provider.d.ts +0 -26
- package/dist/modules/instance-ai/filesystem/local-fs-provider.js +0 -321
- package/dist/modules/instance-ai/filesystem/local-fs-provider.js.map +0 -1
- package/dist/modules/token-exchange/token-exchange.controller.js.map +0 -1
- package/dist/modules/token-exchange/token-exchange.service.d.ts +0 -9
- package/dist/modules/token-exchange/token-exchange.service.js +0 -66
- package/dist/modules/token-exchange/token-exchange.service.js.map +0 -1
|
@@ -13,6 +13,7 @@ servers:
|
|
|
13
13
|
- url: /api/v1
|
|
14
14
|
security:
|
|
15
15
|
- ApiKeyAuth: []
|
|
16
|
+
- BearerAuth: []
|
|
16
17
|
tags:
|
|
17
18
|
- name: User
|
|
18
19
|
description: Operations about users
|
|
@@ -38,6 +39,8 @@ tags:
|
|
|
38
39
|
description: Operations about community packages
|
|
39
40
|
- name: Discover
|
|
40
41
|
description: API capability discovery
|
|
42
|
+
- name: Insights
|
|
43
|
+
description: Operations about insights
|
|
41
44
|
externalDocs:
|
|
42
45
|
description: n8n API documentation
|
|
43
46
|
url: https://docs.n8n.io/api/
|
|
@@ -119,7 +122,7 @@ paths:
|
|
|
119
122
|
content:
|
|
120
123
|
application/json:
|
|
121
124
|
schema:
|
|
122
|
-
$ref: '#/components/schemas/
|
|
125
|
+
$ref: '#/components/schemas/credentialCreate'
|
|
123
126
|
responses:
|
|
124
127
|
'200':
|
|
125
128
|
description: Operation successful.
|
|
@@ -128,9 +131,13 @@ paths:
|
|
|
128
131
|
schema:
|
|
129
132
|
$ref: '#/components/schemas/create-credential-response'
|
|
130
133
|
'400':
|
|
131
|
-
|
|
134
|
+
$ref: '#/components/responses/badRequest'
|
|
132
135
|
'401':
|
|
133
136
|
$ref: '#/components/responses/unauthorized'
|
|
137
|
+
'403':
|
|
138
|
+
$ref: '#/components/responses/forbidden'
|
|
139
|
+
'404':
|
|
140
|
+
$ref: '#/components/responses/notFound'
|
|
134
141
|
'415':
|
|
135
142
|
description: Unsupported media type.
|
|
136
143
|
/credentials/{id}:
|
|
@@ -676,7 +683,7 @@ paths:
|
|
|
676
683
|
content:
|
|
677
684
|
application/json:
|
|
678
685
|
schema:
|
|
679
|
-
$ref: '#/components/schemas/
|
|
686
|
+
$ref: '#/components/schemas/workflowCreate'
|
|
680
687
|
required: true
|
|
681
688
|
responses:
|
|
682
689
|
'200':
|
|
@@ -689,6 +696,10 @@ paths:
|
|
|
689
696
|
$ref: '#/components/responses/badRequest'
|
|
690
697
|
'401':
|
|
691
698
|
$ref: '#/components/responses/unauthorized'
|
|
699
|
+
'403':
|
|
700
|
+
$ref: '#/components/responses/forbidden'
|
|
701
|
+
'404':
|
|
702
|
+
$ref: '#/components/responses/notFound'
|
|
692
703
|
get:
|
|
693
704
|
x-eov-operation-id: getWorkflows
|
|
694
705
|
x-eov-operation-handler: v1/handlers/workflows/workflows.handler
|
|
@@ -2178,6 +2189,49 @@ paths:
|
|
|
2178
2189
|
description: URL to the full OpenAPI specification
|
|
2179
2190
|
'401':
|
|
2180
2191
|
$ref: '#/components/responses/unauthorized'
|
|
2192
|
+
/insights/summary:
|
|
2193
|
+
get:
|
|
2194
|
+
x-eov-operation-id: getInsightsSummary
|
|
2195
|
+
x-eov-operation-handler: v1/handlers/insights/insights.handler
|
|
2196
|
+
tags:
|
|
2197
|
+
- Insights
|
|
2198
|
+
summary: Retrieve insights summary
|
|
2199
|
+
description: Retrieve the insights summary for the selected date range.
|
|
2200
|
+
parameters:
|
|
2201
|
+
- name: startDate
|
|
2202
|
+
in: query
|
|
2203
|
+
required: false
|
|
2204
|
+
description: ISO 8601 start date. Defaults to 7 days ago.
|
|
2205
|
+
schema:
|
|
2206
|
+
type: string
|
|
2207
|
+
format: date-time
|
|
2208
|
+
- name: endDate
|
|
2209
|
+
in: query
|
|
2210
|
+
required: false
|
|
2211
|
+
description: ISO 8601 end date. Defaults to now.
|
|
2212
|
+
schema:
|
|
2213
|
+
type: string
|
|
2214
|
+
format: date-time
|
|
2215
|
+
- name: projectId
|
|
2216
|
+
in: query
|
|
2217
|
+
required: false
|
|
2218
|
+
description: Project identifier to filter insights by project.
|
|
2219
|
+
schema:
|
|
2220
|
+
type: string
|
|
2221
|
+
example: VmwOO9HeTEj20kxM
|
|
2222
|
+
responses:
|
|
2223
|
+
'200':
|
|
2224
|
+
description: Operation successful.
|
|
2225
|
+
content:
|
|
2226
|
+
application/json:
|
|
2227
|
+
schema:
|
|
2228
|
+
$ref: '#/components/schemas/insights'
|
|
2229
|
+
'400':
|
|
2230
|
+
$ref: '#/components/responses/badRequest'
|
|
2231
|
+
'401':
|
|
2232
|
+
$ref: '#/components/responses/unauthorized'
|
|
2233
|
+
'403':
|
|
2234
|
+
$ref: '#/components/responses/forbidden'
|
|
2181
2235
|
components:
|
|
2182
2236
|
schemas:
|
|
2183
2237
|
audit:
|
|
@@ -2258,6 +2312,10 @@ components:
|
|
|
2258
2312
|
- id
|
|
2259
2313
|
- name
|
|
2260
2314
|
- type
|
|
2315
|
+
- isManaged
|
|
2316
|
+
- isGlobal
|
|
2317
|
+
- isResolvable
|
|
2318
|
+
- resolvableAllowFallback
|
|
2261
2319
|
- createdAt
|
|
2262
2320
|
- updatedAt
|
|
2263
2321
|
type: object
|
|
@@ -2272,6 +2330,32 @@ components:
|
|
|
2272
2330
|
type:
|
|
2273
2331
|
type: string
|
|
2274
2332
|
example: githubApi
|
|
2333
|
+
isManaged:
|
|
2334
|
+
type: boolean
|
|
2335
|
+
readOnly: true
|
|
2336
|
+
description: Whether the credential is managed by n8n (managed credentials cannot be edited via the API).
|
|
2337
|
+
example: false
|
|
2338
|
+
isGlobal:
|
|
2339
|
+
type: boolean
|
|
2340
|
+
readOnly: true
|
|
2341
|
+
description: Whether the credential is available for use by all users.
|
|
2342
|
+
example: false
|
|
2343
|
+
isResolvable:
|
|
2344
|
+
type: boolean
|
|
2345
|
+
readOnly: true
|
|
2346
|
+
description: Whether the credential can be dynamically resolved by a resolver.
|
|
2347
|
+
example: false
|
|
2348
|
+
resolvableAllowFallback:
|
|
2349
|
+
type: boolean
|
|
2350
|
+
readOnly: true
|
|
2351
|
+
description: Whether the credential resolver may fall back to static credentials if dynamic resolution fails.
|
|
2352
|
+
example: false
|
|
2353
|
+
resolverId:
|
|
2354
|
+
type: string
|
|
2355
|
+
nullable: true
|
|
2356
|
+
readOnly: true
|
|
2357
|
+
description: ID of the dynamic credential resolver associated with this credential, if any.
|
|
2358
|
+
example: null
|
|
2275
2359
|
createdAt:
|
|
2276
2360
|
type: string
|
|
2277
2361
|
format: date-time
|
|
@@ -2332,6 +2416,46 @@ components:
|
|
|
2332
2416
|
description: Paginate through credentials by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first "page" of the collection.
|
|
2333
2417
|
nullable: true
|
|
2334
2418
|
example: MTIzZTQ1NjctZTg5Yi0xMmQzLWE0NTYtNDI2NjE0MTc0MDA
|
|
2419
|
+
credentialCreate:
|
|
2420
|
+
required:
|
|
2421
|
+
- name
|
|
2422
|
+
- type
|
|
2423
|
+
- data
|
|
2424
|
+
type: object
|
|
2425
|
+
properties:
|
|
2426
|
+
id:
|
|
2427
|
+
type: string
|
|
2428
|
+
readOnly: true
|
|
2429
|
+
example: R2DjclaysHbqn778
|
|
2430
|
+
name:
|
|
2431
|
+
type: string
|
|
2432
|
+
example: Joe's Github Credentials
|
|
2433
|
+
type:
|
|
2434
|
+
type: string
|
|
2435
|
+
example: githubApi
|
|
2436
|
+
data:
|
|
2437
|
+
type: object
|
|
2438
|
+
writeOnly: true
|
|
2439
|
+
example:
|
|
2440
|
+
accessToken: ada612vad6fa5df4adf5a5dsf4389adsf76da7s
|
|
2441
|
+
isResolvable:
|
|
2442
|
+
type: boolean
|
|
2443
|
+
example: false
|
|
2444
|
+
description: Whether this credential has resolvable fields
|
|
2445
|
+
createdAt:
|
|
2446
|
+
type: string
|
|
2447
|
+
format: date-time
|
|
2448
|
+
readOnly: true
|
|
2449
|
+
example: '2022-04-29T11:02:29.842Z'
|
|
2450
|
+
updatedAt:
|
|
2451
|
+
type: string
|
|
2452
|
+
format: date-time
|
|
2453
|
+
readOnly: true
|
|
2454
|
+
example: '2022-04-29T11:02:29.842Z'
|
|
2455
|
+
projectId:
|
|
2456
|
+
type: string
|
|
2457
|
+
description: Project to create the credential in. Defaults to the user's personal project.
|
|
2458
|
+
example: VmwOO9HeTEj20kxM
|
|
2335
2459
|
credential:
|
|
2336
2460
|
required:
|
|
2337
2461
|
- name
|
|
@@ -2645,9 +2769,9 @@ components:
|
|
|
2645
2769
|
- none
|
|
2646
2770
|
- workflowsFromAList
|
|
2647
2771
|
- workflowsFromSameOwner
|
|
2648
|
-
default: workflowsFromSameOwner
|
|
2649
2772
|
description: |
|
|
2650
2773
|
Controls which workflows are allowed to call this workflow using the Execute Workflow node.
|
|
2774
|
+
Defaults to workflowsFromSameOwner.
|
|
2651
2775
|
|
|
2652
2776
|
Available options:
|
|
2653
2777
|
- `any`: Any workflow can call this workflow (no restrictions)
|
|
@@ -2668,9 +2792,9 @@ components:
|
|
|
2668
2792
|
description: Estimated time saved per execution in minutes
|
|
2669
2793
|
availableInMCP:
|
|
2670
2794
|
type: boolean
|
|
2671
|
-
default: false
|
|
2672
2795
|
description: |
|
|
2673
2796
|
Controls whether this workflow is accessible via the Model Context Protocol (MCP).
|
|
2797
|
+
Defaults to false.
|
|
2674
2798
|
|
|
2675
2799
|
When enabled, this workflow can be called by MCP clients (AI assistants and other tools
|
|
2676
2800
|
that support MCP). This allows external AI tools to discover and execute this workflow
|
|
@@ -2865,6 +2989,100 @@ components:
|
|
|
2865
2989
|
description: Paginate through workflows by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first "page" of the collection.
|
|
2866
2990
|
nullable: true
|
|
2867
2991
|
example: MTIzZTQ1NjctZTg5Yi0xMmQzLWE0NTYtNDI2NjE0MTc0MDA
|
|
2992
|
+
workflowCreate:
|
|
2993
|
+
type: object
|
|
2994
|
+
additionalProperties: false
|
|
2995
|
+
required:
|
|
2996
|
+
- name
|
|
2997
|
+
- nodes
|
|
2998
|
+
- connections
|
|
2999
|
+
- settings
|
|
3000
|
+
properties:
|
|
3001
|
+
id:
|
|
3002
|
+
type: string
|
|
3003
|
+
readOnly: true
|
|
3004
|
+
example: 2tUt1wbLX592XDdX
|
|
3005
|
+
name:
|
|
3006
|
+
type: string
|
|
3007
|
+
example: Workflow 1
|
|
3008
|
+
active:
|
|
3009
|
+
type: boolean
|
|
3010
|
+
readOnly: true
|
|
3011
|
+
createdAt:
|
|
3012
|
+
type: string
|
|
3013
|
+
format: date-time
|
|
3014
|
+
readOnly: true
|
|
3015
|
+
updatedAt:
|
|
3016
|
+
type: string
|
|
3017
|
+
format: date-time
|
|
3018
|
+
readOnly: true
|
|
3019
|
+
isArchived:
|
|
3020
|
+
type: boolean
|
|
3021
|
+
readOnly: true
|
|
3022
|
+
versionId:
|
|
3023
|
+
type: string
|
|
3024
|
+
readOnly: true
|
|
3025
|
+
description: Current version identifier used for optimistic locking
|
|
3026
|
+
triggerCount:
|
|
3027
|
+
type: integer
|
|
3028
|
+
readOnly: true
|
|
3029
|
+
description: Number of active trigger nodes in the workflow
|
|
3030
|
+
nodes:
|
|
3031
|
+
type: array
|
|
3032
|
+
items:
|
|
3033
|
+
$ref: '#/components/schemas/node'
|
|
3034
|
+
connections:
|
|
3035
|
+
type: object
|
|
3036
|
+
example:
|
|
3037
|
+
Jira:
|
|
3038
|
+
main:
|
|
3039
|
+
- - node: Jira
|
|
3040
|
+
type: main
|
|
3041
|
+
index: 0
|
|
3042
|
+
settings:
|
|
3043
|
+
$ref: '#/components/schemas/workflowSettings'
|
|
3044
|
+
staticData:
|
|
3045
|
+
example:
|
|
3046
|
+
lastId: 1
|
|
3047
|
+
anyOf:
|
|
3048
|
+
- type: string
|
|
3049
|
+
format: jsonString
|
|
3050
|
+
nullable: true
|
|
3051
|
+
- type: object
|
|
3052
|
+
nullable: true
|
|
3053
|
+
pinData:
|
|
3054
|
+
type: object
|
|
3055
|
+
nullable: true
|
|
3056
|
+
description: Pinned sample data for nodes, keyed by node name
|
|
3057
|
+
projectId:
|
|
3058
|
+
type: string
|
|
3059
|
+
description: Target project to create the workflow in. Defaults to the user's personal project.
|
|
3060
|
+
example: VmwOO9HeTEj20kxM
|
|
3061
|
+
meta:
|
|
3062
|
+
type: object
|
|
3063
|
+
nullable: true
|
|
3064
|
+
readOnly: true
|
|
3065
|
+
description: Workflow metadata such as template information
|
|
3066
|
+
properties:
|
|
3067
|
+
onboardingId:
|
|
3068
|
+
type: string
|
|
3069
|
+
templateId:
|
|
3070
|
+
type: string
|
|
3071
|
+
instanceId:
|
|
3072
|
+
type: string
|
|
3073
|
+
templateCredsSetupCompleted:
|
|
3074
|
+
type: boolean
|
|
3075
|
+
tags:
|
|
3076
|
+
type: array
|
|
3077
|
+
items:
|
|
3078
|
+
$ref: '#/components/schemas/tag'
|
|
3079
|
+
readOnly: true
|
|
3080
|
+
shared:
|
|
3081
|
+
type: array
|
|
3082
|
+
items:
|
|
3083
|
+
$ref: '#/components/schemas/sharedWorkflow'
|
|
3084
|
+
activeVersion:
|
|
3085
|
+
$ref: '#/components/schemas/activeVersion'
|
|
2868
3086
|
workflowVersion:
|
|
2869
3087
|
type: object
|
|
2870
3088
|
additionalProperties: false
|
|
@@ -3515,6 +3733,99 @@ components:
|
|
|
3515
3733
|
version:
|
|
3516
3734
|
type: string
|
|
3517
3735
|
description: Specific semver version to install
|
|
3736
|
+
verify:
|
|
3737
|
+
type: boolean
|
|
3738
|
+
description: |
|
|
3739
|
+
Whether to verify the package against the n8n-vetted package list. Required when the instance has N8N_UNVERIFIED_PACKAGES_ENABLED=false.
|
|
3740
|
+
insights:
|
|
3741
|
+
type: object
|
|
3742
|
+
required:
|
|
3743
|
+
- total
|
|
3744
|
+
- failed
|
|
3745
|
+
- failureRate
|
|
3746
|
+
- timeSaved
|
|
3747
|
+
- averageRunTime
|
|
3748
|
+
properties:
|
|
3749
|
+
total:
|
|
3750
|
+
type: object
|
|
3751
|
+
required:
|
|
3752
|
+
- value
|
|
3753
|
+
- deviation
|
|
3754
|
+
- unit
|
|
3755
|
+
properties:
|
|
3756
|
+
value:
|
|
3757
|
+
type: number
|
|
3758
|
+
deviation:
|
|
3759
|
+
type: number
|
|
3760
|
+
nullable: true
|
|
3761
|
+
unit:
|
|
3762
|
+
type: string
|
|
3763
|
+
enum:
|
|
3764
|
+
- count
|
|
3765
|
+
failed:
|
|
3766
|
+
type: object
|
|
3767
|
+
required:
|
|
3768
|
+
- value
|
|
3769
|
+
- deviation
|
|
3770
|
+
- unit
|
|
3771
|
+
properties:
|
|
3772
|
+
value:
|
|
3773
|
+
type: number
|
|
3774
|
+
deviation:
|
|
3775
|
+
type: number
|
|
3776
|
+
nullable: true
|
|
3777
|
+
unit:
|
|
3778
|
+
type: string
|
|
3779
|
+
enum:
|
|
3780
|
+
- count
|
|
3781
|
+
failureRate:
|
|
3782
|
+
type: object
|
|
3783
|
+
required:
|
|
3784
|
+
- value
|
|
3785
|
+
- deviation
|
|
3786
|
+
- unit
|
|
3787
|
+
properties:
|
|
3788
|
+
value:
|
|
3789
|
+
type: number
|
|
3790
|
+
deviation:
|
|
3791
|
+
type: number
|
|
3792
|
+
nullable: true
|
|
3793
|
+
unit:
|
|
3794
|
+
type: string
|
|
3795
|
+
enum:
|
|
3796
|
+
- ratio
|
|
3797
|
+
timeSaved:
|
|
3798
|
+
type: object
|
|
3799
|
+
required:
|
|
3800
|
+
- value
|
|
3801
|
+
- deviation
|
|
3802
|
+
- unit
|
|
3803
|
+
properties:
|
|
3804
|
+
value:
|
|
3805
|
+
type: number
|
|
3806
|
+
deviation:
|
|
3807
|
+
type: number
|
|
3808
|
+
nullable: true
|
|
3809
|
+
unit:
|
|
3810
|
+
type: string
|
|
3811
|
+
enum:
|
|
3812
|
+
- minute
|
|
3813
|
+
averageRunTime:
|
|
3814
|
+
type: object
|
|
3815
|
+
required:
|
|
3816
|
+
- value
|
|
3817
|
+
- deviation
|
|
3818
|
+
- unit
|
|
3819
|
+
properties:
|
|
3820
|
+
value:
|
|
3821
|
+
type: number
|
|
3822
|
+
deviation:
|
|
3823
|
+
type: number
|
|
3824
|
+
nullable: true
|
|
3825
|
+
unit:
|
|
3826
|
+
type: string
|
|
3827
|
+
enum:
|
|
3828
|
+
- millisecond
|
|
3518
3829
|
error:
|
|
3519
3830
|
required:
|
|
3520
3831
|
- message
|
|
@@ -3606,12 +3917,12 @@ components:
|
|
|
3606
3917
|
responses:
|
|
3607
3918
|
unauthorized:
|
|
3608
3919
|
description: Unauthorized
|
|
3609
|
-
notFound:
|
|
3610
|
-
description: The specified resource was not found.
|
|
3611
3920
|
badRequest:
|
|
3612
3921
|
description: The request is invalid or provides malformed data.
|
|
3613
3922
|
forbidden:
|
|
3614
3923
|
description: Forbidden
|
|
3924
|
+
notFound:
|
|
3925
|
+
description: The specified resource was not found.
|
|
3615
3926
|
conflict:
|
|
3616
3927
|
description: Conflict
|
|
3617
3928
|
NotFound:
|
|
@@ -3743,3 +4054,7 @@ components:
|
|
|
3743
4054
|
type: apiKey
|
|
3744
4055
|
in: header
|
|
3745
4056
|
name: X-N8N-API-KEY
|
|
4057
|
+
BearerAuth:
|
|
4058
|
+
type: http
|
|
4059
|
+
scheme: bearer
|
|
4060
|
+
bearerFormat: JWT
|
|
@@ -16,7 +16,7 @@ export declare const validCursor: (req: PaginatedRequest, res: express.Response,
|
|
|
16
16
|
export type ScopeTaggedMiddleware = ((...args: unknown[]) => unknown) & {
|
|
17
17
|
__apiKeyScope: ApiKeyScope;
|
|
18
18
|
};
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const publicApiScope: (apiKeyScope: ApiKeyScope) => ScopeTaggedMiddleware;
|
|
20
20
|
export declare const apiKeyHasScopeWithGlobalScopeFallback: (config: {
|
|
21
21
|
scope: ApiKeyScope & Scope;
|
|
22
22
|
} | {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isLicensed = exports.validLicenseWithUserQuota = exports.apiKeyHasScopeWithGlobalScopeFallback = exports.
|
|
3
|
+
exports.isLicensed = exports.validLicenseWithUserQuota = exports.apiKeyHasScopeWithGlobalScopeFallback = exports.publicApiScope = exports.validCursor = exports.projectScope = exports.globalScope = void 0;
|
|
4
4
|
const di_1 = require("@n8n/di");
|
|
5
5
|
const feature_not_licensed_error_1 = require("../../../../errors/feature-not-licensed.error");
|
|
6
6
|
const not_found_error_1 = require("../../../../errors/response-errors/not-found.error");
|
|
7
7
|
const license_1 = require("../../../../license");
|
|
8
8
|
const check_access_1 = require("../../../../permissions.ee/check-access");
|
|
9
|
-
const public_api_key_service_1 = require("../../../../services/public-api-key.service");
|
|
10
9
|
const pagination_service_1 = require("../services/pagination.service");
|
|
11
10
|
const UNLIMITED_USERS_QUOTA = -1;
|
|
12
11
|
const buildScopeMiddleware = (scopes, resource, { globalOnly } = { globalOnly: false }) => {
|
|
@@ -68,14 +67,26 @@ function tagMiddleware(middleware, apiKeyScope) {
|
|
|
68
67
|
const tagged = Object.assign((req, res, next) => middleware(req, res, next), { __apiKeyScope: apiKeyScope });
|
|
69
68
|
return tagged;
|
|
70
69
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
function makePublicApiScopeEnforcementMiddleware(endpointScope) {
|
|
71
|
+
return async (req, res, next) => {
|
|
72
|
+
const { tokenGrant } = req;
|
|
73
|
+
if (!tokenGrant) {
|
|
74
|
+
res.status(403).json({ message: 'Forbidden' });
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (!tokenGrant.apiKeyScopes?.includes(endpointScope)) {
|
|
78
|
+
res.status(403).json({ message: 'Forbidden' });
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
next();
|
|
82
|
+
return;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
const publicApiScope = (apiKeyScope) => tagMiddleware(makePublicApiScopeEnforcementMiddleware(apiKeyScope), apiKeyScope);
|
|
86
|
+
exports.publicApiScope = publicApiScope;
|
|
76
87
|
const apiKeyHasScopeWithGlobalScopeFallback = (config) => {
|
|
77
88
|
const scope = 'scope' in config ? config.scope : config.apiKeyScope;
|
|
78
|
-
return tagMiddleware(
|
|
89
|
+
return tagMiddleware(makePublicApiScopeEnforcementMiddleware(scope), scope);
|
|
79
90
|
};
|
|
80
91
|
exports.apiKeyHasScopeWithGlobalScopeFallback = apiKeyHasScopeWithGlobalScopeFallback;
|
|
81
92
|
const validLicenseWithUserQuota = (_, res, next) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global.middleware.js","sourceRoot":"","sources":["../../../../../src/public-api/v1/shared/middlewares/global.middleware.ts"],"names":[],"mappings":";;;AAGA,gCAAoC;AAIpC,oFAA8E;AAC9E,8EAAyE;AACzE,uCAAoC;AACpC,gEAA8D;
|
|
1
|
+
{"version":3,"file":"global.middleware.js","sourceRoot":"","sources":["../../../../../src/public-api/v1/shared/middlewares/global.middleware.ts"],"names":[],"mappings":";;;AAGA,gCAAoC;AAIpC,oFAA8E;AAC9E,8EAAyE;AACzE,uCAAoC;AACpC,gEAA8D;AAG9D,uEAA8D;AAE9D,MAAM,qBAAqB,GAAG,CAAC,CAAC,CAAC;AAIjC,MAAM,oBAAoB,GAAG,CAC5B,MAAe,EACf,QAA+B,EAC/B,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,EACrC,EAAE;IACH,OAAO,KAAK,EACX,GAAgE,EAChE,GAAqB,EACrB,IAA0B,EACS,EAAE;QACrC,MAAM,MAAM,GAAyE,EAAE,CAAC;QACxF,IAAI,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACnB,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;gBAC7B,MAAM,CAAC,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACnC,CAAC;iBAAM,IAAI,QAAQ,KAAK,YAAY,EAAE,CAAC;gBACtC,MAAM,CAAC,YAAY,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACrC,CAAC;QACF,CAAC;aAAM,IAAI,GAAG,CAAC,MAAM,CAAC,WAAW,IAAI,QAAQ,KAAK,WAAW,EAAE,CAAC;YAC/D,M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CAAC;AACf,CAAC,CAAC;AAbW,QAAA,yBAAyB,6BAapC;AAEK,MAAM,UAAU,GAAG,CAAC,OAA8B,EAAE,EAAE;IAC5D,OAAO,KAAK,EAAE,CAAuB,EAAE,GAAqB,EAAE,IAA0B,EAAE,EAAE;QAC3F,IAAI,cAAS,CAAC,GAAG,CAAC,iBAAO,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC;YAAE,OAAO,IAAI,EAAE,CAAC;QAE9D,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,oDAAuB,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACxF,CAAC,CAAC;AACH,CAAC,CAAC;AANW,QAAA,UAAU,cAMrB"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { SecurityConfig } from '@n8n/config';
|
|
2
|
-
import { CredentialsRepository, ExecutionDataRepository
|
|
2
|
+
import { CredentialsRepository, ExecutionDataRepository } from '@n8n/db';
|
|
3
3
|
import type { IWorkflowBase } from 'n8n-workflow';
|
|
4
4
|
import type { RiskReporter, Risk } from '../../security-audit/types';
|
|
5
5
|
export declare class CredentialsRiskReporter implements RiskReporter {
|
|
6
6
|
private readonly credentialsRepository;
|
|
7
|
-
private readonly executionRepository;
|
|
8
7
|
private readonly executionDataRepository;
|
|
9
8
|
private readonly securityConfig;
|
|
10
|
-
constructor(credentialsRepository: CredentialsRepository,
|
|
9
|
+
constructor(credentialsRepository: CredentialsRepository, executionDataRepository: ExecutionDataRepository, securityConfig: SecurityConfig);
|
|
11
10
|
report(workflows: IWorkflowBase[]): Promise<Risk.StandardReport | null>;
|
|
12
11
|
private getAllCredsInUse;
|
|
13
12
|
private getAllExistingCreds;
|
|
@@ -15,9 +15,8 @@ const db_1 = require("@n8n/db");
|
|
|
15
15
|
const di_1 = require("@n8n/di");
|
|
16
16
|
const constants_1 = require("../../security-audit/constants");
|
|
17
17
|
let CredentialsRiskReporter = class CredentialsRiskReporter {
|
|
18
|
-
constructor(credentialsRepository,
|
|
18
|
+
constructor(credentialsRepository, executionDataRepository, securityConfig) {
|
|
19
19
|
this.credentialsRepository = credentialsRepository;
|
|
20
|
-
this.executionRepository = executionRepository;
|
|
21
20
|
this.executionDataRepository = executionDataRepository;
|
|
22
21
|
this.securityConfig = securityConfig;
|
|
23
22
|
}
|
|
@@ -102,8 +101,7 @@ let CredentialsRiskReporter = class CredentialsRiskReporter {
|
|
|
102
101
|
async getExecutedWorkflowsInPastDays(days) {
|
|
103
102
|
const date = new Date();
|
|
104
103
|
date.setDate(date.getDate() - days);
|
|
105
|
-
|
|
106
|
-
return await this.executionDataRepository.findByExecutionIds(executionIds);
|
|
104
|
+
return await this.executionDataRepository.getWorkflowsExecutedSince(date);
|
|
107
105
|
}
|
|
108
106
|
async getCredsInRecentlyExecutedWorkflows(days) {
|
|
109
107
|
const executedWorkflows = await this.getExecutedWorkflowsInPastDays(days);
|
|
@@ -124,7 +122,6 @@ exports.CredentialsRiskReporter = CredentialsRiskReporter;
|
|
|
124
122
|
exports.CredentialsRiskReporter = CredentialsRiskReporter = __decorate([
|
|
125
123
|
(0, di_1.Service)(),
|
|
126
124
|
__metadata("design:paramtypes", [db_1.CredentialsRepository,
|
|
127
|
-
db_1.ExecutionRepository,
|
|
128
125
|
db_1.ExecutionDataRepository,
|
|
129
126
|
config_1.SecurityConfig])
|
|
130
127
|
], CredentialsRiskReporter);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials-risk-reporter.js","sourceRoot":"","sources":["../../../src/security-audit/risk-reporters/credentials-risk-reporter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAA6C;AAC7C,
|
|
1
|
+
{"version":3,"file":"credentials-risk-reporter.js","sourceRoot":"","sources":["../../../src/security-audit/risk-reporters/credentials-risk-reporter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAA6C;AAC7C,gCAAyE;AACzE,gCAAk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n/db';
|
|
4
|
+
import { InstanceSettings } from 'n8n-core';
|
|
5
|
+
import type { ICredentialDataDecryptedObject } from 'n8n-workflow';
|
|
6
|
+
import type { AiGatewayConfigDto, AiGatewayUsageResponse } from '@n8n/api-types';
|
|
7
|
+
import { License } from '../license';
|
|
8
|
+
import { OwnershipService } from '../services/ownership.service';
|
|
9
|
+
interface GatewayCreditsResponse {
|
|
10
|
+
creditsQuota: number;
|
|
11
|
+
creditsRemaining: number;
|
|
12
|
+
}
|
|
13
|
+
export declare class AiGatewayService {
|
|
14
|
+
private readonly globalConfig;
|
|
15
|
+
private readonly license;
|
|
16
|
+
private readonly licenseState;
|
|
17
|
+
private readonly instanceSettings;
|
|
18
|
+
private readonly ownershipService;
|
|
19
|
+
private readonly userRepository;
|
|
20
|
+
private readonly tokenCache;
|
|
21
|
+
private readonly TOKEN_CACHE_MAX_SIZE;
|
|
22
|
+
private readonly pendingTokenRequests;
|
|
23
|
+
private gatewayConfig;
|
|
24
|
+
private configFetchedAt;
|
|
25
|
+
private static readonly CONFIG_TTL_MS;
|
|
26
|
+
constructor(globalConfig: GlobalConfig, license: License, licenseState: LicenseState, instanceSettings: InstanceSettings, ownershipService: OwnershipService, userRepository: UserRepository);
|
|
27
|
+
private resolveUserId;
|
|
28
|
+
getSyntheticCredential({ credentialType, userId, workflowId, projectId, }: {
|
|
29
|
+
credentialType: string;
|
|
30
|
+
userId: string | undefined;
|
|
31
|
+
workflowId?: string;
|
|
32
|
+
projectId?: string;
|
|
33
|
+
}): Promise<ICredentialDataDecryptedObject>;
|
|
34
|
+
getUsage(userId: string, offset: number, limit: number): Promise<AiGatewayUsageResponse>;
|
|
35
|
+
getCreditsRemaining(userId: string): Promise<GatewayCreditsResponse>;
|
|
36
|
+
private parseCreditsResponse;
|
|
37
|
+
private requireBaseUrl;
|
|
38
|
+
private isConfigStale;
|
|
39
|
+
getGatewayConfig(): Promise<AiGatewayConfigDto>;
|
|
40
|
+
private buildGatewayCredentialsHeaders;
|
|
41
|
+
private getOrFetchToken;
|
|
42
|
+
private fetchAndCacheToken;
|
|
43
|
+
}
|
|
44
|
+
export {};
|