@meistrari/chat-nuxt 4.5.0-rc.3 → 4.5.0-rc.4
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/module.json
CHANGED
|
@@ -2,7 +2,9 @@ const URL_CHAR_CLASS = "[^\\s\"'<>`\\[\\]()*_~]+";
|
|
|
2
2
|
export const VAULT_REGEX = /(?<!\]\()vault:\/\/[^\s"'<>`\[\]()*_~]+/gi;
|
|
3
3
|
export const URL_REGEX = /(?<!\]\(|<)https?:\/\/[^\s"'<>`\[\]()*_~]+/gi;
|
|
4
4
|
export const VAULT_PATTERN = new RegExp(`vault://${URL_CHAR_CLASS}`, "gi");
|
|
5
|
-
|
|
5
|
+
const TELA_DOMAIN_PATTERN = "(?:tela\\.com|telastaging\\.com|fornin\\.com)";
|
|
6
|
+
export const VAULT_PERMALINK_PATTERN = new RegExp(`https://(?:[a-z0-9-]+\\.)*(?:vault|vault-api|api)\\.${TELA_DOMAIN_PATTERN}/(?:[a-z0-9_-]+/)*permalinks/${URL_CHAR_CLASS}`, "gi");
|
|
7
|
+
const GATEWAY_PERMALINK_RE = new RegExp(`^https://api\\.(${TELA_DOMAIN_PATTERN})/(?:_services/vault/)?permalinks/`);
|
|
6
8
|
export function stripTrailingPunctuation(url) {
|
|
7
9
|
return url.replace(/[.,:;!?]+$/, "");
|
|
8
10
|
}
|
|
@@ -13,19 +15,16 @@ export function isVaultS3Url(url) {
|
|
|
13
15
|
return url.includes("vault-staging-permanentstorage.s3") || url.includes("vault-prod-permanentstorage.s3");
|
|
14
16
|
}
|
|
15
17
|
export function normalizeVaultPermalinkUrl(url) {
|
|
16
|
-
return url.replace(
|
|
17
|
-
/^(https:\/\/(?:[a-z0-9-]+\.)*api\.tela(?:staging)?\.com)\/(permalinks\/)/,
|
|
18
|
-
"$1/_services/vault/$2"
|
|
19
|
-
);
|
|
18
|
+
return url.replace(GATEWAY_PERMALINK_RE, "https://vault-api.$1/permalinks/");
|
|
20
19
|
}
|
|
21
20
|
export function isVaultPermalink(url) {
|
|
22
21
|
try {
|
|
23
22
|
const parsed = new URL(url);
|
|
24
23
|
const host = parsed.host;
|
|
25
|
-
const isTelaHost = host === "vault.tela.com" || host.endsWith(".vault.tela.com") || host === "vault-api.tela.com" || host === "vault-api.telastaging.com" || host === "api.tela.com" || host.endsWith(".api.tela.com") || host === "api.telastaging.com" || host.endsWith(".api.telastaging.com");
|
|
24
|
+
const isTelaHost = host === "vault.tela.com" || host.endsWith(".vault.tela.com") || host === "vault-api.tela.com" || host === "vault-api.telastaging.com" || host === "vault-api.fornin.com" || host === "api.tela.com" || host.endsWith(".api.tela.com") || host === "api.telastaging.com" || host.endsWith(".api.telastaging.com") || host === "api.fornin.com";
|
|
26
25
|
return isTelaHost && /(?:^|\/)permalinks\//.test(parsed.pathname);
|
|
27
26
|
} catch {
|
|
28
|
-
return
|
|
27
|
+
return new RegExp(`^https://(?:[a-z0-9-]+\\.)*(?:vault|vault-api|api)\\.${TELA_DOMAIN_PATTERN}/(?:[a-z0-9_-]+/)*permalinks/`).test(url);
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
30
|
export function parseVaultHashParams(url) {
|