@secrecy/lib 1.45.0 → 1.47.0
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.
|
@@ -21,7 +21,8 @@ export const getUrl = ({ hash, path, }) => {
|
|
|
21
21
|
const lang = document.documentElement.lang;
|
|
22
22
|
const protocol = process.env.NEXT_PUBLIC_VERCEL_ENV !== 'development' ? 'https' : 'http';
|
|
23
23
|
const url = process.env.NEXT_PUBLIC_VERCEL_ENV &&
|
|
24
|
-
process.env.NEXT_PUBLIC_VERCEL_ENV !== 'production'
|
|
24
|
+
process.env.NEXT_PUBLIC_VERCEL_ENV !== 'production' &&
|
|
25
|
+
process.env.NEXT_PUBLIC_IS_SECRECY_INTERNAL === 'true'
|
|
25
26
|
? `${process.env.NEXT_PUBLIC_VERCEL_URL}/${lang}/auth`
|
|
26
27
|
: `www.secrecy.tech/${lang}/auth`;
|
|
27
28
|
path = path.startsWith('/') ? path : `/${path}`;
|
package/dist/lib/client.js
CHANGED
|
@@ -12,7 +12,8 @@ superjson.registerCustom({
|
|
|
12
12
|
export const getUrl = () => {
|
|
13
13
|
const protocol = process.env.NEXT_PUBLIC_VERCEL_ENV !== 'development' ? 'https' : 'http';
|
|
14
14
|
const url = process.env.NEXT_PUBLIC_VERCEL_ENV &&
|
|
15
|
-
process.env.NEXT_PUBLIC_VERCEL_ENV !== 'production'
|
|
15
|
+
process.env.NEXT_PUBLIC_VERCEL_ENV !== 'production' &&
|
|
16
|
+
process.env.NEXT_PUBLIC_IS_SECRECY_INTERNAL === 'true'
|
|
16
17
|
? `${process.env.NEXT_PUBLIC_VERCEL_URL}/api/trpc`
|
|
17
18
|
: `www.secrecy.tech/api/trpc`;
|
|
18
19
|
return `${protocol}://${url}`;
|
package/dist/lib/utils/links.js
CHANGED
|
@@ -24,7 +24,11 @@ function getEnv() {
|
|
|
24
24
|
return 'production';
|
|
25
25
|
}
|
|
26
26
|
const env = getEnv();
|
|
27
|
-
const
|
|
27
|
+
const secrecyUrl = process.env.NEXT_PUBLIC_IS_SECRECY_INTERNAL !== 'true'
|
|
28
|
+
? 'www.secrecy.tech'
|
|
29
|
+
: (process.env.VERCEL_URL ??
|
|
30
|
+
process.env.NEXT_PUBLIC_VERCEL_URL ??
|
|
31
|
+
'www.secrecy.tech');
|
|
28
32
|
function withPath(origin, path) {
|
|
29
33
|
if (!path) {
|
|
30
34
|
return origin;
|
|
@@ -37,13 +41,13 @@ function getLocalLink({ app, path, }) {
|
|
|
37
41
|
}
|
|
38
42
|
function getPreviewLink({ app, path, }) {
|
|
39
43
|
const sd = secrecyApplications.find((domain) => domain === app);
|
|
40
|
-
return withPath(`https://${
|
|
44
|
+
return withPath(`https://${secrecyUrl}${sd ? `/${sd}` : ''}`, path);
|
|
41
45
|
}
|
|
42
46
|
function getProductionLink({ app, path, }) {
|
|
43
47
|
const sd = secrecyApplications.find((domain) => domain === app);
|
|
44
48
|
// NOTE: We temporary using pathanem routing on production
|
|
45
|
-
// return withPath(`https://${sd ? `${sd}.` : ''}${
|
|
46
|
-
return withPath(`https://${
|
|
49
|
+
// return withPath(`https://${sd ? `${sd}.` : ''}${secrecyUrl}`, path)
|
|
50
|
+
return withPath(`https://${secrecyUrl}${sd ? `/${sd}` : ''}`, path);
|
|
47
51
|
}
|
|
48
52
|
export const getLink = env === 'production'
|
|
49
53
|
? getProductionLink
|
package/package.json
CHANGED