chore(brand): rename the product to ReplyPier
The upstream project name is gone from code, assets, docs and build
output: brand strings, domains (replypier.site and its app/api/docs/help
subdomains), env prefixes, image and network names, the widget's public
JS API (window.ReplyPier, replypierId/BaseUrl/Config/Token), CSS tokens
(--rp-*), file and directory names, and the WordPress plugin package.
- widget loader is now webclient/replypier.min.js; both bundles rebuilt
from source (backend/assets/widget.{js,css}, frontend/public/webclient)
- NOTICE, llms.txt, CONTRIBUTING, HELP_CENTER_INFRA and config.dev.js
rewritten rather than string-swapped; the demo config no longer ships
the previous vendor's Firebase/Razorpay/Google keys
- new migration replypier_ai_model_001 adds REPLYPIER to the managed
AIModelType and rewrites pre-rename rows
- local compose project, database, role and volume renamed; LOCAL_DEPLOY
documents carrying the old local data over
This commit is contained in:
1 parent
ff0a09f0e5
commit
54b949b392
1156 files changed
+7292
-7147
No files matched your search
@@ -1,11 +1,11 @@
|
||||
// A pretend customer website with the ChatterMate widget embedded the way the
|
||||
// A pretend customer website with the ReplyPier widget embedded the way the
|
||||
// dashboard's install snippet does it. Everything about the embed comes from the
|
||||
// query string:
|
||||
//
|
||||
// http://127.0.0.1:13000/?widget=<id>
|
||||
// &config=<json> → window.chattermateConfig (launcher, position, trigger, …)
|
||||
// &token=<jwt> → window.chattermateToken (token-authenticated widgets)
|
||||
// &trigger=1 → adds a page button with data-chattermate-open
|
||||
// &config=<json> → window.replypierConfig (launcher, position, trigger, …)
|
||||
// &token=<jwt> → window.replypierToken (token-authenticated widgets)
|
||||
// &trigger=1 → adds a page button with data-replypier-open
|
||||
// &snippet=iframe → the dashboard's iframe snippet instead of the script
|
||||
//
|
||||
// It has to be a real server on 127.0.0.1: Chrome's Local Network Access check
|
||||
@@ -23,7 +23,7 @@ function arg(name: string, fallback: string): string {
|
||||
|
||||
const port = Number(arg('port', '13000'))
|
||||
const apiUrl = arg('api', 'http://127.0.0.1:18000/api/v1')
|
||||
const loaderUrl = arg('loader', 'http://127.0.0.1:15173/webclient/chattermate.min.js')
|
||||
const loaderUrl = arg('loader', 'http://127.0.0.1:15173/webclient/replypier.min.js')
|
||||
|
||||
interface Embed {
|
||||
widgetId: string
|
||||
@@ -36,7 +36,7 @@ interface Embed {
|
||||
/** The dashboard's iframe snippet (AgentWidgetTab), classed so the page object finds it. */
|
||||
function iframeSnippet(widgetId: string): string {
|
||||
const src = `${apiUrl}/widgets/${encodeURIComponent(widgetId)}/data`
|
||||
return `<iframe class="chattermate-iframe" src="${src}" width="100%" height="600" frameborder="0" title="AI Assistant" allow="clipboard-write"></iframe>`
|
||||
return `<iframe class="replypier-iframe" src="${src}" width="100%" height="600" frameborder="0" title="AI Assistant" allow="clipboard-write"></iframe>`
|
||||
}
|
||||
|
||||
function page(embed: Embed): string {
|
||||
@@ -51,18 +51,18 @@ function page(embed: Embed): string {
|
||||
</html>`
|
||||
}
|
||||
const globals = [
|
||||
`window.chattermateId = ${JSON.stringify(embed.widgetId)};`,
|
||||
`window.chattermateBaseUrl = ${JSON.stringify(apiUrl)};`,
|
||||
`window.replypierId = ${JSON.stringify(embed.widgetId)};`,
|
||||
`window.replypierBaseUrl = ${JSON.stringify(apiUrl)};`,
|
||||
// config arrives as JSON text; parse it here so a malformed value fails the request, not the page.
|
||||
embed.config ? `window.chattermateConfig = ${JSON.stringify(JSON.parse(embed.config))};` : '',
|
||||
embed.token ? `window.chattermateToken = ${JSON.stringify(embed.token)};` : '',
|
||||
embed.config ? `window.replypierConfig = ${JSON.stringify(JSON.parse(embed.config))};` : '',
|
||||
embed.token ? `window.replypierToken = ${JSON.stringify(embed.token)};` : '',
|
||||
].filter(Boolean).join('\n ')
|
||||
return `<!doctype html>
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Acme Store</title></head>
|
||||
<body>
|
||||
<h1>Acme Store</h1>
|
||||
${embed.trigger ? '<button type="button" data-chattermate-open>Chat with us</button>' : ''}
|
||||
${embed.trigger ? '<button type="button" data-replypier-open>Chat with us</button>' : ''}
|
||||
<script>
|
||||
${globals}
|
||||
</script>
|
||||
|
||||
Reference in new issue
Block a user