@resolveio/server-lib 22.3.220 → 22.3.221
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/.nodemon.json +5 -0
- package/.vscode/settings.json +21 -0
- package/AGENTS.md +195 -0
- package/README.md +22 -0
- package/build_package.sh +5 -0
- package/compileDTS.pl +64 -0
- package/docs/ai-assistant-nightly-eval.md +65 -0
- package/docs/ai-assistant-preflight-checklist.md +23 -0
- package/docs/ai-assistant-report-builder-bridge-playbook.md +115 -0
- package/eslint-plugin-custom/index.js +7 -0
- package/eslint-plugin-custom/rules/no-filter-zero-index.js +44 -0
- package/eslint.config.js +103 -0
- package/gulpfile.js +216 -0
- package/methodAndPublicationListGenerator.py +375 -0
- package/mongodbensurers.js +2 -0
- package/mongostop.js +3 -0
- package/package.json +1 -1
- package/scripts/cleanup-bypassed-callmethod-logs.js +616 -0
- package/settings.development.json +25 -0
- package/settings.development.redacted.json +25 -0
- package/src/.env +12 -0
- package/src/ai/assistant-core-heuristics.ts +379 -0
- package/src/ai/resolveio-platform-intelligence-memory-corpus.ts +185 -0
- package/src/ai/resolveio-platform-intelligence-memory.ts +325 -0
- package/{ai/resolveio-platform-intelligence-types.d.ts → src/ai/resolveio-platform-intelligence-types.ts} +20 -15
- package/src/ai/resolveio-platform-intelligence.ts +462 -0
- package/src/client-server-app.ts +12 -0
- package/src/collections/ai-run.collection.ts +117 -0
- package/src/collections/ai-terminal-conversation.collection.ts +91 -0
- package/src/collections/ai-terminal-issue-report.collection.ts +99 -0
- package/src/collections/ai-terminal-message.collection.ts +77 -0
- package/src/collections/app-setting.collection.ts +104 -0
- package/src/collections/app-status.collection.ts +58 -0
- package/src/collections/communication-metric.collection.ts +84 -0
- package/src/collections/counter.collection.ts +56 -0
- package/src/collections/cron-job-history.collection.ts +94 -0
- package/src/collections/cron-job.collection.ts +92 -0
- package/src/collections/customer-notification.collection.ts +131 -0
- package/src/collections/customer-portal-password.collection.ts +76 -0
- package/src/collections/email-history.collection.ts +134 -0
- package/src/collections/email-verified.collection.ts +62 -0
- package/src/collections/file.collection.ts +74 -0
- package/src/collections/flag-update.collection.ts +57 -0
- package/src/collections/flag.collection.ts +57 -0
- package/src/collections/log-method-latency.collection.ts +77 -0
- package/src/collections/log-subscription.collection.ts +80 -0
- package/src/collections/log.collection.ts +93 -0
- package/src/collections/logged-in-users.collection.ts +67 -0
- package/src/collections/monitor-cpu.collection.ts +65 -0
- package/src/collections/monitor-function.collection.ts +74 -0
- package/src/collections/monitor-memory.collection.ts +77 -0
- package/src/collections/monitor-mongo.collection.ts +71 -0
- package/src/collections/notification.collection.ts +57 -0
- package/src/collections/openai-usage-ledger.collection.ts +131 -0
- package/src/collections/report-builder-dashboard-builder.collection.ts +109 -0
- package/src/collections/report-builder-library.collection.ts +89 -0
- package/src/collections/report-builder-report.collection.ts +184 -0
- package/src/collections/user-group.collection.ts +89 -0
- package/src/collections/user-guide.collection.ts +57 -0
- package/src/collections/user.collection.ts +181 -0
- package/src/cron/cron.ts +117 -0
- package/src/fixtures/cron-jobs.ts +95 -0
- package/src/fixtures/init.ts +35 -0
- package/src/http/auth.ts +818 -0
- package/src/http/health.ts +7 -0
- package/src/http/home.ts +90 -0
- package/src/http/slow-query-publication.ts +49 -0
- package/src/index.ts +1 -0
- package/src/managers/ai-assistant-codex-manager.manager.ts +1131 -0
- package/src/managers/ai-run-evidence.manager.ts +264 -0
- package/src/managers/communication-metric.manager.ts +82 -0
- package/src/managers/cron.manager.ts +333 -0
- package/src/managers/customer-notification-content.manager.ts +236 -0
- package/src/managers/diagnostic-manager-bootstrap.ts +165 -0
- package/src/managers/error-auto-fix.manager.ts +2767 -0
- package/src/managers/local-log.manager.ts +113 -0
- package/src/managers/method.manager.ts +1857 -0
- package/src/managers/mongo.manager.ts +4575 -0
- package/src/managers/monitor.manager.ts +507 -0
- package/src/managers/openai-usage-ledger.manager.ts +112 -0
- package/src/managers/slow-query-verifier.manager.ts +3590 -0
- package/src/managers/slow-query.manager.ts +519 -0
- package/src/managers/subscription.manager.ts +3128 -0
- package/src/managers/websocket.manager.ts +746 -0
- package/src/managers/worker-dispatcher.manager.ts +1360 -0
- package/src/managers/worker-server.manager.ts +536 -0
- package/src/methods/accounts.ts +532 -0
- package/src/methods/ai-terminal.ts +29070 -0
- package/src/methods/app-settings.ts +114 -0
- package/src/methods/aws.ts +649 -0
- package/src/methods/collections.ts +641 -0
- package/src/methods/counters.ts +69 -0
- package/src/methods/cron-jobs.ts +2614 -0
- package/src/methods/customer-notifications.ts +458 -0
- package/src/methods/diagnostics.ts +616 -0
- package/src/methods/flag-updates.ts +7 -0
- package/src/methods/flags.ts +7 -0
- package/src/methods/logs.ts +657 -0
- package/src/methods/mongo-explorer.ts +1880 -0
- package/src/methods/monitor.ts +540 -0
- package/src/methods/pdf.ts +1236 -0
- package/src/methods/publications.ts +129 -0
- package/src/methods/report-builder.ts +3300 -0
- package/src/methods/support.ts +335 -0
- package/src/models/ai-run.model.ts +27 -0
- package/src/models/ai-terminal-conversation.model.ts +19 -0
- package/src/models/ai-terminal-issue-report.model.ts +21 -0
- package/src/models/ai-terminal-message.model.ts +24 -0
- package/src/models/app-setting.model.ts +17 -0
- package/{models/app-status.model.d.ts → src/models/app-status.model.ts} +3 -2
- package/{models/billing-logged-in-users.model.d.ts → src/models/billing-logged-in-users.model.ts} +5 -4
- package/src/models/collection-document.model.ts +24 -0
- package/src/models/communication-metric.model.ts +23 -0
- package/{models/counter.model.d.ts → src/models/counter.model.ts} +4 -3
- package/src/models/cron-job-history.model.ts +16 -0
- package/src/models/cron-job.model.ts +15 -0
- package/src/models/customer-notification.model.ts +28 -0
- package/src/models/customer-portal-password.model.ts +12 -0
- package/src/models/dialog.model.ts +25 -0
- package/{models/email-history.model.js → src/models/email-history.model.ts} +36 -4
- package/{models/email-verified.model.d.ts → src/models/email-verified.model.ts} +6 -5
- package/{models/file.model.d.ts → src/models/file.model.ts} +8 -7
- package/{models/flag-update.model.d.ts → src/models/flag-update.model.ts} +4 -3
- package/{models/flag.model.d.ts → src/models/flag.model.ts} +4 -3
- package/src/models/log-method-latency.model.ts +11 -0
- package/{models/log-subscription.model.d.ts → src/models/log-subscription.model.ts} +11 -9
- package/src/models/log.model.ts +19 -0
- package/{models/logged-in-users.model.d.ts → src/models/logged-in-users.model.ts} +6 -5
- package/{models/method-response.model.d.ts → src/models/method-response.model.ts} +7 -6
- package/src/models/method.model.ts +25 -0
- package/{models/monitor-cpu.model.d.ts → src/models/monitor-cpu.model.ts} +9 -7
- package/src/models/monitor-function.model.ts +16 -0
- package/src/models/monitor-memory.model.ts +17 -0
- package/src/models/monitor-mongo.model.ts +15 -0
- package/{models/notification.model.d.ts → src/models/notification.model.ts} +6 -4
- package/src/models/openai-usage-ledger.model.ts +56 -0
- package/src/models/pagination.model.ts +35 -0
- package/src/models/permission.model.ts +14 -0
- package/src/models/report-builder-dashboard-builder.model.ts +29 -0
- package/src/models/report-builder-library.model.ts +20 -0
- package/src/models/report-builder-report.model.ts +136 -0
- package/src/models/report-builder.model.ts +68 -0
- package/src/models/select-data-label.model.ts +9 -0
- package/src/models/server-message.model.ts +31 -0
- package/src/models/slow-query-report.model.ts +23 -0
- package/src/models/subscription.model.ts +73 -0
- package/src/models/support-ticket.model.ts +104 -0
- package/src/models/user-group.model.ts +24 -0
- package/{models/user-guide.model.d.ts → src/models/user-guide.model.ts} +5 -4
- package/src/models/user.model.ts +96 -0
- package/src/private/images/ResolveIO.png +0 -0
- package/src/publications/ai-terminal.ts +73 -0
- package/src/publications/app-settings.ts +25 -0
- package/src/publications/app-status.ts +13 -0
- package/src/publications/cron-jobs.ts +40 -0
- package/src/publications/customer-notifications.ts +101 -0
- package/src/publications/files.ts +33 -0
- package/src/publications/flags-update.ts +19 -0
- package/src/publications/flags.ts +19 -0
- package/src/publications/logs.ts +163 -0
- package/src/publications/notifications.ts +13 -0
- package/src/publications/report-builder-dashboard-builders.ts +39 -0
- package/src/publications/report-builder-libraries.ts +41 -0
- package/src/publications/report-builder-reports.ts +47 -0
- package/src/publications/super-admin.ts +13 -0
- package/src/publications/user-groups.ts +12 -0
- package/src/publications/user-guides.ts +12 -0
- package/src/resolveio-server-app.ts +617 -0
- package/src/server-app.ts +3354 -0
- package/src/services/codex-client.ts +1231 -0
- package/src/services/openai-client.ts +265 -0
- package/src/types/error-report.ts +26 -0
- package/src/types/js-tiktoken.d.ts +11 -0
- package/src/types/slow-query-report.ts +28 -0
- package/src/util/ai-qa-policy.ts +925 -0
- package/src/util/ai-run-evidence-adapters.ts +8347 -0
- package/src/util/ai-run-evidence-dashboard.ts +323 -0
- package/src/util/ai-run-evidence-eval.ts +1057 -0
- package/src/util/ai-run-evidence.ts +1430 -0
- package/src/util/ai-runner-artifacts.ts +586 -0
- package/src/util/ai-runner-manager-autopilot.ts +961 -0
- package/src/util/ai-runner-manager-policy.ts +5011 -0
- package/src/util/ai-runner-qa-auth.ts +838 -0
- package/src/util/ai-runner-qa-tools.ts +3536 -0
- package/src/util/aicoder-runner-v6.ts +3121 -0
- package/src/util/common.ts +649 -0
- package/src/util/customer-portal-password.ts +183 -0
- package/src/util/error-reporter.ts +332 -0
- package/src/util/error-tracking.ts +79 -0
- package/src/util/openai-usage-cost.ts +114 -0
- package/src/util/report-builder-unwinds.ts +180 -0
- package/src/util/runner-process-janitor.ts +219 -0
- package/src/util/schema-report-builder.ts +448 -0
- package/src/util/slow-query-reporter.ts +216 -0
- package/src/util/subscription-dependency-context.ts +1096 -0
- package/src/util/support-runner-v5.ts +10040 -0
- package/src/util/tokenizer.ts +38 -0
- package/src/workers/codex-runner.worker.ts +142 -0
- package/start_server.sh +5 -0
- package/tests/ai-assistant-corpus-build.ts +484 -0
- package/tests/ai-assistant-corpus-replay-e2e.ts +774 -0
- package/tests/ai-assistant-data-parity-e2e.ts +1989 -0
- package/tests/ai-assistant-eval-triage.ts +831 -0
- package/tests/ai-assistant-openai-e2e.ts +1061 -0
- package/tests/ai-assistant-openai-git-e2e.ts +155 -0
- package/tests/ai-assistant-preflight-matrix.ts +215 -0
- package/tests/ai-assistant-routing-eval.test.ts +585 -0
- package/tests/ai-assistant-snf-live-eval.ts +975 -0
- package/tests/ai-assistant-utils.test.ts +4834 -0
- package/tests/ai-manager-autopilot-snapshot.test.ts +193 -0
- package/tests/ai-manager-recovery-checkpoint.test.ts +1383 -0
- package/tests/ai-run-eval.test.ts +132 -0
- package/tests/ai-run-evidence.test.ts +3773 -0
- package/tests/ai-runner-contract.test.ts +515 -0
- package/tests/aicoder-runner-v6.test.ts +822 -0
- package/tests/error-reporter.test.ts +145 -0
- package/tests/method-publication-generator.test.ts +46 -0
- package/tests/report-builder-linking.test.ts +79 -0
- package/tests/resolveio-platform-intelligence.test.ts +352 -0
- package/tests/server-app-cron-owner.test.ts +127 -0
- package/tests/subscription-connect-race.test.ts +158 -0
- package/tests/subscription-dependency-context.test.ts +324 -0
- package/tests/subscription-manager-collection-tracking.test.ts +86 -0
- package/tests/subscription-manager-invalidation.test.ts +86 -0
- package/tests/support-runner-v5.test.ts +3201 -0
- package/tsconfig.json +34 -0
- package/ai/assistant-core-heuristics.d.ts +0 -11
- package/ai/assistant-core-heuristics.js +0 -356
- package/ai/assistant-core-heuristics.js.map +0 -1
- package/ai/resolveio-platform-intelligence-memory-corpus.d.ts +0 -3
- package/ai/resolveio-platform-intelligence-memory-corpus.js +0 -214
- package/ai/resolveio-platform-intelligence-memory-corpus.js.map +0 -1
- package/ai/resolveio-platform-intelligence-memory.d.ts +0 -20
- package/ai/resolveio-platform-intelligence-memory.js +0 -341
- package/ai/resolveio-platform-intelligence-memory.js.map +0 -1
- package/ai/resolveio-platform-intelligence-types.js +0 -4
- package/ai/resolveio-platform-intelligence-types.js.map +0 -1
- package/ai/resolveio-platform-intelligence.d.ts +0 -6
- package/ai/resolveio-platform-intelligence.js +0 -463
- package/ai/resolveio-platform-intelligence.js.map +0 -1
- package/client-server-app.d.ts +0 -1
- package/client-server-app.js +0 -68
- package/client-server-app.js.map +0 -1
- package/collections/ai-run.collection.d.ts +0 -3
- package/collections/ai-run.collection.js +0 -170
- package/collections/ai-run.collection.js.map +0 -1
- package/collections/ai-terminal-conversation.collection.d.ts +0 -2
- package/collections/ai-terminal-conversation.collection.js +0 -140
- package/collections/ai-terminal-conversation.collection.js.map +0 -1
- package/collections/ai-terminal-issue-report.collection.d.ts +0 -2
- package/collections/ai-terminal-issue-report.collection.js +0 -148
- package/collections/ai-terminal-issue-report.collection.js.map +0 -1
- package/collections/ai-terminal-message.collection.d.ts +0 -2
- package/collections/ai-terminal-message.collection.js +0 -121
- package/collections/ai-terminal-message.collection.js.map +0 -1
- package/collections/app-setting.collection.d.ts +0 -3
- package/collections/app-setting.collection.js +0 -103
- package/collections/app-setting.collection.js.map +0 -1
- package/collections/app-status.collection.d.ts +0 -3
- package/collections/app-status.collection.js +0 -57
- package/collections/app-status.collection.js.map +0 -1
- package/collections/communication-metric.collection.d.ts +0 -2
- package/collections/communication-metric.collection.js +0 -133
- package/collections/communication-metric.collection.js.map +0 -1
- package/collections/counter.collection.d.ts +0 -3
- package/collections/counter.collection.js +0 -56
- package/collections/counter.collection.js.map +0 -1
- package/collections/cron-job-history.collection.d.ts +0 -3
- package/collections/cron-job-history.collection.js +0 -137
- package/collections/cron-job-history.collection.js.map +0 -1
- package/collections/cron-job.collection.d.ts +0 -3
- package/collections/cron-job.collection.js +0 -92
- package/collections/cron-job.collection.js.map +0 -1
- package/collections/customer-notification.collection.d.ts +0 -3
- package/collections/customer-notification.collection.js +0 -130
- package/collections/customer-notification.collection.js.map +0 -1
- package/collections/customer-portal-password.collection.d.ts +0 -3
- package/collections/customer-portal-password.collection.js +0 -75
- package/collections/customer-portal-password.collection.js.map +0 -1
- package/collections/email-history.collection.d.ts +0 -3
- package/collections/email-history.collection.js +0 -134
- package/collections/email-history.collection.js.map +0 -1
- package/collections/email-verified.collection.d.ts +0 -3
- package/collections/email-verified.collection.js +0 -62
- package/collections/email-verified.collection.js.map +0 -1
- package/collections/file.collection.d.ts +0 -3
- package/collections/file.collection.js +0 -74
- package/collections/file.collection.js.map +0 -1
- package/collections/flag-update.collection.d.ts +0 -3
- package/collections/flag-update.collection.js +0 -57
- package/collections/flag-update.collection.js.map +0 -1
- package/collections/flag.collection.d.ts +0 -3
- package/collections/flag.collection.js +0 -57
- package/collections/flag.collection.js.map +0 -1
- package/collections/log-method-latency.collection.d.ts +0 -3
- package/collections/log-method-latency.collection.js +0 -77
- package/collections/log-method-latency.collection.js.map +0 -1
- package/collections/log-subscription.collection.d.ts +0 -3
- package/collections/log-subscription.collection.js +0 -80
- package/collections/log-subscription.collection.js.map +0 -1
- package/collections/log.collection.d.ts +0 -3
- package/collections/log.collection.js +0 -93
- package/collections/log.collection.js.map +0 -1
- package/collections/logged-in-users.collection.d.ts +0 -3
- package/collections/logged-in-users.collection.js +0 -67
- package/collections/logged-in-users.collection.js.map +0 -1
- package/collections/monitor-cpu.collection.d.ts +0 -3
- package/collections/monitor-cpu.collection.js +0 -65
- package/collections/monitor-cpu.collection.js.map +0 -1
- package/collections/monitor-function.collection.d.ts +0 -3
- package/collections/monitor-function.collection.js +0 -74
- package/collections/monitor-function.collection.js.map +0 -1
- package/collections/monitor-memory.collection.d.ts +0 -3
- package/collections/monitor-memory.collection.js +0 -77
- package/collections/monitor-memory.collection.js.map +0 -1
- package/collections/monitor-mongo.collection.d.ts +0 -3
- package/collections/monitor-mongo.collection.js +0 -71
- package/collections/monitor-mongo.collection.js.map +0 -1
- package/collections/notification.collection.d.ts +0 -3
- package/collections/notification.collection.js +0 -57
- package/collections/notification.collection.js.map +0 -1
- package/collections/openai-usage-ledger.collection.d.ts +0 -2
- package/collections/openai-usage-ledger.collection.js +0 -188
- package/collections/openai-usage-ledger.collection.js.map +0 -1
- package/collections/report-builder-dashboard-builder.collection.d.ts +0 -3
- package/collections/report-builder-dashboard-builder.collection.js +0 -109
- package/collections/report-builder-dashboard-builder.collection.js.map +0 -1
- package/collections/report-builder-library.collection.d.ts +0 -3
- package/collections/report-builder-library.collection.js +0 -87
- package/collections/report-builder-library.collection.js.map +0 -1
- package/collections/report-builder-report.collection.d.ts +0 -4
- package/collections/report-builder-report.collection.js +0 -184
- package/collections/report-builder-report.collection.js.map +0 -1
- package/collections/user-group.collection.d.ts +0 -4
- package/collections/user-group.collection.js +0 -89
- package/collections/user-group.collection.js.map +0 -1
- package/collections/user-guide.collection.d.ts +0 -3
- package/collections/user-guide.collection.js +0 -57
- package/collections/user-guide.collection.js.map +0 -1
- package/collections/user.collection.d.ts +0 -4
- package/collections/user.collection.js +0 -180
- package/collections/user.collection.js.map +0 -1
- package/cron/cron.d.ts +0 -14
- package/cron/cron.js +0 -216
- package/cron/cron.js.map +0 -1
- package/fixtures/cron-jobs.d.ts +0 -1
- package/fixtures/cron-jobs.js +0 -150
- package/fixtures/cron-jobs.js.map +0 -1
- package/fixtures/init.d.ts +0 -1
- package/fixtures/init.js +0 -91
- package/fixtures/init.js.map +0 -1
- package/http/auth.d.ts +0 -2
- package/http/auth.js +0 -951
- package/http/auth.js.map +0 -1
- package/http/health.d.ts +0 -1
- package/http/health.js +0 -11
- package/http/health.js.map +0 -1
- package/http/home.d.ts +0 -1
- package/http/home.js +0 -134
- package/http/home.js.map +0 -1
- package/http/slow-query-publication.d.ts +0 -2
- package/http/slow-query-publication.js +0 -99
- package/http/slow-query-publication.js.map +0 -1
- package/index.d.ts +0 -1
- package/index.js +0 -19
- package/index.js.map +0 -1
- package/managers/ai-assistant-codex-manager.manager.d.ts +0 -67
- package/managers/ai-assistant-codex-manager.manager.js +0 -1113
- package/managers/ai-assistant-codex-manager.manager.js.map +0 -1
- package/managers/ai-run-evidence.manager.d.ts +0 -36
- package/managers/ai-run-evidence.manager.js +0 -377
- package/managers/ai-run-evidence.manager.js.map +0 -1
- package/managers/communication-metric.manager.d.ts +0 -16
- package/managers/communication-metric.manager.js +0 -134
- package/managers/communication-metric.manager.js.map +0 -1
- package/managers/cron.manager.d.ts +0 -20
- package/managers/cron.manager.js +0 -534
- package/managers/cron.manager.js.map +0 -1
- package/managers/customer-notification-content.manager.d.ts +0 -55
- package/managers/customer-notification-content.manager.js +0 -158
- package/managers/customer-notification-content.manager.js.map +0 -1
- package/managers/diagnostic-manager-bootstrap.d.ts +0 -9
- package/managers/diagnostic-manager-bootstrap.js +0 -260
- package/managers/diagnostic-manager-bootstrap.js.map +0 -1
- package/managers/error-auto-fix.manager.d.ts +0 -149
- package/managers/error-auto-fix.manager.js +0 -3064
- package/managers/error-auto-fix.manager.js.map +0 -1
- package/managers/local-log.manager.d.ts +0 -18
- package/managers/local-log.manager.js +0 -88
- package/managers/local-log.manager.js.map +0 -1
- package/managers/method.manager.d.ts +0 -84
- package/managers/method.manager.js +0 -1964
- package/managers/method.manager.js.map +0 -1
- package/managers/mongo.manager.d.ts +0 -224
- package/managers/mongo.manager.js +0 -5000
- package/managers/mongo.manager.js.map +0 -1
- package/managers/monitor.manager.d.ts +0 -70
- package/managers/monitor.manager.js +0 -550
- package/managers/monitor.manager.js.map +0 -1
- package/managers/openai-usage-ledger.manager.d.ts +0 -30
- package/managers/openai-usage-ledger.manager.js +0 -142
- package/managers/openai-usage-ledger.manager.js.map +0 -1
- package/managers/slow-query-verifier.manager.d.ts +0 -144
- package/managers/slow-query-verifier.manager.js +0 -3857
- package/managers/slow-query-verifier.manager.js.map +0 -1
- package/managers/slow-query.manager.d.ts +0 -28
- package/managers/slow-query.manager.js +0 -468
- package/managers/slow-query.manager.js.map +0 -1
- package/managers/subscription.manager.d.ts +0 -169
- package/managers/subscription.manager.js +0 -3434
- package/managers/subscription.manager.js.map +0 -1
- package/managers/websocket.manager.d.ts +0 -73
- package/managers/websocket.manager.js +0 -673
- package/managers/websocket.manager.js.map +0 -1
- package/managers/worker-dispatcher.manager.d.ts +0 -120
- package/managers/worker-dispatcher.manager.js +0 -1266
- package/managers/worker-dispatcher.manager.js.map +0 -1
- package/managers/worker-server.manager.d.ts +0 -35
- package/managers/worker-server.manager.js +0 -582
- package/managers/worker-server.manager.js.map +0 -1
- package/methods/accounts.d.ts +0 -2
- package/methods/accounts.js +0 -624
- package/methods/accounts.js.map +0 -1
- package/methods/ai-terminal.d.ts +0 -458
- package/methods/ai-terminal.js +0 -27991
- package/methods/ai-terminal.js.map +0 -1
- package/methods/app-settings.d.ts +0 -2
- package/methods/app-settings.js +0 -169
- package/methods/app-settings.js.map +0 -1
- package/methods/aws.d.ts +0 -2
- package/methods/aws.js +0 -877
- package/methods/aws.js.map +0 -1
- package/methods/collections.d.ts +0 -2
- package/methods/collections.js +0 -719
- package/methods/collections.js.map +0 -1
- package/methods/counters.d.ts +0 -2
- package/methods/counters.js +0 -113
- package/methods/counters.js.map +0 -1
- package/methods/cron-jobs.d.ts +0 -2
- package/methods/cron-jobs.js +0 -2475
- package/methods/cron-jobs.js.map +0 -1
- package/methods/customer-notifications.d.ts +0 -2
- package/methods/customer-notifications.js +0 -528
- package/methods/customer-notifications.js.map +0 -1
- package/methods/diagnostics.d.ts +0 -2
- package/methods/diagnostics.js +0 -703
- package/methods/diagnostics.js.map +0 -1
- package/methods/flag-updates.d.ts +0 -2
- package/methods/flag-updates.js +0 -8
- package/methods/flag-updates.js.map +0 -1
- package/methods/flags.d.ts +0 -2
- package/methods/flags.js +0 -8
- package/methods/flags.js.map +0 -1
- package/methods/logs.d.ts +0 -2
- package/methods/logs.js +0 -751
- package/methods/logs.js.map +0 -1
- package/methods/mongo-explorer.d.ts +0 -2
- package/methods/mongo-explorer.js +0 -1808
- package/methods/mongo-explorer.js.map +0 -1
- package/methods/monitor.d.ts +0 -2
- package/methods/monitor.js +0 -543
- package/methods/monitor.js.map +0 -1
- package/methods/pdf.d.ts +0 -2
- package/methods/pdf.js +0 -1216
- package/methods/pdf.js.map +0 -1
- package/methods/publications.d.ts +0 -1
- package/methods/publications.js +0 -183
- package/methods/publications.js.map +0 -1
- package/methods/report-builder.d.ts +0 -2
- package/methods/report-builder.js +0 -3094
- package/methods/report-builder.js.map +0 -1
- package/methods/support.d.ts +0 -2
- package/methods/support.js +0 -430
- package/methods/support.js.map +0 -1
- package/models/ai-run.model.d.ts +0 -19
- package/models/ai-run.model.js +0 -4
- package/models/ai-run.model.js.map +0 -1
- package/models/ai-terminal-conversation.model.d.ts +0 -17
- package/models/ai-terminal-conversation.model.js +0 -4
- package/models/ai-terminal-conversation.model.js.map +0 -1
- package/models/ai-terminal-issue-report.model.d.ts +0 -19
- package/models/ai-terminal-issue-report.model.js +0 -4
- package/models/ai-terminal-issue-report.model.js.map +0 -1
- package/models/ai-terminal-message.model.d.ts +0 -22
- package/models/ai-terminal-message.model.js +0 -4
- package/models/ai-terminal-message.model.js.map +0 -1
- package/models/app-setting.model.d.ts +0 -16
- package/models/app-setting.model.js +0 -4
- package/models/app-setting.model.js.map +0 -1
- package/models/app-status.model.js +0 -4
- package/models/app-status.model.js.map +0 -1
- package/models/billing-logged-in-users.model.js +0 -4
- package/models/billing-logged-in-users.model.js.map +0 -1
- package/models/collection-document.model.d.ts +0 -21
- package/models/collection-document.model.js +0 -4
- package/models/collection-document.model.js.map +0 -1
- package/models/communication-metric.model.d.ts +0 -20
- package/models/communication-metric.model.js +0 -4
- package/models/communication-metric.model.js.map +0 -1
- package/models/counter.model.js +0 -4
- package/models/counter.model.js.map +0 -1
- package/models/cron-job-history.model.d.ts +0 -15
- package/models/cron-job-history.model.js +0 -4
- package/models/cron-job-history.model.js.map +0 -1
- package/models/cron-job.model.d.ts +0 -14
- package/models/cron-job.model.js +0 -4
- package/models/cron-job.model.js.map +0 -1
- package/models/customer-notification.model.d.ts +0 -26
- package/models/customer-notification.model.js +0 -4
- package/models/customer-notification.model.js.map +0 -1
- package/models/customer-portal-password.model.d.ts +0 -11
- package/models/customer-portal-password.model.js +0 -4
- package/models/customer-portal-password.model.js.map +0 -1
- package/models/dialog.model.d.ts +0 -23
- package/models/dialog.model.js +0 -4
- package/models/dialog.model.js.map +0 -1
- package/models/email-history.model.d.ts +0 -32
- package/models/email-history.model.js.map +0 -1
- package/models/email-verified.model.js +0 -4
- package/models/email-verified.model.js.map +0 -1
- package/models/file.model.js +0 -4
- package/models/file.model.js.map +0 -1
- package/models/flag-update.model.js +0 -4
- package/models/flag-update.model.js.map +0 -1
- package/models/flag.model.js +0 -4
- package/models/flag.model.js.map +0 -1
- package/models/log-method-latency.model.d.ts +0 -10
- package/models/log-method-latency.model.js +0 -4
- package/models/log-method-latency.model.js.map +0 -1
- package/models/log-subscription.model.js +0 -4
- package/models/log-subscription.model.js.map +0 -1
- package/models/log.model.d.ts +0 -17
- package/models/log.model.js +0 -4
- package/models/log.model.js.map +0 -1
- package/models/logged-in-users.model.js +0 -4
- package/models/logged-in-users.model.js.map +0 -1
- package/models/method-response.model.js +0 -4
- package/models/method-response.model.js.map +0 -1
- package/models/method.model.d.ts +0 -26
- package/models/method.model.js +0 -4
- package/models/method.model.js.map +0 -1
- package/models/monitor-cpu.model.js +0 -4
- package/models/monitor-cpu.model.js.map +0 -1
- package/models/monitor-function.model.d.ts +0 -14
- package/models/monitor-function.model.js +0 -4
- package/models/monitor-function.model.js.map +0 -1
- package/models/monitor-memory.model.d.ts +0 -15
- package/models/monitor-memory.model.js +0 -4
- package/models/monitor-memory.model.js.map +0 -1
- package/models/monitor-mongo.model.d.ts +0 -13
- package/models/monitor-mongo.model.js +0 -4
- package/models/monitor-mongo.model.js.map +0 -1
- package/models/notification.model.js +0 -4
- package/models/notification.model.js.map +0 -1
- package/models/openai-usage-ledger.model.d.ts +0 -30
- package/models/openai-usage-ledger.model.js +0 -4
- package/models/openai-usage-ledger.model.js.map +0 -1
- package/models/pagination.model.d.ts +0 -11
- package/models/pagination.model.js +0 -28
- package/models/pagination.model.js.map +0 -1
- package/models/permission.model.d.ts +0 -12
- package/models/permission.model.js +0 -4
- package/models/permission.model.js.map +0 -1
- package/models/report-builder-dashboard-builder.model.d.ts +0 -25
- package/models/report-builder-dashboard-builder.model.js +0 -4
- package/models/report-builder-dashboard-builder.model.js.map +0 -1
- package/models/report-builder-library.model.d.ts +0 -17
- package/models/report-builder-library.model.js +0 -4
- package/models/report-builder-library.model.js.map +0 -1
- package/models/report-builder-report.model.d.ts +0 -121
- package/models/report-builder-report.model.js +0 -4
- package/models/report-builder-report.model.js.map +0 -1
- package/models/report-builder.model.d.ts +0 -61
- package/models/report-builder.model.js +0 -4
- package/models/report-builder.model.js.map +0 -1
- package/models/select-data-label.model.d.ts +0 -9
- package/models/select-data-label.model.js +0 -4
- package/models/select-data-label.model.js.map +0 -1
- package/models/server-message.model.d.ts +0 -32
- package/models/server-message.model.js +0 -4
- package/models/server-message.model.js.map +0 -1
- package/models/slow-query-report.model.d.ts +0 -23
- package/models/slow-query-report.model.js +0 -4
- package/models/slow-query-report.model.js.map +0 -1
- package/models/subscription.model.d.ts +0 -31
- package/models/subscription.model.js +0 -4
- package/models/subscription.model.js.map +0 -1
- package/models/support-ticket.model.d.ts +0 -87
- package/models/support-ticket.model.js +0 -4
- package/models/support-ticket.model.js.map +0 -1
- package/models/user-group.model.d.ts +0 -20
- package/models/user-group.model.js +0 -4
- package/models/user-group.model.js.map +0 -1
- package/models/user-guide.model.js +0 -4
- package/models/user-guide.model.js.map +0 -1
- package/models/user.model.d.ts +0 -84
- package/models/user.model.js +0 -4
- package/models/user.model.js.map +0 -1
- package/private/images/ResolveIO.png +0 -0
- package/public_api.js +0 -127
- package/public_api.js.map +0 -1
- package/publications/ai-terminal.d.ts +0 -1
- package/publications/ai-terminal.js +0 -122
- package/publications/ai-terminal.js.map +0 -1
- package/publications/app-settings.d.ts +0 -2
- package/publications/app-settings.js +0 -28
- package/publications/app-settings.js.map +0 -1
- package/publications/app-status.d.ts +0 -2
- package/publications/app-status.js +0 -16
- package/publications/app-status.js.map +0 -1
- package/publications/cron-jobs.d.ts +0 -2
- package/publications/cron-jobs.js +0 -88
- package/publications/cron-jobs.js.map +0 -1
- package/publications/customer-notifications.d.ts +0 -2
- package/publications/customer-notifications.js +0 -161
- package/publications/customer-notifications.js.map +0 -1
- package/publications/files.d.ts +0 -2
- package/publications/files.js +0 -36
- package/publications/files.js.map +0 -1
- package/publications/flags-update.d.ts +0 -2
- package/publications/flags-update.js +0 -22
- package/publications/flags-update.js.map +0 -1
- package/publications/flags.d.ts +0 -2
- package/publications/flags.js +0 -22
- package/publications/flags.js.map +0 -1
- package/publications/logs.d.ts +0 -2
- package/publications/logs.js +0 -164
- package/publications/logs.js.map +0 -1
- package/publications/notifications.d.ts +0 -2
- package/publications/notifications.js +0 -16
- package/publications/notifications.js.map +0 -1
- package/publications/report-builder-dashboard-builders.d.ts +0 -2
- package/publications/report-builder-dashboard-builders.js +0 -42
- package/publications/report-builder-dashboard-builders.js.map +0 -1
- package/publications/report-builder-libraries.d.ts +0 -2
- package/publications/report-builder-libraries.js +0 -90
- package/publications/report-builder-libraries.js.map +0 -1
- package/publications/report-builder-reports.d.ts +0 -2
- package/publications/report-builder-reports.js +0 -50
- package/publications/report-builder-reports.js.map +0 -1
- package/publications/super-admin.d.ts +0 -2
- package/publications/super-admin.js +0 -16
- package/publications/super-admin.js.map +0 -1
- package/publications/user-groups.d.ts +0 -1
- package/publications/user-groups.js +0 -16
- package/publications/user-groups.js.map +0 -1
- package/publications/user-guides.d.ts +0 -1
- package/publications/user-guides.js +0 -16
- package/publications/user-guides.js.map +0 -1
- package/resolveio-server-app.d.ts +0 -70
- package/resolveio-server-app.js +0 -801
- package/resolveio-server-app.js.map +0 -1
- package/server-app.d.ts +0 -228
- package/server-app.js +0 -3566
- package/server-app.js.map +0 -1
- package/services/codex-client.d.ts +0 -128
- package/services/codex-client.js +0 -1629
- package/services/codex-client.js.map +0 -1
- package/services/openai-client.d.ts +0 -46
- package/services/openai-client.js +0 -318
- package/services/openai-client.js.map +0 -1
- package/types/error-report.d.ts +0 -25
- package/types/error-report.js +0 -4
- package/types/error-report.js.map +0 -1
- package/types/slow-query-report.d.ts +0 -27
- package/types/slow-query-report.js +0 -6
- package/types/slow-query-report.js.map +0 -1
- package/util/ai-qa-policy.d.ts +0 -124
- package/util/ai-qa-policy.js +0 -736
- package/util/ai-qa-policy.js.map +0 -1
- package/util/ai-run-evidence-adapters.d.ts +0 -109
- package/util/ai-run-evidence-adapters.js +0 -7234
- package/util/ai-run-evidence-adapters.js.map +0 -1
- package/util/ai-run-evidence-dashboard.d.ts +0 -88
- package/util/ai-run-evidence-dashboard.js +0 -343
- package/util/ai-run-evidence-dashboard.js.map +0 -1
- package/util/ai-run-evidence-eval.d.ts +0 -86
- package/util/ai-run-evidence-eval.js +0 -1018
- package/util/ai-run-evidence-eval.js.map +0 -1
- package/util/ai-run-evidence.d.ts +0 -244
- package/util/ai-run-evidence.js +0 -1096
- package/util/ai-run-evidence.js.map +0 -1
- package/util/ai-runner-artifacts.d.ts +0 -82
- package/util/ai-runner-artifacts.js +0 -713
- package/util/ai-runner-artifacts.js.map +0 -1
- package/util/ai-runner-manager-autopilot.d.ts +0 -210
- package/util/ai-runner-manager-autopilot.js +0 -642
- package/util/ai-runner-manager-autopilot.js.map +0 -1
- package/util/ai-runner-manager-policy.d.ts +0 -807
- package/util/ai-runner-manager-policy.js +0 -3501
- package/util/ai-runner-manager-policy.js.map +0 -1
- package/util/ai-runner-qa-auth.d.ts +0 -5
- package/util/ai-runner-qa-auth.js +0 -839
- package/util/ai-runner-qa-auth.js.map +0 -1
- package/util/ai-runner-qa-tools.d.ts +0 -26
- package/util/ai-runner-qa-tools.js +0 -3520
- package/util/ai-runner-qa-tools.js.map +0 -1
- package/util/aicoder-runner-v6.d.ts +0 -426
- package/util/aicoder-runner-v6.js +0 -2464
- package/util/aicoder-runner-v6.js.map +0 -1
- package/util/common.d.ts +0 -31
- package/util/common.js +0 -683
- package/util/common.js.map +0 -1
- package/util/customer-portal-password.d.ts +0 -13
- package/util/customer-portal-password.js +0 -209
- package/util/customer-portal-password.js.map +0 -1
- package/util/error-reporter.d.ts +0 -52
- package/util/error-reporter.js +0 -326
- package/util/error-reporter.js.map +0 -1
- package/util/error-tracking.d.ts +0 -13
- package/util/error-tracking.js +0 -120
- package/util/error-tracking.js.map +0 -1
- package/util/openai-usage-cost.d.ts +0 -6
- package/util/openai-usage-cost.js +0 -103
- package/util/openai-usage-cost.js.map +0 -1
- package/util/report-builder-unwinds.d.ts +0 -15
- package/util/report-builder-unwinds.js +0 -156
- package/util/report-builder-unwinds.js.map +0 -1
- package/util/runner-process-janitor.d.ts +0 -27
- package/util/runner-process-janitor.js +0 -208
- package/util/runner-process-janitor.js.map +0 -1
- package/util/schema-report-builder.d.ts +0 -6
- package/util/schema-report-builder.js +0 -481
- package/util/schema-report-builder.js.map +0 -1
- package/util/slow-query-reporter.d.ts +0 -28
- package/util/slow-query-reporter.js +0 -226
- package/util/slow-query-reporter.js.map +0 -1
- package/util/subscription-dependency-context.d.ts +0 -34
- package/util/subscription-dependency-context.js +0 -1283
- package/util/subscription-dependency-context.js.map +0 -1
- package/util/support-runner-v5.d.ts +0 -1426
- package/util/support-runner-v5.js +0 -7631
- package/util/support-runner-v5.js.map +0 -1
- package/util/tokenizer.d.ts +0 -5
- package/util/tokenizer.js +0 -41
- package/util/tokenizer.js.map +0 -1
- package/workers/codex-runner.worker.d.ts +0 -1
- package/workers/codex-runner.worker.js +0 -192
- package/workers/codex-runner.worker.js.map +0 -1
- /package/{private → src/private}/email-templates/enrollment.html +0 -0
- /package/{private → src/private}/email-templates/forgot-password.html +0 -0
- /package/{private → src/private}/email-templates/support-ticket-deleted.html +0 -0
- /package/{private → src/private}/email-templates/support-ticket-modified.html +0 -0
- /package/{private → src/private}/email-templates/support-ticket.html +0 -0
- /package/{public_api.d.ts → src/public_api.ts} +0 -0
|
@@ -0,0 +1,838 @@
|
|
|
1
|
+
export interface ResolveIORunnerQaAuthBootstrapScriptOptions {
|
|
2
|
+
defaultUsername?: string;
|
|
3
|
+
defaultPassword?: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export function buildResolveIORunnerQaAuthBootstrapScript(options: ResolveIORunnerQaAuthBootstrapScriptOptions = {}): string {
|
|
7
|
+
const defaultUsername = options.defaultUsername || 'admin';
|
|
8
|
+
const defaultPassword = options.defaultPassword || '';
|
|
9
|
+
return [
|
|
10
|
+
'#!/usr/bin/env node',
|
|
11
|
+
"'use strict';",
|
|
12
|
+
'',
|
|
13
|
+
'const fs = require("fs");',
|
|
14
|
+
'const crypto = require("crypto");',
|
|
15
|
+
'const http = require("http");',
|
|
16
|
+
'const https = require("https");',
|
|
17
|
+
'const path = require("path");',
|
|
18
|
+
'',
|
|
19
|
+
'if (isBuildLane()) {',
|
|
20
|
+
' console.error("ResolveIO support lane guard: auth bootstrap is owned by the QA lane, not the 5.3 build lane.");',
|
|
21
|
+
' process.exit(86);',
|
|
22
|
+
'}',
|
|
23
|
+
'',
|
|
24
|
+
'const projectRoot = path.resolve(process.argv[2] || process.cwd());',
|
|
25
|
+
'const routeArg = process.argv[3] || process.env.RESOLVEIO_RUNNER_QA_TARGET_ROUTE || process.env.RESOLVEIO_SUPPORT_QA_TARGET_ROUTE || process.env.RESOLVEIO_SUPPORT_QA_LAST_URL || "/";',
|
|
26
|
+
'const targetRoute = normalizeTargetRouteInput(routeArg);',
|
|
27
|
+
'const clientUrl = stripTrailingSlash(process.env.RESOLVEIO_RUNNER_QA_CLIENT_URL || process.env.RESOLVEIO_SUPPORT_QA_CLIENT_URL || `http://localhost:${process.env.RESOLVEIO_SUPPORT_QA_CLIENT_PORT || "4200"}`);',
|
|
28
|
+
'const artifactDir = path.resolve(process.env.RESOLVEIO_RUNNER_QA_ARTIFACT_DIR || process.env.RESOLVEIO_SUPPORT_QA_ARTIFACT_DIR || path.join(projectRoot, "qa-artifacts"));',
|
|
29
|
+
'const serverUrl = stripTrailingSlash(process.env.RESOLVEIO_RUNNER_QA_SERVER_URL || process.env.RESOLVEIO_SUPPORT_QA_SERVER_URL || "http://localhost:8080");',
|
|
30
|
+
'const explicitQaUsername = process.env.RESOLVEIO_RUNNER_QA_AFFECTED_USER_EMAIL || process.env.RESOLVEIO_SUPPORT_QA_AFFECTED_USER_EMAIL || process.env.RESOLVEIO_RUNNER_QA_TICKET_REPORTER_EMAIL || process.env.RESOLVEIO_SUPPORT_QA_TICKET_REPORTER_EMAIL || "";',
|
|
31
|
+
'const envQaUsername = process.env.RESOLVEIO_RUNNER_QA_USERNAME || process.env.RESOLVEIO_SUPPORT_QA_USERNAME || "";',
|
|
32
|
+
'const seededQaUsername = readSeededPreferredQaUsername();',
|
|
33
|
+
`const username = explicitQaUsername || seededQaUsername || envQaUsername || ${JSON.stringify(defaultUsername)};`,
|
|
34
|
+
`const password = process.env.RESOLVEIO_RUNNER_QA_PASSWORD || process.env.RESOLVEIO_SUPPORT_QA_PASSWORD || ${JSON.stringify(defaultPassword)};`,
|
|
35
|
+
'const viewportWidth = Number(process.env.RESOLVEIO_RUNNER_QA_VIEWPORT_WIDTH || process.env.RESOLVEIO_SUPPORT_QA_VIEWPORT_WIDTH || 1920);',
|
|
36
|
+
'const viewportHeight = Number(process.env.RESOLVEIO_RUNNER_QA_VIEWPORT_HEIGHT || process.env.RESOLVEIO_SUPPORT_QA_VIEWPORT_HEIGHT || 1080);',
|
|
37
|
+
'const startupTimeoutMs = Math.max(1000, Number(process.env.RESOLVEIO_RUNNER_QA_ANGULAR_STARTUP_TIMEOUT_SECONDS || process.env.RESOLVEIO_SUPPORT_QA_ANGULAR_STARTUP_TIMEOUT_SECONDS || 900) * 1000);',
|
|
38
|
+
'const resultPath = path.join(artifactDir, "auth-bootstrap-result.json");',
|
|
39
|
+
'const storageStatePath = path.join(artifactDir, "auth-bootstrap-storage-state.json");',
|
|
40
|
+
'const readyScreenshotPath = path.join(artifactDir, "auth-bootstrap-ready.jpg");',
|
|
41
|
+
'const failureScreenshotPath = path.join(artifactDir, "auth-bootstrap-failed.jpg");',
|
|
42
|
+
'',
|
|
43
|
+
'function isBuildLane() {',
|
|
44
|
+
' return /^(build|support_build|support-build)$/i.test(String(process.env.RESOLVEIO_SUPPORT_CODEX_LANE || "").trim());',
|
|
45
|
+
'}',
|
|
46
|
+
'',
|
|
47
|
+
'function stripTrailingSlash(value) {',
|
|
48
|
+
' return String(value || "").replace(/\\/+$/, "");',
|
|
49
|
+
'}',
|
|
50
|
+
'',
|
|
51
|
+
'function extractRoutePathFromText(value) {',
|
|
52
|
+
' const raw = String(value || "").trim();',
|
|
53
|
+
' if (!raw) return "";',
|
|
54
|
+
' if (/^https?:\\/\\//i.test(raw)) {',
|
|
55
|
+
' try { return new URL(raw).pathname || "/"; } catch (error) { return ""; }',
|
|
56
|
+
' }',
|
|
57
|
+
" const match = raw.match(/(?:^|[\\s\\\"'`(])((?:\\/[a-z0-9][a-z0-9._~!$&'()*+,;=:@%\\/-]*)(?:\\?[^\\s\\\"'`<>)]*)?)/i);",
|
|
58
|
+
' const candidate = (match && match[1]) || raw;',
|
|
59
|
+
' return candidate.split(/\\s*->\\s*/)[0].split(/\\s+-\\s+/)[0].trim().replace(/[),.;]+$/g, "");',
|
|
60
|
+
'}',
|
|
61
|
+
'',
|
|
62
|
+
'function normalizeTargetRouteInput(value) {',
|
|
63
|
+
' const extracted = extractRoutePathFromText(value);',
|
|
64
|
+
' if (!extracted) return "/";',
|
|
65
|
+
' return extracted.startsWith("/") ? extracted : `/${extracted}`;',
|
|
66
|
+
'}',
|
|
67
|
+
'',
|
|
68
|
+
'function isLocalhostUrl(value) {',
|
|
69
|
+
' try {',
|
|
70
|
+
' const parsed = new URL(value);',
|
|
71
|
+
' return ["localhost", "127.0.0.1", "::1"].includes(parsed.hostname);',
|
|
72
|
+
' }',
|
|
73
|
+
' catch (error) {',
|
|
74
|
+
' return false;',
|
|
75
|
+
' }',
|
|
76
|
+
'}',
|
|
77
|
+
'',
|
|
78
|
+
'function readSeededPreferredQaUsername() {',
|
|
79
|
+
' try {',
|
|
80
|
+
' const seed = JSON.parse(fs.readFileSync(path.join(artifactDir, "qa-live-data-seed-result.json"), "utf8"));',
|
|
81
|
+
' const context = seed && seed.selected && seed.selected.qa_user_context;',
|
|
82
|
+
' const preferred = context && (context.preferred_username || context.preferred_email || context.affected_user_email || context.reporter_email);',
|
|
83
|
+
' return String(preferred || "").trim();',
|
|
84
|
+
' } catch (error) {',
|
|
85
|
+
' return "";',
|
|
86
|
+
' }',
|
|
87
|
+
'}',
|
|
88
|
+
'',
|
|
89
|
+
'function isExplicitQaIdentity(value) {',
|
|
90
|
+
' const normalized = String(value || "").trim().toLowerCase();',
|
|
91
|
+
' if (!normalized || /^(admin|dev@resolveio\\.com)$/i.test(normalized)) return false;',
|
|
92
|
+
' const explicit = [',
|
|
93
|
+
' process.env.RESOLVEIO_RUNNER_QA_AFFECTED_USER_EMAIL,',
|
|
94
|
+
' process.env.RESOLVEIO_SUPPORT_QA_AFFECTED_USER_EMAIL,',
|
|
95
|
+
' process.env.RESOLVEIO_RUNNER_QA_TICKET_REPORTER_EMAIL,',
|
|
96
|
+
' process.env.RESOLVEIO_SUPPORT_QA_TICKET_REPORTER_EMAIL,',
|
|
97
|
+
' readSeededPreferredQaUsername()',
|
|
98
|
+
' ].map((entry) => String(entry || "").trim().toLowerCase()).filter(Boolean);',
|
|
99
|
+
' return explicit.includes(normalized) || normalized.includes("@");',
|
|
100
|
+
'}',
|
|
101
|
+
'',
|
|
102
|
+
'function resolveLocalMongoUrl() {',
|
|
103
|
+
' const localQaMongoUrl = process.env.RESOLVEIO_RUNNER_QA_MONGO_URL || process.env.RESOLVEIO_SUPPORT_QA_MONGO_URL || `mongodb://127.0.0.1:${process.env.RESOLVEIO_SUPPORT_QA_MONGO_PORT || "3001"}/resolveio?directConnection=true`;',
|
|
104
|
+
' if (isLocalhostUrl(serverUrl)) {',
|
|
105
|
+
' return localQaMongoUrl;',
|
|
106
|
+
' }',
|
|
107
|
+
' return process.env.MONGO_URL || localQaMongoUrl;',
|
|
108
|
+
'}',
|
|
109
|
+
'',
|
|
110
|
+
'function requireMongoClient() {',
|
|
111
|
+
' const candidates = [',
|
|
112
|
+
' path.join(projectRoot, "server", "node_modules", "mongodb"),',
|
|
113
|
+
' path.join(projectRoot, "node_modules", "mongodb"),',
|
|
114
|
+
' path.join(process.cwd(), "server", "node_modules", "mongodb"),',
|
|
115
|
+
' path.join(process.cwd(), "node_modules", "mongodb"),',
|
|
116
|
+
' "mongodb"',
|
|
117
|
+
' ];',
|
|
118
|
+
' for (const candidate of candidates) {',
|
|
119
|
+
' try { return require(candidate).MongoClient; }',
|
|
120
|
+
' catch (error) {}',
|
|
121
|
+
' }',
|
|
122
|
+
' throw new Error("Unable to require mongodb from project/server node_modules or global resolution");',
|
|
123
|
+
'}',
|
|
124
|
+
'',
|
|
125
|
+
'function buildDefaultQaUserSettings() {',
|
|
126
|
+
' return {',
|
|
127
|
+
' table_color: "#3b3ee3",',
|
|
128
|
+
' table_font_color: "#ffffff",',
|
|
129
|
+
' secondary_table_color: "#87ceeb",',
|
|
130
|
+
' secondary_table_font_color: "#000000",',
|
|
131
|
+
' tertiary_table_color: "#ff4500",',
|
|
132
|
+
' tertiary_table_font_color: "#000000",',
|
|
133
|
+
' font_size: 12,',
|
|
134
|
+
' collapsable_menu: false,',
|
|
135
|
+
' entries_per_page: "25",',
|
|
136
|
+
' warning_color: "#ffc107",',
|
|
137
|
+
' warning_font_color: "#000000",',
|
|
138
|
+
' warning_hover_color: "#e0a800",',
|
|
139
|
+
' success_color: "#28a745",',
|
|
140
|
+
' success_font_color: "#ffffff",',
|
|
141
|
+
' success_hover_color: "#218838",',
|
|
142
|
+
' danger_color: "#dc3545",',
|
|
143
|
+
' danger_font_color: "#ffffff",',
|
|
144
|
+
' danger_hover_color: "#c82333",',
|
|
145
|
+
' info_color: "#17a2b8",',
|
|
146
|
+
' info_font_color: "#ffffff",',
|
|
147
|
+
' info_hover_color: "#138496",',
|
|
148
|
+
' primary_color: "#007bff",',
|
|
149
|
+
' primary_font_color: "#ffffff",',
|
|
150
|
+
' primary_hover_color: "#0069d9",',
|
|
151
|
+
' secondary_color: "#868e96",',
|
|
152
|
+
' secondary_font_color: "#ffffff",',
|
|
153
|
+
' secondary_hover_color: "#5a6268",',
|
|
154
|
+
' routing_preference: "",',
|
|
155
|
+
' opening_route: targetRoute,',
|
|
156
|
+
' rio_select_search_mode: "exact"',
|
|
157
|
+
' };',
|
|
158
|
+
'}',
|
|
159
|
+
'',
|
|
160
|
+
'function normalizeQaUserForBrowser(user) {',
|
|
161
|
+
' const normalized = { ...(user || {}) };',
|
|
162
|
+
' normalized.other = {',
|
|
163
|
+
' ...(normalized.other || {}),',
|
|
164
|
+
' yards: Array.isArray(normalized.other && normalized.other.yards) ? normalized.other.yards : [],',
|
|
165
|
+
' tour_completed: true,',
|
|
166
|
+
' took_tour: true,',
|
|
167
|
+
' core_tour_completed: true,',
|
|
168
|
+
' welcome_tour_completed: true,',
|
|
169
|
+
' top_navigation_tour_completed: true,',
|
|
170
|
+
' user_settings_tour_completed: true',
|
|
171
|
+
' };',
|
|
172
|
+
' normalized.settings = {',
|
|
173
|
+
' ...buildDefaultQaUserSettings(),',
|
|
174
|
+
' ...(normalized.settings || {}),',
|
|
175
|
+
' opening_route: targetRoute',
|
|
176
|
+
' };',
|
|
177
|
+
' return normalized;',
|
|
178
|
+
'}',
|
|
179
|
+
'',
|
|
180
|
+
'async function ensureLocalQaUser() {',
|
|
181
|
+
' if (!isLocalhostUrl(serverUrl) || process.env.RESOLVEIO_RUNNER_QA_DISABLE_LOCAL_USER_REPAIR === "true" || process.env.RESOLVEIO_SUPPORT_QA_DISABLE_LOCAL_USER_REPAIR === "true") {',
|
|
182
|
+
' return false;',
|
|
183
|
+
' }',
|
|
184
|
+
' const MongoClient = requireMongoClient();',
|
|
185
|
+
' const client = new MongoClient(resolveLocalMongoUrl());',
|
|
186
|
+
' await client.connect();',
|
|
187
|
+
' try {',
|
|
188
|
+
' const db = client.db();',
|
|
189
|
+
' const users = db.collection("users");',
|
|
190
|
+
' const now = new Date();',
|
|
191
|
+
' const salt = crypto.randomBytes(32).toString("hex");',
|
|
192
|
+
' const hash = crypto.pbkdf2Sync(password, salt, 25000, 512, "sha256").toString("hex");',
|
|
193
|
+
' const existing = await users.findOne({ $or: [{ username }, { email: username }] });',
|
|
194
|
+
' const defaultSettings = buildDefaultQaUserSettings();',
|
|
195
|
+
' const defaultOther = { yards: [], date_picker_day_start: "S", tour_completed: true, took_tour: true, core_tour_completed: true, welcome_tour_completed: true, top_navigation_tour_completed: true, user_settings_tour_completed: true, tour_completed_at: now.toISOString() };',
|
|
196
|
+
' if (existing && existing._id && isExplicitQaIdentity(username)) {',
|
|
197
|
+
' await users.updateOne({ _id: existing._id }, {',
|
|
198
|
+
' $set: {',
|
|
199
|
+
' active: true,',
|
|
200
|
+
' other: { ...(existing.other || {}), ...defaultOther, yards: Array.isArray(existing.other && existing.other.yards) ? existing.other.yards : [] },',
|
|
201
|
+
' settings: { ...defaultSettings, ...(existing.settings || {}), opening_route: targetRoute, collapsable_menu: false },',
|
|
202
|
+
' hash,',
|
|
203
|
+
' salt,',
|
|
204
|
+
' attempts: 0,',
|
|
205
|
+
' readonly: false,',
|
|
206
|
+
' updatedAt: now',
|
|
207
|
+
' }',
|
|
208
|
+
' });',
|
|
209
|
+
' return true;',
|
|
210
|
+
' }',
|
|
211
|
+
' const baseUser = {',
|
|
212
|
+
' __v: 0,',
|
|
213
|
+
' username,',
|
|
214
|
+
' email: username.includes("@") ? username : "dev@resolveio.com",',
|
|
215
|
+
' fullname: "QA Admin",',
|
|
216
|
+
' roles: { super_admin: true, approvals: [], groups: [], notifications: [], miscs: [] },',
|
|
217
|
+
' active: true,',
|
|
218
|
+
' other: defaultOther,',
|
|
219
|
+
' settings: defaultSettings,',
|
|
220
|
+
' phonenumber: "",',
|
|
221
|
+
' readonly: false,',
|
|
222
|
+
' is_customer: false,',
|
|
223
|
+
' hash,',
|
|
224
|
+
' salt,',
|
|
225
|
+
' attempts: 0,',
|
|
226
|
+
' services: {},',
|
|
227
|
+
' updatedAt: now',
|
|
228
|
+
' };',
|
|
229
|
+
' const qaUserFilter = {',
|
|
230
|
+
' $or: [',
|
|
231
|
+
' { username },',
|
|
232
|
+
' { email: username },',
|
|
233
|
+
' { username: "admin" },',
|
|
234
|
+
' { email: "admin" },',
|
|
235
|
+
' { email: "dev@resolveio.com" }',
|
|
236
|
+
' ]',
|
|
237
|
+
' };',
|
|
238
|
+
' await users.updateMany(qaUserFilter, {',
|
|
239
|
+
' $set: {',
|
|
240
|
+
' active: true,',
|
|
241
|
+
' roles: baseUser.roles,',
|
|
242
|
+
' other: defaultOther,',
|
|
243
|
+
' settings: defaultSettings,',
|
|
244
|
+
' hash,',
|
|
245
|
+
' salt,',
|
|
246
|
+
' attempts: 0,',
|
|
247
|
+
' readonly: false,',
|
|
248
|
+
' is_customer: false,',
|
|
249
|
+
' updatedAt: now',
|
|
250
|
+
' }',
|
|
251
|
+
' });',
|
|
252
|
+
' if (existing && existing._id) {',
|
|
253
|
+
' await users.updateOne({ _id: existing._id }, { $set: baseUser });',
|
|
254
|
+
' }',
|
|
255
|
+
' else {',
|
|
256
|
+
' await users.insertOne({ _id: crypto.randomBytes(12).toString("hex"), createdAt: now, ...baseUser });',
|
|
257
|
+
' }',
|
|
258
|
+
' const repaired = await users.findOne(qaUserFilter, { projection: { _id: 1 } });',
|
|
259
|
+
' if (repaired && repaired._id) {',
|
|
260
|
+
' await users.updateOne({ _id: repaired._id }, {',
|
|
261
|
+
' $set: {',
|
|
262
|
+
' active: true,',
|
|
263
|
+
' roles: baseUser.roles,',
|
|
264
|
+
' other: defaultOther,',
|
|
265
|
+
' settings: defaultSettings,',
|
|
266
|
+
' hash,',
|
|
267
|
+
' salt,',
|
|
268
|
+
' attempts: 0,',
|
|
269
|
+
' readonly: false,',
|
|
270
|
+
' is_customer: false,',
|
|
271
|
+
' updatedAt: now',
|
|
272
|
+
' }',
|
|
273
|
+
' });',
|
|
274
|
+
' }',
|
|
275
|
+
' return true;',
|
|
276
|
+
' }',
|
|
277
|
+
' finally {',
|
|
278
|
+
' await client.close().catch(() => undefined);',
|
|
279
|
+
' }',
|
|
280
|
+
'}',
|
|
281
|
+
'',
|
|
282
|
+
'async function refreshAuthAndSeed(page) {',
|
|
283
|
+
' const auth = await login();',
|
|
284
|
+
' await seedAuth(page, auth);',
|
|
285
|
+
' return auth;',
|
|
286
|
+
'}',
|
|
287
|
+
'',
|
|
288
|
+
'function writeResult(payload) {',
|
|
289
|
+
' fs.mkdirSync(artifactDir, { recursive: true });',
|
|
290
|
+
' fs.writeFileSync(resultPath, JSON.stringify(payload, null, 2));',
|
|
291
|
+
'}',
|
|
292
|
+
'',
|
|
293
|
+
'function writeAuthStorageState(auth) {',
|
|
294
|
+
' const normalizedUser = normalizeQaUserForBrowser(auth && auth.user);',
|
|
295
|
+
' const bootstrappedAt = new Date().toISOString();',
|
|
296
|
+
' const localStorage = {',
|
|
297
|
+
' refreshToken: auth && auth.refreshToken,',
|
|
298
|
+
' accessToken: auth && auth.accessToken,',
|
|
299
|
+
' user: JSON.stringify(normalizedUser),',
|
|
300
|
+
' lastURL: targetRoute,',
|
|
301
|
+
' "resolveio.runnerQaAuthBootstrappedAt": bootstrappedAt',
|
|
302
|
+
' };',
|
|
303
|
+
' const localStorageEntries = Object.entries(localStorage).map(([name, value]) => ({ name, key: name, value: String(value == null ? "" : value) }));',
|
|
304
|
+
' const payload = {',
|
|
305
|
+
' status: "pass",',
|
|
306
|
+
' clientUrl,',
|
|
307
|
+
' serverUrl,',
|
|
308
|
+
' targetRoute,',
|
|
309
|
+
' createdAt: bootstrappedAt,',
|
|
310
|
+
' refreshToken: auth && auth.refreshToken,',
|
|
311
|
+
' accessToken: auth && auth.accessToken,',
|
|
312
|
+
' user: normalizedUser,',
|
|
313
|
+
' localStorage,',
|
|
314
|
+
' localStorageEntries,',
|
|
315
|
+
' cookies: [],',
|
|
316
|
+
' origins: [{',
|
|
317
|
+
' origin: clientUrl,',
|
|
318
|
+
' localStorage: localStorageEntries.map(({ name, value }) => ({ name, value }))',
|
|
319
|
+
' }]',
|
|
320
|
+
' };',
|
|
321
|
+
' fs.mkdirSync(artifactDir, { recursive: true });',
|
|
322
|
+
' fs.writeFileSync(storageStatePath, JSON.stringify(payload, null, 2));',
|
|
323
|
+
' return payload;',
|
|
324
|
+
'}',
|
|
325
|
+
'',
|
|
326
|
+
'function requestJson(url, payload) {',
|
|
327
|
+
' return new Promise((resolve, reject) => {',
|
|
328
|
+
' const body = JSON.stringify(payload || {});',
|
|
329
|
+
' const parsed = new URL(url);',
|
|
330
|
+
' const mod = parsed.protocol === "https:" ? https : http;',
|
|
331
|
+
' const req = mod.request(parsed, {',
|
|
332
|
+
' method: "POST",',
|
|
333
|
+
' timeout: 20000,',
|
|
334
|
+
' headers: {',
|
|
335
|
+
' "content-type": "application/json",',
|
|
336
|
+
' "content-length": Buffer.byteLength(body),',
|
|
337
|
+
' "origin": clientUrl',
|
|
338
|
+
' }',
|
|
339
|
+
' }, (res) => {',
|
|
340
|
+
' let raw = "";',
|
|
341
|
+
' res.setEncoding("utf8");',
|
|
342
|
+
' res.on("data", (chunk) => { raw += chunk; });',
|
|
343
|
+
' res.on("end", () => {',
|
|
344
|
+
' let json = null;',
|
|
345
|
+
' try { json = raw ? JSON.parse(raw) : {}; }',
|
|
346
|
+
' catch (error) {',
|
|
347
|
+
' reject(new Error(`${url} returned non-JSON HTTP ${res.statusCode}: ${raw.slice(0, 300)}`));',
|
|
348
|
+
' return;',
|
|
349
|
+
' }',
|
|
350
|
+
' if (!res.statusCode || res.statusCode >= 400) {',
|
|
351
|
+
' reject(new Error(`${url} returned HTTP ${res.statusCode}: ${JSON.stringify(json).slice(0, 500)}`));',
|
|
352
|
+
' return;',
|
|
353
|
+
' }',
|
|
354
|
+
' resolve(json);',
|
|
355
|
+
' });',
|
|
356
|
+
' });',
|
|
357
|
+
' req.on("timeout", () => req.destroy(new Error(`${url} timed out`)));',
|
|
358
|
+
' req.on("error", reject);',
|
|
359
|
+
' req.write(body);',
|
|
360
|
+
' req.end();',
|
|
361
|
+
' });',
|
|
362
|
+
'}',
|
|
363
|
+
'',
|
|
364
|
+
'function requestReady(url) {',
|
|
365
|
+
' return new Promise((resolve) => {',
|
|
366
|
+
' try {',
|
|
367
|
+
' const parsed = new URL(url);',
|
|
368
|
+
' const mod = parsed.protocol === "https:" ? https : http;',
|
|
369
|
+
' const req = mod.get(parsed, { timeout: 2500 }, (res) => {',
|
|
370
|
+
' res.resume();',
|
|
371
|
+
' resolve(Boolean(res.statusCode && res.statusCode < 500));',
|
|
372
|
+
' });',
|
|
373
|
+
' req.on("timeout", () => req.destroy(new Error("timeout")));',
|
|
374
|
+
' req.on("error", () => resolve(false));',
|
|
375
|
+
' }',
|
|
376
|
+
' catch (error) {',
|
|
377
|
+
' resolve(false);',
|
|
378
|
+
' }',
|
|
379
|
+
' });',
|
|
380
|
+
'}',
|
|
381
|
+
'',
|
|
382
|
+
'async function waitForHttpReady(url, label) {',
|
|
383
|
+
' const deadline = Date.now() + startupTimeoutMs;',
|
|
384
|
+
' while (Date.now() < deadline) {',
|
|
385
|
+
' if (await requestReady(url)) {',
|
|
386
|
+
' return;',
|
|
387
|
+
' }',
|
|
388
|
+
' await delay(3000);',
|
|
389
|
+
' }',
|
|
390
|
+
' throw new Error(`${label} did not become ready at ${url} within ${Math.round(startupTimeoutMs / 1000)}s`);',
|
|
391
|
+
'}',
|
|
392
|
+
'',
|
|
393
|
+
'function requirePuppeteer() {',
|
|
394
|
+
' const candidates = [',
|
|
395
|
+
' path.join(projectRoot, "server", "node_modules", "puppeteer", "lib", "cjs", "puppeteer", "puppeteer.js"),',
|
|
396
|
+
' path.join(projectRoot, "node_modules", "puppeteer", "lib", "cjs", "puppeteer", "puppeteer.js"),',
|
|
397
|
+
' path.join(process.cwd(), "server", "node_modules", "puppeteer", "lib", "cjs", "puppeteer", "puppeteer.js"),',
|
|
398
|
+
' path.join(process.cwd(), "node_modules", "puppeteer", "lib", "cjs", "puppeteer", "puppeteer.js"),',
|
|
399
|
+
' "puppeteer"',
|
|
400
|
+
' ];',
|
|
401
|
+
' for (const candidate of candidates) {',
|
|
402
|
+
' try { return require(candidate); }',
|
|
403
|
+
' catch (error) {}',
|
|
404
|
+
' }',
|
|
405
|
+
' throw new Error("Unable to require puppeteer from project/server node_modules or global resolution");',
|
|
406
|
+
'}',
|
|
407
|
+
'',
|
|
408
|
+
'async function login() {',
|
|
409
|
+
' if (!password) {',
|
|
410
|
+
' throw new Error("QA password is empty; source .resolveio-support-tools/env.sh or set RESOLVEIO_RUNNER_QA_PASSWORD before auth bootstrap");',
|
|
411
|
+
' }',
|
|
412
|
+
' await waitForHttpReady(serverUrl, "QA server");',
|
|
413
|
+
' await ensureLocalQaUser();',
|
|
414
|
+
' let loginJson = await requestJson(`${serverUrl}/login`, { username, password });',
|
|
415
|
+
' if ((loginJson && loginJson.error) && /Invalid Username And Password|Too Many Attempts/i.test(String(loginJson.result || ""))) {',
|
|
416
|
+
' const repaired = await ensureLocalQaUser();',
|
|
417
|
+
' if (repaired) {',
|
|
418
|
+
' loginJson = await requestJson(`${serverUrl}/login`, { username, password });',
|
|
419
|
+
' }',
|
|
420
|
+
' }',
|
|
421
|
+
' const refreshToken = loginJson && loginJson.result && loginJson.result.token;',
|
|
422
|
+
' if (loginJson.error || !refreshToken) {',
|
|
423
|
+
' throw new Error(`Login failed: ${JSON.stringify(loginJson).slice(0, 800)}`);',
|
|
424
|
+
' }',
|
|
425
|
+
' const accessJson = await requestJson(`${serverUrl}/accessToken`, { refreshToken });',
|
|
426
|
+
' const accessToken = accessJson && accessJson.result && accessJson.result.token;',
|
|
427
|
+
' const user = accessJson && accessJson.result && accessJson.result.user;',
|
|
428
|
+
' if (accessJson.error || !accessToken || !user) {',
|
|
429
|
+
' throw new Error(`Access token failed: ${JSON.stringify(accessJson).slice(0, 800)}`);',
|
|
430
|
+
' }',
|
|
431
|
+
' return { refreshToken, accessToken, user: normalizeQaUserForBrowser(user) };',
|
|
432
|
+
'}',
|
|
433
|
+
'',
|
|
434
|
+
'async function launchBrowser(puppeteer) {',
|
|
435
|
+
' const browserUrl = process.env.RESOLVEIO_RUNNER_QA_BROWSER_URL || process.env.RESOLVEIO_SUPPORT_QA_BROWSER_URL || "";',
|
|
436
|
+
' if (browserUrl) {',
|
|
437
|
+
' try {',
|
|
438
|
+
' const debugUrl = `${browserUrl.replace(/\\/$/, "")}/json/version`;',
|
|
439
|
+
' if (!(await requestReady(debugUrl))) {',
|
|
440
|
+
' throw new Error(`QA browser debug endpoint did not answer at ${debugUrl}`);',
|
|
441
|
+
' }',
|
|
442
|
+
' return puppeteer.connect({ browserURL: browserUrl, protocolTimeout: 30000, defaultViewport: null });',
|
|
443
|
+
' }',
|
|
444
|
+
' catch (error) {',
|
|
445
|
+
' console.warn(`QA browser debug endpoint unavailable at ${browserUrl}; launching scoped browser instead: ${error.message || error}`);',
|
|
446
|
+
' }',
|
|
447
|
+
' }',
|
|
448
|
+
' const launchOptions = {',
|
|
449
|
+
' headless: true,',
|
|
450
|
+
' defaultViewport: { width: viewportWidth, height: viewportHeight },',
|
|
451
|
+
' args: ["--no-sandbox", "--disable-setuid-sandbox", "--disable-dev-shm-usage", `--window-size=${viewportWidth},${viewportHeight}`]',
|
|
452
|
+
' };',
|
|
453
|
+
' if (process.env.PUPPETEER_EXECUTABLE_PATH || process.env.CHROME_BIN) {',
|
|
454
|
+
' launchOptions.executablePath = process.env.PUPPETEER_EXECUTABLE_PATH || process.env.CHROME_BIN;',
|
|
455
|
+
' }',
|
|
456
|
+
' return puppeteer.launch(launchOptions);',
|
|
457
|
+
'}',
|
|
458
|
+
'',
|
|
459
|
+
'async function resetBrowserState(page) {',
|
|
460
|
+
' await waitForHttpReady(clientUrl, "QA client");',
|
|
461
|
+
' await page.goto(clientUrl, { waitUntil: "domcontentloaded", timeout: 45000 });',
|
|
462
|
+
' await page.evaluate(async () => {',
|
|
463
|
+
' try {',
|
|
464
|
+
' const registrations = await navigator.serviceWorker.getRegistrations();',
|
|
465
|
+
' await Promise.all(registrations.map((registration) => registration.unregister().catch(() => false)));',
|
|
466
|
+
' } catch (error) {}',
|
|
467
|
+
' try {',
|
|
468
|
+
' if (window.caches && window.caches.keys) {',
|
|
469
|
+
' const keys = await window.caches.keys();',
|
|
470
|
+
' await Promise.all(keys.map((key) => window.caches.delete(key).catch(() => false)));',
|
|
471
|
+
' }',
|
|
472
|
+
' } catch (error) {}',
|
|
473
|
+
' try {',
|
|
474
|
+
' if (window.indexedDB && window.indexedDB.databases) {',
|
|
475
|
+
' const databases = await window.indexedDB.databases();',
|
|
476
|
+
' await Promise.all(databases.filter((database) => database && database.name).map((database) => new Promise((resolve) => {',
|
|
477
|
+
' const request = window.indexedDB.deleteDatabase(database.name);',
|
|
478
|
+
' request.onsuccess = () => resolve(true);',
|
|
479
|
+
' request.onerror = () => resolve(false);',
|
|
480
|
+
' request.onblocked = () => resolve(false);',
|
|
481
|
+
' })));',
|
|
482
|
+
' }',
|
|
483
|
+
' } catch (error) {}',
|
|
484
|
+
' localStorage.clear();',
|
|
485
|
+
' sessionStorage.clear();',
|
|
486
|
+
' });',
|
|
487
|
+
'}',
|
|
488
|
+
'',
|
|
489
|
+
'async function seedAuth(page, auth) {',
|
|
490
|
+
' auth.user = normalizeQaUserForBrowser(auth.user);',
|
|
491
|
+
' writeAuthStorageState(auth);',
|
|
492
|
+
' await page.evaluate((payload) => {',
|
|
493
|
+
' localStorage.setItem("refreshToken", payload.refreshToken);',
|
|
494
|
+
' localStorage.setItem("accessToken", payload.accessToken);',
|
|
495
|
+
' localStorage.setItem("user", JSON.stringify(payload.user));',
|
|
496
|
+
' localStorage.setItem("lastURL", payload.lastURL);',
|
|
497
|
+
' localStorage.setItem("resolveio.runnerQaAuthBootstrappedAt", payload.bootstrappedAt);',
|
|
498
|
+
' }, { ...auth, lastURL: targetRoute, bootstrappedAt: new Date().toISOString() });',
|
|
499
|
+
'}',
|
|
500
|
+
'',
|
|
501
|
+
'async function patchBrowserQaUser(page) {',
|
|
502
|
+
' await page.evaluate((nextRoute) => {',
|
|
503
|
+
' let user = {};',
|
|
504
|
+
' try { user = JSON.parse(localStorage.getItem("user") || "{}"); } catch (error) { user = {}; }',
|
|
505
|
+
' const settings = {',
|
|
506
|
+
' table_color: "#3b3ee3",',
|
|
507
|
+
' table_font_color: "#ffffff",',
|
|
508
|
+
' secondary_table_color: "#87ceeb",',
|
|
509
|
+
' secondary_table_font_color: "#000000",',
|
|
510
|
+
' tertiary_table_color: "#ff4500",',
|
|
511
|
+
' tertiary_table_font_color: "#000000",',
|
|
512
|
+
' font_size: 12,',
|
|
513
|
+
' collapsable_menu: false,',
|
|
514
|
+
' entries_per_page: "25",',
|
|
515
|
+
' warning_color: "#ffc107",',
|
|
516
|
+
' warning_font_color: "#000000",',
|
|
517
|
+
' warning_hover_color: "#e0a800",',
|
|
518
|
+
' success_color: "#28a745",',
|
|
519
|
+
' success_font_color: "#ffffff",',
|
|
520
|
+
' success_hover_color: "#218838",',
|
|
521
|
+
' danger_color: "#dc3545",',
|
|
522
|
+
' danger_font_color: "#ffffff",',
|
|
523
|
+
' danger_hover_color: "#c82333",',
|
|
524
|
+
' info_color: "#17a2b8",',
|
|
525
|
+
' info_font_color: "#ffffff",',
|
|
526
|
+
' info_hover_color: "#138496",',
|
|
527
|
+
' primary_color: "#007bff",',
|
|
528
|
+
' primary_font_color: "#ffffff",',
|
|
529
|
+
' primary_hover_color: "#0069d9",',
|
|
530
|
+
' secondary_color: "#868e96",',
|
|
531
|
+
' secondary_font_color: "#ffffff",',
|
|
532
|
+
' secondary_hover_color: "#5a6268",',
|
|
533
|
+
' routing_preference: "",',
|
|
534
|
+
' opening_route: nextRoute,',
|
|
535
|
+
' rio_select_search_mode: "exact"',
|
|
536
|
+
' };',
|
|
537
|
+
' user = {',
|
|
538
|
+
' ...user,',
|
|
539
|
+
' other: {',
|
|
540
|
+
' ...(user.other || {}),',
|
|
541
|
+
' yards: Array.isArray(user.other && user.other.yards) ? user.other.yards : [],',
|
|
542
|
+
' tour_completed: true,',
|
|
543
|
+
' took_tour: true,',
|
|
544
|
+
' core_tour_completed: true,',
|
|
545
|
+
' welcome_tour_completed: true,',
|
|
546
|
+
' top_navigation_tour_completed: true,',
|
|
547
|
+
' user_settings_tour_completed: true',
|
|
548
|
+
' },',
|
|
549
|
+
' settings: { ...settings, ...(user.settings || {}), opening_route: nextRoute }',
|
|
550
|
+
' };',
|
|
551
|
+
' localStorage.setItem("user", JSON.stringify(user));',
|
|
552
|
+
' localStorage.setItem("lastURL", nextRoute);',
|
|
553
|
+
' localStorage.setItem("resolveio.runnerQaPostLoginGateRepairedAt", new Date().toISOString());',
|
|
554
|
+
' });',
|
|
555
|
+
'}',
|
|
556
|
+
'',
|
|
557
|
+
'async function dismissVisibleTourOrSetupGate(page) {',
|
|
558
|
+
' return page.evaluate(() => {',
|
|
559
|
+
' const controls = Array.from(document.querySelectorAll("button, a, [role=\'button\']"));',
|
|
560
|
+
' const control = controls.find((candidate) => {',
|
|
561
|
+
' const text = (candidate.textContent || "").replace(/\\s+/g, " ").trim();',
|
|
562
|
+
' return /^(skip|finish|done|close)$/i.test(text);',
|
|
563
|
+
' });',
|
|
564
|
+
' if (control && typeof control.click === "function") {',
|
|
565
|
+
' control.click();',
|
|
566
|
+
' return true;',
|
|
567
|
+
' }',
|
|
568
|
+
' return false;',
|
|
569
|
+
' });',
|
|
570
|
+
'}',
|
|
571
|
+
'',
|
|
572
|
+
'function isPostLoginSetupOrTourGate(currentRoute, summary) {',
|
|
573
|
+
' const text = String(summary && summary.bodyTextSnippet || "");',
|
|
574
|
+
' return currentRoute === "/user-settings/settings" || /Top Navigation Step \\d+ of \\d+|\\bSkip\\b|User Settings/i.test(text);',
|
|
575
|
+
'}',
|
|
576
|
+
'',
|
|
577
|
+
'async function repairPostLoginSetupOrTourGate(page, expectedRoute) {',
|
|
578
|
+
' if (process.env.RESOLVEIO_RUNNER_QA_DISABLE_POST_LOGIN_ROUTE_REPAIR === "true" || process.env.RESOLVEIO_SUPPORT_QA_DISABLE_POST_LOGIN_ROUTE_REPAIR === "true") {',
|
|
579
|
+
' return false;',
|
|
580
|
+
' }',
|
|
581
|
+
' const current = normalizeRoutePath(await page.evaluate(() => location.href));',
|
|
582
|
+
' const summary = await pageSummary(page).catch(() => ({}));',
|
|
583
|
+
' if (!isPostLoginSetupOrTourGate(current, summary)) {',
|
|
584
|
+
' return false;',
|
|
585
|
+
' }',
|
|
586
|
+
' await ensureLocalQaUser().catch(() => false);',
|
|
587
|
+
' await refreshAuthAndSeed(page).catch(() => undefined);',
|
|
588
|
+
' await dismissVisibleTourOrSetupGate(page).catch(() => false);',
|
|
589
|
+
' await patchBrowserQaUser(page);',
|
|
590
|
+
' await page.goto(`${clientUrl}${expectedRoute}`, { waitUntil: "domcontentloaded", timeout: 60000 });',
|
|
591
|
+
' await delay(1500);',
|
|
592
|
+
' await dismissVisibleTourOrSetupGate(page).catch(() => false);',
|
|
593
|
+
' await patchBrowserQaUser(page);',
|
|
594
|
+
' await delay(500);',
|
|
595
|
+
' const repairedCurrent = canonicalizeRoutePath(await page.evaluate(() => location.href));',
|
|
596
|
+
' return routesMatch(repairedCurrent, expectedRoute);',
|
|
597
|
+
'}',
|
|
598
|
+
'',
|
|
599
|
+
'function delay(ms) {',
|
|
600
|
+
' return new Promise((resolve) => setTimeout(resolve, ms));',
|
|
601
|
+
'}',
|
|
602
|
+
'',
|
|
603
|
+
'function normalizeRoutePath(value) {',
|
|
604
|
+
' try {',
|
|
605
|
+
' const parsed = new URL(value, clientUrl);',
|
|
606
|
+
' let pathname = parsed.pathname || "/";',
|
|
607
|
+
' pathname = pathname.replace(/\\/+$/, "") || "/";',
|
|
608
|
+
' return pathname;',
|
|
609
|
+
' }',
|
|
610
|
+
' catch (error) {',
|
|
611
|
+
' return String(value || "/").split("?")[0].replace(/\\/+$/, "") || "/";',
|
|
612
|
+
' }',
|
|
613
|
+
'}',
|
|
614
|
+
'',
|
|
615
|
+
'function canonicalizeRoutePath(value) {',
|
|
616
|
+
' const route = normalizeRoutePath(value);',
|
|
617
|
+
' const aliases = {',
|
|
618
|
+
' "/billing": "/dashboard/billing",',
|
|
619
|
+
' "/invoice": "/dashboard/billing",',
|
|
620
|
+
' "/invoices": "/dashboard/billing",',
|
|
621
|
+
' "/customer": "/manage/customer",',
|
|
622
|
+
' "/customers": "/manage/customer",',
|
|
623
|
+
' "/pricing": "/manage/pricing",',
|
|
624
|
+
' "/items": "/manage/item",',
|
|
625
|
+
' "/invoice-items": "/manage/item",',
|
|
626
|
+
' "/inventory": "/manage/inventory"',
|
|
627
|
+
' };',
|
|
628
|
+
' return aliases[route] || route;',
|
|
629
|
+
'}',
|
|
630
|
+
'',
|
|
631
|
+
'function routesMatch(currentRoute, expectedRoute) {',
|
|
632
|
+
' return canonicalizeRoutePath(currentRoute) === canonicalizeRoutePath(expectedRoute);',
|
|
633
|
+
'}',
|
|
634
|
+
'',
|
|
635
|
+
'function isGenericAuthTargetRoute(routePath) {',
|
|
636
|
+
' return ["/", "/screen", "/home"].includes(canonicalizeRoutePath(routePath));',
|
|
637
|
+
'}',
|
|
638
|
+
'',
|
|
639
|
+
'function isAuthenticatedNonSetupRoute(summary) {',
|
|
640
|
+
' const current = normalizeRoutePath(summary && summary.url || "");',
|
|
641
|
+
' return !!summary',
|
|
642
|
+
' && !!summary.hasRefreshToken',
|
|
643
|
+
' && !!summary.hasAccessToken',
|
|
644
|
+
' && !!summary.hasUser',
|
|
645
|
+
' && !summary.hasLoginText',
|
|
646
|
+
' && !summary.hasOfflineModeText',
|
|
647
|
+
' && current !== "/user-settings/settings";',
|
|
648
|
+
'}',
|
|
649
|
+
'',
|
|
650
|
+
'async function assertTargetRoute(page) {',
|
|
651
|
+
' const expected = canonicalizeRoutePath(targetRoute);',
|
|
652
|
+
' if (expected === "/") {',
|
|
653
|
+
' return;',
|
|
654
|
+
' }',
|
|
655
|
+
' const current = canonicalizeRoutePath(await page.evaluate(() => location.href));',
|
|
656
|
+
' if (!routesMatch(current, expected)) {',
|
|
657
|
+
' const repaired = await repairPostLoginSetupOrTourGate(page, expected);',
|
|
658
|
+
' if (repaired) {',
|
|
659
|
+
' return;',
|
|
660
|
+
' }',
|
|
661
|
+
' const summary = await pageSummary(page).catch(() => ({}));',
|
|
662
|
+
' if (isGenericAuthTargetRoute(expected) && isAuthenticatedNonSetupRoute(summary)) {',
|
|
663
|
+
' return;',
|
|
664
|
+
' }',
|
|
665
|
+
' throw new Error(`QA auth bootstrap reached ${current}, not requested target route ${expected}. This is a route blocker; do not continue browser QA until the runner/app can reach the requested screen. Page summary: ${JSON.stringify(summary).slice(0, 1200)}`);',
|
|
666
|
+
' }',
|
|
667
|
+
'}',
|
|
668
|
+
'',
|
|
669
|
+
'async function waitForStableTargetRoute(page) {',
|
|
670
|
+
' const expected = canonicalizeRoutePath(targetRoute);',
|
|
671
|
+
' if (isGenericAuthTargetRoute(expected)) {',
|
|
672
|
+
' return;',
|
|
673
|
+
' }',
|
|
674
|
+
' const deadline = Date.now() + Number(process.env.RESOLVEIO_RUNNER_QA_ROUTE_STABILITY_TIMEOUT_MS || process.env.RESOLVEIO_SUPPORT_QA_ROUTE_STABILITY_TIMEOUT_MS || 7000);',
|
|
675
|
+
' let stableSince = 0;',
|
|
676
|
+
' let lastCurrent = "";',
|
|
677
|
+
' while (Date.now() < deadline) {',
|
|
678
|
+
' const current = canonicalizeRoutePath(await page.evaluate(() => location.href));',
|
|
679
|
+
' lastCurrent = current;',
|
|
680
|
+
' if (routesMatch(current, expected)) {',
|
|
681
|
+
' stableSince = stableSince || Date.now();',
|
|
682
|
+
' if (Date.now() - stableSince >= Number(process.env.RESOLVEIO_RUNNER_QA_ROUTE_STABLE_MS || process.env.RESOLVEIO_SUPPORT_QA_ROUTE_STABLE_MS || 2500)) {',
|
|
683
|
+
' return;',
|
|
684
|
+
' }',
|
|
685
|
+
' }',
|
|
686
|
+
' else {',
|
|
687
|
+
' stableSince = 0;',
|
|
688
|
+
' }',
|
|
689
|
+
' await delay(250);',
|
|
690
|
+
' }',
|
|
691
|
+
' const summary = await pageSummary(page).catch(() => ({}));',
|
|
692
|
+
' throw new Error(`QA auth bootstrap route was not stable on requested target ${expected}; last route was ${lastCurrent || "unknown"}. This is a route blocker; do not continue browser QA until the runner/app can remain on the requested screen. Page summary: ${JSON.stringify(summary).slice(0, 1200)}`);',
|
|
693
|
+
'}',
|
|
694
|
+
'',
|
|
695
|
+
'async function dismissNavigationOverlays(page) {',
|
|
696
|
+
' try {',
|
|
697
|
+
' await page.keyboard.press("Escape");',
|
|
698
|
+
' } catch (error) {}',
|
|
699
|
+
' try {',
|
|
700
|
+
' await page.mouse.move(16, Math.max(120, viewportHeight - 24));',
|
|
701
|
+
' } catch (error) {}',
|
|
702
|
+
' try {',
|
|
703
|
+
' await page.evaluate(() => {',
|
|
704
|
+
' if (document.activeElement && typeof document.activeElement.blur === "function") document.activeElement.blur();',
|
|
705
|
+
' document.body && document.body.dispatchEvent(new MouseEvent("mousemove", { bubbles: true, clientX: 16, clientY: Math.max(120, window.innerHeight - 24) }));',
|
|
706
|
+
' });',
|
|
707
|
+
' } catch (error) {}',
|
|
708
|
+
' await delay(350);',
|
|
709
|
+
'}',
|
|
710
|
+
'',
|
|
711
|
+
'async function assertSummaryOnTargetRoute(summary) {',
|
|
712
|
+
' const expected = canonicalizeRoutePath(targetRoute);',
|
|
713
|
+
' if (expected === "/") {',
|
|
714
|
+
' return;',
|
|
715
|
+
' }',
|
|
716
|
+
' const current = canonicalizeRoutePath(summary && summary.url || "");',
|
|
717
|
+
' if (!routesMatch(current, expected)) {',
|
|
718
|
+
' if (isGenericAuthTargetRoute(expected) && isAuthenticatedNonSetupRoute(summary)) {',
|
|
719
|
+
' return;',
|
|
720
|
+
' }',
|
|
721
|
+
' throw new Error(`QA auth bootstrap final summary is on ${current}, not requested target route ${expected}. This is a route blocker; refusing to write a false pass. Page summary: ${JSON.stringify(summary).slice(0, 1200)}`);',
|
|
722
|
+
' }',
|
|
723
|
+
'}',
|
|
724
|
+
'',
|
|
725
|
+
'async function logoutExistingBrowserSession(page) {',
|
|
726
|
+
' try {',
|
|
727
|
+
' await page.goto(clientUrl, { waitUntil: "domcontentloaded", timeout: 45000 });',
|
|
728
|
+
' await delay(500);',
|
|
729
|
+
' await page.evaluate(() => {',
|
|
730
|
+
' const controls = Array.from(document.querySelectorAll("button, a, [role=\'button\']"));',
|
|
731
|
+
' const logoutControl = controls.find((control) => /(^|\\s)logout(\\s|$)/i.test((control.textContent || "").trim()));',
|
|
732
|
+
' if (logoutControl && typeof logoutControl.click === "function") {',
|
|
733
|
+
' logoutControl.click();',
|
|
734
|
+
' return true;',
|
|
735
|
+
' }',
|
|
736
|
+
' return false;',
|
|
737
|
+
' });',
|
|
738
|
+
' await delay(1000);',
|
|
739
|
+
' }',
|
|
740
|
+
' catch (error) {}',
|
|
741
|
+
'}',
|
|
742
|
+
'',
|
|
743
|
+
'async function waitForAuthenticatedApp(page) {',
|
|
744
|
+
' const url = `${clientUrl}${targetRoute}`;',
|
|
745
|
+
' await page.goto(url, { waitUntil: "domcontentloaded", timeout: 60000 });',
|
|
746
|
+
' await page.waitForFunction(() => {',
|
|
747
|
+
' const text = (document.body && document.body.innerText || "").replace(/\\s+/g, " ").trim();',
|
|
748
|
+
' const hasTokens = !!localStorage.getItem("refreshToken") && !!localStorage.getItem("accessToken") && !!localStorage.getItem("user");',
|
|
749
|
+
' const hasLogin = /Employee\\/Customer Login|Employee Sign In|Customer Access|Unable to sign in/i.test(text);',
|
|
750
|
+
' const hasOffline = text.includes("*** OFFLINE MODE ***");',
|
|
751
|
+
' return hasTokens && !hasLogin && !hasOffline && text.length > 40;',
|
|
752
|
+
' }, { timeout: Number(process.env.RESOLVEIO_RUNNER_QA_AUTH_TIMEOUT_MS || process.env.RESOLVEIO_SUPPORT_QA_AUTH_TIMEOUT_MS || 60000) });',
|
|
753
|
+
' await delay(1000);',
|
|
754
|
+
' await assertTargetRoute(page);',
|
|
755
|
+
' await waitForStableTargetRoute(page);',
|
|
756
|
+
' await dismissNavigationOverlays(page);',
|
|
757
|
+
'}',
|
|
758
|
+
'',
|
|
759
|
+
'async function pageSummary(page) {',
|
|
760
|
+
' return page.evaluate(() => {',
|
|
761
|
+
' const bodyText = (document.body && document.body.innerText || "").replace(/\\s+/g, " ").trim();',
|
|
762
|
+
' return {',
|
|
763
|
+
' url: location.href,',
|
|
764
|
+
' title: document.title,',
|
|
765
|
+
' hasAngularDebug: !!window.ng,',
|
|
766
|
+
' hasRefreshToken: !!localStorage.getItem("refreshToken"),',
|
|
767
|
+
' hasAccessToken: !!localStorage.getItem("accessToken"),',
|
|
768
|
+
' hasUser: !!localStorage.getItem("user"),',
|
|
769
|
+
' hasOfflineModeText: bodyText.includes("*** OFFLINE MODE ***"),',
|
|
770
|
+
' hasLoginText: /Employee\\/Customer Login|Employee Sign In|Customer Access|Unable to sign in/i.test(bodyText),',
|
|
771
|
+
' bodyTextSnippet: bodyText.slice(0, 800),',
|
|
772
|
+
' localStorageKeys: Object.keys(localStorage).sort()',
|
|
773
|
+
' };',
|
|
774
|
+
' });',
|
|
775
|
+
'}',
|
|
776
|
+
'',
|
|
777
|
+
'(async () => {',
|
|
778
|
+
' fs.mkdirSync(artifactDir, { recursive: true });',
|
|
779
|
+
' await waitForHttpReady(clientUrl, "QA client");',
|
|
780
|
+
' await waitForHttpReady(serverUrl, "QA server");',
|
|
781
|
+
' const puppeteer = requirePuppeteer();',
|
|
782
|
+
' const browser = await launchBrowser(puppeteer);',
|
|
783
|
+
' let page;',
|
|
784
|
+
' try {',
|
|
785
|
+
' page = await browser.newPage();',
|
|
786
|
+
' await page.setViewport({ width: viewportWidth, height: viewportHeight });',
|
|
787
|
+
' page.on("console", (msg) => {',
|
|
788
|
+
' const text = msg.text();',
|
|
789
|
+
' if (["error", "warning"].includes(msg.type()) || /error/i.test(text)) {',
|
|
790
|
+
' console.log("[browser console]", msg.type(), text);',
|
|
791
|
+
' }',
|
|
792
|
+
' });',
|
|
793
|
+
' page.on("pageerror", (error) => console.log("[pageerror]", error.message));',
|
|
794
|
+
' await logoutExistingBrowserSession(page);',
|
|
795
|
+
' await resetBrowserState(page);',
|
|
796
|
+
' const auth = await login();',
|
|
797
|
+
' await seedAuth(page, auth);',
|
|
798
|
+
' await waitForAuthenticatedApp(page);',
|
|
799
|
+
' const finalPage = await pageSummary(page);',
|
|
800
|
+
' await assertSummaryOnTargetRoute(finalPage);',
|
|
801
|
+
' await page.screenshot({ path: readyScreenshotPath, type: "jpeg", quality: 82, fullPage: false });',
|
|
802
|
+
' const summary = {',
|
|
803
|
+
' status: "pass",',
|
|
804
|
+
' clientUrl,',
|
|
805
|
+
' serverUrl,',
|
|
806
|
+
' targetRoute,',
|
|
807
|
+
' screenshot: readyScreenshotPath,',
|
|
808
|
+
' storageState: storageStatePath,',
|
|
809
|
+
' user: { _id: auth.user && auth.user._id, username: auth.user && auth.user.username, fullname: auth.user && auth.user.fullname },',
|
|
810
|
+
' page: finalPage',
|
|
811
|
+
' };',
|
|
812
|
+
' writeResult(summary);',
|
|
813
|
+
' console.log(JSON.stringify(summary, null, 2));',
|
|
814
|
+
' }',
|
|
815
|
+
' catch (error) {',
|
|
816
|
+
' let summary = { status: "fail", clientUrl, serverUrl, targetRoute, screenshot: failureScreenshotPath, error: error && error.stack || String(error) };',
|
|
817
|
+
' try {',
|
|
818
|
+
' if (page) {',
|
|
819
|
+
' await page.screenshot({ path: failureScreenshotPath, type: "jpeg", quality: 82, fullPage: false });',
|
|
820
|
+
' summary.page = await pageSummary(page);',
|
|
821
|
+
' }',
|
|
822
|
+
' } catch (screenshotError) {',
|
|
823
|
+
' summary.screenshotError = screenshotError && screenshotError.stack || String(screenshotError);',
|
|
824
|
+
' }',
|
|
825
|
+
' writeResult(summary);',
|
|
826
|
+
' console.error(JSON.stringify(summary, null, 2));',
|
|
827
|
+
' process.exitCode = 1;',
|
|
828
|
+
' }',
|
|
829
|
+
' finally {',
|
|
830
|
+
' if (browser && typeof browser.close === "function") {',
|
|
831
|
+
' await browser.close().catch(() => undefined);',
|
|
832
|
+
' }',
|
|
833
|
+
' process.exit(process.exitCode || 0);',
|
|
834
|
+
' }',
|
|
835
|
+
'})();',
|
|
836
|
+
''
|
|
837
|
+
].join('\n');
|
|
838
|
+
}
|