@valbuild/server 0.85.0 → 0.86.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.
|
@@ -37,7 +37,7 @@ type ValServerOverrides = Partial<{
|
|
|
37
37
|
* "local" means that changes will be written to the local filesystem,
|
|
38
38
|
* which is what you want when developing locally.
|
|
39
39
|
*
|
|
40
|
-
* "proxy" means that changes will proxied to https://
|
|
40
|
+
* "proxy" means that changes will proxied to https://admin.val.build
|
|
41
41
|
* and eventually be committed in the Git repository.
|
|
42
42
|
*
|
|
43
43
|
* It will automatically be "proxy" if both VAL_API_KEY env var (or the apiKey property) and VAL_SECRET env var (or the valSecret property)
|
|
@@ -69,7 +69,7 @@ type ValServerOverrides = Partial<{
|
|
|
69
69
|
*
|
|
70
70
|
* Can also be overridden using the VAL_BUILD_URL env var.
|
|
71
71
|
*
|
|
72
|
-
* @example "https://
|
|
72
|
+
* @example "https://admin.val.build"
|
|
73
73
|
*/
|
|
74
74
|
valBuildUrl: string;
|
|
75
75
|
/**
|
|
@@ -4556,7 +4556,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
|
4556
4556
|
if (!options.valBuildUrl) {
|
|
4557
4557
|
throw new Error("Val build url is not set");
|
|
4558
4558
|
}
|
|
4559
|
-
const url = new URL(`/
|
|
4559
|
+
const url = new URL(`/authorize`, options.valBuildUrl);
|
|
4560
4560
|
url.searchParams.set("redirect_uri", encodeURIComponent(`${publicValApiRe}/callback`));
|
|
4561
4561
|
url.searchParams.set("state", token);
|
|
4562
4562
|
return url.toString();
|
|
@@ -4569,7 +4569,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
|
4569
4569
|
if (!options.valBuildUrl) {
|
|
4570
4570
|
throw new Error("Val build url is not set");
|
|
4571
4571
|
}
|
|
4572
|
-
const url = new URL(`/
|
|
4572
|
+
const url = new URL(`/authorize`, options.valBuildUrl);
|
|
4573
4573
|
url.searchParams.set("error", encodeURIComponent(error));
|
|
4574
4574
|
return url.toString();
|
|
4575
4575
|
};
|
|
@@ -4580,7 +4580,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
|
4580
4580
|
if (!options.valBuildUrl) {
|
|
4581
4581
|
throw new Error("Val build url is not set");
|
|
4582
4582
|
}
|
|
4583
|
-
const url = new URL(`/api/val
|
|
4583
|
+
const url = new URL(`/api/val/auth/token`, options.valBuildUrl);
|
|
4584
4584
|
url.searchParams.set("code", encodeURIComponent(code));
|
|
4585
4585
|
if (!options.apiKey) {
|
|
4586
4586
|
return null;
|
|
@@ -4665,7 +4665,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
|
4665
4665
|
const authorize = async redirectTo => {
|
|
4666
4666
|
const token = crypto.randomUUID();
|
|
4667
4667
|
const redirectUrl = new URL(redirectTo);
|
|
4668
|
-
const appAuthorizeUrl = getAuthorizeUrl(`${redirectUrl.origin}
|
|
4668
|
+
const appAuthorizeUrl = getAuthorizeUrl(`${redirectUrl.origin}${options.route}`, token);
|
|
4669
4669
|
await callbacks.onEnable(true);
|
|
4670
4670
|
return {
|
|
4671
4671
|
cookies: {
|
|
@@ -4950,7 +4950,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
|
4950
4950
|
value: null
|
|
4951
4951
|
}
|
|
4952
4952
|
},
|
|
4953
|
-
redirectTo: getAppErrorUrl("Failed to exchange code for
|
|
4953
|
+
redirectTo: getAppErrorUrl("Failed to exchange code for token - check that API Key and project are correct")
|
|
4954
4954
|
};
|
|
4955
4955
|
}
|
|
4956
4956
|
const exp = getExpire();
|
|
@@ -6288,7 +6288,7 @@ async function initHandlerOptions(route, opts, config) {
|
|
|
6288
6288
|
const valEnableRedirectUrl = opts.valEnableRedirectUrl || process.env.VAL_ENABLE_REDIRECT_URL;
|
|
6289
6289
|
const valDisableRedirectUrl = opts.valDisableRedirectUrl || process.env.VAL_DISABLE_REDIRECT_URL;
|
|
6290
6290
|
const maybeValProject = opts.project || process.env.VAL_PROJECT;
|
|
6291
|
-
const valBuildUrl = opts.valBuildUrl || process.env.VAL_BUILD_URL || "https://
|
|
6291
|
+
const valBuildUrl = opts.valBuildUrl || process.env.VAL_BUILD_URL || "https://admin.val.build";
|
|
6292
6292
|
const valContentUrl = opts.valContentUrl || process.env.VAL_CONTENT_URL || core.DEFAULT_CONTENT_HOST;
|
|
6293
6293
|
if (isProxyMode) {
|
|
6294
6294
|
var _opts$versions, _opts$versions2;
|
|
@@ -6331,7 +6331,7 @@ async function initHandlerOptions(route, opts, config) {
|
|
|
6331
6331
|
};
|
|
6332
6332
|
} else {
|
|
6333
6333
|
const cwd = process.cwd();
|
|
6334
|
-
const valBuildUrl = opts.valBuildUrl || process.env.VAL_BUILD_URL || "https://
|
|
6334
|
+
const valBuildUrl = opts.valBuildUrl || process.env.VAL_BUILD_URL || "https://admin.val.build";
|
|
6335
6335
|
return {
|
|
6336
6336
|
mode: "fs",
|
|
6337
6337
|
cwd,
|
|
@@ -4556,7 +4556,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
|
4556
4556
|
if (!options.valBuildUrl) {
|
|
4557
4557
|
throw new Error("Val build url is not set");
|
|
4558
4558
|
}
|
|
4559
|
-
const url = new URL(`/
|
|
4559
|
+
const url = new URL(`/authorize`, options.valBuildUrl);
|
|
4560
4560
|
url.searchParams.set("redirect_uri", encodeURIComponent(`${publicValApiRe}/callback`));
|
|
4561
4561
|
url.searchParams.set("state", token);
|
|
4562
4562
|
return url.toString();
|
|
@@ -4569,7 +4569,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
|
4569
4569
|
if (!options.valBuildUrl) {
|
|
4570
4570
|
throw new Error("Val build url is not set");
|
|
4571
4571
|
}
|
|
4572
|
-
const url = new URL(`/
|
|
4572
|
+
const url = new URL(`/authorize`, options.valBuildUrl);
|
|
4573
4573
|
url.searchParams.set("error", encodeURIComponent(error));
|
|
4574
4574
|
return url.toString();
|
|
4575
4575
|
};
|
|
@@ -4580,7 +4580,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
|
4580
4580
|
if (!options.valBuildUrl) {
|
|
4581
4581
|
throw new Error("Val build url is not set");
|
|
4582
4582
|
}
|
|
4583
|
-
const url = new URL(`/api/val
|
|
4583
|
+
const url = new URL(`/api/val/auth/token`, options.valBuildUrl);
|
|
4584
4584
|
url.searchParams.set("code", encodeURIComponent(code));
|
|
4585
4585
|
if (!options.apiKey) {
|
|
4586
4586
|
return null;
|
|
@@ -4665,7 +4665,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
|
4665
4665
|
const authorize = async redirectTo => {
|
|
4666
4666
|
const token = crypto.randomUUID();
|
|
4667
4667
|
const redirectUrl = new URL(redirectTo);
|
|
4668
|
-
const appAuthorizeUrl = getAuthorizeUrl(`${redirectUrl.origin}
|
|
4668
|
+
const appAuthorizeUrl = getAuthorizeUrl(`${redirectUrl.origin}${options.route}`, token);
|
|
4669
4669
|
await callbacks.onEnable(true);
|
|
4670
4670
|
return {
|
|
4671
4671
|
cookies: {
|
|
@@ -4950,7 +4950,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
|
4950
4950
|
value: null
|
|
4951
4951
|
}
|
|
4952
4952
|
},
|
|
4953
|
-
redirectTo: getAppErrorUrl("Failed to exchange code for
|
|
4953
|
+
redirectTo: getAppErrorUrl("Failed to exchange code for token - check that API Key and project are correct")
|
|
4954
4954
|
};
|
|
4955
4955
|
}
|
|
4956
4956
|
const exp = getExpire();
|
|
@@ -6288,7 +6288,7 @@ async function initHandlerOptions(route, opts, config) {
|
|
|
6288
6288
|
const valEnableRedirectUrl = opts.valEnableRedirectUrl || process.env.VAL_ENABLE_REDIRECT_URL;
|
|
6289
6289
|
const valDisableRedirectUrl = opts.valDisableRedirectUrl || process.env.VAL_DISABLE_REDIRECT_URL;
|
|
6290
6290
|
const maybeValProject = opts.project || process.env.VAL_PROJECT;
|
|
6291
|
-
const valBuildUrl = opts.valBuildUrl || process.env.VAL_BUILD_URL || "https://
|
|
6291
|
+
const valBuildUrl = opts.valBuildUrl || process.env.VAL_BUILD_URL || "https://admin.val.build";
|
|
6292
6292
|
const valContentUrl = opts.valContentUrl || process.env.VAL_CONTENT_URL || core.DEFAULT_CONTENT_HOST;
|
|
6293
6293
|
if (isProxyMode) {
|
|
6294
6294
|
var _opts$versions, _opts$versions2;
|
|
@@ -6331,7 +6331,7 @@ async function initHandlerOptions(route, opts, config) {
|
|
|
6331
6331
|
};
|
|
6332
6332
|
} else {
|
|
6333
6333
|
const cwd = process.cwd();
|
|
6334
|
-
const valBuildUrl = opts.valBuildUrl || process.env.VAL_BUILD_URL || "https://
|
|
6334
|
+
const valBuildUrl = opts.valBuildUrl || process.env.VAL_BUILD_URL || "https://admin.val.build";
|
|
6335
6335
|
return {
|
|
6336
6336
|
mode: "fs",
|
|
6337
6337
|
cwd,
|
|
@@ -4525,7 +4525,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
|
4525
4525
|
if (!options.valBuildUrl) {
|
|
4526
4526
|
throw new Error("Val build url is not set");
|
|
4527
4527
|
}
|
|
4528
|
-
const url = new URL(`/
|
|
4528
|
+
const url = new URL(`/authorize`, options.valBuildUrl);
|
|
4529
4529
|
url.searchParams.set("redirect_uri", encodeURIComponent(`${publicValApiRe}/callback`));
|
|
4530
4530
|
url.searchParams.set("state", token);
|
|
4531
4531
|
return url.toString();
|
|
@@ -4538,7 +4538,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
|
4538
4538
|
if (!options.valBuildUrl) {
|
|
4539
4539
|
throw new Error("Val build url is not set");
|
|
4540
4540
|
}
|
|
4541
|
-
const url = new URL(`/
|
|
4541
|
+
const url = new URL(`/authorize`, options.valBuildUrl);
|
|
4542
4542
|
url.searchParams.set("error", encodeURIComponent(error));
|
|
4543
4543
|
return url.toString();
|
|
4544
4544
|
};
|
|
@@ -4549,7 +4549,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
|
4549
4549
|
if (!options.valBuildUrl) {
|
|
4550
4550
|
throw new Error("Val build url is not set");
|
|
4551
4551
|
}
|
|
4552
|
-
const url = new URL(`/api/val
|
|
4552
|
+
const url = new URL(`/api/val/auth/token`, options.valBuildUrl);
|
|
4553
4553
|
url.searchParams.set("code", encodeURIComponent(code));
|
|
4554
4554
|
if (!options.apiKey) {
|
|
4555
4555
|
return null;
|
|
@@ -4634,7 +4634,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
|
4634
4634
|
const authorize = async redirectTo => {
|
|
4635
4635
|
const token = crypto.randomUUID();
|
|
4636
4636
|
const redirectUrl = new URL(redirectTo);
|
|
4637
|
-
const appAuthorizeUrl = getAuthorizeUrl(`${redirectUrl.origin}
|
|
4637
|
+
const appAuthorizeUrl = getAuthorizeUrl(`${redirectUrl.origin}${options.route}`, token);
|
|
4638
4638
|
await callbacks.onEnable(true);
|
|
4639
4639
|
return {
|
|
4640
4640
|
cookies: {
|
|
@@ -4919,7 +4919,7 @@ const ValServer = (valModules, options, callbacks) => {
|
|
|
4919
4919
|
value: null
|
|
4920
4920
|
}
|
|
4921
4921
|
},
|
|
4922
|
-
redirectTo: getAppErrorUrl("Failed to exchange code for
|
|
4922
|
+
redirectTo: getAppErrorUrl("Failed to exchange code for token - check that API Key and project are correct")
|
|
4923
4923
|
};
|
|
4924
4924
|
}
|
|
4925
4925
|
const exp = getExpire();
|
|
@@ -6257,7 +6257,7 @@ async function initHandlerOptions(route, opts, config) {
|
|
|
6257
6257
|
const valEnableRedirectUrl = opts.valEnableRedirectUrl || process.env.VAL_ENABLE_REDIRECT_URL;
|
|
6258
6258
|
const valDisableRedirectUrl = opts.valDisableRedirectUrl || process.env.VAL_DISABLE_REDIRECT_URL;
|
|
6259
6259
|
const maybeValProject = opts.project || process.env.VAL_PROJECT;
|
|
6260
|
-
const valBuildUrl = opts.valBuildUrl || process.env.VAL_BUILD_URL || "https://
|
|
6260
|
+
const valBuildUrl = opts.valBuildUrl || process.env.VAL_BUILD_URL || "https://admin.val.build";
|
|
6261
6261
|
const valContentUrl = opts.valContentUrl || process.env.VAL_CONTENT_URL || DEFAULT_CONTENT_HOST;
|
|
6262
6262
|
if (isProxyMode) {
|
|
6263
6263
|
var _opts$versions, _opts$versions2;
|
|
@@ -6300,7 +6300,7 @@ async function initHandlerOptions(route, opts, config) {
|
|
|
6300
6300
|
};
|
|
6301
6301
|
} else {
|
|
6302
6302
|
const cwd = process.cwd();
|
|
6303
|
-
const valBuildUrl = opts.valBuildUrl || process.env.VAL_BUILD_URL || "https://
|
|
6303
|
+
const valBuildUrl = opts.valBuildUrl || process.env.VAL_BUILD_URL || "https://admin.val.build";
|
|
6304
6304
|
return {
|
|
6305
6305
|
mode: "fs",
|
|
6306
6306
|
cwd,
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"./package.json": "./package.json"
|
|
13
13
|
},
|
|
14
14
|
"types": "dist/valbuild-server.cjs.d.ts",
|
|
15
|
-
"version": "0.
|
|
15
|
+
"version": "0.86.0",
|
|
16
16
|
"scripts": {
|
|
17
17
|
"typecheck": "tsc --noEmit",
|
|
18
18
|
"test": "jest",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"@types/jest": "^29.2.5"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@valbuild/core": "~0.
|
|
27
|
-
"@valbuild/shared": "~0.
|
|
28
|
-
"@valbuild/ui": "~0.
|
|
26
|
+
"@valbuild/core": "~0.86.0",
|
|
27
|
+
"@valbuild/shared": "~0.86.0",
|
|
28
|
+
"@valbuild/ui": "~0.86.0",
|
|
29
29
|
"chokidar": "^4.0.1",
|
|
30
30
|
"image-size": "^1.0.2",
|
|
31
31
|
"minimatch": "^3.0.4",
|