@resolveio/server-lib 22.3.23 → 22.3.25
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/ai/assistant-core-heuristics.d.ts +11 -0
- package/ai/assistant-core-heuristics.js +356 -0
- package/ai/assistant-core-heuristics.js.map +1 -0
- package/ai/resolveio-platform-intelligence-memory-corpus.d.ts +3 -0
- package/ai/resolveio-platform-intelligence-memory-corpus.js +214 -0
- package/ai/resolveio-platform-intelligence-memory-corpus.js.map +1 -0
- package/ai/resolveio-platform-intelligence-memory.d.ts +20 -0
- package/ai/resolveio-platform-intelligence-memory.js +341 -0
- package/ai/resolveio-platform-intelligence-memory.js.map +1 -0
- package/{src/ai/resolveio-platform-intelligence-types.ts → ai/resolveio-platform-intelligence-types.d.ts} +15 -20
- package/ai/resolveio-platform-intelligence-types.js +4 -0
- package/ai/resolveio-platform-intelligence-types.js.map +1 -0
- package/ai/resolveio-platform-intelligence.d.ts +6 -0
- package/ai/resolveio-platform-intelligence.js +463 -0
- package/ai/resolveio-platform-intelligence.js.map +1 -0
- package/client-server-app.d.ts +1 -0
- package/client-server-app.js +68 -0
- package/client-server-app.js.map +1 -0
- package/collections/ai-terminal-conversation.collection.d.ts +2 -0
- package/collections/ai-terminal-conversation.collection.js +140 -0
- package/collections/ai-terminal-conversation.collection.js.map +1 -0
- package/collections/ai-terminal-issue-report.collection.d.ts +2 -0
- package/collections/ai-terminal-issue-report.collection.js +148 -0
- package/collections/ai-terminal-issue-report.collection.js.map +1 -0
- package/collections/ai-terminal-message.collection.d.ts +2 -0
- package/collections/ai-terminal-message.collection.js +121 -0
- package/collections/ai-terminal-message.collection.js.map +1 -0
- package/collections/app-setting.collection.d.ts +3 -0
- package/collections/app-setting.collection.js +103 -0
- package/collections/app-setting.collection.js.map +1 -0
- package/collections/app-status.collection.d.ts +3 -0
- package/collections/app-status.collection.js +57 -0
- package/collections/app-status.collection.js.map +1 -0
- package/collections/communication-metric.collection.d.ts +2 -0
- package/collections/communication-metric.collection.js +133 -0
- package/collections/communication-metric.collection.js.map +1 -0
- package/collections/counter.collection.d.ts +3 -0
- package/collections/counter.collection.js +56 -0
- package/collections/counter.collection.js.map +1 -0
- package/collections/cron-job-history.collection.d.ts +3 -0
- package/collections/cron-job-history.collection.js +137 -0
- package/collections/cron-job-history.collection.js.map +1 -0
- package/collections/cron-job.collection.d.ts +3 -0
- package/collections/cron-job.collection.js +92 -0
- package/collections/cron-job.collection.js.map +1 -0
- package/collections/customer-notification.collection.d.ts +3 -0
- package/collections/customer-notification.collection.js +130 -0
- package/collections/customer-notification.collection.js.map +1 -0
- package/collections/customer-portal-password.collection.d.ts +3 -0
- package/collections/customer-portal-password.collection.js +75 -0
- package/collections/customer-portal-password.collection.js.map +1 -0
- package/collections/email-history.collection.d.ts +3 -0
- package/collections/email-history.collection.js +127 -0
- package/collections/email-history.collection.js.map +1 -0
- package/collections/email-verified.collection.d.ts +3 -0
- package/collections/email-verified.collection.js +62 -0
- package/collections/email-verified.collection.js.map +1 -0
- package/collections/file.collection.d.ts +3 -0
- package/collections/file.collection.js +74 -0
- package/collections/file.collection.js.map +1 -0
- package/collections/flag-update.collection.d.ts +3 -0
- package/collections/flag-update.collection.js +57 -0
- package/collections/flag-update.collection.js.map +1 -0
- package/collections/flag.collection.d.ts +3 -0
- package/collections/flag.collection.js +57 -0
- package/collections/flag.collection.js.map +1 -0
- package/collections/log-method-latency.collection.d.ts +3 -0
- package/collections/log-method-latency.collection.js +77 -0
- package/collections/log-method-latency.collection.js.map +1 -0
- package/collections/log-subscription.collection.d.ts +3 -0
- package/collections/log-subscription.collection.js +80 -0
- package/collections/log-subscription.collection.js.map +1 -0
- package/collections/log.collection.d.ts +3 -0
- package/collections/log.collection.js +93 -0
- package/collections/log.collection.js.map +1 -0
- package/collections/logged-in-users.collection.d.ts +3 -0
- package/collections/logged-in-users.collection.js +67 -0
- package/collections/logged-in-users.collection.js.map +1 -0
- package/collections/monitor-cpu.collection.d.ts +3 -0
- package/collections/monitor-cpu.collection.js +65 -0
- package/collections/monitor-cpu.collection.js.map +1 -0
- package/collections/monitor-function.collection.d.ts +3 -0
- package/collections/monitor-function.collection.js +74 -0
- package/collections/monitor-function.collection.js.map +1 -0
- package/collections/monitor-memory.collection.d.ts +3 -0
- package/collections/monitor-memory.collection.js +77 -0
- package/collections/monitor-memory.collection.js.map +1 -0
- package/collections/monitor-mongo.collection.d.ts +3 -0
- package/collections/monitor-mongo.collection.js +71 -0
- package/collections/monitor-mongo.collection.js.map +1 -0
- package/collections/notification.collection.d.ts +3 -0
- package/collections/notification.collection.js +57 -0
- package/collections/notification.collection.js.map +1 -0
- package/collections/openai-usage-ledger.collection.d.ts +2 -0
- package/collections/openai-usage-ledger.collection.js +124 -0
- package/collections/openai-usage-ledger.collection.js.map +1 -0
- package/collections/report-builder-dashboard-builder.collection.d.ts +3 -0
- package/collections/report-builder-dashboard-builder.collection.js +109 -0
- package/collections/report-builder-dashboard-builder.collection.js.map +1 -0
- package/collections/report-builder-library.collection.d.ts +3 -0
- package/collections/report-builder-library.collection.js +87 -0
- package/collections/report-builder-library.collection.js.map +1 -0
- package/collections/report-builder-report.collection.d.ts +4 -0
- package/collections/report-builder-report.collection.js +184 -0
- package/collections/report-builder-report.collection.js.map +1 -0
- package/collections/user-group.collection.d.ts +4 -0
- package/collections/user-group.collection.js +89 -0
- package/collections/user-group.collection.js.map +1 -0
- package/collections/user-guide.collection.d.ts +3 -0
- package/collections/user-guide.collection.js +57 -0
- package/collections/user-guide.collection.js.map +1 -0
- package/collections/user.collection.d.ts +4 -0
- package/collections/user.collection.js +180 -0
- package/collections/user.collection.js.map +1 -0
- package/cron/cron.d.ts +14 -0
- package/cron/cron.js +216 -0
- package/cron/cron.js.map +1 -0
- package/fixtures/cron-jobs.d.ts +1 -0
- package/fixtures/cron-jobs.js +150 -0
- package/fixtures/cron-jobs.js.map +1 -0
- package/fixtures/init.d.ts +1 -0
- package/fixtures/init.js +91 -0
- package/fixtures/init.js.map +1 -0
- package/http/auth.d.ts +2 -0
- package/http/auth.js +906 -0
- package/http/auth.js.map +1 -0
- package/http/health.d.ts +1 -0
- package/http/health.js +11 -0
- package/http/health.js.map +1 -0
- package/http/home.d.ts +1 -0
- package/http/home.js +134 -0
- package/http/home.js.map +1 -0
- package/http/slow-query-publication.d.ts +2 -0
- package/http/slow-query-publication.js +99 -0
- package/http/slow-query-publication.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/index.js.map +1 -0
- package/managers/ai-assistant-codex-manager.manager.d.ts +67 -0
- package/managers/ai-assistant-codex-manager.manager.js +1113 -0
- package/managers/ai-assistant-codex-manager.manager.js.map +1 -0
- package/managers/communication-metric.manager.d.ts +16 -0
- package/managers/communication-metric.manager.js +134 -0
- package/managers/communication-metric.manager.js.map +1 -0
- package/managers/cron.manager.d.ts +20 -0
- package/managers/cron.manager.js +534 -0
- package/managers/cron.manager.js.map +1 -0
- package/managers/customer-notification-content.manager.d.ts +55 -0
- package/managers/customer-notification-content.manager.js +158 -0
- package/managers/customer-notification-content.manager.js.map +1 -0
- package/managers/diagnostic-manager-bootstrap.d.ts +9 -0
- package/managers/diagnostic-manager-bootstrap.js +260 -0
- package/managers/diagnostic-manager-bootstrap.js.map +1 -0
- package/managers/error-auto-fix.manager.d.ts +149 -0
- package/managers/error-auto-fix.manager.js +3064 -0
- package/managers/error-auto-fix.manager.js.map +1 -0
- package/managers/local-log.manager.d.ts +18 -0
- package/managers/local-log.manager.js +88 -0
- package/managers/local-log.manager.js.map +1 -0
- package/managers/method.manager.d.ts +83 -0
- package/managers/method.manager.js +1941 -0
- package/managers/method.manager.js.map +1 -0
- package/managers/mongo.manager.d.ts +224 -0
- package/managers/mongo.manager.js +5000 -0
- package/managers/mongo.manager.js.map +1 -0
- package/managers/monitor.manager.d.ts +70 -0
- package/managers/monitor.manager.js +550 -0
- package/managers/monitor.manager.js.map +1 -0
- package/managers/openai-usage-ledger.manager.d.ts +15 -0
- package/managers/openai-usage-ledger.manager.js +144 -0
- package/managers/openai-usage-ledger.manager.js.map +1 -0
- package/managers/slow-query-verifier.manager.d.ts +144 -0
- package/managers/slow-query-verifier.manager.js +3857 -0
- package/managers/slow-query-verifier.manager.js.map +1 -0
- package/managers/slow-query.manager.d.ts +28 -0
- package/managers/slow-query.manager.js +468 -0
- package/managers/slow-query.manager.js.map +1 -0
- package/managers/subscription.manager.d.ts +169 -0
- package/managers/subscription.manager.js +3434 -0
- package/managers/subscription.manager.js.map +1 -0
- package/managers/websocket.manager.d.ts +73 -0
- package/managers/websocket.manager.js +673 -0
- package/managers/websocket.manager.js.map +1 -0
- package/managers/worker-dispatcher.manager.d.ts +120 -0
- package/managers/worker-dispatcher.manager.js +1266 -0
- package/managers/worker-dispatcher.manager.js.map +1 -0
- package/managers/worker-server.manager.d.ts +35 -0
- package/managers/worker-server.manager.js +582 -0
- package/managers/worker-server.manager.js.map +1 -0
- package/methods/accounts.d.ts +2 -0
- package/methods/accounts.js +624 -0
- package/methods/accounts.js.map +1 -0
- package/methods/ai-terminal.d.ts +322 -0
- package/methods/ai-terminal.js +22699 -0
- package/methods/ai-terminal.js.map +1 -0
- package/methods/app-settings.d.ts +2 -0
- package/methods/app-settings.js +169 -0
- package/methods/app-settings.js.map +1 -0
- package/methods/aws.d.ts +2 -0
- package/methods/aws.js +877 -0
- package/methods/aws.js.map +1 -0
- package/methods/collections.d.ts +2 -0
- package/methods/collections.js +719 -0
- package/methods/collections.js.map +1 -0
- package/methods/counters.d.ts +2 -0
- package/methods/counters.js +113 -0
- package/methods/counters.js.map +1 -0
- package/methods/cron-jobs.d.ts +2 -0
- package/methods/cron-jobs.js +2475 -0
- package/methods/cron-jobs.js.map +1 -0
- package/methods/customer-notifications.d.ts +2 -0
- package/methods/customer-notifications.js +528 -0
- package/methods/customer-notifications.js.map +1 -0
- package/methods/diagnostics.d.ts +2 -0
- package/methods/diagnostics.js +703 -0
- package/methods/diagnostics.js.map +1 -0
- package/methods/flag-updates.d.ts +2 -0
- package/methods/flag-updates.js +8 -0
- package/methods/flag-updates.js.map +1 -0
- package/methods/flags.d.ts +2 -0
- package/methods/flags.js +8 -0
- package/methods/flags.js.map +1 -0
- package/methods/logs.d.ts +2 -0
- package/methods/logs.js +751 -0
- package/methods/logs.js.map +1 -0
- package/methods/mongo-explorer.d.ts +2 -0
- package/methods/mongo-explorer.js +1808 -0
- package/methods/mongo-explorer.js.map +1 -0
- package/methods/monitor.d.ts +2 -0
- package/methods/monitor.js +543 -0
- package/methods/monitor.js.map +1 -0
- package/methods/pdf.d.ts +2 -0
- package/methods/pdf.js +1216 -0
- package/methods/pdf.js.map +1 -0
- package/methods/publications.d.ts +1 -0
- package/methods/publications.js +183 -0
- package/methods/publications.js.map +1 -0
- package/methods/report-builder.d.ts +2 -0
- package/methods/report-builder.js +3094 -0
- package/methods/report-builder.js.map +1 -0
- package/methods/support.d.ts +2 -0
- package/methods/support.js +430 -0
- package/methods/support.js.map +1 -0
- package/models/ai-terminal-conversation.model.d.ts +17 -0
- package/models/ai-terminal-conversation.model.js +4 -0
- package/models/ai-terminal-conversation.model.js.map +1 -0
- package/models/ai-terminal-issue-report.model.d.ts +19 -0
- package/models/ai-terminal-issue-report.model.js +4 -0
- package/models/ai-terminal-issue-report.model.js.map +1 -0
- package/models/ai-terminal-message.model.d.ts +22 -0
- package/models/ai-terminal-message.model.js +4 -0
- package/models/ai-terminal-message.model.js.map +1 -0
- package/models/app-setting.model.d.ts +16 -0
- package/models/app-setting.model.js +4 -0
- package/models/app-setting.model.js.map +1 -0
- package/{src/models/app-status.model.ts → models/app-status.model.d.ts} +2 -3
- package/models/app-status.model.js +4 -0
- package/models/app-status.model.js.map +1 -0
- package/{src/models/billing-logged-in-users.model.ts → models/billing-logged-in-users.model.d.ts} +4 -5
- package/models/billing-logged-in-users.model.js +4 -0
- package/models/billing-logged-in-users.model.js.map +1 -0
- package/models/collection-document.model.d.ts +21 -0
- package/models/collection-document.model.js +4 -0
- package/models/collection-document.model.js.map +1 -0
- package/models/communication-metric.model.d.ts +20 -0
- package/models/communication-metric.model.js +4 -0
- package/models/communication-metric.model.js.map +1 -0
- package/{src/models/counter.model.ts → models/counter.model.d.ts} +3 -4
- package/models/counter.model.js +4 -0
- package/models/counter.model.js.map +1 -0
- package/models/cron-job-history.model.d.ts +15 -0
- package/models/cron-job-history.model.js +4 -0
- package/models/cron-job-history.model.js.map +1 -0
- package/models/cron-job.model.d.ts +14 -0
- package/models/cron-job.model.js +4 -0
- package/models/cron-job.model.js.map +1 -0
- package/models/customer-notification.model.d.ts +26 -0
- package/models/customer-notification.model.js +4 -0
- package/models/customer-notification.model.js.map +1 -0
- package/models/customer-portal-password.model.d.ts +11 -0
- package/models/customer-portal-password.model.js +4 -0
- package/models/customer-portal-password.model.js.map +1 -0
- package/models/dialog.model.d.ts +23 -0
- package/models/dialog.model.js +4 -0
- package/models/dialog.model.js.map +1 -0
- package/models/email-history.model.d.ts +31 -0
- package/{src/models/email-history.model.ts → models/email-history.model.js} +4 -35
- package/models/email-history.model.js.map +1 -0
- package/{src/models/email-verified.model.ts → models/email-verified.model.d.ts} +5 -6
- package/models/email-verified.model.js +4 -0
- package/models/email-verified.model.js.map +1 -0
- package/{src/models/file.model.ts → models/file.model.d.ts} +7 -8
- package/models/file.model.js +4 -0
- package/models/file.model.js.map +1 -0
- package/{src/models/flag-update.model.ts → models/flag-update.model.d.ts} +3 -4
- package/models/flag-update.model.js +4 -0
- package/models/flag-update.model.js.map +1 -0
- package/{src/models/flag.model.ts → models/flag.model.d.ts} +3 -4
- package/models/flag.model.js +4 -0
- package/models/flag.model.js.map +1 -0
- package/models/log-method-latency.model.d.ts +10 -0
- package/models/log-method-latency.model.js +4 -0
- package/models/log-method-latency.model.js.map +1 -0
- package/{src/models/log-subscription.model.ts → models/log-subscription.model.d.ts} +9 -11
- package/models/log-subscription.model.js +4 -0
- package/models/log-subscription.model.js.map +1 -0
- package/models/log.model.d.ts +17 -0
- package/models/log.model.js +4 -0
- package/models/log.model.js.map +1 -0
- package/{src/models/logged-in-users.model.ts → models/logged-in-users.model.d.ts} +5 -6
- package/models/logged-in-users.model.js +4 -0
- package/models/logged-in-users.model.js.map +1 -0
- package/{src/models/method-response.model.ts → models/method-response.model.d.ts} +6 -7
- package/models/method-response.model.js +4 -0
- package/models/method-response.model.js.map +1 -0
- package/models/method.model.d.ts +26 -0
- package/models/method.model.js +4 -0
- package/models/method.model.js.map +1 -0
- package/{src/models/monitor-cpu.model.ts → models/monitor-cpu.model.d.ts} +7 -9
- package/models/monitor-cpu.model.js +4 -0
- package/models/monitor-cpu.model.js.map +1 -0
- package/models/monitor-function.model.d.ts +14 -0
- package/models/monitor-function.model.js +4 -0
- package/models/monitor-function.model.js.map +1 -0
- package/models/monitor-memory.model.d.ts +15 -0
- package/models/monitor-memory.model.js +4 -0
- package/models/monitor-memory.model.js.map +1 -0
- package/models/monitor-mongo.model.d.ts +13 -0
- package/models/monitor-mongo.model.js +4 -0
- package/models/monitor-mongo.model.js.map +1 -0
- package/{src/models/notification.model.ts → models/notification.model.d.ts} +4 -6
- package/models/notification.model.js +4 -0
- package/models/notification.model.js.map +1 -0
- package/models/openai-usage-ledger.model.d.ts +15 -0
- package/models/openai-usage-ledger.model.js +4 -0
- package/models/openai-usage-ledger.model.js.map +1 -0
- package/models/pagination.model.d.ts +11 -0
- package/models/pagination.model.js +28 -0
- package/models/pagination.model.js.map +1 -0
- package/models/permission.model.d.ts +12 -0
- package/models/permission.model.js +4 -0
- package/models/permission.model.js.map +1 -0
- package/models/report-builder-dashboard-builder.model.d.ts +25 -0
- package/models/report-builder-dashboard-builder.model.js +4 -0
- package/models/report-builder-dashboard-builder.model.js.map +1 -0
- package/models/report-builder-library.model.d.ts +17 -0
- package/models/report-builder-library.model.js +4 -0
- package/models/report-builder-library.model.js.map +1 -0
- package/models/report-builder-report.model.d.ts +121 -0
- package/models/report-builder-report.model.js +4 -0
- package/models/report-builder-report.model.js.map +1 -0
- package/models/report-builder.model.d.ts +61 -0
- package/models/report-builder.model.js +4 -0
- package/models/report-builder.model.js.map +1 -0
- package/models/select-data-label.model.d.ts +9 -0
- package/models/select-data-label.model.js +4 -0
- package/models/select-data-label.model.js.map +1 -0
- package/models/server-message.model.d.ts +32 -0
- package/models/server-message.model.js +4 -0
- package/models/server-message.model.js.map +1 -0
- package/models/slow-query-report.model.d.ts +23 -0
- package/models/slow-query-report.model.js +4 -0
- package/models/slow-query-report.model.js.map +1 -0
- package/models/subscription.model.d.ts +31 -0
- package/models/subscription.model.js +4 -0
- package/models/subscription.model.js.map +1 -0
- package/models/support-ticket.model.d.ts +87 -0
- package/models/support-ticket.model.js +4 -0
- package/models/support-ticket.model.js.map +1 -0
- package/models/user-group.model.d.ts +20 -0
- package/models/user-group.model.js +4 -0
- package/models/user-group.model.js.map +1 -0
- package/{src/models/user-guide.model.ts → models/user-guide.model.d.ts} +4 -5
- package/models/user-guide.model.js +4 -0
- package/models/user-guide.model.js.map +1 -0
- package/models/user.model.d.ts +84 -0
- package/models/user.model.js +4 -0
- package/models/user.model.js.map +1 -0
- package/package.json +1 -1
- package/private/images/ResolveIO.png +0 -0
- package/{src/public_api.ts → public_api.d.ts} +1 -0
- package/public_api.js +113 -0
- package/public_api.js.map +1 -0
- package/publications/ai-terminal.d.ts +1 -0
- package/publications/ai-terminal.js +122 -0
- package/publications/ai-terminal.js.map +1 -0
- package/publications/app-settings.d.ts +2 -0
- package/publications/app-settings.js +28 -0
- package/publications/app-settings.js.map +1 -0
- package/publications/app-status.d.ts +2 -0
- package/publications/app-status.js +16 -0
- package/publications/app-status.js.map +1 -0
- package/publications/cron-jobs.d.ts +2 -0
- package/publications/cron-jobs.js +88 -0
- package/publications/cron-jobs.js.map +1 -0
- package/publications/customer-notifications.d.ts +2 -0
- package/publications/customer-notifications.js +161 -0
- package/publications/customer-notifications.js.map +1 -0
- package/publications/files.d.ts +2 -0
- package/publications/files.js +36 -0
- package/publications/files.js.map +1 -0
- package/publications/flags-update.d.ts +2 -0
- package/publications/flags-update.js +22 -0
- package/publications/flags-update.js.map +1 -0
- package/publications/flags.d.ts +2 -0
- package/publications/flags.js +22 -0
- package/publications/flags.js.map +1 -0
- package/publications/logs.d.ts +2 -0
- package/publications/logs.js +164 -0
- package/publications/logs.js.map +1 -0
- package/publications/notifications.d.ts +2 -0
- package/publications/notifications.js +16 -0
- package/publications/notifications.js.map +1 -0
- package/publications/report-builder-dashboard-builders.d.ts +2 -0
- package/publications/report-builder-dashboard-builders.js +42 -0
- package/publications/report-builder-dashboard-builders.js.map +1 -0
- package/publications/report-builder-libraries.d.ts +2 -0
- package/publications/report-builder-libraries.js +90 -0
- package/publications/report-builder-libraries.js.map +1 -0
- package/publications/report-builder-reports.d.ts +2 -0
- package/publications/report-builder-reports.js +50 -0
- package/publications/report-builder-reports.js.map +1 -0
- package/publications/super-admin.d.ts +2 -0
- package/publications/super-admin.js +16 -0
- package/publications/super-admin.js.map +1 -0
- package/publications/user-groups.d.ts +1 -0
- package/publications/user-groups.js +16 -0
- package/publications/user-groups.js.map +1 -0
- package/publications/user-guides.d.ts +1 -0
- package/publications/user-guides.js +16 -0
- package/publications/user-guides.js.map +1 -0
- package/resolveio-server-app.d.ts +70 -0
- package/resolveio-server-app.js +801 -0
- package/resolveio-server-app.js.map +1 -0
- package/server-app.d.ts +228 -0
- package/server-app.js +3566 -0
- package/server-app.js.map +1 -0
- package/services/codex-client.d.ts +126 -0
- package/services/codex-client.js +1622 -0
- package/services/codex-client.js.map +1 -0
- package/services/openai-client.d.ts +46 -0
- package/services/openai-client.js +318 -0
- package/services/openai-client.js.map +1 -0
- package/types/error-report.d.ts +25 -0
- package/types/error-report.js +4 -0
- package/types/error-report.js.map +1 -0
- package/types/slow-query-report.d.ts +27 -0
- package/types/slow-query-report.js +6 -0
- package/types/slow-query-report.js.map +1 -0
- package/util/ai-qa-policy.d.ts +119 -0
- package/util/ai-qa-policy.js +638 -0
- package/util/ai-qa-policy.js.map +1 -0
- package/util/ai-runner-artifacts.d.ts +71 -0
- package/util/ai-runner-artifacts.js +493 -0
- package/util/ai-runner-artifacts.js.map +1 -0
- package/util/common.d.ts +31 -0
- package/util/common.js +683 -0
- package/util/common.js.map +1 -0
- package/util/customer-portal-password.d.ts +13 -0
- package/util/customer-portal-password.js +209 -0
- package/util/customer-portal-password.js.map +1 -0
- package/util/error-reporter.d.ts +52 -0
- package/util/error-reporter.js +326 -0
- package/util/error-reporter.js.map +1 -0
- package/util/error-tracking.d.ts +13 -0
- package/util/error-tracking.js +120 -0
- package/util/error-tracking.js.map +1 -0
- package/util/report-builder-unwinds.d.ts +15 -0
- package/util/report-builder-unwinds.js +156 -0
- package/util/report-builder-unwinds.js.map +1 -0
- package/util/schema-report-builder.d.ts +6 -0
- package/util/schema-report-builder.js +481 -0
- package/util/schema-report-builder.js.map +1 -0
- package/util/slow-query-reporter.d.ts +28 -0
- package/util/slow-query-reporter.js +226 -0
- package/util/slow-query-reporter.js.map +1 -0
- package/util/subscription-dependency-context.d.ts +34 -0
- package/util/subscription-dependency-context.js +1283 -0
- package/util/subscription-dependency-context.js.map +1 -0
- package/util/tokenizer.d.ts +5 -0
- package/util/tokenizer.js +41 -0
- package/util/tokenizer.js.map +1 -0
- package/workers/codex-runner.worker.d.ts +1 -0
- package/workers/codex-runner.worker.js +192 -0
- package/workers/codex-runner.worker.js.map +1 -0
- package/.nodemon.json +0 -5
- package/.vscode/settings.json +0 -21
- package/AGENTS.md +0 -189
- package/README.md +0 -22
- package/build_package.sh +0 -5
- package/compileDTS.pl +0 -64
- package/docs/ai-assistant-nightly-eval.md +0 -65
- package/docs/ai-assistant-preflight-checklist.md +0 -23
- package/docs/ai-assistant-report-builder-bridge-playbook.md +0 -115
- package/eslint-plugin-custom/index.js +0 -7
- package/eslint-plugin-custom/rules/no-filter-zero-index.js +0 -44
- package/eslint.config.js +0 -103
- package/gulpfile.js +0 -216
- package/methodAndPublicationListGenerator.py +0 -344
- package/mongodbensurers.js +0 -2
- package/mongostop.js +0 -3
- package/scripts/cleanup-bypassed-callmethod-logs.js +0 -616
- package/settings.development.json +0 -25
- package/settings.development.redacted.json +0 -25
- package/src/.env +0 -12
- package/src/ai/assistant-core-heuristics.ts +0 -379
- package/src/ai/resolveio-platform-intelligence-memory-corpus.ts +0 -185
- package/src/ai/resolveio-platform-intelligence-memory.ts +0 -325
- package/src/ai/resolveio-platform-intelligence.ts +0 -462
- package/src/client-server-app.ts +0 -12
- package/src/collections/ai-terminal-conversation.collection.ts +0 -91
- package/src/collections/ai-terminal-issue-report.collection.ts +0 -99
- package/src/collections/ai-terminal-message.collection.ts +0 -77
- package/src/collections/app-setting.collection.ts +0 -104
- package/src/collections/app-status.collection.ts +0 -58
- package/src/collections/communication-metric.collection.ts +0 -84
- package/src/collections/counter.collection.ts +0 -56
- package/src/collections/cron-job-history.collection.ts +0 -94
- package/src/collections/cron-job.collection.ts +0 -92
- package/src/collections/customer-notification.collection.ts +0 -131
- package/src/collections/customer-portal-password.collection.ts +0 -76
- package/src/collections/email-history.collection.ts +0 -127
- package/src/collections/email-verified.collection.ts +0 -62
- package/src/collections/file.collection.ts +0 -74
- package/src/collections/flag-update.collection.ts +0 -57
- package/src/collections/flag.collection.ts +0 -57
- package/src/collections/log-method-latency.collection.ts +0 -77
- package/src/collections/log-subscription.collection.ts +0 -80
- package/src/collections/log.collection.ts +0 -93
- package/src/collections/logged-in-users.collection.ts +0 -67
- package/src/collections/monitor-cpu.collection.ts +0 -65
- package/src/collections/monitor-function.collection.ts +0 -74
- package/src/collections/monitor-memory.collection.ts +0 -77
- package/src/collections/monitor-mongo.collection.ts +0 -71
- package/src/collections/notification.collection.ts +0 -57
- package/src/collections/openai-usage-ledger.collection.ts +0 -77
- package/src/collections/report-builder-dashboard-builder.collection.ts +0 -109
- package/src/collections/report-builder-library.collection.ts +0 -89
- package/src/collections/report-builder-report.collection.ts +0 -184
- package/src/collections/user-group.collection.ts +0 -89
- package/src/collections/user-guide.collection.ts +0 -57
- package/src/collections/user.collection.ts +0 -181
- package/src/cron/cron.ts +0 -117
- package/src/fixtures/cron-jobs.ts +0 -95
- package/src/fixtures/init.ts +0 -35
- package/src/http/auth.ts +0 -764
- package/src/http/health.ts +0 -7
- package/src/http/home.ts +0 -90
- package/src/http/slow-query-publication.ts +0 -49
- package/src/index.ts +0 -1
- package/src/managers/ai-assistant-codex-manager.manager.ts +0 -1131
- package/src/managers/communication-metric.manager.ts +0 -82
- package/src/managers/cron.manager.ts +0 -333
- package/src/managers/customer-notification-content.manager.ts +0 -236
- package/src/managers/diagnostic-manager-bootstrap.ts +0 -165
- package/src/managers/error-auto-fix.manager.ts +0 -2767
- package/src/managers/local-log.manager.ts +0 -113
- package/src/managers/method.manager.ts +0 -1827
- package/src/managers/mongo.manager.ts +0 -4575
- package/src/managers/monitor.manager.ts +0 -507
- package/src/managers/openai-usage-ledger.manager.ts +0 -116
- package/src/managers/slow-query-verifier.manager.ts +0 -3590
- package/src/managers/slow-query.manager.ts +0 -519
- package/src/managers/subscription.manager.ts +0 -3128
- package/src/managers/websocket.manager.ts +0 -746
- package/src/managers/worker-dispatcher.manager.ts +0 -1360
- package/src/managers/worker-server.manager.ts +0 -536
- package/src/methods/accounts.ts +0 -532
- package/src/methods/ai-terminal.ts +0 -22943
- package/src/methods/app-settings.ts +0 -114
- package/src/methods/aws.ts +0 -649
- package/src/methods/collections.ts +0 -641
- package/src/methods/counters.ts +0 -69
- package/src/methods/cron-jobs.ts +0 -2614
- package/src/methods/customer-notifications.ts +0 -458
- package/src/methods/diagnostics.ts +0 -616
- package/src/methods/flag-updates.ts +0 -7
- package/src/methods/flags.ts +0 -7
- package/src/methods/logs.ts +0 -657
- package/src/methods/mongo-explorer.ts +0 -1880
- package/src/methods/monitor.ts +0 -540
- package/src/methods/pdf.ts +0 -1236
- package/src/methods/publications.ts +0 -129
- package/src/methods/report-builder.ts +0 -3300
- package/src/methods/support.ts +0 -335
- package/src/models/ai-terminal-conversation.model.ts +0 -19
- package/src/models/ai-terminal-issue-report.model.ts +0 -21
- package/src/models/ai-terminal-message.model.ts +0 -24
- package/src/models/app-setting.model.ts +0 -17
- package/src/models/collection-document.model.ts +0 -24
- package/src/models/communication-metric.model.ts +0 -23
- package/src/models/cron-job-history.model.ts +0 -16
- package/src/models/cron-job.model.ts +0 -15
- package/src/models/customer-notification.model.ts +0 -28
- package/src/models/customer-portal-password.model.ts +0 -12
- package/src/models/dialog.model.ts +0 -25
- package/src/models/log-method-latency.model.ts +0 -11
- package/src/models/log.model.ts +0 -19
- package/src/models/method.model.ts +0 -25
- package/src/models/monitor-function.model.ts +0 -16
- package/src/models/monitor-memory.model.ts +0 -17
- package/src/models/monitor-mongo.model.ts +0 -15
- package/src/models/openai-usage-ledger.model.ts +0 -16
- package/src/models/pagination.model.ts +0 -35
- package/src/models/permission.model.ts +0 -14
- package/src/models/report-builder-dashboard-builder.model.ts +0 -29
- package/src/models/report-builder-library.model.ts +0 -20
- package/src/models/report-builder-report.model.ts +0 -136
- package/src/models/report-builder.model.ts +0 -68
- package/src/models/select-data-label.model.ts +0 -9
- package/src/models/server-message.model.ts +0 -31
- package/src/models/slow-query-report.model.ts +0 -23
- package/src/models/subscription.model.ts +0 -73
- package/src/models/support-ticket.model.ts +0 -104
- package/src/models/user-group.model.ts +0 -24
- package/src/models/user.model.ts +0 -96
- package/src/private/images/ResolveIO.png +0 -0
- package/src/publications/ai-terminal.ts +0 -73
- package/src/publications/app-settings.ts +0 -25
- package/src/publications/app-status.ts +0 -13
- package/src/publications/cron-jobs.ts +0 -40
- package/src/publications/customer-notifications.ts +0 -101
- package/src/publications/files.ts +0 -33
- package/src/publications/flags-update.ts +0 -19
- package/src/publications/flags.ts +0 -19
- package/src/publications/logs.ts +0 -163
- package/src/publications/notifications.ts +0 -13
- package/src/publications/report-builder-dashboard-builders.ts +0 -39
- package/src/publications/report-builder-libraries.ts +0 -41
- package/src/publications/report-builder-reports.ts +0 -47
- package/src/publications/super-admin.ts +0 -13
- package/src/publications/user-groups.ts +0 -12
- package/src/publications/user-guides.ts +0 -12
- package/src/resolveio-server-app.ts +0 -617
- package/src/server-app.ts +0 -3354
- package/src/services/codex-client.ts +0 -1223
- package/src/services/openai-client.ts +0 -265
- package/src/types/error-report.ts +0 -26
- package/src/types/js-tiktoken.d.ts +0 -11
- package/src/types/slow-query-report.ts +0 -28
- package/src/util/ai-qa-policy.ts +0 -799
- package/src/util/common.ts +0 -649
- package/src/util/customer-portal-password.ts +0 -183
- package/src/util/error-reporter.ts +0 -332
- package/src/util/error-tracking.ts +0 -79
- package/src/util/report-builder-unwinds.ts +0 -180
- package/src/util/schema-report-builder.ts +0 -448
- package/src/util/slow-query-reporter.ts +0 -216
- package/src/util/subscription-dependency-context.ts +0 -1096
- package/src/util/tokenizer.ts +0 -38
- package/src/workers/codex-runner.worker.ts +0 -142
- package/start_server.sh +0 -5
- package/tests/ai-assistant-corpus-build.ts +0 -484
- package/tests/ai-assistant-corpus-replay-e2e.ts +0 -774
- package/tests/ai-assistant-data-parity-e2e.ts +0 -1989
- package/tests/ai-assistant-eval-triage.ts +0 -831
- package/tests/ai-assistant-openai-e2e.ts +0 -1061
- package/tests/ai-assistant-openai-git-e2e.ts +0 -155
- package/tests/ai-assistant-preflight-matrix.ts +0 -215
- package/tests/ai-assistant-routing-eval.test.ts +0 -560
- package/tests/ai-assistant-snf-live-eval.ts +0 -975
- package/tests/ai-assistant-utils.test.ts +0 -2860
- package/tests/ai-runner-contract.test.ts +0 -119
- package/tests/error-reporter.test.ts +0 -145
- package/tests/report-builder-linking.test.ts +0 -79
- package/tests/resolveio-platform-intelligence.test.ts +0 -352
- package/tests/server-app-cron-owner.test.ts +0 -127
- package/tests/subscription-connect-race.test.ts +0 -158
- package/tests/subscription-dependency-context.test.ts +0 -324
- package/tests/subscription-manager-collection-tracking.test.ts +0 -86
- package/tests/subscription-manager-invalidation.test.ts +0 -86
- package/tsconfig.json +0 -34
- /package/{src/private → private}/email-templates/enrollment.html +0 -0
- /package/{src/private → private}/email-templates/forgot-password.html +0 -0
- /package/{src/private → private}/email-templates/support-ticket-deleted.html +0 -0
- /package/{src/private → private}/email-templates/support-ticket-modified.html +0 -0
- /package/{src/private → private}/email-templates/support-ticket.html +0 -0
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var __values = (this && this.__values) || function(o) {
|
|
50
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
51
|
+
if (m) return m.call(o);
|
|
52
|
+
if (o && typeof o.length === "number") return {
|
|
53
|
+
next: function () {
|
|
54
|
+
if (o && i >= o.length) o = void 0;
|
|
55
|
+
return { value: o && o[i++], done: !o };
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
59
|
+
};
|
|
60
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
61
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
62
|
+
if (!m) return o;
|
|
63
|
+
var i = m.call(o), r, ar = [], e;
|
|
64
|
+
try {
|
|
65
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
66
|
+
}
|
|
67
|
+
catch (error) { e = { error: error }; }
|
|
68
|
+
finally {
|
|
69
|
+
try {
|
|
70
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
71
|
+
}
|
|
72
|
+
finally { if (e) throw e.error; }
|
|
73
|
+
}
|
|
74
|
+
return ar;
|
|
75
|
+
};
|
|
76
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
77
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
78
|
+
if (ar || !(i in from)) {
|
|
79
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
80
|
+
ar[i] = from[i];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
84
|
+
};
|
|
85
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
86
|
+
exports.inferResolveIORunnerEvidenceContentType = inferResolveIORunnerEvidenceContentType;
|
|
87
|
+
exports.buildResolveIORunnerEvidenceCid = buildResolveIORunnerEvidenceCid;
|
|
88
|
+
exports.normalizeResolveIORunnerPersistedEvidenceFiles = normalizeResolveIORunnerPersistedEvidenceFiles;
|
|
89
|
+
exports.mergeResolveIORunnerEvidenceFileIds = mergeResolveIORunnerEvidenceFileIds;
|
|
90
|
+
exports.collectResolveIORunnerEvidenceArtifactPaths = collectResolveIORunnerEvidenceArtifactPaths;
|
|
91
|
+
exports.toResolveIORunnerEvidenceAttachments = toResolveIORunnerEvidenceAttachments;
|
|
92
|
+
exports.persistResolveIORunnerEvidenceArtifacts = persistResolveIORunnerEvidenceArtifacts;
|
|
93
|
+
var node_crypto_1 = require("node:crypto");
|
|
94
|
+
var fs = require("fs");
|
|
95
|
+
var path = require("path");
|
|
96
|
+
function inferResolveIORunnerEvidenceContentType(fileName) {
|
|
97
|
+
var normalized = String(fileName || '').trim().toLowerCase();
|
|
98
|
+
if (normalized.endsWith('.png')) {
|
|
99
|
+
return 'image/png';
|
|
100
|
+
}
|
|
101
|
+
if (normalized.endsWith('.jpg') || normalized.endsWith('.jpeg')) {
|
|
102
|
+
return 'image/jpeg';
|
|
103
|
+
}
|
|
104
|
+
if (normalized.endsWith('.webp')) {
|
|
105
|
+
return 'image/webp';
|
|
106
|
+
}
|
|
107
|
+
if (normalized.endsWith('.zip')) {
|
|
108
|
+
return 'application/zip';
|
|
109
|
+
}
|
|
110
|
+
if (normalized.endsWith('.json')) {
|
|
111
|
+
return 'application/json';
|
|
112
|
+
}
|
|
113
|
+
if (normalized.endsWith('.txt') || normalized.endsWith('.log')) {
|
|
114
|
+
return 'text/plain; charset=utf-8';
|
|
115
|
+
}
|
|
116
|
+
return 'application/octet-stream';
|
|
117
|
+
}
|
|
118
|
+
function buildResolveIORunnerEvidenceCid(filePath) {
|
|
119
|
+
var baseName = path.basename(String(filePath || '').trim()) || 'runner-artifact';
|
|
120
|
+
var normalized = baseName
|
|
121
|
+
.toLowerCase()
|
|
122
|
+
.replace(/[^a-z0-9._-]+/g, '-')
|
|
123
|
+
.replace(/^-+|-+$/g, '')
|
|
124
|
+
.slice(0, 80) || 'runner-artifact';
|
|
125
|
+
var digest = (0, node_crypto_1.createHash)('sha1').update(String(filePath || '')).digest('hex').slice(0, 12);
|
|
126
|
+
return "".concat(normalized, "-").concat(digest, "@resolveio-runner");
|
|
127
|
+
}
|
|
128
|
+
function normalizeResolveIORunnerPersistedEvidenceFiles(value) {
|
|
129
|
+
if (!Array.isArray(value)) {
|
|
130
|
+
return [];
|
|
131
|
+
}
|
|
132
|
+
return value
|
|
133
|
+
.map(function (item) {
|
|
134
|
+
var fileId = String((item === null || item === void 0 ? void 0 : item.file_id) || (item === null || item === void 0 ? void 0 : item.id_file) || (item === null || item === void 0 ? void 0 : item._id) || '').trim();
|
|
135
|
+
if (!fileId) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
return {
|
|
139
|
+
file_id: fileId,
|
|
140
|
+
filename: String((item === null || item === void 0 ? void 0 : item.filename) || (item === null || item === void 0 ? void 0 : item.name) || '').trim(),
|
|
141
|
+
key: String((item === null || item === void 0 ? void 0 : item.key) || '').trim() || undefined,
|
|
142
|
+
contentType: String((item === null || item === void 0 ? void 0 : item.contentType) || (item === null || item === void 0 ? void 0 : item.content_type) || '').trim() || undefined,
|
|
143
|
+
content_hash: String((item === null || item === void 0 ? void 0 : item.content_hash) || (item === null || item === void 0 ? void 0 : item.hash) || '').trim() || undefined,
|
|
144
|
+
ticket_url: String((item === null || item === void 0 ? void 0 : item.ticket_url) || '').trim() || undefined
|
|
145
|
+
};
|
|
146
|
+
})
|
|
147
|
+
.filter(function (item) { return !!item; });
|
|
148
|
+
}
|
|
149
|
+
function mergeResolveIORunnerEvidenceFileIds() {
|
|
150
|
+
var values = [];
|
|
151
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
152
|
+
values[_i] = arguments[_i];
|
|
153
|
+
}
|
|
154
|
+
var ids = [];
|
|
155
|
+
var seen = new Set();
|
|
156
|
+
var push = function (value) {
|
|
157
|
+
if (Array.isArray(value)) {
|
|
158
|
+
value.forEach(push);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
var id = String((value === null || value === void 0 ? void 0 : value.file_id) || (value === null || value === void 0 ? void 0 : value.id_file) || (value === null || value === void 0 ? void 0 : value._id) || value || '').trim();
|
|
162
|
+
if (!id || seen.has(id)) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
seen.add(id);
|
|
166
|
+
ids.push(id);
|
|
167
|
+
};
|
|
168
|
+
values.forEach(push);
|
|
169
|
+
return ids;
|
|
170
|
+
}
|
|
171
|
+
function collectResolveIORunnerEvidenceText(value, output) {
|
|
172
|
+
if (value === null || value === undefined) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (typeof value === 'string') {
|
|
176
|
+
output.push(value);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
if (Array.isArray(value)) {
|
|
180
|
+
value.forEach(function (entry) { return collectResolveIORunnerEvidenceText(entry, output); });
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
if (typeof value === 'object') {
|
|
184
|
+
Object.values(value).forEach(function (entry) { return collectResolveIORunnerEvidenceText(entry, output); });
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function normalizeArtifactCandidatePath(value) {
|
|
188
|
+
return String(value || '')
|
|
189
|
+
.trim()
|
|
190
|
+
.replace(/[),.;:'"]+$/g, '')
|
|
191
|
+
.replace(/\\/g, '/');
|
|
192
|
+
}
|
|
193
|
+
function pathExists(filePath) {
|
|
194
|
+
try {
|
|
195
|
+
return !!filePath && fs.existsSync(filePath) && fs.statSync(filePath).isFile();
|
|
196
|
+
}
|
|
197
|
+
catch (_a) {
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function resolveArtifactCandidate(candidate, roots) {
|
|
202
|
+
var e_1, _a;
|
|
203
|
+
var normalized = normalizeArtifactCandidatePath(candidate);
|
|
204
|
+
if (!normalized) {
|
|
205
|
+
return '';
|
|
206
|
+
}
|
|
207
|
+
if (path.isAbsolute(normalized)) {
|
|
208
|
+
return pathExists(normalized) ? normalized : '';
|
|
209
|
+
}
|
|
210
|
+
try {
|
|
211
|
+
for (var roots_1 = __values(roots), roots_1_1 = roots_1.next(); !roots_1_1.done; roots_1_1 = roots_1.next()) {
|
|
212
|
+
var root = roots_1_1.value;
|
|
213
|
+
var normalizedRoot = String(root || '').trim();
|
|
214
|
+
if (!normalizedRoot) {
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
var resolved = path.resolve(normalizedRoot, normalized);
|
|
218
|
+
if (pathExists(resolved)) {
|
|
219
|
+
return resolved;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
224
|
+
finally {
|
|
225
|
+
try {
|
|
226
|
+
if (roots_1_1 && !roots_1_1.done && (_a = roots_1.return)) _a.call(roots_1);
|
|
227
|
+
}
|
|
228
|
+
finally { if (e_1) throw e_1.error; }
|
|
229
|
+
}
|
|
230
|
+
return '';
|
|
231
|
+
}
|
|
232
|
+
function collectResolveIORunnerEvidenceArtifactPaths(input) {
|
|
233
|
+
var e_2, _a, e_3, _b, e_4, _c, e_5, _d, e_6, _e;
|
|
234
|
+
var _f, _g, _h, _j;
|
|
235
|
+
if (input === void 0) { input = {}; }
|
|
236
|
+
var values = [];
|
|
237
|
+
collectResolveIORunnerEvidenceText(input.evidence, values);
|
|
238
|
+
var job = input.job || {};
|
|
239
|
+
collectResolveIORunnerEvidenceText(job.responseSummary, values);
|
|
240
|
+
collectResolveIORunnerEvidenceText(job.lastVerificationSummary, values);
|
|
241
|
+
collectResolveIORunnerEvidenceText(job.lastRerunReason, values);
|
|
242
|
+
collectResolveIORunnerEvidenceText((_f = job.artifacts) === null || _f === void 0 ? void 0 : _f.agentNotes, values);
|
|
243
|
+
collectResolveIORunnerEvidenceText((_g = job.artifacts) === null || _g === void 0 ? void 0 : _g.supportArtifacts, values);
|
|
244
|
+
collectResolveIORunnerEvidenceText((_h = job.artifacts) === null || _h === void 0 ? void 0 : _h.qaArtifacts, values);
|
|
245
|
+
collectResolveIORunnerEvidenceText((_j = job.artifacts) === null || _j === void 0 ? void 0 : _j.qa_artifacts, values);
|
|
246
|
+
collectResolveIORunnerEvidenceText(job.qa_artifacts, values);
|
|
247
|
+
collectResolveIORunnerEvidenceText(job.supportQaArtifacts, values);
|
|
248
|
+
collectResolveIORunnerEvidenceText(job.runnerEvidenceArtifacts, values);
|
|
249
|
+
if (Array.isArray(job.tasks)) {
|
|
250
|
+
try {
|
|
251
|
+
for (var _k = __values(job.tasks), _l = _k.next(); !_l.done; _l = _k.next()) {
|
|
252
|
+
var task = _l.value;
|
|
253
|
+
collectResolveIORunnerEvidenceText(task === null || task === void 0 ? void 0 : task.title, values);
|
|
254
|
+
collectResolveIORunnerEvidenceText(task === null || task === void 0 ? void 0 : task.notes, values);
|
|
255
|
+
collectResolveIORunnerEvidenceText(task === null || task === void 0 ? void 0 : task.artifacts, values);
|
|
256
|
+
collectResolveIORunnerEvidenceText(task === null || task === void 0 ? void 0 : task.evidence, values);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
260
|
+
finally {
|
|
261
|
+
try {
|
|
262
|
+
if (_l && !_l.done && (_a = _k.return)) _a.call(_k);
|
|
263
|
+
}
|
|
264
|
+
finally { if (e_2) throw e_2.error; }
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
if (Array.isArray(job.log)) {
|
|
268
|
+
collectResolveIORunnerEvidenceText(job.log.slice(-160), values);
|
|
269
|
+
}
|
|
270
|
+
var roots = Array.from(new Set(__spreadArray(__spreadArray([], __read((input.roots || [])), false), [
|
|
271
|
+
job.workspacePath,
|
|
272
|
+
job.projectRoot && job.workspacePath ? path.join(job.workspacePath, job.projectRoot) : '',
|
|
273
|
+
job.projectDisplayPath && job.workspacePath ? path.join(job.workspacePath, job.projectDisplayPath) : '',
|
|
274
|
+
job.localPath
|
|
275
|
+
], false).map(function (entry) { return String(entry || '').trim(); }).filter(Boolean)));
|
|
276
|
+
var candidates = [];
|
|
277
|
+
try {
|
|
278
|
+
for (var values_1 = __values(values), values_1_1 = values_1.next(); !values_1_1.done; values_1_1 = values_1.next()) {
|
|
279
|
+
var value = values_1_1.value;
|
|
280
|
+
var text = String(value || '');
|
|
281
|
+
try {
|
|
282
|
+
for (var _m = (e_4 = void 0, __values(text.matchAll(/((?:\/tmp\/|\/var\/|\/Users\/)[^\s)'"]+?\.(?:png|jpe?g|webp|zip|json|txt|log))/gi))), _o = _m.next(); !_o.done; _o = _m.next()) {
|
|
283
|
+
var match = _o.value;
|
|
284
|
+
candidates.push(match[1]);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
288
|
+
finally {
|
|
289
|
+
try {
|
|
290
|
+
if (_o && !_o.done && (_c = _m.return)) _c.call(_m);
|
|
291
|
+
}
|
|
292
|
+
finally { if (e_4) throw e_4.error; }
|
|
293
|
+
}
|
|
294
|
+
try {
|
|
295
|
+
for (var _p = (e_5 = void 0, __values(text.matchAll(/(?:^|[\s("'`])((?:(?:[\w.-]+\/)*qa-artifacts|qa-artifacts|test-results|playwright-report|\.build-output)\/[^\s)'"]+?\.(?:png|jpe?g|webp|zip|json|txt|log))/gim))), _q = _p.next(); !_q.done; _q = _p.next()) {
|
|
296
|
+
var match = _q.value;
|
|
297
|
+
candidates.push(match[1]);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
301
|
+
finally {
|
|
302
|
+
try {
|
|
303
|
+
if (_q && !_q.done && (_d = _p.return)) _d.call(_p);
|
|
304
|
+
}
|
|
305
|
+
finally { if (e_5) throw e_5.error; }
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
310
|
+
finally {
|
|
311
|
+
try {
|
|
312
|
+
if (values_1_1 && !values_1_1.done && (_b = values_1.return)) _b.call(values_1);
|
|
313
|
+
}
|
|
314
|
+
finally { if (e_3) throw e_3.error; }
|
|
315
|
+
}
|
|
316
|
+
var resolved = [];
|
|
317
|
+
var seen = new Set();
|
|
318
|
+
try {
|
|
319
|
+
for (var candidates_1 = __values(candidates), candidates_1_1 = candidates_1.next(); !candidates_1_1.done; candidates_1_1 = candidates_1.next()) {
|
|
320
|
+
var candidate = candidates_1_1.value;
|
|
321
|
+
var filePath = resolveArtifactCandidate(candidate, roots);
|
|
322
|
+
if (!filePath || seen.has(filePath)) {
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
325
|
+
seen.add(filePath);
|
|
326
|
+
resolved.push(filePath);
|
|
327
|
+
if (resolved.length >= (input.maxFiles || 8)) {
|
|
328
|
+
break;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
333
|
+
finally {
|
|
334
|
+
try {
|
|
335
|
+
if (candidates_1_1 && !candidates_1_1.done && (_e = candidates_1.return)) _e.call(candidates_1);
|
|
336
|
+
}
|
|
337
|
+
finally { if (e_6) throw e_6.error; }
|
|
338
|
+
}
|
|
339
|
+
return resolved;
|
|
340
|
+
}
|
|
341
|
+
function toResolveIORunnerEvidenceAttachments(input) {
|
|
342
|
+
if (input === void 0) { input = {}; }
|
|
343
|
+
return collectResolveIORunnerEvidenceArtifactPaths(input).map(function (filePath) {
|
|
344
|
+
var filename = path.basename(filePath);
|
|
345
|
+
return {
|
|
346
|
+
filename: filename,
|
|
347
|
+
path: filePath,
|
|
348
|
+
contentType: inferResolveIORunnerEvidenceContentType(filename),
|
|
349
|
+
cid: buildResolveIORunnerEvidenceCid(filePath)
|
|
350
|
+
};
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
function persistResolveIORunnerEvidenceArtifacts(options) {
|
|
354
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
355
|
+
var maxFiles, previousFiles, existingByHash, previousFiles_1, previousFiles_1_1, file, attachments, persistedFiles, fileIds, errors, nextAttachments, seenPaths, attachments_1, attachments_1_1, attachment, filePath, filename, contentType, error, stat, error, contentBuffer, contentHash, existing, uploaded, fileId, persisted, error_1, message, e_7_1;
|
|
356
|
+
var e_8, _a, e_7, _b;
|
|
357
|
+
return __generator(this, function (_c) {
|
|
358
|
+
switch (_c.label) {
|
|
359
|
+
case 0:
|
|
360
|
+
maxFiles = Math.max(1, options.maxFiles || 8);
|
|
361
|
+
previousFiles = normalizeResolveIORunnerPersistedEvidenceFiles(options.previousFiles);
|
|
362
|
+
existingByHash = new Map();
|
|
363
|
+
try {
|
|
364
|
+
for (previousFiles_1 = __values(previousFiles), previousFiles_1_1 = previousFiles_1.next(); !previousFiles_1_1.done; previousFiles_1_1 = previousFiles_1.next()) {
|
|
365
|
+
file = previousFiles_1_1.value;
|
|
366
|
+
if (file.content_hash) {
|
|
367
|
+
existingByHash.set(file.content_hash, file);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
372
|
+
finally {
|
|
373
|
+
try {
|
|
374
|
+
if (previousFiles_1_1 && !previousFiles_1_1.done && (_a = previousFiles_1.return)) _a.call(previousFiles_1);
|
|
375
|
+
}
|
|
376
|
+
finally { if (e_8) throw e_8.error; }
|
|
377
|
+
}
|
|
378
|
+
attachments = __spreadArray(__spreadArray([], __read((options.attachments || [])), false), __read(toResolveIORunnerEvidenceAttachments({
|
|
379
|
+
evidence: options.evidence,
|
|
380
|
+
job: options.job,
|
|
381
|
+
roots: options.roots,
|
|
382
|
+
maxFiles: maxFiles
|
|
383
|
+
})), false);
|
|
384
|
+
persistedFiles = __spreadArray([], __read(previousFiles), false);
|
|
385
|
+
fileIds = mergeResolveIORunnerEvidenceFileIds(options.existingFileIds, previousFiles.map(function (file) { return file.file_id; }));
|
|
386
|
+
errors = [];
|
|
387
|
+
nextAttachments = [];
|
|
388
|
+
seenPaths = new Set();
|
|
389
|
+
_c.label = 1;
|
|
390
|
+
case 1:
|
|
391
|
+
_c.trys.push([1, 10, 11, 12]);
|
|
392
|
+
attachments_1 = __values(attachments), attachments_1_1 = attachments_1.next();
|
|
393
|
+
_c.label = 2;
|
|
394
|
+
case 2:
|
|
395
|
+
if (!!attachments_1_1.done) return [3 /*break*/, 9];
|
|
396
|
+
attachment = attachments_1_1.value;
|
|
397
|
+
if (nextAttachments.length >= maxFiles) {
|
|
398
|
+
return [3 /*break*/, 9];
|
|
399
|
+
}
|
|
400
|
+
filePath = String((attachment === null || attachment === void 0 ? void 0 : attachment.path) || '').trim();
|
|
401
|
+
if (!filePath || seenPaths.has(filePath)) {
|
|
402
|
+
return [3 /*break*/, 8];
|
|
403
|
+
}
|
|
404
|
+
seenPaths.add(filePath);
|
|
405
|
+
filename = String((attachment === null || attachment === void 0 ? void 0 : attachment.filename) || path.basename(filePath) || 'runner-qa-artifact.png').trim();
|
|
406
|
+
contentType = String((attachment === null || attachment === void 0 ? void 0 : attachment.contentType) || inferResolveIORunnerEvidenceContentType(filename)).trim();
|
|
407
|
+
if (!pathExists(filePath)) {
|
|
408
|
+
error = "".concat(filename, ": evidence file was not found before S3 upload.");
|
|
409
|
+
errors.push(error);
|
|
410
|
+
nextAttachments.push(__assign(__assign({}, attachment), { filename: filename, upload_error: error }));
|
|
411
|
+
return [3 /*break*/, 8];
|
|
412
|
+
}
|
|
413
|
+
return [4 /*yield*/, fs.promises.stat(filePath)];
|
|
414
|
+
case 3:
|
|
415
|
+
stat = _c.sent();
|
|
416
|
+
if (!stat.isFile() || stat.size <= 0) {
|
|
417
|
+
error = "".concat(filename, ": evidence file was empty before S3 upload.");
|
|
418
|
+
errors.push(error);
|
|
419
|
+
nextAttachments.push(__assign(__assign({}, attachment), { filename: filename, upload_error: error }));
|
|
420
|
+
return [3 /*break*/, 8];
|
|
421
|
+
}
|
|
422
|
+
return [4 /*yield*/, fs.promises.readFile(filePath)];
|
|
423
|
+
case 4:
|
|
424
|
+
contentBuffer = _c.sent();
|
|
425
|
+
contentHash = (0, node_crypto_1.createHash)('sha1').update(new Uint8Array(contentBuffer)).digest('hex');
|
|
426
|
+
existing = existingByHash.get(contentHash);
|
|
427
|
+
if (existing) {
|
|
428
|
+
fileIds.push(existing.file_id);
|
|
429
|
+
nextAttachments.push(__assign(__assign({}, attachment), { filename: filename, file_id: existing.file_id, key: existing.key, content_hash: contentHash, ticket_url: options.ticketUrl || existing.ticket_url, uploaded_to_support_ticket: true }));
|
|
430
|
+
return [3 /*break*/, 8];
|
|
431
|
+
}
|
|
432
|
+
_c.label = 5;
|
|
433
|
+
case 5:
|
|
434
|
+
_c.trys.push([5, 7, , 8]);
|
|
435
|
+
return [4 /*yield*/, options.uploadFile({
|
|
436
|
+
filename: filename,
|
|
437
|
+
filePath: filePath,
|
|
438
|
+
contentType: contentType,
|
|
439
|
+
size: stat.size,
|
|
440
|
+
contentBuffer: contentBuffer,
|
|
441
|
+
contentHash: contentHash
|
|
442
|
+
})];
|
|
443
|
+
case 6:
|
|
444
|
+
uploaded = _c.sent();
|
|
445
|
+
fileId = String((uploaded === null || uploaded === void 0 ? void 0 : uploaded.file_id) || (uploaded === null || uploaded === void 0 ? void 0 : uploaded.id_file) || (uploaded === null || uploaded === void 0 ? void 0 : uploaded._id) || '').trim();
|
|
446
|
+
if (!fileId) {
|
|
447
|
+
throw new Error('artifact upload returned no file id');
|
|
448
|
+
}
|
|
449
|
+
persisted = {
|
|
450
|
+
file_id: fileId,
|
|
451
|
+
filename: String((uploaded === null || uploaded === void 0 ? void 0 : uploaded.filename) || (uploaded === null || uploaded === void 0 ? void 0 : uploaded.name) || filename).trim() || filename,
|
|
452
|
+
key: String((uploaded === null || uploaded === void 0 ? void 0 : uploaded.key) || '').trim() || undefined,
|
|
453
|
+
contentType: contentType,
|
|
454
|
+
content_hash: contentHash,
|
|
455
|
+
ticket_url: String(options.ticketUrl || '').trim() || undefined
|
|
456
|
+
};
|
|
457
|
+
persistedFiles.push(persisted);
|
|
458
|
+
existingByHash.set(contentHash, persisted);
|
|
459
|
+
fileIds.push(fileId);
|
|
460
|
+
nextAttachments.push(__assign(__assign({}, attachment), { filename: filename, file_id: fileId, key: persisted.key, content_hash: contentHash, ticket_url: persisted.ticket_url, uploaded_to_support_ticket: true }));
|
|
461
|
+
return [3 /*break*/, 8];
|
|
462
|
+
case 7:
|
|
463
|
+
error_1 = _c.sent();
|
|
464
|
+
message = "".concat(filename, ": ").concat((error_1 === null || error_1 === void 0 ? void 0 : error_1.message) || error_1);
|
|
465
|
+
errors.push(message);
|
|
466
|
+
nextAttachments.push(__assign(__assign({}, attachment), { filename: filename, content_hash: contentHash, upload_error: message }));
|
|
467
|
+
return [3 /*break*/, 8];
|
|
468
|
+
case 8:
|
|
469
|
+
attachments_1_1 = attachments_1.next();
|
|
470
|
+
return [3 /*break*/, 2];
|
|
471
|
+
case 9: return [3 /*break*/, 12];
|
|
472
|
+
case 10:
|
|
473
|
+
e_7_1 = _c.sent();
|
|
474
|
+
e_7 = { error: e_7_1 };
|
|
475
|
+
return [3 /*break*/, 12];
|
|
476
|
+
case 11:
|
|
477
|
+
try {
|
|
478
|
+
if (attachments_1_1 && !attachments_1_1.done && (_b = attachments_1.return)) _b.call(attachments_1);
|
|
479
|
+
}
|
|
480
|
+
finally { if (e_7) throw e_7.error; }
|
|
481
|
+
return [7 /*endfinally*/];
|
|
482
|
+
case 12: return [2 /*return*/, {
|
|
483
|
+
attachments: nextAttachments,
|
|
484
|
+
fileIds: mergeResolveIORunnerEvidenceFileIds(fileIds),
|
|
485
|
+
files: persistedFiles,
|
|
486
|
+
errors: errors
|
|
487
|
+
}];
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
//# sourceMappingURL=ai-runner-artifacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/util/ai-runner-artifacts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,0FAqBC;AAED,0EASC;AAED,wGAoBC;AAED,kFAiBC;AAwDD,kGA8DC;AAED,oFAeC;AAED,0FAiHC;AAnYD,2CAAyC;AACzC,uBAAyB;AACzB,2BA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C;wBACrD,KAAK,EAAE,cAAc;wBACrB,MAAM,QAAA;qBACN,EAAC;;;;CACF","file":"ai-runner-artifacts.js","sourcesContent":["import { createHash } from 'node:crypto';\nimport * as fs from 'fs';\nimport * as path from 'path';\n\nexport interface ResolveIORunnerEvidenceAttachment {\n\tfilename: string;\n\tpath: string;\n\tcontentType?: string;\n\tcid?: string;\n\tfile_id?: string;\n\tkey?: string;\n\tcontent_hash?: string;\n\tticket_url?: string;\n\tuploaded_to_support_ticket?: boolean;\n\tupload_error?: string;\n}\n\nexport interface ResolveIORunnerPersistedEvidenceFile {\n\tfile_id: string;\n\tfilename: string;\n\tkey?: string;\n\tcontentType?: string;\n\tcontent_hash?: string;\n\tticket_url?: string;\n}\n\nexport interface ResolveIORunnerEvidenceUploadInput {\n\tfilename: string;\n\tfilePath: string;\n\tcontentType: string;\n\tsize: number;\n\tcontentBuffer: Buffer;\n\tcontentHash: string;\n}\n\nexport interface ResolveIORunnerEvidenceUploadResult {\n\tfile_id?: string;\n\tid_file?: string;\n\t_id?: string;\n\tkey?: string;\n\tname?: string;\n\tfilename?: string;\n}\n\nexport interface ResolveIORunnerPersistEvidenceOptions {\n\tattachments?: ResolveIORunnerEvidenceAttachment[];\n\tevidence?: any;\n\tjob?: any;\n\tticket?: any;\n\tticketUrl?: string;\n\troots?: string[];\n\tpreviousFiles?: any[];\n\texistingFileIds?: any[];\n\tmaxFiles?: number;\n\tuploadFile: any;\n}\n\nexport interface ResolveIORunnerPersistEvidenceResult {\n\tattachments: ResolveIORunnerEvidenceAttachment[];\n\tfileIds: string[];\n\tfiles: ResolveIORunnerPersistedEvidenceFile[];\n\terrors: string[];\n}\n\nexport function inferResolveIORunnerEvidenceContentType(fileName: string): string {\n\tconst normalized = String(fileName || '').trim().toLowerCase();\n\tif (normalized.endsWith('.png')) {\n\t\treturn 'image/png';\n\t}\n\tif (normalized.endsWith('.jpg') || normalized.endsWith('.jpeg')) {\n\t\treturn 'image/jpeg';\n\t}\n\tif (normalized.endsWith('.webp')) {\n\t\treturn 'image/webp';\n\t}\n\tif (normalized.endsWith('.zip')) {\n\t\treturn 'application/zip';\n\t}\n\tif (normalized.endsWith('.json')) {\n\t\treturn 'application/json';\n\t}\n\tif (normalized.endsWith('.txt') || normalized.endsWith('.log')) {\n\t\treturn 'text/plain; charset=utf-8';\n\t}\n\treturn 'application/octet-stream';\n}\n\nexport function buildResolveIORunnerEvidenceCid(filePath: string): string {\n\tconst baseName = path.basename(String(filePath || '').trim()) || 'runner-artifact';\n\tconst normalized = baseName\n\t\t.toLowerCase()\n\t\t.replace(/[^a-z0-9._-]+/g, '-')\n\t\t.replace(/^-+|-+$/g, '')\n\t\t.slice(0, 80) || 'runner-artifact';\n\tconst digest = createHash('sha1').update(String(filePath || '')).digest('hex').slice(0, 12);\n\treturn `${normalized}-${digest}@resolveio-runner`;\n}\n\nexport function normalizeResolveIORunnerPersistedEvidenceFiles(value: any): ResolveIORunnerPersistedEvidenceFile[] {\n\tif (!Array.isArray(value)) {\n\t\treturn [];\n\t}\n\treturn value\n\t\t.map((item): ResolveIORunnerPersistedEvidenceFile | null => {\n\t\t\tconst fileId = String(item?.file_id || item?.id_file || item?._id || '').trim();\n\t\t\tif (!fileId) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tfile_id: fileId,\n\t\t\t\tfilename: String(item?.filename || item?.name || '').trim(),\n\t\t\t\tkey: String(item?.key || '').trim() || undefined,\n\t\t\t\tcontentType: String(item?.contentType || item?.content_type || '').trim() || undefined,\n\t\t\t\tcontent_hash: String(item?.content_hash || item?.hash || '').trim() || undefined,\n\t\t\t\tticket_url: String(item?.ticket_url || '').trim() || undefined\n\t\t\t};\n\t\t})\n\t\t.filter((item): item is ResolveIORunnerPersistedEvidenceFile => !!item);\n}\n\nexport function mergeResolveIORunnerEvidenceFileIds(...values: any[]): string[] {\n\tconst ids: string[] = [];\n\tconst seen = new Set<string>();\n\tconst push = (value: any) => {\n\t\tif (Array.isArray(value)) {\n\t\t\tvalue.forEach(push);\n\t\t\treturn;\n\t\t}\n\t\tconst id = String(value?.file_id || value?.id_file || value?._id || value || '').trim();\n\t\tif (!id || seen.has(id)) {\n\t\t\treturn;\n\t\t}\n\t\tseen.add(id);\n\t\tids.push(id);\n\t};\n\tvalues.forEach(push);\n\treturn ids;\n}\n\nfunction collectResolveIORunnerEvidenceText(value: any, output: string[]): void {\n\tif (value === null || value === undefined) {\n\t\treturn;\n\t}\n\tif (typeof value === 'string') {\n\t\toutput.push(value);\n\t\treturn;\n\t}\n\tif (Array.isArray(value)) {\n\t\tvalue.forEach((entry) => collectResolveIORunnerEvidenceText(entry, output));\n\t\treturn;\n\t}\n\tif (typeof value === 'object') {\n\t\tObject.values(value).forEach((entry) => collectResolveIORunnerEvidenceText(entry, output));\n\t}\n}\n\nfunction normalizeArtifactCandidatePath(value: string): string {\n\treturn String(value || '')\n\t\t.trim()\n\t\t.replace(/[),.;:'\"]+$/g, '')\n\t\t.replace(/\\\\/g, '/');\n}\n\nfunction pathExists(filePath: string): boolean {\n\ttry {\n\t\treturn !!filePath && fs.existsSync(filePath) && fs.statSync(filePath).isFile();\n\t}\n\tcatch {\n\t\treturn false;\n\t}\n}\n\nfunction resolveArtifactCandidate(candidate: string, roots: string[]): string {\n\tconst normalized = normalizeArtifactCandidatePath(candidate);\n\tif (!normalized) {\n\t\treturn '';\n\t}\n\tif (path.isAbsolute(normalized)) {\n\t\treturn pathExists(normalized) ? normalized : '';\n\t}\n\tfor (const root of roots) {\n\t\tconst normalizedRoot = String(root || '').trim();\n\t\tif (!normalizedRoot) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst resolved = path.resolve(normalizedRoot, normalized);\n\t\tif (pathExists(resolved)) {\n\t\t\treturn resolved;\n\t\t}\n\t}\n\treturn '';\n}\n\nexport function collectResolveIORunnerEvidenceArtifactPaths(input: {\n\tevidence?: any;\n\tjob?: any;\n\troots?: string[];\n\tmaxFiles?: number;\n} = {}): string[] {\n\tconst values: string[] = [];\n\tcollectResolveIORunnerEvidenceText(input.evidence, values);\n\tconst job = input.job || {};\n\tcollectResolveIORunnerEvidenceText(job.responseSummary, values);\n\tcollectResolveIORunnerEvidenceText(job.lastVerificationSummary, values);\n\tcollectResolveIORunnerEvidenceText(job.lastRerunReason, values);\n\tcollectResolveIORunnerEvidenceText(job.artifacts?.agentNotes, values);\n\tcollectResolveIORunnerEvidenceText(job.artifacts?.supportArtifacts, values);\n\tcollectResolveIORunnerEvidenceText(job.artifacts?.qaArtifacts, values);\n\tcollectResolveIORunnerEvidenceText(job.artifacts?.qa_artifacts, values);\n\tcollectResolveIORunnerEvidenceText(job.qa_artifacts, values);\n\tcollectResolveIORunnerEvidenceText(job.supportQaArtifacts, values);\n\tcollectResolveIORunnerEvidenceText(job.runnerEvidenceArtifacts, values);\n\tif (Array.isArray(job.tasks)) {\n\t\tfor (const task of job.tasks) {\n\t\t\tcollectResolveIORunnerEvidenceText(task?.title, values);\n\t\t\tcollectResolveIORunnerEvidenceText(task?.notes, values);\n\t\t\tcollectResolveIORunnerEvidenceText(task?.artifacts, values);\n\t\t\tcollectResolveIORunnerEvidenceText(task?.evidence, values);\n\t\t}\n\t}\n\tif (Array.isArray(job.log)) {\n\t\tcollectResolveIORunnerEvidenceText(job.log.slice(-160), values);\n\t}\n\n\tconst roots = Array.from(new Set([\n\t\t...(input.roots || []),\n\t\tjob.workspacePath,\n\t\tjob.projectRoot && job.workspacePath ? path.join(job.workspacePath, job.projectRoot) : '',\n\t\tjob.projectDisplayPath && job.workspacePath ? path.join(job.workspacePath, job.projectDisplayPath) : '',\n\t\tjob.localPath\n\t].map((entry) => String(entry || '').trim()).filter(Boolean)));\n\tconst candidates: string[] = [];\n\tfor (const value of values) {\n\t\tconst text = String(value || '');\n\t\tfor (const match of text.matchAll(/((?:\\/tmp\\/|\\/var\\/|\\/Users\\/)[^\\s)'\"]+?\\.(?:png|jpe?g|webp|zip|json|txt|log))/gi)) {\n\t\t\tcandidates.push(match[1]);\n\t\t}\n\t\tfor (const match of text.matchAll(/(?:^|[\\s(\"'`])((?:(?:[\\w.-]+\\/)*qa-artifacts|qa-artifacts|test-results|playwright-report|\\.build-output)\\/[^\\s)'\"]+?\\.(?:png|jpe?g|webp|zip|json|txt|log))/gim)) {\n\t\t\tcandidates.push(match[1]);\n\t\t}\n\t}\n\tconst resolved: string[] = [];\n\tconst seen = new Set<string>();\n\tfor (const candidate of candidates) {\n\t\tconst filePath = resolveArtifactCandidate(candidate, roots);\n\t\tif (!filePath || seen.has(filePath)) {\n\t\t\tcontinue;\n\t\t}\n\t\tseen.add(filePath);\n\t\tresolved.push(filePath);\n\t\tif (resolved.length >= (input.maxFiles || 8)) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn resolved;\n}\n\nexport function toResolveIORunnerEvidenceAttachments(input: {\n\tevidence?: any;\n\tjob?: any;\n\troots?: string[];\n\tmaxFiles?: number;\n} = {}): ResolveIORunnerEvidenceAttachment[] {\n\treturn collectResolveIORunnerEvidenceArtifactPaths(input).map((filePath) => {\n\t\tconst filename = path.basename(filePath);\n\t\treturn {\n\t\t\tfilename,\n\t\t\tpath: filePath,\n\t\t\tcontentType: inferResolveIORunnerEvidenceContentType(filename),\n\t\t\tcid: buildResolveIORunnerEvidenceCid(filePath)\n\t\t};\n\t});\n}\n\nexport async function persistResolveIORunnerEvidenceArtifacts(\n\toptions: ResolveIORunnerPersistEvidenceOptions\n): Promise<ResolveIORunnerPersistEvidenceResult> {\n\tconst maxFiles = Math.max(1, options.maxFiles || 8);\n\tconst previousFiles = normalizeResolveIORunnerPersistedEvidenceFiles(options.previousFiles);\n\tconst existingByHash = new Map<string, ResolveIORunnerPersistedEvidenceFile>();\n\tfor (const file of previousFiles) {\n\t\tif (file.content_hash) {\n\t\t\texistingByHash.set(file.content_hash, file);\n\t\t}\n\t}\n\tconst attachments = [\n\t\t...(options.attachments || []),\n\t\t...toResolveIORunnerEvidenceAttachments({\n\t\t\tevidence: options.evidence,\n\t\t\tjob: options.job,\n\t\t\troots: options.roots,\n\t\t\tmaxFiles\n\t\t})\n\t];\n\tconst persistedFiles = [...previousFiles];\n\tconst fileIds = mergeResolveIORunnerEvidenceFileIds(options.existingFileIds, previousFiles.map((file) => file.file_id));\n\tconst errors: string[] = [];\n\tconst nextAttachments: ResolveIORunnerEvidenceAttachment[] = [];\n\tconst seenPaths = new Set<string>();\n\n\tfor (const attachment of attachments) {\n\t\tif (nextAttachments.length >= maxFiles) {\n\t\t\tbreak;\n\t\t}\n\t\tconst filePath = String(attachment?.path || '').trim();\n\t\tif (!filePath || seenPaths.has(filePath)) {\n\t\t\tcontinue;\n\t\t}\n\t\tseenPaths.add(filePath);\n\t\tconst filename = String(attachment?.filename || path.basename(filePath) || 'runner-qa-artifact.png').trim();\n\t\tconst contentType = String(attachment?.contentType || inferResolveIORunnerEvidenceContentType(filename)).trim();\n\t\tif (!pathExists(filePath)) {\n\t\t\tconst error = `${filename}: evidence file was not found before S3 upload.`;\n\t\t\terrors.push(error);\n\t\t\tnextAttachments.push({ ...attachment, filename, upload_error: error });\n\t\t\tcontinue;\n\t\t}\n\t\tconst stat = await fs.promises.stat(filePath);\n\t\tif (!stat.isFile() || stat.size <= 0) {\n\t\t\tconst error = `${filename}: evidence file was empty before S3 upload.`;\n\t\t\terrors.push(error);\n\t\t\tnextAttachments.push({ ...attachment, filename, upload_error: error });\n\t\t\tcontinue;\n\t\t}\n\t\tconst contentBuffer = await fs.promises.readFile(filePath);\n\t\tconst contentHash = createHash('sha1').update(new Uint8Array(contentBuffer)).digest('hex');\n\t\tconst existing = existingByHash.get(contentHash);\n\t\tif (existing) {\n\t\t\tfileIds.push(existing.file_id);\n\t\t\tnextAttachments.push({\n\t\t\t\t...attachment,\n\t\t\t\tfilename,\n\t\t\t\tfile_id: existing.file_id,\n\t\t\t\tkey: existing.key,\n\t\t\t\tcontent_hash: contentHash,\n\t\t\t\tticket_url: options.ticketUrl || existing.ticket_url,\n\t\t\t\tuploaded_to_support_ticket: true\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\ttry {\n\t\t\tconst uploaded = await options.uploadFile({\n\t\t\t\tfilename,\n\t\t\t\tfilePath,\n\t\t\t\tcontentType,\n\t\t\t\tsize: stat.size,\n\t\t\t\tcontentBuffer,\n\t\t\t\tcontentHash\n\t\t\t});\n\t\t\tconst fileId = String(uploaded?.file_id || uploaded?.id_file || uploaded?._id || '').trim();\n\t\t\tif (!fileId) {\n\t\t\t\tthrow new Error('artifact upload returned no file id');\n\t\t\t}\n\t\t\tconst persisted: ResolveIORunnerPersistedEvidenceFile = {\n\t\t\t\tfile_id: fileId,\n\t\t\t\tfilename: String(uploaded?.filename || uploaded?.name || filename).trim() || filename,\n\t\t\t\tkey: String(uploaded?.key || '').trim() || undefined,\n\t\t\t\tcontentType,\n\t\t\t\tcontent_hash: contentHash,\n\t\t\t\tticket_url: String(options.ticketUrl || '').trim() || undefined\n\t\t\t};\n\t\t\tpersistedFiles.push(persisted);\n\t\t\texistingByHash.set(contentHash, persisted);\n\t\t\tfileIds.push(fileId);\n\t\t\tnextAttachments.push({\n\t\t\t\t...attachment,\n\t\t\t\tfilename,\n\t\t\t\tfile_id: fileId,\n\t\t\t\tkey: persisted.key,\n\t\t\t\tcontent_hash: contentHash,\n\t\t\t\tticket_url: persisted.ticket_url,\n\t\t\t\tuploaded_to_support_ticket: true\n\t\t\t});\n\t\t}\n\t\tcatch (error) {\n\t\t\tconst message = `${filename}: ${(error as Error)?.message || error}`;\n\t\t\terrors.push(message);\n\t\t\tnextAttachments.push({ ...attachment, filename, content_hash: contentHash, upload_error: message });\n\t\t}\n\t}\n\n\treturn {\n\t\tattachments: nextAttachments,\n\t\tfileIds: mergeResolveIORunnerEvidenceFileIds(fileIds),\n\t\tfiles: persistedFiles,\n\t\terrors\n\t};\n}\n"]}
|
package/util/common.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { LookupTables } from '../models/report-builder.model';
|
|
2
|
+
export declare function objectIdHexString(): string;
|
|
3
|
+
export declare function buildRbSchema(rbSchema: any): any;
|
|
4
|
+
export declare function buildRbLookups(rbLookups: LookupTables[], defaultSchema: object, default_checked_array?: string[]): object;
|
|
5
|
+
export declare function throwErr(err: any, lkp: any, lookupNode: any, newPropertyName?: string): void;
|
|
6
|
+
export declare function roundPrecision(value: number, precision?: number): number;
|
|
7
|
+
export declare function round(value: any, precision?: number): number;
|
|
8
|
+
export declare function floorPrecision(value: number, precision?: number): number;
|
|
9
|
+
export declare function deepCopy(value: any): any;
|
|
10
|
+
export declare function dateReviver(key: any, value: any): any;
|
|
11
|
+
export declare function getAllowedOrigins(serverConfig: any): string[];
|
|
12
|
+
export declare function isAllowedOrigin(origin: string, serverConfig: any): boolean;
|
|
13
|
+
export declare function getMongoUpdates(currDoc: any, modifiedDoc: any, incVersion: any): any;
|
|
14
|
+
export declare function getMongoMergeUpdatedDoc(f_doc: any, currentDoc: any, oldDoc: any): any;
|
|
15
|
+
export declare function mergeUpdates(...updatesToMerge: any[]): {
|
|
16
|
+
$set: {};
|
|
17
|
+
$unset: {};
|
|
18
|
+
$inc: {};
|
|
19
|
+
$push: {};
|
|
20
|
+
$pull: {};
|
|
21
|
+
};
|
|
22
|
+
export declare function getDeepDiff(doc1: any, doc2: any): any;
|
|
23
|
+
export declare function applyMongoUpdate(uDoc: any, delta: any): any;
|
|
24
|
+
export declare function deepDiffDetails(object1: Object, object2: Object): string;
|
|
25
|
+
export declare function getBinarySize(string: any): number;
|
|
26
|
+
export declare function pad(num: any, size: any): string;
|
|
27
|
+
export declare function randomString(length: any, chars: any): string;
|
|
28
|
+
export declare function toTitleCase(str: any): any;
|
|
29
|
+
export declare function isObject(item: any): boolean;
|
|
30
|
+
export declare function mergeDeep(target: any, ...sources: any[]): any;
|
|
31
|
+
export declare function generateSearchTokensFromFields(doc: any, fields: string[]): string[];
|