hunter-mate 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/extension/background/service-worker.js +911 -159
- package/dist/assets/extension/build-info.json +1 -0
- package/dist/assets/extension/content/index.js +22 -4
- package/dist/assets/extension/manifest.json +5 -4
- package/dist/assets/extension/offscreen/offscreen.html +8 -0
- package/dist/assets/extension/offscreen/offscreen.js +149 -0
- package/dist/assets/extension/package.json +12 -4
- package/dist/assets/extension/sidepanel/index.css +2 -0
- package/dist/assets/extension/sidepanel/index.html +7 -394
- package/dist/assets/extension/sidepanel/index.js +53 -923
- package/dist/assets/server/app.module.js +12 -1
- package/dist/assets/server/app.module.js.map +1 -1
- package/dist/assets/server/auth/auth.controller.d.ts +7 -0
- package/dist/assets/server/auth/auth.controller.js +20 -0
- package/dist/assets/server/auth/auth.controller.js.map +1 -1
- package/dist/assets/server/auth/auth.middleware.js +9 -1
- package/dist/assets/server/auth/auth.middleware.js.map +1 -1
- package/dist/assets/server/auth/auth.service.d.ts +11 -0
- package/dist/assets/server/auth/auth.service.js +58 -1
- package/dist/assets/server/auth/auth.service.js.map +1 -1
- package/dist/assets/server/build-info.json +1 -1
- package/dist/assets/server/customer/customer.controller.d.ts +18 -0
- package/dist/assets/server/customer/customer.controller.js +81 -0
- package/dist/assets/server/customer/customer.controller.js.map +1 -0
- package/dist/assets/server/customer/customer.entity.d.ts +17 -0
- package/dist/assets/server/customer/customer.entity.js +82 -0
- package/dist/assets/server/customer/customer.entity.js.map +1 -0
- package/dist/assets/server/customer/customer.module.d.ts +2 -0
- package/dist/assets/server/customer/customer.module.js +28 -0
- package/dist/assets/server/customer/customer.module.js.map +1 -0
- package/dist/assets/server/customer/customer.service.d.ts +36 -0
- package/dist/assets/server/customer/customer.service.js +200 -0
- package/dist/assets/server/customer/customer.service.js.map +1 -0
- package/dist/assets/server/db/schema-validator.service.d.ts +2 -0
- package/dist/assets/server/db/schema-validator.service.js +32 -1
- package/dist/assets/server/db/schema-validator.service.js.map +1 -1
- package/dist/assets/server/db/sqlite.module.d.ts +1 -0
- package/dist/assets/server/db/sqlite.module.js +12 -2
- package/dist/assets/server/db/sqlite.module.js.map +1 -1
- package/dist/assets/server/devops/devops-sink-init.d.ts +1 -14
- package/dist/assets/server/devops/devops-sink-init.js +3 -8
- package/dist/assets/server/devops/devops-sink-init.js.map +1 -1
- package/dist/assets/server/extension/extension-control.controller.d.ts +15 -0
- package/dist/assets/server/extension/extension-control.controller.js +42 -2
- package/dist/assets/server/extension/extension-control.controller.js.map +1 -1
- package/dist/assets/server/extension/extension-control.service.d.ts +14 -1
- package/dist/assets/server/extension/extension-control.service.js +65 -2
- package/dist/assets/server/extension/extension-control.service.js.map +1 -1
- package/dist/assets/server/extraction/adapter.service.d.ts +3 -0
- package/dist/assets/server/extraction/adapter.service.js +127 -6
- package/dist/assets/server/extraction/adapter.service.js.map +1 -1
- package/dist/assets/server/extraction/anomaly-report.service.js +1 -1
- package/dist/assets/server/extraction/anomaly-report.service.js.map +1 -1
- package/dist/assets/server/extraction/entities/adapter-rule.entity.d.ts +2 -0
- package/dist/assets/server/extraction/entities/adapter-rule.entity.js +10 -0
- package/dist/assets/server/extraction/entities/adapter-rule.entity.js.map +1 -1
- package/dist/assets/server/extraction/extraction-entity.controller.d.ts +21 -3
- package/dist/assets/server/extraction/extraction-entity.controller.js +44 -9
- package/dist/assets/server/extraction/extraction-entity.controller.js.map +1 -1
- package/dist/assets/server/extraction/extraction.module.js +13 -3
- package/dist/assets/server/extraction/extraction.module.js.map +1 -1
- package/dist/assets/server/extraction/extraction.service.d.ts +4 -1
- package/dist/assets/server/extraction/extraction.service.js +59 -4
- package/dist/assets/server/extraction/extraction.service.js.map +1 -1
- package/dist/assets/server/extraction/harness-overlay.service.d.ts +41 -0
- package/dist/assets/server/extraction/harness-overlay.service.js +319 -0
- package/dist/assets/server/extraction/harness-overlay.service.js.map +1 -0
- package/dist/assets/server/extraction/liepin-extractor.d.ts +1 -0
- package/dist/assets/server/extraction/liepin-extractor.js +172 -0
- package/dist/assets/server/extraction/liepin-extractor.js.map +1 -0
- package/dist/assets/server/extraction/script-rule.js +4 -0
- package/dist/assets/server/extraction/script-rule.js.map +1 -1
- package/dist/assets/server/governance/action-audit.entity.d.ts +12 -0
- package/dist/assets/server/governance/action-audit.entity.js +66 -0
- package/dist/assets/server/governance/action-audit.entity.js.map +1 -0
- package/dist/assets/server/governance/governance.controller.d.ts +14 -0
- package/dist/assets/server/governance/governance.controller.js +77 -0
- package/dist/assets/server/governance/governance.controller.js.map +1 -0
- package/dist/assets/server/governance/governance.ingester.d.ts +20 -0
- package/dist/assets/server/governance/governance.ingester.js +114 -0
- package/dist/assets/server/governance/governance.ingester.js.map +1 -0
- package/dist/assets/server/governance/governance.module.d.ts +2 -0
- package/dist/assets/server/governance/governance.module.js +26 -0
- package/dist/assets/server/governance/governance.module.js.map +1 -0
- package/dist/assets/server/governance/governance.service.d.ts +114 -0
- package/dist/assets/server/governance/governance.service.js +356 -0
- package/dist/assets/server/governance/governance.service.js.map +1 -0
- package/dist/assets/server/jobcase/jobcase.controller.d.ts +1 -0
- package/dist/assets/server/jobcase/jobcase.entity.d.ts +1 -0
- package/dist/assets/server/jobcase/jobcase.entity.js +6 -0
- package/dist/assets/server/jobcase/jobcase.entity.js.map +1 -1
- package/dist/assets/server/jobcase/jobcase.service.d.ts +2 -0
- package/dist/assets/server/jobcase/jobcase.service.js +2 -1
- package/dist/assets/server/jobcase/jobcase.service.js.map +1 -1
- package/dist/assets/server/main.js +1 -0
- package/dist/assets/server/main.js.map +1 -1
- package/dist/assets/server/package.json +5 -4
- package/dist/assets/server/preference/preference.controller.d.ts +14 -0
- package/dist/assets/server/preference/preference.controller.js +66 -0
- package/dist/assets/server/preference/preference.controller.js.map +1 -0
- package/dist/assets/server/preference/preference.entity.d.ts +13 -0
- package/dist/assets/server/preference/preference.entity.js +77 -0
- package/dist/assets/server/preference/preference.entity.js.map +1 -0
- package/dist/assets/server/preference/preference.module.d.ts +2 -0
- package/dist/assets/server/preference/preference.module.js +26 -0
- package/dist/assets/server/preference/preference.module.js.map +1 -0
- package/dist/assets/server/preference/preference.service.d.ts +33 -0
- package/dist/assets/server/preference/preference.service.js +122 -0
- package/dist/assets/server/preference/preference.service.js.map +1 -0
- package/dist/assets/server/recording/recording-event-queue.service.d.ts +26 -0
- package/dist/assets/server/recording/recording-event-queue.service.js +115 -0
- package/dist/assets/server/recording/recording-event-queue.service.js.map +1 -0
- package/dist/assets/server/recording/recording-retention.service.d.ts +38 -0
- package/dist/assets/server/recording/recording-retention.service.js +174 -0
- package/dist/assets/server/recording/recording-retention.service.js.map +1 -0
- package/dist/assets/server/recording/recording-snapshot.service.d.ts +1 -0
- package/dist/assets/server/recording/recording-snapshot.service.js +4 -0
- package/dist/assets/server/recording/recording-snapshot.service.js.map +1 -1
- package/dist/assets/server/recording/recording.controller.d.ts +21 -1
- package/dist/assets/server/recording/recording.controller.js +37 -2
- package/dist/assets/server/recording/recording.controller.js.map +1 -1
- package/dist/assets/server/recording/recording.gateway.js +11 -0
- package/dist/assets/server/recording/recording.gateway.js.map +1 -1
- package/dist/assets/server/recording/recording.module.js +16 -2
- package/dist/assets/server/recording/recording.module.js.map +1 -1
- package/dist/assets/server/recording/recording.service.d.ts +10 -1
- package/dist/assets/server/recording/recording.service.js +31 -6
- package/dist/assets/server/recording/recording.service.js.map +1 -1
- package/dist/assets/server/remark/remark.controller.d.ts +1 -1
- package/dist/assets/server/remark/remark.controller.js +1 -10
- package/dist/assets/server/remark/remark.controller.js.map +1 -1
- package/dist/assets/server/remark/remark.entity.d.ts +1 -1
- package/dist/assets/server/remark/remark.entity.js.map +1 -1
- package/dist/assets/server/site/entities/site-registry.entity.d.ts +1 -1
- package/dist/assets/server/site/entities/site-registry.entity.js +1 -1
- package/dist/assets/server/site/entities/site-registry.entity.js.map +1 -1
- package/dist/assets/server/site/site.controller.d.ts +1 -1
- package/dist/assets/server/site/site.service.d.ts +5 -1
- package/dist/assets/server/site/site.service.js +13 -0
- package/dist/assets/server/site/site.service.js.map +1 -1
- package/dist/assets/server/system/system.controller.d.ts +1 -0
- package/dist/assets/server/system/system.controller.js +1 -1
- package/dist/assets/server/system/system.controller.js.map +1 -1
- package/dist/assets/server/system/system.service.d.ts +1 -0
- package/dist/assets/server/system/system.service.js +3 -2
- package/dist/assets/server/system/system.service.js.map +1 -1
- package/dist/cache/db.js +6 -6
- package/dist/commands/addons.js +2 -1
- package/dist/commands/cache.js +3 -4
- package/dist/commands/case.d.ts +67 -0
- package/dist/commands/case.js +101 -0
- package/dist/commands/config.d.ts +4 -0
- package/dist/commands/config.js +8 -1
- package/dist/commands/customer.d.ts +25 -0
- package/dist/commands/customer.js +137 -0
- package/dist/commands/doctor.js +119 -13
- package/dist/commands/extension.js +26 -32
- package/dist/commands/extras.d.ts +22 -3
- package/dist/commands/extras.js +116 -7
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.js +3 -4
- package/dist/commands/issue-env.d.ts +23 -0
- package/dist/commands/issue-env.js +101 -0
- package/dist/commands/job.d.ts +6 -2
- package/dist/commands/job.js +75 -20
- package/dist/commands/login.d.ts +19 -0
- package/dist/commands/login.js +85 -13
- package/dist/commands/migrate.d.ts +32 -0
- package/dist/commands/migrate.js +116 -0
- package/dist/commands/note.d.ts +3 -0
- package/dist/commands/note.js +75 -0
- package/dist/commands/ops.js +82 -15
- package/dist/commands/preference.d.ts +6 -0
- package/dist/commands/preference.js +80 -0
- package/dist/commands/record.js +2 -4
- package/dist/commands/report.js +2 -4
- package/dist/commands/search.js +9 -2
- package/dist/commands/server.d.ts +9 -2
- package/dist/commands/server.js +118 -19
- package/dist/commands/status.d.ts +4 -0
- package/dist/commands/status.js +16 -6
- package/dist/commands/update.js +8 -9
- package/dist/config.d.ts +21 -0
- package/dist/config.js +27 -0
- package/dist/i18n/locales/en-US.json +19 -1
- package/dist/i18n/locales/zh-CN.json +19 -1
- package/dist/index.js +52 -2
- package/dist/keychain.d.ts +16 -1
- package/dist/keychain.js +43 -16
- package/dist/logger.js +2 -2
- package/dist/updater.d.ts +1 -1
- package/dist/updater.js +24 -7
- package/dist/utils/command-error.d.ts +11 -0
- package/dist/utils/command-error.js +47 -0
- package/dist/utils/link.d.ts +18 -0
- package/dist/utils/link.js +83 -0
- package/dist/utils/proxy-detect.d.ts +20 -0
- package/dist/utils/proxy-detect.js +96 -0
- package/dist/utils/script-path.d.ts +5 -0
- package/dist/utils/script-path.js +27 -0
- package/dist/version.js +34 -9
- package/dist/watchdog.d.ts +23 -1
- package/dist/watchdog.js +97 -6
- package/dist/web/dist/404.html +1 -0
- package/dist/web/dist/_next/static/WdJr3NhHjlu5xN0qOap1k/_buildManifest.js +1 -0
- package/dist/web/dist/_next/static/WdJr3NhHjlu5xN0qOap1k/_ssgManifest.js +1 -0
- package/dist/web/dist/_next/static/chunks/166.f30be223f694f8ee.js +1 -0
- package/dist/web/dist/_next/static/chunks/1e6d5a0c.0488932e17ecdf24.js +15 -0
- package/dist/web/dist/_next/static/chunks/539-5d0e8c5c238c56f8.js +1 -0
- package/dist/web/dist/_next/static/chunks/589-d632233641f35681.js +1 -0
- package/dist/web/dist/_next/static/chunks/671.3b8e9cc96b25b6ea.js +1 -0
- package/dist/web/dist/_next/static/chunks/935-99f57b7d4151d9e7.js +5 -0
- package/dist/web/dist/_next/static/chunks/a7067448-96dd4b8457c447e8.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/_not-found/page-fdf1a13a7656886a.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/auth/verify/page-8e5cff53d6f7d8e1.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/companies/page-e38a69e1929d0953.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/entity/page-250f8a9b6d91ab19.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/jobs/page-6a281776fec065f6.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/layout-83e623e973c1693f.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/logs/page-d478031d49f7ba00.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/matching/jobs/[id]/talents/page-f57f4b7529823601.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/matching/portraits/[id]/jobs/page-614d1e62d7b9d215.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/page-e3392de08ae81fba.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/parselog/page-58d3acece95b4089.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/recordings/page-e2e2e3c3a64083fb.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/snapshots/[id]/agent-prompt/page-fd3b7d7373b8f8b7.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/talents/page-30748338da20d7e0.js +1 -0
- package/dist/web/dist/_next/static/chunks/framework-b3a558b17a070965.js +1 -0
- package/dist/web/dist/_next/static/chunks/main-5a4e0cd75dd7f04b.js +1 -0
- package/dist/web/dist/_next/static/chunks/main-app-80b038a312917d90.js +1 -0
- package/dist/web/dist/_next/static/chunks/pages/_app-da7d628f49271ece.js +4 -0
- package/dist/web/dist/_next/static/chunks/pages/_error-17756f67e0a11350.js +1 -0
- package/dist/web/dist/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/dist/web/dist/_next/static/chunks/webpack-1784baecc6fdcf0b.js +1 -0
- package/dist/web/dist/_next/static/css/db881c5b3072b88a.css +3 -0
- package/dist/web/dist/_next/static/css/f60d210841fab76b.css +1 -0
- package/dist/web/dist/auth/verify.html +1 -0
- package/dist/web/dist/auth/verify.txt +8 -0
- package/dist/web/dist/companies.html +1 -0
- package/dist/web/dist/companies.txt +7 -0
- package/dist/web/dist/entity.html +1 -0
- package/dist/web/dist/entity.txt +8 -0
- package/dist/web/dist/index.html +1 -0
- package/dist/web/dist/index.txt +8 -0
- package/dist/web/dist/jobs.html +1 -0
- package/dist/web/dist/jobs.txt +7 -0
- package/dist/web/dist/logs.html +1 -0
- package/dist/web/dist/logs.txt +8 -0
- package/dist/web/dist/matching/jobs/placeholder/talents.html +1 -0
- package/dist/web/dist/matching/jobs/placeholder/talents.txt +8 -0
- package/dist/web/dist/matching/portraits/placeholder/jobs.html +1 -0
- package/dist/web/dist/matching/portraits/placeholder/jobs.txt +8 -0
- package/dist/web/dist/parselog.html +1 -0
- package/dist/web/dist/parselog.txt +8 -0
- package/dist/web/dist/recordings.html +1 -0
- package/dist/web/dist/recordings.txt +8 -0
- package/dist/web/dist/snapshots/placeholder/agent-prompt.html +1 -0
- package/dist/web/dist/snapshots/placeholder/agent-prompt.txt +8 -0
- package/dist/web/dist/talents.html +1 -0
- package/dist/web/dist/talents.txt +7 -0
- package/package.json +26 -6
|
@@ -41,12 +41,15 @@ const devops_sink_module_1 = require("./devops/devops-sink.module");
|
|
|
41
41
|
const site_module_1 = require("./site/site.module");
|
|
42
42
|
const telemetry_module_1 = require("./telemetry/telemetry.module");
|
|
43
43
|
const doctor_module_1 = require("./doctor/doctor.module");
|
|
44
|
+
const customer_module_1 = require("./customer/customer.module");
|
|
45
|
+
const preference_module_1 = require("./preference/preference.module");
|
|
46
|
+
const governance_module_1 = require("./governance/governance.module");
|
|
44
47
|
const WEB_DIST = (0, path_1.join)(__dirname, '..', '..', 'web', 'dist');
|
|
45
48
|
let AppModule = class AppModule {
|
|
46
49
|
configure(consumer) {
|
|
47
50
|
consumer
|
|
48
51
|
.apply(auth_middleware_1.AuthMiddleware)
|
|
49
|
-
.exclude({ path: '/', method: common_1.RequestMethod.GET }, { path: 'entity', method: common_1.RequestMethod.GET }, { path: 'talents', method: common_1.RequestMethod.GET }, { path: 'jobs', method: common_1.RequestMethod.GET }, { path: 'companies', method: common_1.RequestMethod.GET }, { path: 'parselog', method: common_1.RequestMethod.GET }, { path: 'recordings', method: common_1.RequestMethod.GET }, { path: '_next/(.*)', method: common_1.RequestMethod.ALL }, { path: 'health', method: common_1.RequestMethod.GET }, { path: 'health/db', method: common_1.RequestMethod.GET }, { path: 'auth/device-code', method: common_1.RequestMethod.ALL }, { path: 'auth/login', method: common_1.RequestMethod.ALL }, { path: 'auth/approve', method: common_1.RequestMethod.ALL }, { path: 'auth/token', method: common_1.RequestMethod.ALL }, { path: 'auth/verify-info', method: common_1.RequestMethod.ALL }, { path: 'auth/verify', method: common_1.RequestMethod.GET }, { path: 'system/(.*)', method: common_1.RequestMethod.ALL }, { path: 'extension/version', method: common_1.RequestMethod.GET }, { path: 'extensions', method: common_1.RequestMethod.ALL }, { path: 'extensions/(.*)', method: common_1.RequestMethod.ALL }, { path: 'sites', method: common_1.RequestMethod.ALL }, { path: 'sites/(.*)', method: common_1.RequestMethod.ALL }, { path: 'entities', method: common_1.RequestMethod.ALL }, { path: 'entities/(.*)', method: common_1.RequestMethod.ALL }, { path: 'parse-log', method: common_1.RequestMethod.ALL }, { path: 'parse-log/(.*)', method: common_1.RequestMethod.ALL }, { path: 'parse/(.*)', method: common_1.RequestMethod.ALL }, { path: 'extract/(.*)', method: common_1.RequestMethod.ALL }, { path: 'adapters', method: common_1.RequestMethod.ALL }, { path: 'adapters/(.*)', method: common_1.RequestMethod.ALL }, { path: 'recordings', method: common_1.RequestMethod.ALL }, { path: 'recordings/(.*)', method: common_1.RequestMethod.ALL }, { path: 'logs', method: common_1.RequestMethod.ALL }, { path: 'logs/(.*)', method: common_1.RequestMethod.ALL }, { path: 'doctor', method: common_1.RequestMethod.ALL }, { path: 'doctor/(.*)', method: common_1.RequestMethod.ALL })
|
|
52
|
+
.exclude({ path: '/', method: common_1.RequestMethod.GET }, { path: 'entity', method: common_1.RequestMethod.GET }, { path: 'talents', method: common_1.RequestMethod.GET }, { path: 'jobs', method: common_1.RequestMethod.GET }, { path: 'companies', method: common_1.RequestMethod.GET }, { path: 'parselog', method: common_1.RequestMethod.GET }, { path: 'recordings', method: common_1.RequestMethod.GET }, { path: '_next/(.*)', method: common_1.RequestMethod.ALL }, { path: 'health', method: common_1.RequestMethod.GET }, { path: 'health/db', method: common_1.RequestMethod.GET }, { path: 'auth/device-code', method: common_1.RequestMethod.ALL }, { path: 'auth/login', method: common_1.RequestMethod.ALL }, { path: 'auth/approve', method: common_1.RequestMethod.ALL }, { path: 'auth/token', method: common_1.RequestMethod.ALL }, { path: 'auth/email/send-code', method: common_1.RequestMethod.ALL }, { path: 'auth/email/verify', method: common_1.RequestMethod.ALL }, { path: 'auth/verify-info', method: common_1.RequestMethod.ALL }, { path: 'auth/verify', method: common_1.RequestMethod.GET }, { path: 'system/(.*)', method: common_1.RequestMethod.ALL }, { path: 'extension/version', method: common_1.RequestMethod.GET }, { path: 'extensions', method: common_1.RequestMethod.ALL }, { path: 'extensions/(.*)', method: common_1.RequestMethod.ALL }, { path: 'sites', method: common_1.RequestMethod.ALL }, { path: 'sites/(.*)', method: common_1.RequestMethod.ALL }, { path: 'entities', method: common_1.RequestMethod.ALL }, { path: 'entities/(.*)', method: common_1.RequestMethod.ALL }, { path: 'parse-log', method: common_1.RequestMethod.ALL }, { path: 'parse-log/(.*)', method: common_1.RequestMethod.ALL }, { path: 'parse/(.*)', method: common_1.RequestMethod.ALL }, { path: 'extract/(.*)', method: common_1.RequestMethod.ALL }, { path: 'adapters', method: common_1.RequestMethod.ALL }, { path: 'adapters/(.*)', method: common_1.RequestMethod.ALL }, { path: 'recordings', method: common_1.RequestMethod.ALL }, { path: 'recordings/(.*)', method: common_1.RequestMethod.ALL }, { path: 'api/recordings', method: common_1.RequestMethod.ALL }, { path: 'api/recordings/(.*)', method: common_1.RequestMethod.ALL }, { path: 'logs', method: common_1.RequestMethod.ALL }, { path: 'logs/(.*)', method: common_1.RequestMethod.ALL }, { path: 'doctor', method: common_1.RequestMethod.ALL }, { path: 'doctor/(.*)', method: common_1.RequestMethod.ALL }, { path: 'governance', method: common_1.RequestMethod.ALL }, { path: 'governance/(.*)', method: common_1.RequestMethod.ALL })
|
|
50
53
|
.forRoutes('*');
|
|
51
54
|
}
|
|
52
55
|
};
|
|
@@ -67,6 +70,7 @@ exports.AppModule = AppModule = __decorate([
|
|
|
67
70
|
'/auth/login',
|
|
68
71
|
'/auth/approve',
|
|
69
72
|
'/auth/token',
|
|
73
|
+
'/auth/email/(.*)',
|
|
70
74
|
'/auth/verify-info',
|
|
71
75
|
'/health',
|
|
72
76
|
'/system/(.*)',
|
|
@@ -87,6 +91,10 @@ exports.AppModule = AppModule = __decorate([
|
|
|
87
91
|
'/search/(.*)',
|
|
88
92
|
'/query/(.*)',
|
|
89
93
|
'/job-cases/(.*)',
|
|
94
|
+
'/customers/(.*)',
|
|
95
|
+
'/preferences/(.*)',
|
|
96
|
+
'/governance',
|
|
97
|
+
'/governance/(.*)',
|
|
90
98
|
'/communication-records/(.*)',
|
|
91
99
|
'/reports/(.*)',
|
|
92
100
|
'/ws',
|
|
@@ -120,6 +128,9 @@ exports.AppModule = AppModule = __decorate([
|
|
|
120
128
|
telemetry_module_1.TelemetryModule,
|
|
121
129
|
devops_sink_module_1.DevopsSinkModule,
|
|
122
130
|
doctor_module_1.DoctorModule,
|
|
131
|
+
customer_module_1.CustomerModule,
|
|
132
|
+
preference_module_1.PreferenceModule,
|
|
133
|
+
governance_module_1.GovernanceModule,
|
|
123
134
|
],
|
|
124
135
|
controllers: [health_controller_1.HealthController],
|
|
125
136
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA2E;AAC3E,2CAA8C;AAC9C,uDAAyD;AACzD,+BAA4B;AAC5B,2DAAiE;AACjE,sDAAkD;AAClD,0DAAsD;AACtD,uDAAmD;AACnD,uDAAmD;AACnD,6DAAyD;AACzD,sEAAkE;AAClE,0DAAsD;AACtD,+EAA2E;AAC3E,4DAAwD;AACxD,oDAAgD;AAChD,kEAA8D;AAC9D,uDAAmD;AACnD,0DAAsD;AACtD,mEAA+D;AAC/D,mEAA+D;AAC/D,0DAAsD;AACtD,gEAA4D;AAC5D,+EAA0E;AAC1E,qFAAgF;AAChF,8FAAyF;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;oBAC7B,eAAe;oBACf,KAAK;iBACN;aACF,CAAC;YACF,4BAAY;YACZ,wBAAe,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;YAC7C,4BAAY;YACZ,0BAAW;YACX,0BAAW;YACX,8BAAa;YACb,oCAAgB;YAChB,4BAAY;YACZ,0CAAmB;YACnB,0BAAW;YACX,4BAAY;YACZ,kCAAe;YACf,kCAAe;YACf,wBAAU;YACV,4BAAY;YACZ,gCAAc;YACd,yCAAkB;YAClB,6CAAoB;YACpB,mDAAuB;YACvB,8CAAoB;YACpB,4BAAY;YACZ,gCAAc;YACd,8BAAa;YACb,sBAAS;YACT,wBAAU;YACV,kCAAe;YACf,qCAAgB;YAChB,4BAAY;YACZ,gCAAc;YACd,oCAAgB;YAChB,oCAAgB;SACjB;QACD,WAAW,EAAE,CAAC,oCAAgB,CAAC;KAChC,CAAC;GACW,SAAS,CAkErB"}
|
|
@@ -19,4 +19,11 @@ export declare class AuthController {
|
|
|
19
19
|
token(dto: TokenRequestDto): import("./auth.types").TokenResponse | {
|
|
20
20
|
status: "pending" | "expired";
|
|
21
21
|
};
|
|
22
|
+
sendEmailCode(body: {
|
|
23
|
+
email: string;
|
|
24
|
+
}): Promise<unknown>;
|
|
25
|
+
verifyEmailCode(body: {
|
|
26
|
+
email: string;
|
|
27
|
+
code: string;
|
|
28
|
+
}): Promise<import("./auth.types").TokenResponse>;
|
|
22
29
|
}
|
|
@@ -45,6 +45,12 @@ let AuthController = class AuthController {
|
|
|
45
45
|
token(dto) {
|
|
46
46
|
return this.authService.exchange(dto);
|
|
47
47
|
}
|
|
48
|
+
sendEmailCode(body) {
|
|
49
|
+
return this.authService.sendEmailCode(body);
|
|
50
|
+
}
|
|
51
|
+
verifyEmailCode(body) {
|
|
52
|
+
return this.authService.verifyEmailCode(body);
|
|
53
|
+
}
|
|
48
54
|
};
|
|
49
55
|
exports.AuthController = AuthController;
|
|
50
56
|
__decorate([
|
|
@@ -81,6 +87,20 @@ __decorate([
|
|
|
81
87
|
__metadata("design:paramtypes", [Object]),
|
|
82
88
|
__metadata("design:returntype", void 0)
|
|
83
89
|
], AuthController.prototype, "token", null);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, common_1.Post)('email/send-code'),
|
|
92
|
+
__param(0, (0, common_1.Body)()),
|
|
93
|
+
__metadata("design:type", Function),
|
|
94
|
+
__metadata("design:paramtypes", [Object]),
|
|
95
|
+
__metadata("design:returntype", void 0)
|
|
96
|
+
], AuthController.prototype, "sendEmailCode", null);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, common_1.Post)('email/verify'),
|
|
99
|
+
__param(0, (0, common_1.Body)()),
|
|
100
|
+
__metadata("design:type", Function),
|
|
101
|
+
__metadata("design:paramtypes", [Object]),
|
|
102
|
+
__metadata("design:returntype", void 0)
|
|
103
|
+
], AuthController.prototype, "verifyEmailCode", null);
|
|
84
104
|
exports.AuthController = AuthController = __decorate([
|
|
85
105
|
(0, common_1.Controller)('auth'),
|
|
86
106
|
__metadata("design:paramtypes", [auth_service_1.AuthService])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.controller.js","sourceRoot":"","sources":["../../src/auth/auth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAkE;AAElE,iDAA6C;AAG7C,SAAS,cAAc,CAAC,GAAY;IAClC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;IACvC,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAC1B,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACrF,OAAO,GAAG,QAAQ,MAAM,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;AAC7C,CAAC;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc;IACI;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;IACT,WAAA,IAAA,aAAI,GAAE,CAAA;;;;mDAEpB;AAGD;IADC,IAAA,aAAI,EAAC,cAAc,CAAC;IACJ,WAAA,IAAA,aAAI,GAAE,CAAA;;;;qDAEtB;yBAxCU,cAAc;IAD1B,IAAA,mBAAU,EAAC,MAAM,CAAC;qCAEyB,0BAAW;GAD1C,cAAc,CAyC1B"}
|
|
@@ -23,7 +23,15 @@ let AuthMiddleware = class AuthMiddleware {
|
|
|
23
23
|
next();
|
|
24
24
|
}
|
|
25
25
|
catch (err) {
|
|
26
|
-
|
|
26
|
+
let foreign = false;
|
|
27
|
+
try {
|
|
28
|
+
const decoded = jwt.decode(token);
|
|
29
|
+
foreign = !!decoded?.data?._id;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
foreign = false;
|
|
33
|
+
}
|
|
34
|
+
throw new common_1.UnauthorizedException(foreign ? 'Token signed by another server (SaaS); please re-login locally' : 'Invalid or expired token');
|
|
27
35
|
}
|
|
28
36
|
}
|
|
29
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.middleware.js","sourceRoot":"","sources":["../../src/auth/auth.middleware.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAmF;AAEnF,oCAAoC;AAO7B,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,GAAG,CAAC,GAAY,EAAE,GAAa,EAAE,IAAkB;QACjD,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,IAAI,EAAE,CAAC;QACnD,MAAM,KAAK,GAAG,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEjF,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,8BAAqB,CAAC,gBAAgB,CAAC,CAAC;QACpD,CAAC;QAED,IAAI,CAAC;YAEH,MAAM,MAAM,GAAG,OAAO,C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AM,CAAC,KAAK,CAAuB,CAAC;gBACxD,OAAO,GAAG,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC;YACjC,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,GAAG,KAAK,CAAC;YAClB,CAAC;YACD,MAAM,IAAI,8BAAqB,CAC7B,OAAO,CAAC,CAAC,CAAC,gEAAgE,CAAC,CAAC,CAAC,0BAA0B,CACxG,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AA9BY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;GACA,cAAc,CA8B1B"}
|
|
@@ -11,6 +11,7 @@ export declare class AuthService {
|
|
|
11
11
|
onModuleInit(): void;
|
|
12
12
|
onModuleDestroy(): void;
|
|
13
13
|
private get baseUrl();
|
|
14
|
+
private get saasBaseUrl();
|
|
14
15
|
private get secret();
|
|
15
16
|
createDeviceCode(webAppUrl: string): DeviceCodeResponse;
|
|
16
17
|
login({ loginWith, identifier, password }: {
|
|
@@ -24,6 +25,16 @@ export declare class AuthService {
|
|
|
24
25
|
exchange({ deviceCode }: TokenRequestDto): TokenResponse | {
|
|
25
26
|
status: 'pending' | 'expired';
|
|
26
27
|
};
|
|
28
|
+
private issueLocalToken;
|
|
29
|
+
sendEmailCode(body: {
|
|
30
|
+
email: string;
|
|
31
|
+
}): Promise<unknown>;
|
|
32
|
+
verifyEmailCode(body: {
|
|
33
|
+
email: string;
|
|
34
|
+
code: string;
|
|
35
|
+
}): Promise<TokenResponse>;
|
|
36
|
+
private extractUserId;
|
|
37
|
+
private rethrowSaaSError;
|
|
27
38
|
private verifyHcapiToken;
|
|
28
39
|
private isExpired;
|
|
29
40
|
private cleanup;
|
|
@@ -57,6 +57,11 @@ let AuthService = AuthService_1 = class AuthService {
|
|
|
57
57
|
get baseUrl() {
|
|
58
58
|
return this.config.get('HCAPI_BASE_URL', 'http://localhost:7001');
|
|
59
59
|
}
|
|
60
|
+
get saasBaseUrl() {
|
|
61
|
+
return (this.config.get('HUNTER_MATE_SAAS_URL') ||
|
|
62
|
+
this.config.get('SAAS_URL') ||
|
|
63
|
+
'https://dev-ops.hiredchina.com');
|
|
64
|
+
}
|
|
60
65
|
get secret() {
|
|
61
66
|
return this.config.get('USER_SESSION_SECRET', 'dev-secret-change-me');
|
|
62
67
|
}
|
|
@@ -138,13 +143,65 @@ let AuthService = AuthService_1 = class AuthService {
|
|
|
138
143
|
if (code.status !== 'approved' || !code.userId) {
|
|
139
144
|
return { status: 'pending' };
|
|
140
145
|
}
|
|
141
|
-
|
|
146
|
+
return this.issueLocalToken(code.userId);
|
|
147
|
+
}
|
|
148
|
+
issueLocalToken(userId) {
|
|
149
|
+
const accessToken = jwt.sign({ data: { _id: userId } }, this.secret, { expiresIn: '7d' });
|
|
142
150
|
return {
|
|
143
151
|
access_token: accessToken,
|
|
144
152
|
token_type: 'UTOKEN',
|
|
145
153
|
expires_in: 60 * 60 * 24 * 7,
|
|
146
154
|
};
|
|
147
155
|
}
|
|
156
|
+
async sendEmailCode(body) {
|
|
157
|
+
try {
|
|
158
|
+
const res = await (0, rxjs_1.firstValueFrom)(this.http.post(`${this.saasBaseUrl}/hunter-mate/auth/email/send-code`, body));
|
|
159
|
+
return res.data ?? { ok: true };
|
|
160
|
+
}
|
|
161
|
+
catch (err) {
|
|
162
|
+
this.rethrowSaaSError('send-code', err);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
async verifyEmailCode(body) {
|
|
166
|
+
let data;
|
|
167
|
+
try {
|
|
168
|
+
const res = await (0, rxjs_1.firstValueFrom)(this.http.post(`${this.saasBaseUrl}/hunter-mate/auth/email/verify`, body));
|
|
169
|
+
data = res.data;
|
|
170
|
+
}
|
|
171
|
+
catch (err) {
|
|
172
|
+
this.rethrowSaaSError('verify', err);
|
|
173
|
+
}
|
|
174
|
+
if (!data?.access_token) {
|
|
175
|
+
throw new common_1.UnauthorizedException('SaaS verify 未返回 access_token');
|
|
176
|
+
}
|
|
177
|
+
const userId = this.extractUserId(data.access_token, data);
|
|
178
|
+
if (!userId) {
|
|
179
|
+
throw new common_1.UnauthorizedException('SaaS 令牌中无法识别用户,请改用设备码登录');
|
|
180
|
+
}
|
|
181
|
+
return this.issueLocalToken(userId);
|
|
182
|
+
}
|
|
183
|
+
extractUserId(saasToken, data) {
|
|
184
|
+
let decoded = null;
|
|
185
|
+
try {
|
|
186
|
+
decoded = jwt.decode(saasToken);
|
|
187
|
+
}
|
|
188
|
+
catch {
|
|
189
|
+
decoded = null;
|
|
190
|
+
}
|
|
191
|
+
const raw = decoded?.data?._id ?? decoded?.data?.id ?? decoded?._id ?? decoded?.sub ??
|
|
192
|
+
data?.userId ?? data?._id ?? null;
|
|
193
|
+
const num = Number(raw);
|
|
194
|
+
return Number.isFinite(num) && num > 0 ? num : null;
|
|
195
|
+
}
|
|
196
|
+
rethrowSaaSError(op, err) {
|
|
197
|
+
const status = err?.response?.status;
|
|
198
|
+
const message = err?.response?.data?.message || err?.message || `SaaS email ${op} 请求失败`;
|
|
199
|
+
this.logger.warn(`saas email ${op} failed`, { status, message });
|
|
200
|
+
if (status && status < 500) {
|
|
201
|
+
throw new common_1.UnauthorizedException(message);
|
|
202
|
+
}
|
|
203
|
+
throw new common_1.BadGatewayException(`SaaS auth ${op} 不可用: ${message}`);
|
|
204
|
+
}
|
|
148
205
|
async verifyHcapiToken(token) {
|
|
149
206
|
try {
|
|
150
207
|
const res = await (0, rxjs_1.firstValueFrom)(this.http.get(`${this.baseUrl}/api/v1/base/current`, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../../src/auth/auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../../src/auth/auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoH;AACpH,2CAA+C;AAC/C,yCAA4C;AAC5C,+BAAsC;AACtC,mCAAiD;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AI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IAC7D,CAAC;IAEO,OAAO;QACb,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;YAC/C,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;gBACzB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACzB,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAnPY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;qCAOgB,sBAAa;QACf,mBAAW;GAPzB,WAAW,CAmPvB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CustomerService, UpsertCustomerDto } from './customer.service';
|
|
2
|
+
export declare class CustomerController {
|
|
3
|
+
private readonly service;
|
|
4
|
+
constructor(service: CustomerService);
|
|
5
|
+
upsert(dto: UpsertCustomerDto, req: any): Promise<{
|
|
6
|
+
customer: import("./customer.entity").Customer;
|
|
7
|
+
created: boolean;
|
|
8
|
+
merged: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
search(query?: string): Promise<import("./customer.entity").Customer[]>;
|
|
11
|
+
related(id: string): Promise<{
|
|
12
|
+
customer: import("./customer.entity").Customer;
|
|
13
|
+
jobCases: import("../jobcase/jobcase.entity").JobCase[];
|
|
14
|
+
remarks: import("../remark/remark.entity").Remark[];
|
|
15
|
+
}>;
|
|
16
|
+
findOne(id: string): Promise<import("./customer.entity").Customer>;
|
|
17
|
+
update(id: string, dto: Partial<UpsertCustomerDto>): Promise<import("./customer.entity").Customer>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.CustomerController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const customer_service_1 = require("./customer.service");
|
|
18
|
+
let CustomerController = class CustomerController {
|
|
19
|
+
service;
|
|
20
|
+
constructor(service) {
|
|
21
|
+
this.service = service;
|
|
22
|
+
}
|
|
23
|
+
upsert(dto, req) {
|
|
24
|
+
return this.service.resolveOrCreate({ ...dto, ownerId: req.user?.userId });
|
|
25
|
+
}
|
|
26
|
+
search(query) {
|
|
27
|
+
return this.service.search(query);
|
|
28
|
+
}
|
|
29
|
+
related(id) {
|
|
30
|
+
return this.service.related(parseInt(id, 10));
|
|
31
|
+
}
|
|
32
|
+
findOne(id) {
|
|
33
|
+
return this.service.findOne(parseInt(id, 10));
|
|
34
|
+
}
|
|
35
|
+
update(id, dto) {
|
|
36
|
+
return this.service.update(parseInt(id, 10), dto);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.CustomerController = CustomerController;
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, common_1.Post)(),
|
|
42
|
+
__param(0, (0, common_1.Body)()),
|
|
43
|
+
__param(1, (0, common_1.Request)()),
|
|
44
|
+
__metadata("design:type", Function),
|
|
45
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
46
|
+
__metadata("design:returntype", void 0)
|
|
47
|
+
], CustomerController.prototype, "upsert", null);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, common_1.Get)(),
|
|
50
|
+
__param(0, (0, common_1.Query)('query')),
|
|
51
|
+
__metadata("design:type", Function),
|
|
52
|
+
__metadata("design:paramtypes", [String]),
|
|
53
|
+
__metadata("design:returntype", void 0)
|
|
54
|
+
], CustomerController.prototype, "search", null);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, common_1.Get)(':id/related'),
|
|
57
|
+
__param(0, (0, common_1.Param)('id')),
|
|
58
|
+
__metadata("design:type", Function),
|
|
59
|
+
__metadata("design:paramtypes", [String]),
|
|
60
|
+
__metadata("design:returntype", void 0)
|
|
61
|
+
], CustomerController.prototype, "related", null);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, common_1.Get)(':id'),
|
|
64
|
+
__param(0, (0, common_1.Param)('id')),
|
|
65
|
+
__metadata("design:type", Function),
|
|
66
|
+
__metadata("design:paramtypes", [String]),
|
|
67
|
+
__metadata("design:returntype", void 0)
|
|
68
|
+
], CustomerController.prototype, "findOne", null);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, common_1.Patch)(':id'),
|
|
71
|
+
__param(0, (0, common_1.Param)('id')),
|
|
72
|
+
__param(1, (0, common_1.Body)()),
|
|
73
|
+
__metadata("design:type", Function),
|
|
74
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
75
|
+
__metadata("design:returntype", void 0)
|
|
76
|
+
], CustomerController.prototype, "update", null);
|
|
77
|
+
exports.CustomerController = CustomerController = __decorate([
|
|
78
|
+
(0, common_1.Controller)('customers'),
|
|
79
|
+
__metadata("design:paramtypes", [customer_service_1.CustomerService])
|
|
80
|
+
], CustomerController);
|
|
81
|
+
//# sourceMappingURL=customer.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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,cAAK,EAAC,IAAI,CAAC,CAAA;;;;iDAEnB;AAGD;IADC,IAAA,YAAG,EAAC,KAAK,CAAC;IACF,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;iDAEnB;AAGD;IADC,IAAA,cAAK,EAAC,KAAK,CAAC;IACL,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,aAAI,GAAE,CAAA;;;;gDAEtC;6BA5BU,kBAAkB;IAD9B,IAAA,mBAAU,EAAC,WAAW,CAAC;qCAEgB,kCAAe;GAD1C,kBAAkB,CA6B9B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class Customer {
|
|
2
|
+
id: number;
|
|
3
|
+
canonicalName: string;
|
|
4
|
+
aliases?: string[];
|
|
5
|
+
dedupKey: string;
|
|
6
|
+
typeStatus?: {
|
|
7
|
+
type?: string;
|
|
8
|
+
status?: string;
|
|
9
|
+
};
|
|
10
|
+
contacts?: Record<string, any>[];
|
|
11
|
+
purchaseHistory?: Record<string, any>[];
|
|
12
|
+
notes?: string;
|
|
13
|
+
activityLogIds?: string[];
|
|
14
|
+
ownerId?: number;
|
|
15
|
+
createdAt: Date;
|
|
16
|
+
updatedAt: Date;
|
|
17
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Customer = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
let Customer = class Customer {
|
|
15
|
+
id;
|
|
16
|
+
canonicalName;
|
|
17
|
+
aliases;
|
|
18
|
+
dedupKey;
|
|
19
|
+
typeStatus;
|
|
20
|
+
contacts;
|
|
21
|
+
purchaseHistory;
|
|
22
|
+
notes;
|
|
23
|
+
activityLogIds;
|
|
24
|
+
ownerId;
|
|
25
|
+
createdAt;
|
|
26
|
+
updatedAt;
|
|
27
|
+
};
|
|
28
|
+
exports.Customer = Customer;
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
31
|
+
__metadata("design:type", Number)
|
|
32
|
+
], Customer.prototype, "id", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Index)(),
|
|
35
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 128 }),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], Customer.prototype, "canonicalName", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
|
|
40
|
+
__metadata("design:type", Array)
|
|
41
|
+
], Customer.prototype, "aliases", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Index)({ unique: true }),
|
|
44
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 128 }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], Customer.prototype, "dedupKey", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
|
|
49
|
+
__metadata("design:type", Object)
|
|
50
|
+
], Customer.prototype, "typeStatus", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
|
|
53
|
+
__metadata("design:type", Array)
|
|
54
|
+
], Customer.prototype, "contacts", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
|
|
57
|
+
__metadata("design:type", Array)
|
|
58
|
+
], Customer.prototype, "purchaseHistory", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], Customer.prototype, "notes", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({ type: 'simple-json', nullable: true }),
|
|
65
|
+
__metadata("design:type", Array)
|
|
66
|
+
], Customer.prototype, "activityLogIds", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
69
|
+
__metadata("design:type", Number)
|
|
70
|
+
], Customer.prototype, "ownerId", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
73
|
+
__metadata("design:type", Date)
|
|
74
|
+
], Customer.prototype, "createdAt", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
77
|
+
__metadata("design:type", Date)
|
|
78
|
+
], Customer.prototype, "updatedAt", void 0);
|
|
79
|
+
exports.Customer = Customer = __decorate([
|
|
80
|
+
(0, typeorm_1.Entity)('customers')
|
|
81
|
+
], Customer);
|
|
82
|
+
//# sourceMappingURL=customer.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer.entity.js","sourceRoot":"","sources":["../../src/customer/customer.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAOiB;AAQV,IAAM,QAAQ,GAAd,MAAM,QAAQ;IAEnB,EAAE,CAAS;IAIX,aAAa,CAAS;IAItB,OA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;yCACvB;AAGjB;IADC,IAAA,0BAAgB,GAAE;8BACR,IAAI;2CAAC;AAGhB;IADC,IAAA,0BAAgB,GAAE;8BACR,IAAI;2CAAC;mBAtCL,QAAQ;IADpB,IAAA,gBAAM,EAAC,WAAW,CAAC;GACP,QAAQ,CAuCpB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.CustomerModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
12
|
+
const customer_entity_1 = require("./customer.entity");
|
|
13
|
+
const jobcase_entity_1 = require("../jobcase/jobcase.entity");
|
|
14
|
+
const remark_entity_1 = require("../remark/remark.entity");
|
|
15
|
+
const customer_service_1 = require("./customer.service");
|
|
16
|
+
const customer_controller_1 = require("./customer.controller");
|
|
17
|
+
let CustomerModule = class CustomerModule {
|
|
18
|
+
};
|
|
19
|
+
exports.CustomerModule = CustomerModule;
|
|
20
|
+
exports.CustomerModule = CustomerModule = __decorate([
|
|
21
|
+
(0, common_1.Module)({
|
|
22
|
+
imports: [typeorm_1.TypeOrmModule.forFeature([customer_entity_1.Customer, jobcase_entity_1.JobCase, remark_entity_1.Remark])],
|
|
23
|
+
controllers: [customer_controller_1.CustomerController],
|
|
24
|
+
providers: [customer_service_1.CustomerService],
|
|
25
|
+
exports: [customer_service_1.CustomerService],
|
|
26
|
+
})
|
|
27
|
+
], CustomerModule);
|
|
28
|
+
//# sourceMappingURL=customer.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer.module.js","sourceRoot":"","sources":["../../src/customer/customer.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,uDAA6C;AAC7C,8DAAoD;AACpD,2DAAiD;AACjD,yDAAqD;AACrD,+DAA2D;AAQpD,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAN1B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,0BAAQ,EAAE,wBAAO,EAAE,sBAAM,CAAC,CAAC,CAAC;QAChE,WAAW,EAAE,CAAC,wCAAkB,CAAC;QACjC,SAAS,EAAE,CAAC,kCAAe,CAAC;QAC5B,OAAO,EAAE,CAAC,kCAAe,CAAC;KAC3B,CAAC;GACW,cAAc,CAAG"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Repository } from 'typeorm';
|
|
2
|
+
import { Customer } from './customer.entity';
|
|
3
|
+
import { JobCase } from '../jobcase/jobcase.entity';
|
|
4
|
+
import { Remark } from '../remark/remark.entity';
|
|
5
|
+
export interface UpsertCustomerDto {
|
|
6
|
+
name: string;
|
|
7
|
+
aliases?: string[];
|
|
8
|
+
typeStatus?: {
|
|
9
|
+
type?: string;
|
|
10
|
+
status?: string;
|
|
11
|
+
};
|
|
12
|
+
contacts?: Record<string, any>[];
|
|
13
|
+
purchaseHistory?: Record<string, any>[];
|
|
14
|
+
notes?: string;
|
|
15
|
+
ownerId?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function normalizeCustomerName(raw: string): string;
|
|
18
|
+
export declare class CustomerService {
|
|
19
|
+
private readonly repo;
|
|
20
|
+
private readonly jobCaseRepo;
|
|
21
|
+
private readonly remarkRepo;
|
|
22
|
+
constructor(repo: Repository<Customer>, jobCaseRepo: Repository<JobCase>, remarkRepo: Repository<Remark>);
|
|
23
|
+
findOne(id: number): Promise<Customer>;
|
|
24
|
+
search(query?: string): Promise<Customer[]>;
|
|
25
|
+
resolveOrCreate(dto: UpsertCustomerDto): Promise<{
|
|
26
|
+
customer: Customer;
|
|
27
|
+
created: boolean;
|
|
28
|
+
merged: boolean;
|
|
29
|
+
}>;
|
|
30
|
+
update(id: number, dto: Partial<UpsertCustomerDto>): Promise<Customer>;
|
|
31
|
+
related(id: number): Promise<{
|
|
32
|
+
customer: Customer;
|
|
33
|
+
jobCases: JobCase[];
|
|
34
|
+
remarks: Remark[];
|
|
35
|
+
}>;
|
|
36
|
+
}
|