opendialogai / webchat
Open Dialog项目的前端Web聊天组件
该软件包的规范存储库似乎已不存在,因此软件包已被冻结。
Requires
- php: ^8.1
- genealabs/laravel-caffeine: ^9.0
- illuminate/contracts: ^9.43
Requires (Dev)
- opendialogai/core: 1.x-dev
- orchestra/testbench: ^7.15.0
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: ^3.4
- 1.x-dev
- 1.18.0
- 1.17.0
- 1.16.0
- 1.15.0
- 1.14.0
- 1.13.0
- 1.12.0
- 1.11.0
- 1.10.0
- 1.9.6
- 1.9.5
- 1.9.4
- 1.9.3
- 1.9.2
- 1.9.1
- 1.9.0
- 1.8.1
- 1.8.0
- 1.7.4
- 1.7.3
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.2
- 1.0.1
- 1.0.0
- 1.0.0-beta.1
- 1.0.0-beta.0
- 1.0.0-alpha.1
- 1.0.0-alpha.0
- 0.7.x-dev
- 0.7.7
- 0.7.6
- 0.7.5
- 0.7.4.1
- 0.7.4
- 0.7.3
- 0.7.2
- 0.7.1.5
- 0.7.1.4
- 0.7.1.3
- 0.7.1.2
- 0.7.1.1
- 0.7.1
- 0.7.0
- 0.6.8
- 0.6.7
- 0.6.6
- 0.6.5
- 0.6.4
- 0.6.3
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.6
- 0.5.5
- 0.5.4
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.1
- 0.4.0
- dev-feature/OPNDLG-conversation-handover
- dev-feature/ONW-30__interface-settings
- dev-fix/format_date_in_user_lang
- dev-feature/ODTR-150_error_response_message_translation
- dev-feature/ODTR-142_form_validation_messages_translations
- dev-feature/updates_use_web_sockets_setting
- dev-fix/pusher_channel_test
- dev-fix/date-picker-fix
- dev-snyk-fix-864eb26fb4742a9c3d69470672ebc8e6
- dev-feature/OPNDLG-1842
- dev-feature/php8.1
- dev-dependabot/npm_and_yarn/yaml-and-release-it--removed
- dev-feature/ODPS-4__upload-message
- dev-feature/laravel-10
- dev-dependabot/npm_and_yarn/vm2-3.9.15
- dev-bug/ODTR-133_iframe_query_param
- dev-dependabot/npm_and_yarn/scss-tokenizer-and-node-sass-0.4.3
- dev-dependabot/npm_and_yarn/parse-path-and-release-it-7.0.0
- dev-dependabot/npm_and_yarn/loader-utils-and-loader-utils-and-resolve-url-loader-2.0.4
- dev-dependabot/npm_and_yarn/terser-and-laravel-mix-5.16.8
- dev-dependabot/npm_and_yarn/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/json5-1.0.2
- dev-dependabot/npm_and_yarn/http-cache-semantics-4.1.1
- dev-dependabot/npm_and_yarn/vm2-3.9.14
- dev-feature/ODTR-124_config_for_default_scenario_base_language
- dev-feature/ODTR-113__user-lang-for-datetime-messages
- dev-feature/ODTR-48_update_webchat_config
- dev-feature/ODTR-24__lang-negotiation
- dev-shift-76008
- dev-feature/ODTR-21_interface_settings_translations
- dev-rc/1.12.0
- dev-fix/show-close-chat-button
- dev-feature/avoid-iframe-session-storage
- dev-feature/ODTR-18_options_message_type
- dev-spike/avoid_iframe_session_storage
- dev-dependabot/npm_and_yarn/express-4.18.2
- dev-feature/OPNDLG-1698-changing-scenario-bug
- dev-dependabot/npm_and_yarn/qs-6.5.3
- dev-dependabot/npm_and_yarn/minimatch-3.0.8
- dev-snyk-upgrade-2f3241c9315d9a060016b93fbead90d8
- dev-feature/OPNDLG-1696-scenario-alias
- dev-feature/od-support-bot
- dev-rc/1.10.0
- dev-spike/OPNDLG-1636-scenario-id-alias
- dev-fix/core-composite-collection
- dev-fix/OPNDLG-1688_escape_autocompelte_options
- dev-fix/OPNDLG-1666_sends_request_id_for_preview
- dev-feature/update-core
- dev-rc/1.9.4
- dev-dependabot/composer/guzzlehttp/guzzle-7.5.x-dev
- dev-fix/remove-text-message-meta
- dev-dependabot/npm_and_yarn/moment-2.29.4
- dev-feature/audio-message
- dev-fix/pusher-channel-name
- dev-dependabot/npm_and_yarn/parse-url-6.0.2
- dev-rc/1.9.1
- dev-bug/form-message-history
- dev-rc/1.9.0
- dev-fix/remove_request_id_from_meta
- dev-feature/additional-meta-updates
- dev-fix/remove-hand-to-system-error
- dev-feature/PEP-49_webchat_sockets
- dev-dependabot/npm_and_yarn/eventsource-1.1.1
- dev-feature/OPNDLG-1552_add_ipinfo_token
- dev-fix/OPNDLG-1530-disabled-input
- dev-feature/right-to-left-support
- dev-feature/escalating-triggers
- dev-spike/audio-message
- dev-fix/OPNDLG-1168-fp-form-cancel-color
- dev-fix/OPNDLG-1393-autocomplete-selected-option
- dev-fix/OPNDLG-950-cta-color
- dev-feature/OPNDLG-1514-make-route-registration-configurable
- dev-fix/OPNDLG-1518_links_in_messages
- dev-feature/circleci_notifications_update
- dev-fix/OPNDLG-1483_form_message_checkbox
- dev-dependabot/npm_and_yarn/url-parse-1.5.10
- dev-dependabot/npm_and_yarn/url-parse-1.5.7
- dev-bud/OPNDLG-1454_fix_typing_indicator
- dev-feature-add-webchat-licence
- dev-feature/send-chat-open-response-event
- dev-feature/OPNDLG-721
- dev-feature/code-of-conduct
- dev-feature/add-apache-2-license-file
- dev-master
This package is auto-updated.
Last update: 2023-07-11 13:52:56 UTC
README
这是OpenDialog webchat软件包,其中包含基于Vue的webchat机器人、API和数据库配置。
本地开发设置
该应用程序旨在使用OpenDialog开发环境进行开发。请遵循那里的说明来设置容器。测试应在workspace
容器内运行。
运行代码检查器
要运行代码检查器,请运行以下命令 ./vendor/bin/phpcs --standard=od-cs-ruleset.xml src/ --ignore=*/migrations/*,*/tests/*
Git钩子
要设置包含的git pre-commit钩子,首先确保pre-commit脚本是可执行的,运行
chmod +x .githooks/pre-commit
然后通过运行以下命令配置您的本地git以使用此目录作为git钩子目录
git config core.hooksPath .githooks/
现在,您所做的每个提交都将触发php codesniffer运行。如果代码格式存在问题,脚本将输出php codesniffer的输出。如果没有问题,提交将进入git。
在应用程序中使用此软件包的步骤
Composer设置
要使用Composer安装,请运行以下命令
composer require opendialogai/webchat
构建前端资源
资源CI构建
该项目已设置,以便css
、js
和image
资源不会被从开发人员的机器上推送(它们是.gitignore
的一部分,以确保)。相反,它们由CI过程在每个提交时构建和推送。
要忽略已构建资源的本地更改,请运行
git update-index --assume-unchanged public/css/app.css public/css/app-fullpage.css public/css/app-iframe.css public/css/main.css public/js/app.js public/js/opendialog-bot.js public/js/opendialog-bot-full.js
手动构建资源
在开发时构建资源,请按照以下流程操作
-
切换到
vendor/opendialog/webchat-frontend
目录,并运行yarn install; yarn dev
(用于开发) -
运行
php artisan vendor:publish --tag=public --force
将新构建的资源移动到父应用程序中进行服务
发布迁移文件
迁移文件需要在应用到OpenDialog应用的数据库之前发布。要发布迁移,请运行:php artisan vendor:publish --tag="od-webchat-migrations" 如果作为多租户系统运行,则此操作依赖于在应用的.env
文件中将MULTI_TENANT
环境变量设置为true,以确保迁移最终落在正确的位置
配置
WebChat配置可以在webchat_settings
表中找到。在运行之前,应该通过运行以下命令来填充配置表:
php artisan webchat:settings
这将为每个可用的设置加载一行。
配置项仍然可以在添加到父网页的openDialogSettings
JavaScript变量中覆盖。
功能
Chat Open 参数
如果托管聊天机器人的页面URL包含查询参数'chat_open=true',则聊天将预先打开。
打开事件回调ID
当聊天窗口打开时,与聊天打开事件一起发送默认的welcome回调ID。可以通过设置托管聊天机器人的页面URL上的'callback_id'查询参数来覆盖它。设置查询参数的值将与聊天打开事件一起发送。然后由用户设置一个处理该回调ID的对话。
评论标签
WebChat小部件可以从中获取符合JSON:API规范的端点的评论。要启用评论,请在openDialogSettings中添加commentsEnabled参数,将其设置为true。您还需要传递有关评论实体名称、作者实体名称和部分实体名称的信息。(如果存在)
示例配置
window.openDialogSettings = { url: "{{env('APP_URL')}}", user : { first_name: 'Jane', last_name: 'Smith', email: 'jane.smith@opendialog.ai', external_id: "{{ auth()->user()->id }}", }, comments: { commentsEnabled: true, commentsName: 'Comments', commentsAxiosConfig: { baseURL: 'https:///json/', headers: { // eslint-disable-next-line no-undef Authorization: `Bearer {{ auth()->user()->api_token }}`, 'Content-Type': 'application/vnd.api+json', }, }, commentsEntityName: 'comments', commentsCreatedFieldName: 'created', commentsTextFieldName: 'comment', commentsAuthorEntityName: 'people', commentsAuthorRelationshipName: 'commentAuthor', commentsAuthorIdFieldName: 'id', commentsAuthorNameFieldName: 'name', commentsSectionEntityName: 'posts', commentsSectionRelationshipName: 'post', commentsSectionIdFieldName: 'id', commentsSectionNameFieldName: 'title', commentsSectionPathPattern: 'home\\\/posts\\\/(\\\d*)$', }, };